[antlr-interest] name of generated parser

Bart Kiers bkiers at gmail.com
Thu May 10 11:12:03 PDT 2012


There are 4 types of grammars:

   1. a combined grammar, `grammar T;`, generates a parser and lexer called
   `TParser.java` and `TLexer.java` respectively;
   2. a parser grammar, `parser grammar TP;`, generates `TP.java`;
   3. a lexer grammar, `lexer grammar TL;`, generates `TL.java`;
   4. a tree grammar, `tree grammar TT;`, generates `TT.java`.

Regards,

Bart.


On Thu, May 10, 2012 at 7:25 PM, Stephen Siegel <siegel at udel.edu> wrote:

> According to the ANTLR book, if I have a parser grammar T (so the file
> containing this grammar is called "T.g" and the first line of the file is
> "parser grammar T;"), then the generated parser should be called
> TParser.java (I'm using the Java target).  However, when I generate the
> parser using AntlrWorks I instead get a file (and class) name T.java.  I
> haven't tried it from the command line but I assume I'll get the same
> result.  Anyone have any ideas why, or what I can do about it?
> Thanks,
> Steve
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>


More information about the antlr-interest mailing list