[antlr-interest] LT(0)

Albert Huh albert.huh at embarcadero-ca.com
Sun Apr 6 10:10:32 PDT 2003


You could just save a reference to the lexer within your parser.  That's how I go about getting the line number information from the lexer.
 
Any thoughts on that approach?
 
Albert
 
 
-----Original Message----- 
From: Braden McDaniel [mailto:braden at endoframe.com] 
Sent: Sun 06/04/2003 12:44 PM 
To: antlr-interest at yahoogroups.com 
Cc: 
Subject: Re: [antlr-interest] LT(0)



	On Sun, 2003-04-06 at 12:30, Terence Parr wrote:
	> 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. ;)
	
	I'm just trying to throw a SemanticException, and provide it with
	accurate line and column information.
	
	--
	Braden McDaniel                           e-mail: <braden at endoframe.com>
	<http://endoframe.com>                    Jabber: <braden at jabber.org>
	
	
	
	
	Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
	
	
	


 

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 4854 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20030406/1beb5274/attachment.bin


More information about the antlr-interest mailing list