Hello,
While working on a grammar I had something that boils down to
grammar T;
start: (y | y C)+ EOF;
y: B (A)? | A;
A : 'a';
B : 'b';
C : 'c';
This gives an expected warning on rule y, that's fine, ANTLR does the right
thing and matches A greedily.
However it also gives a warning on rule start:
T.g:2:19: Decision can match input such as "B {EOF, B..A}" using multiple
alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
I quite understand the need to left factor this, I was just wondering why ANTLR
gives this warning. It must be staring me in the face but I don't see it...
How is this non-deterministic on input B EOF? Is ANTLR unable to see past rule
y for some reason?
Thanks
Peter
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.