[antlr-interest] Parser question
Dima Suliman
suliman at zib.de
Thu May 27 06:41:29 PDT 2004
Hello Arnar,
Thanks for your help, but I am not trying to parse x = y = z
I am trying tp parse a sequence of equations: x=y z=l ........
where x, y, z, l are all mathematical expression
Thats why:
statement: (expr EQ expr)+
Regards
Dima
>
>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
>
>
>
>
>
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