[antlr-interest] building ASTs for recursive lists

Maassen, H.A.M. H.A.M.Maassen at student.tue.nl
Thu Nov 18 01:04:36 PST 2004


" Unfortunately, I can't seem to change logicalExpression to what I'd
like:

logicalExpression
  : relationalExpression
    ( logicalOperator^ relationalExpression )*
  ;

To build a proper tree.  Why can't I? Or even better? How can I? "

 
Here's how I did my expressions:

logicalExpression:!
  e1:relationalExpression  (o:logicalOperator e2:logicalExpression)?
  { #logicalExpression = #(#o, #e1, #e2); }
;
 
Getting my grammar to build decent trees has uglied it up quite a bit :(
 
Regards, Harald Maassen


 
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/
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 4126 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20041118/e528699e/attachment.bin


More information about the antlr-interest mailing list