[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: case insensitive tokens??
Hi Bob.
To create case insensitive tokens, you simply create case insensitive
helpers. In fact, you could even create "internationalized" case insensitive
helpers...
For example:
Helpers
a = ['a' + 'A']; // using sets
b = 'b' | 'B'; // using regular expression
...
e = 'e' | 'E' | 0xuuuu | ...; // where uuuu is the Unicode for the French
"e accent aigu";-)
...
Tokens
to = t o;
hello = h e l l o;
...
If people really want English case insensitive strings, I could add the
following somewhat confusing notation:
Tokens
to = "to"; // case insensitive (double quotes)
hello = 'hello'; // case sensitive (single quotes)
But I am not sure if this is really needed...
Etienne
-----Original Message-----
From: Bob Hutchison <hutch@RedRock.com>
To: sablecc-list@sable.mcgill.ca <sablecc-list@sable.mcgill.ca>
Date: Thursday, May 28, 1998 1:40 AM
Subject: case insensitive tokens??
>Hi,
>
>I'm attempting to use SableCC for a small project I have going. I have
>some questions that I will post separately.
>
>I am wondering if there is any way for sable to ignore case when
>recognising tokens. For example I would like the token 'to' to be found
>four times in the following input: "to TO To tO".
>
>Am I missing some documentation?
>
>Thanks,
>Bob
>---
>Bob Hutchison, hutch@RedRock.com, (416) 878-3454
>RedRock, Toronto, Canada