> -----Original Message----- > From: [email protected] [mailto:antlr-interest- > [email protected]] On Behalf Of Gokulakannan Somasundaram > Sent: Sunday, March 07, 2010 10:56 PM > To: Kieran Simpson > Cc: [email protected] > Subject: Re: [antlr-interest] Using previously matched parser rule in > decision making > > What Jim is suggesting is something like this > > ruleA: ruleB[true]; > > ruleD: ruleB[false]; > > ruleB[boolean isRuleA]: > {isRuleA}? ..... > | ..... > ; > > Usage of semantic predicates.
No - he asked to just know what rule it came from - I presume to test in action code. To use as a predicate it would have to be in a scope as otherwise the predicate may be hoisted out of scope of the local rule code. Jim 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.
