[antlr-interest] Problems with using the C++ grammar provided at antlr.org.

Gordon Prieur Gordon.Prieur at Sun.COM
Wed Jul 20 07:16:14 PDT 2005


Min,

    Unless you left out compiler options (below), the line you typed
would generate lots of messages. You need at least several options.
Try "g++ -c -I<path-to-antlr-cpp-header-files> -g CPPLexer.cpp".
You'll have to supply the path, but you need to tell the compiler
where the antlr cpp module's include files are. You might still
get lots of errors, but there should be fewer and more related
to mistakes in CPPLexer.cpp.

Gordon


Min Deng wrote:

>Hello all,
>
>I am looking at the C++ grammar at
>http://www.antlr.org/grammar/cpp. As indicated in the
>MyReadMe.txt, this grammar for ANTLR will produce a
>lexer and a parser written in C++ for C++ files. I am
>wondering if there is a C++ grammar for ANTLR that
>produces a lexer and a parser written in Java (instead
>of C++) for C++ files.
>
>For the above C++ grammar, the author mentioned the
>use of MSVC 6.0 and ANTLR for MSVC. Is MSVC required
>for compiling the lexer and parser, that is, is it
>possible to compile them successfully on cygwin?
>
>I used the command "java antlr.Tool CPP_parser.g" to
>generate a lexer and a parser on cygwin. After using
>the command "g++ CPPLexer.cpp", a real long list of
>output was produced on screen, and I could not stop or
>redirect the output. Is it possible to turn off/down
>the output so that I can know what is the wrong with
>the compilation process?
>
>Thanks in advance and best regards,
>Min
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>  
>


More information about the antlr-interest mailing list