[antlr-interest] Access to line numbers

Sam Harwell sharwell at pixelminegames.com
Wed Aug 10 07:36:28 PDT 2011


Both the Tree and Token interfaces have a method getLine().

Sam

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of David Smith
Sent: Wednesday, August 10, 2011 9:02 AM
To: antlr-interest at antlr.org
Subject: [antlr-interest] Access to line numbers

It seems that the parse tree generated by the parser has a data field 'line'
that seems to correspond to the source line when parsing.  How do i access
that to include the line number in the tree generated by my grammar?

DMS

David M. Smith http://www.cc.gatech.edu/fac/David.Smith
Georgia Institute of Technology, College of Computing Sent from my ASR-33
Teletype 


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



More information about the antlr-interest mailing list