[antlr-interest] Re: Local lookahead depth

mzukowski at yci.com mzukowski at yci.com
Tue Nov 11 08:07:41 PST 2003


> > 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/ 




More information about the antlr-interest mailing list