[antlr-interest] tree grammar...

Johannes Luber jaluber at gmx.de
Thu Jul 5 02:00:44 PDT 2007


Liviu U wrote:
> Can a tree grammar be defined in the same file as the grammar itself?
> It seems to me awkward to have to sync two files and generate code twice....

To my knowledge, no. The only combined grammars are lexer and parser
grammar combined. And consider that tree grammars are full grammars
themselves - they have a separate start rule, like the parser, but
unlike the lexer, which is more an extension of the parser. Furthermore,
the ASTs may need several passes to be fully constructed.

Best regards,
Johannes Luber


More information about the antlr-interest mailing list