[antlr-interest] new action syntax proposal
Diehl, Matthew J
matthew.j.diehl at intel.com
Sat Jul 14 16:59:35 PDT 2007
> Terence Parr wrote:
> > I propose {...} stay same as an
> > action but {{...}} (double curlies) implies always execute even when
> > backtracking.
> >
> > Counterproposals?
>
> I'd vote for "@always { ... }" or a similar keyword: exploit existing
> syntax, use explicit keywords instead of adding more 'magic'
> characters.
It's always nice to use already existing syntax, but if it was
@always{...}, then could it be used anywhere within the rule?
It would be nice if it could be used within the rule (with {{...}} ) as
well. So I vote for the {{...}} (as if my vote matters, lol...more like
my preference and not a vote).
There are already several other languages that use double curlies (like
System Verilog), so it shouldn't be too bad. That, and also people
aren't
going to accidentally type {{ unless they already know it is a 'magic'
character. Only those who WANT to use it will add it (it's not like the
ever-so-common naming a parser/lexer rule after a reserved keyword).
Matt
More information about the antlr-interest
mailing list