[antlr-interest] case sensitivity for ANTLR v3 lexers

Don Caton dcaton at shorelinesoftware.com
Tue May 16 13:18:48 PDT 2006


Martin:

I don't think it matters how common a need for case-insensitivity is.

My point really was that there is no universal concept of
"case-insensitivity", it depends on what particular language you're parsing
and the culture you're doing it in.  There's no way Antlr can anticipate
that, so just make Antlr extensible in this area and leave the
implementation up to the end user.  It's also less that Ter needs to write,
test and maintain.

Don
 

> -----Original Message-----
> From: Martin Probst [mailto:mail at martin-probst.com] 
> Sent: Tuesday, May 16, 2006 3:37 PM
> To: Don Caton
> Cc: 'ANTLR Interest'
> Subject: Re: [antlr-interest] case sensitivity for ANTLR v3 lexers
> 
> Hi,
> 
> > If you need a case-insensitive lexer, the end user should implement 
> > that by overriding an appropriate method in the lexer and 
> use whatever 
> > comparison is appropriate for their particular needs.  There is no 
> > universal upper or lower-casing function that is 
> appropriate for every 
> > possible locale, so why
> > even go down that road?   Keep the core of Antlr simple, and just  
> > provide
> > extensibility points (with samples) where appropriate.
> 
> It depends on how common the case insensitive lexer thing is. 
> I have personally never used a case insensitive programming 
> language since PASCAL (that was case insensitive, wasn't 
> it?). It should only be an option if really a lot of people 
> need it, otherwise allow for the overriding, provide a Wiki 
> article and a FAQ entry and that's it.  
> Maybe some more detailed Wiki article about using IBM ICU 
> would be nice, but not really needed.
> 
> Martin
> 




More information about the antlr-interest mailing list