[antlr-interest] executing actions during backtrack

Loring Craymer craymer at warpiv.com
Wed May 10 01:46:01 PDT 2006


This is really one of those situations where building a solution into ANTLR
is probably a mistake: simplicity is a virtue.  As a user, you can always do
something like

{ saveState(); } (synpred) => <grammar fragment>
| { recover(); } <alt fragment>


if you ever encounter a situation where a rollback is really needed.  I've
never seen a case where that was true, although I have done the "wouldn't it
be nice" thinking.  Like everyone else, I sometimes try to provide solutions
to non-problems and regret it later.

Does anyone out there have an example that justifies the implementation
effort?  That would probably be good to know before Ter does the work.

--Loring




More information about the antlr-interest mailing list