Ok, I've solved my particular problem using token lookaheads, but I was
wondering if there is a way of doing non-terminal symbol lookaheads in
semantic predicates?

2009/10/6 Naveen Chawla <naveen.c...@googlemail.com>

> grammar x;
>
> x:  a b;
>
>      a: 'i' a? | c? 'j';     // Question, how would I write the semantic
> predicates: if this "a" is followed by 'v1' choose the first alternative, if
> not choose the second alternative
>
>           c: 'i';
>
>      b: 'v1' | 'v2';
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-interest@googlegroups.com
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to