[antlr-interest] Re: Getting token extents for grammar rules

Paul J. Lucas dude at darkfigure.org
Mon May 17 11:24:01 PDT 2004


--- In antlr-interest at yahoogroups.com, Mark Lentczner <markl at g...> wrote:
> 	void consume()
> 	{
> 	    giveToken(LA(1));
> 	    Parser::consume();
> 	}
> 
> (All examples C++, but I'm sure the Java is very similar.)

The problem with the Java version is that LLkparser.consume() doesn't throw 
TokenStreamException, but LA() does.  So if I write the above in Java, I have to catch the 
exception myself even though I don't want to and don't know what to do with it once I've 
caught it.  :-/

- Paul



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

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



More information about the antlr-interest mailing list