[antlr-interest] tree parser syntax

Safiye Celik safisce at gmail.com
Wed Aug 19 05:59:37 PDT 2009


Hi everyone,

I wanna write a tree grammar. But when I write "tree grammar MyGrammar;" at
the beginning of my .g file and then write some lexer rules such as

INTEGER : ('0'..'9')+

, I get an error saying "lexer rule INTEGER not allowed in parser". How
would I handle this issue? If I first write "grammar MyGrammar;" to my .g
file and after listing rules and tokens write "tree grammar MyGrammar;" in
order to parsing the tree, I get a syntax error. In ANTLR v2, we were able
to declare lexer, parser, and then tree walker in the same .g file. What is
the way of it in v3? Or how would I declare tokens such as INTEGER above to
the tree grammar?

--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090819/620bdcf5/attachment.html 


More information about the antlr-interest mailing list