[antlr-interest] How to get line number during parse?

mzukowski at bco.com mzukowski at bco.com
Fri Jan 18 11:31:06 PST 2002


Use a label and then label.getLine() and label.getColumn().
http://www.antlr.org/doc/runtime.html#_bb15

Character number is trickier but I think someone is submitting a patch for
the next release to help with that.

Monty

-----Original Message-----
From: Todd Blanchard [mailto:todd.blanchard at cacheon.com]
Sent: Friday, January 18, 2002 11:30 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] How to get line number during parse?


I'm needing to make a tool that analyzes java code and cites various items.
When a pattern is matched, how do I find out the line number (or even
character number) of the input stream at the location of match?
 
Thanks

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 

 

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



More information about the antlr-interest mailing list