[antlr-interest] new action syntax proposal

Kay Roepke kroepke at classdump.org
Fri Jul 13 16:51:50 PDT 2007


On Jul 14, 2007, at 1:40 AM, Terence Parr wrote:

> Actions are not executed during backtracking as we cannot undo  
> stateful actions.  The problem is that some semantic predicates  
> that test, for example, the symbol table rely on actions updating  
> the symbol table during backtracking.  I propose {...} stay same as  
> an action but {{...}} (double curlies) implies always execute even  
> when backtracking.

I suppose this is a bit paranoid, but in most languages we target the  
curlies are the block delimiters. There's a minimal chance that  
someone writes double curlies to introduce a different automatic  
scope in the C-based targets. (this notion of automatic vars doesn't  
really apply to Java, right? There was something with everything  
being set up on method entry, IIRC. Don't quote me on this, though.)

If that happens, the semantics would change, probably without the  
grammar author noticing. And we couldn't even issue a warning because  
that warning would be totally silly for like 99.99999% of the users.

I don't have a better idea for the tokens, just came across my mind  
when reading it.

cheers,
-k
-- 
Kay Röpke
http://classdump.org/






More information about the antlr-interest mailing list