I want to perform a different embedded action (or generate a different
AST node) on the final rule in a list of rules.

Here's the most basic example I can think of:

identifierList:
        : (Identifier -> ^(ID $Identifier))* (Identifier -> ^(OTHER
$Identifier))
        ;

This doesn't work because there are two alternatives when matching
just against one Identifier.  So I tried making the first nongreedy
with no success:

identifierList:
        : ( options { greedy = false; } : Identifier -> ^(ID $Identifier))*
(Identifier -> ^(OTHER $Identifier))
        ;

My actual example is a good amount lengthier and requires referencing
the rule itself in the rewrite, so solutions that require this to be
broken into multiple rules won't help me except maybe to help me
understand ANTLR better.
--~--~---------~--~----~------------~-------~--~----~
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