[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(fwd) Re: case insensitive tokens??



On Thu, 28 May 1998 13:56:03 GMT, hutch@RedRock.com (Bob Hutchison)
wrote:

[Etienne, I'm sending this again just to get it on the list]

Thanks for the suggestion, though it seems to me to be more of a
work-around than a solution. Personally, I'd vote for "to". There are a
number of case insensitive programming languages out there, Eiffel for
example, where this would be handy.

In this case I might be further ahead by doing something with states.

Thanks,
Bob

On Thu, 28 May 1998 08:16:58 -0400, you wrote:

>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
>

---
Bob Hutchison, hutch@RedRock.com, (416) 878-3454
RedRock, Toronto, Canada

---
Bob Hutchison, hutch@RedRock.com, (416) 878-3454
RedRock, Toronto, Canada