[antlr-interest] LT(0)

Terence Parr parrt at jguru.com
Sun Apr 6 09:30:44 PDT 2003


On Saturday, April 5, 2003, at 11:36  PM, Braden McDaniel wrote:
>> Or LT(1).getLine().
>
> But that looks ahead one token, so the line number could be different
> from the current token... right?

You may have to define "current token"...  I'd say parsers only have 
"matched" tokens and "about to be matched" tokens. ;)

If you want the previous token just override consume() and record last 
token.  :)

Ter
--
Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org
Lecturer in Comp. Sci., University of San Francisco


 

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




More information about the antlr-interest mailing list