[antlr-interest] making AST from subrule as root AST in autom atic AST generation

mzukowski at yci.com mzukowski at yci.com
Tue Jul 29 13:39:19 PDT 2003


You can't do that currently.  You will be able to in ANTLR 3 but that's a
long ways off.
 
Monty

-----Original Message-----
From: prashanth501 [mailto:prashanth501 at yahoo.com] 
Sent: Tuesday, July 29, 2003 12:03 PM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] making AST from subrule as root AST in automatic
AST generation


Hello,

 I've been having dome problems with automatic AST generation. For example
if I have a rule

op:
  PLUS
| MINUS
| AND
| OR

and then when i use this rule in the def of

expr: term (op^ term)*

but, expr: term ((PLUS^ | MINUS^ | AND^ | OR^) term)* 
works.

ANTLR doesnt allow me to use the '^' sign next to 'op' because op is 
a rule. Well, there are workarounds, by constructing the tree myself, 
but i would prefer if there was a mechanism to use '^' sign next to a 
rule in the automatic AST construction because, there are other 
places in my parser where it is not nice to use a fix similar to the 
one above.
 
If anybody knows how to do that, please let me know.

Thank You.
Prashanth...



 

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


 

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




More information about the antlr-interest mailing list