I have a grammar that produces an AST and a tree walker, and I am coming up
blank trying to figure out a reasonable way to track line number information
in the tree walker so that I can map my output to source file lines.
The only solution I have come up with is incredibly wordy, which is to make
sure that every time I see a token name in the walker I track the line
number.

rule : ^(TOKENNAME .... ) { TrackLine($TOKENNAME.line) }
      ;

I am sure there are better solutions than this but I haven't been able to
figure out what they are.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to