[antlr-interest] new action syntax proposal

Jim Idle jimi at temporal-wave.com
Sat Jul 14 18:38:10 PDT 2007


The only slight issue I see with that is that in some target languages
the second { would sometimes be meaningful:


r:
 FRED
  {
	{ int a; ...}
  }

Though this is a minor barrier, perhaps it can be avoided by using
another character as otherwise people may specify a backtrack executing
action without realizing it.

Perhaps:

{<
>}

 (you can read the < as backtrack I guess:

I suspect though that all such sequences offer some clash with targets
;-)

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Terence Parr
> Sent: Friday, July 13, 2007 4:40 PM
> To: antlr-interest Interest
> Subject: [antlr-interest] new action syntax proposal
> 
> Hi,
> 
> 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.
> 
> Counterproposals?
> 
> Ter


More information about the antlr-interest mailing list