[antlr-interest] Lexer and Java keywords

Jim Idle jimi at temporal-wave.com
Wed Dec 9 10:17:23 PST 2009

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Marcin Rzeznicki
> Sent: Wednesday, December 09, 2009 8:57 AM
> But can you tell me why my original example is wrong? If I understand ANTLR correctly this
> should not pose any problems for LL(*)

We would need to see your complete lexer definition before I can tell you what is wrong with it. It is standard lexer stuff to do this:

ABSTRACT : 'abstract' ;
ID : ('a'..'z'|'A'..'Z'| '_') ('a'..'z'|'A'..'Z'| '_'| '0'..'9')* ;

If your lexer rules were exactly as you show, then it would work fine without warnings as v3 knows how to deal with such things.


More information about the antlr-interest mailing list