[antlr-interest] Global scopes for lexers

Kay Roepke kroepke at classdump.org
Tue Jul 31 08:59:06 PDT 2007


On Jul 31, 2007, at 5:51 PM, Alex Shneyderman wrote:

> I thought it would be neat to have the same mechanism for lexer as
> exists in parser. But of course you probably have a better idea of how
> to keep track of
> these levels. I am all ears :-)

I'd say that this is a pretty good case for scopes. :)

It's just that having to have them in a lexer is pretty uncommon,  
thus the reluctance to support the
feature (at least that's my understanding). The same reasoning  
applies to return values in lexer rules. It doesn't
really fit into the concept of the lexer (which should tokenize  
preferably without any context dependencies).

OTOH, given that the implementation of lexers and parsers are so  
alike scopes just magically work, as
long as the target developer thinks of it, maybe there's a case for it.

BTW, that's one messed up language you have there ;)

cheers,
-k
-- 
Kay Röpke
http://classdump.org/






More information about the antlr-interest mailing list