More fun with predicate hoisting:
grammar Simple;
FOO : 'foo' ;
section : element* unrelated EOF ;
element : {P1}?=> pre;
pre : FOO post ;
post : FOO*;
unrelated : ':' post;
In this grammar, the generated code invokes P1
(completely outside its intended syntactic context)
while trying to recognize an "unrelated" (because P1 was
"hoisted downward" into "post", and "post" is reachable via
a nonterminal unrelated to "element").
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.