[antlr-interest] Parser question

Arnar Birgisson arnarb at oddi.is
Thu May 27 06:29:12 PDT 2004


Hello Dima,

> 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?

Are you trying to parse strings like "x = y = z"?
If so, your start rule should probably be

statement: expr (EQ^ expr)+;

which gives you a left recursive tree.

Arnar



 
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