[antlr-interest] Re: help required: accessing intermediary output ASTs in tree parser

lgcraymer lgc at mail1.jpl.nasa.gov
Fri Jan 30 16:44:31 PST 2004


It sounds like you have run into a few of the usual minor gotchas. 
First, you should be using #spec.getFirstChild() to refer to the
output AST's first child and #spec_in for the input AST.  The # is
important--#spec is translated to specAST and spec_in to spec (the
underscore may not be there--I'd have to check).  If you want manual
access to the ASTs created in a loop from outside the loop, you will
want to set references:

{ Stack x; }
(  p:paragraph  { x.push(p); } )+

and then use the Stack as a vector.  Alternatively, use another tree
pass to get at the fields.

--Loring


 

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