[antlr-interest] Re: Local lookahead depth

Tom Moog tmoog at polhode.com
Tue Nov 11 08:24:28 PST 2003


The out-of-the-box behavior in pccts is just as you
described.  However, in some (very) special cases users
want to undo some side-effect on guess-fail.  This is
a hook which is available to those users.



On Tue, 11 Nov 2003 mzukowski at yci.com wrote:

> > > I seem to remember that pccts allows one to associate
> > > user-defined routines with the guess-success and
> > > guess-fail so that one can undo or commit depending
> > > on the guess outcome.
>
> > Sounds good, but probably would be the source for lots of bugs. My
> > dream would be some sort of transaction that simply gets rolled back
> > when guessing failes. Although, this will remain a dream for some
> > time ;)
>
> The only languages I know of that can roll back are functional languages.
> In the world of Java and C++ you'll be stuck doing it yourself.  mark() and
> rewind() give you the hooks, almost like guess-success & guess-fail above.
> I'm scratching my head about why it isn't just guess-finished (rewind()).
> If the guess succeeds the whole thing will be executed again (right Tom?).
> ANTLR 3 could be augmented to allow before & after actions for a synpred but
> the concern there is that people will use them without understanding what
> they are doing.
>
> Monty
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list