[antlr-interest] proper way to handle case insensitive syntax

Sébastien Kirche sebastien.kirche at gmail.com
Thu Jul 14 10:05:04 PDT 2011


Hi Jim,

It was the other solution that is given in the FAQ, but I did not used
it at first, because it looked less easy to use in the grammar.
I have just implemented it and checked that my grammar still work :o)

Thanks for the explanation.

2011/7/14 Jim Idle <jimi at temporal-wave.com>:
> I would not use that method. Override the LA() and make it return upper
> case only, then specify the keywords in upper case. Then you reduce the
> complexity of the keyword match greatly and remove lots of fragment method
> calls. If you are using the C target with only standard ASCII keywords,
> then there is a built in method to use upper case matching in the LA
> function.
>
> Jim

-- 
Sébastien Kirche


More information about the antlr-interest mailing list