[antlr-interest] tree grammar clarification

Bernardo Elayda belayda at gmail.com
Fri Jun 29 19:37:21 PDT 2007


Hello,


I'm having a problem converting a grammar to a tree grammar.

The grammar rule I need to translate is:

nonzeros : MYNZTN+ -> ^(MYNONZEROS MNZTN)+
              ;


I translated the above rule in my tree grammar as:

nonzeros:  ^(MYNONZEROS MNZTN)+
             ;

When I translate the above rule in my tree grammar, ANTLR 3.0
complains that the + is an unexpected token.  I would rather keep the
rule the way it is above.  If I have to change it, I have to change
other rules in the tree grammar.

Is the problem I'm runing into a feature?

thanks in advance!
-Bernardo Elayda


More information about the antlr-interest mailing list