[antlr-interest] Re: Keywords with whitespaces

mzukowski at yci.com mzukowski at yci.com
Tue Jan 28 07:39:15 PST 2003


So if it doesn't match "begin" "sequence" then it is a parsing error.  When
you build your tree you don't need both tokens, just put your own token type
in there.  Call it BEGIN_SEQUENCE if you like.  It's going to be a lot
easier handling this in the parser than in the lexer.

Monty

-----Original Message-----
From: Gunnar Wagenknecht <kreismeister at yahoo.de>
[mailto:kreismeister at yahoo.de]
Sent: Monday, January 27, 2003 1:46 PM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] Re: Keywords with whitespaces



--- In antlr-interest at yahoogroups.com, mzukowski at y... wrote:
> Why not handle this in the parser?
> 
> rule: "begin" "sequence" ....;

I'm not sure. ANTLR will add word "begin" _AND_ word "sequence" to 
the table of literals but only the sequence "begin" "sequence" is one 
literal and not both single words.

Cu, Gunnar


 

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/ 



More information about the antlr-interest mailing list