On 3/22/11 11:27 PM, "Jim Idle" <j...@temporal-wave.com> wrote:

>>> However, using lower case literals in your parser directly is not a
>>> good idea.  Use real tokens so that you error messages are better
>> 
>> Simple example, please?
> 
> Instead of:
> 
> rule : 'join' somerule;
> 
> Use:
> 
> rule : JOIN somerule;
> 
> // Lexer rule to match:
> //
> JOIN : 'join';


Clear.

But this is exactly what was NOT needed in ANTLR v2.
And ANTLR was proud that we can write tokens directly in grammar.

Collecting all this tokens into Lexer is additional manual work. No?
Similar to  Lexer :)


So for me not clear why this is better now for v3?




==============
> And for case insensitivity I specify the token specs all in UPPPER rather
> than lower and then override the input stream as per:
> 
> http://www.antlr.org/wiki/pages/viewpage.action?pageId=1782
> 
> Although someone has added instructions for generating the slowest case
> insensitive lexers in the world with individual letter rules. Use the
> input stream override method in general.

Yes, we have see this page ...

> Support for case insenstive matching is built in to the C target input
> streams. To use it, you must make a method call before using the input stream
> as in the example below and specify all your keyword/lexer tokens in UPPER
> CASE only

    JOIN above  is that  UPPER CASE  example?

I ask because   'join'  above still is in low case ...



-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]



List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to