[antlr-interest] Parser question

Terence Parr parrt at cs.usfca.edu
Thu May 27 07:55:35 PDT 2004


On May 27, 2004, at 4:28 AM, Dima Suliman wrote:

> Hello,
>
> I have the parser start rule:
>
> statement: (expr EQ^ expr)+;
>
> expr is a mathematical expr. It works but when I have more than one 
> expr,
> and I print the ast, the ast shows only the first one!
>
> any suggestions?

The ^ works on the tree created for the current rule not the subrule.  
Move the stuff in the (...)+ to another rule and then reference it. :)  
You will find the sequence of EQ trees you want :)

Terence





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list