> From: George S. Cowan > > Certainly make '.*' and '.+' consistent across all the > grammar types, one way or the other. >
I see this as the paramount consideration. There is nothing more irritating and defect-causing in a language than things that are "almost consistent". > > I suggest deprecating the current notation and using: > (...)** and (...)++ for greedy > (...)|* and (...)|+ for nongreedy > (or some other notation that indicates "stop me, quick") > I second Ter's distaste for not introducing new syntax. Perl regex's have a well-established way of doing this: .* = greedy .*? = non-greedy. I can't think of a defensible argument for not simply adopting this established syntax. I don't follow the argument for changing the default to be non-greedy (in fact I don't see the rationale stated anywhere). This way the existing syntax and semantics stay the same, so nobody's existing parsers get broken, and by adopting the same syntax/symantics of Perl regexes, we creep ever closer to the day when we can all use these glorious regexes in our ANTLR lexers. It's win/win/win. -- Gary R. Van Sickle 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 -~----------~----~----~----~------~----~------~--~---
