[antlr-interest] Using previously matched parser rule in decision making
Gokulakannan Somasundaram
gokul007 at gmail.com
Wed Mar 10 00:41:48 PST 2010
Oh! Sorry! i wrote it wrongly. I meant a set of actions, which will get
executed during look aheads in semantic predicates and syntactic predicates.
But Jim, i am not able to understand you.
Jim :Can’t rollback as it isn’t a database and track state isn’t really the
right thing to be doing here
What i meant by rollback is something like an action which will get executed
after we find out the predicate matching is not possible. For example if i
do a LA(n), say at some point, there is a conflict and it requires the
context to resolve the conflict. setting the context while executing the
LA(n) and resetting the context in a rollback action(something the user
should provide). Please bear with me, if you have already understood that.
Jim : nor is tracing what rule you came through to influence parsing really,
though scopes are better
Can you give a small example, of how to set a flag using scope while doing a
LA(n)? Thanks...
Jim : {{ action executes even if in synpred/backtrack }}
Please point me to the relevant doc. I am not understanding this. I find
that the syntactic predicates don't execute actions of the rules they are
matching.
Thanks,
Gokul.
More information about the antlr-interest
mailing list