source: trunk/yao/share/antlr-2.7.7/examples/cpp/HTML/Main.cpp @ 1

Last change on this file since 1 was 1, checked in by lnalod, 15 years ago

Initial import of YAO sources

  • Property svn:eol-style set to native
File size: 628 bytes
Line 
1/*
2        Simple class for testing antlr-generated HTML parser/lexer.
3        Alexander Hinds, Magelang Institute
4        ahinds@magelang.com
5
6*/
7
8#include <iostream>
9#include "HTMLLexer.hpp"
10#include "HTMLParser.hpp"
11#include "antlr/TokenBuffer.hpp"
12
13int main( int, char** )
14{
15        ANTLR_USING_NAMESPACE(std)
16        ANTLR_USING_NAMESPACE(antlr)
17        try {
18                HTMLLexer lexer(cin);
19                TokenBuffer buffer(lexer);
20                HTMLParser parser(buffer);
21                parser.document();
22        }
23        catch( ANTLRException& e )
24        {
25                cerr << "exception: " << e.getMessage() << endl;
26                return -1;
27        }
28        catch( exception& e )
29        {
30                cerr << "exception: " << e.what() << endl;
31                return -1;
32        }
33        return 0;
34}
35
Note: See TracBrowser for help on using the repository browser.