[antlr-interest] proposal: make .* and .+ always nongreedy

Terence Parr parrt at cs.usfca.edu
Sat Mar 21 12:13:38 PDT 2009


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.

Ter


More information about the antlr-interest mailing list