rule: TRANSITION id1=IDENTIFIER TO id2=IDENTIFIER transFlags Then you can use id1 and id2 as references to their respective tokens in the post-rule code block.
> -----Original Message----- > From: [email protected] [mailto:antlr-interest- > [email protected]] On Behalf Of Alfredo Perez J. > Sent: Wednesday, January 26, 2011 12:41 PM > To: [email protected] > Subject: Re: [antlr-interest] Use of multimap in grammar file. > > Nevermind that previous post (accidentally doubled btw). My mind after > many > hours couldn't see an extra ; that was there which caused the error. > > Now I have a different quesiton if you mind. > > I have some expression like this: > > TRANSITION IDENTIFIER TO IDENTIFIER transFlags > > Now what I want in this step is store IDENTIFIER.text from the left > side and > IDENTIFIER.text from the right side, but how can I tell one from the > other? > Tried something like this: > > TRANSITION IDENTIFIER {Auxiliar = {$IDENTIFIER.text}} TO IDENTIFIER > transFlags > > Auxiliar beign a String but I get the error: IDENTIFIER is a non-unique > reference. > I can't define some sort of "LeftIdentifier" because it's the same rule > and > it won't be matched. > > Any idea how can I differenciate these Identifiers? > > List: http://www.antlr.org/mailman/listinfo/antlr-interest > Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your- > email-address 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.
