[antlr-interest] Re: Local lookahead depth

Oliver Zeigermann oliver at zeigermann.de
Tue Nov 11 08:47:57 PST 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.  

I am just wondering. If we had a custom language with ANTLR as Terence 
proposed to be independent of the destination language (Java, C#, C++) I 
really think this sort of transaction behavior could be implemented. I 
am into transactional caching in the moment and the mechanisms seem to 
be quite similar minus concurrent stuff (which is the complex part). 
This means it would be fairly easy if you could controll the way objects 
in your meta-language are accessed. Although, while saying this it 
sounds much more fun to build than actually useful to me.

Comments?

Oliver



 

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




More information about the antlr-interest mailing list