On 09/24/2009 10:11 AM, Dave Dutcher wrote:
>
> Didn't that used to work in Antlr 2?  I think that would be a very useful
> feature to have back.
>
>    
We have explained this many times in the past but it is to do with the 
performance gains achieved by not associating text with tokens unless 
you really need it and so do so yourself.

You can also do this:

T1 : '/*' r=FRAGRULE '*/'  { setText($r.text); } ;

So in practice it is only a minor inconvenience, for a simpler and 
faster lexer :-)

Jim
> Dave
>
>    
>> -----Original Message-----
>> From: [email protected]
>> [mailto:[email protected]] On Behalf Of Jim Idle
>> Sent: Thursday, September 24, 2009 11:39 AM
>> Cc: [email protected]
>> Subject: Re: [antlr-interest] Question with greedy
>>
>> On 09/24/2009 06:20 AM, Gordon Tyler wrote:
>>      
>>> To exclude the /* and */ would something like this work?
>>>
>>> COMMENT
>>>     :  '/*'! ( options {greedy=false;} : . )* '*/'!
>>>
>>>        
>> No :-)
>>
>>
>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>> Unsubscribe:
>> http://www.antlr.org/mailman/options/antlr-interest/your-email
>> -address
>>      
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: 
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>    


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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to