[antlr-interest] AST rule association.

praveen_c praveen_c at yahoo.com
Mon Nov 25 13:57:02 PST 2002


I created an AST and I would like to know which rule matched which 
node. While traversing the tree I'd like to use this rule information 
as context info. Not sure if I'm asking the right question. But 
basically I want to differentiate instances of a given Token/AST Node 
based on the rule that matched it. Given an AST how do I find out the 
corresponding rule?

It's probably documented somewhere in the documentation or examples. 
But since I don't exactly know what I'm looking for, it's a bit 
difficult. The only way I can think of, was to subclass and set flags 
on the ASTs using actions.

Thanks,
Praveen.


 

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



More information about the antlr-interest mailing list