First, a correction. I wrote: So, how can I force ANTLR to
"consider" ID1 in this position? I meant ID2, of course.

On 3/4/2011 9:33 AM, Kevin J. Cummings wrote:
> fun2 : 'fun2(' (id1=ID1 { id1.setType(ID2); } | ID2 ) ')' ;

This is a perfectly good solution, thanks! It's a pity the
ANTLR book doesn't mention this technique.

Just for my understanding of ANTLR, though, I wonder if
there isn't a solution at the lexer level: some way to tell
the lexer that if it sees a 'fun2(' then it *must* look for
an ID2 next.

Regards,

-- O.L.


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.

Reply via email to