[antlr-interest] proposal: make .* and .+ always nongreedy
Sam Barnett-Cormack
s.barnett-cormack at lancaster.ac.uk
Sat Mar 21 12:16:17 PDT 2009
Terence Parr wrote:
>
> On Mar 21, 2009, at 12:12 PM, Sam Barnett-Cormack wrote:
>
>> Terence Parr wrote:
>>> http://www.antlr.org/jira/browse/ANTLR-392
>>> any objections?
>>
>> Would this effectively make
>>
>> rule : .* (some-exit-set)
>>
>> into
>>
>> rule : ~(some-exit-set)* (some-exit-set)
>>
>> Except, presumably, for magic with predicates and LL(*) cunningness?
>
> That's basically it. .* means
>
> while (!EOF) consume()
>
> at moment. makes no sense.
I'm inclined to agree with you, then... is there a need to provide an
option to allow people to get at the current behaviour if they really
want to?
--
Sam Barnett-Cormack
More information about the antlr-interest
mailing list