[antlr-interest] Problem with keeping data associated with AST nodes in antlr transform mode
Terence Parr
parrt at cs.usfca.edu
Tue Jun 15 10:55:14 PDT 2004
Hi,
Fortunately, there is an easy answer! You need to refer to the tree
created by antlr not the "input" tree. Use #b.setData(data) and your
whole world looks better. :) The key diff is:
b_AST.setType(VAR);
vs
b.setType(VAR);
when you use #b vs b. #b operates like it does in a regular parser: it
refers to the output tree.
Ter
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
Cofounder, http://www.knowspam.net enjoy email again!
Cofounder, http://www.peerscope.com pure link sharing
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