[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: case insensitive tokens??
I made a slight modification to the lexer.txt file in the sablecc source
directory. I replaced most of the "private" occurrence with "protected".
This allows me to override the getchar method. If I do this I can check
for the (lexer) state I'm in and do a conversion to lower case.
I am probably going to make more extensive changes to these files. I
want to get case insensitivity in tokens in a sub-set of lexer states. I
think that at some point that I will have to keep the original text
also. This will require me to change both the util.txt and lexer.txt
If you add the double quote token to SableCC, please be sure to retain a
copy of the original text.
BTW, this use of private in library classes is a bit problematic. It
severely restricts the ability of users of the class to extend the
Bob Hutchison, hutch@RedRock.com, (416) 878-3454
RedRock, Toronto, Canada