At 10:42 19/08/2009, David-Sarah Hopwood wrote:
>ENDOFLINE can indeed be simplified to NEWLINE | EOF.
>
>However, that won't help because it is not the predicate that
>causes the problem here; it's the fact that the match
immediately
>following .* uses the '|' operator. Note that it doesn't matter
>whether this match is "inlined" or in a separate fragment rule
>(and it also doesn't matter whether (option { greedy=false; } :
>.)* is used instead of .*).
Right, but the version I was talking about didn't have the .* in
it at all, so it would have worked (that far). :)
>Therefore, .* can't be used in cases where the match following
it
>necessarily involves an alternation that can't be expressed
using
>'?'.
In my experience, .* in lexer rules only ever works properly when
it is followed by a single inline sequence of
characters. (Nothing optional, no loops, no calling of other
rules.)
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
-~----------~----~----~----~------~----~------~--~---