[antlr-interest] lexer: suffixes and case insensitivity

Kay Roepke kroepke at classdump.org
Mon Aug 20 01:33:43 PDT 2007


On Aug 20, 2007, at 10:25 AM, Edwards, Waverly wrote:

> Can this type of mapping be handled by the ANTLR lexer where
> the lexer knows how to match varName%` before varName%

Just to throw it in: I'd probably do it with semantic predicates that
do some manual lookahead (with calling LA() and comparing that to the
individual suffixes you have).

Then you can force ANTLR to take specific ways through your lexer  
alternatives.

I think on of the examples in the distribution does something  
related, and I'm
sure the list archives also have something like this.

HTH,
-k

P.S.: Sorry for the terse posts, I'm in a hurry... :)
-- 
Kay Röpke
http://classdump.org/






More information about the antlr-interest mailing list