[antlr-interest] Storing token in node?

Susan Jolly easjolly at ix.netcom.com
Mon Aug 1 12:23:11 PDT 2005


I need for my tree nodes to store the associated Token.  

When I explicitly set a node type with the <AST=typename> option, there
seems to be no problem as the Token is passed to the constructor for the
node and I can capture it.

However, it seems that when I set a default node type using the
myParser.setASTNodeType("...") option, a different node constructor is used
and I don't have the option to capture the Token.  Is there a solution other
than explicitly setting the node type for each token?

Thanks,
SusanJ 



More information about the antlr-interest mailing list