[antlr-interest] still more => wars ;)

Terence Parr parrt at cs.usfca.edu
Thu Dec 8 14:53:52 PST 2005


On Dec 8, 2005, at 2:45 PM, Chris Black wrote:

> Terence Parr wrote:
>
>> Ok, so I not overjoyed with what you guys propose either ;)   
>> Adding  random new symbols is probably not the answer. :)
>>
>> How about the following which is identical to what ANTLR v2 does.   
>> To  get hoisted preds though you'll need the '=>' not '?'.
>>
>> (...) =>     syntactic predicate
>> {...} =>    _hoisting_ disambiguating semantic predicate
>> {...}?        gated semantic predicate
>
> Would (...)? syntax still mean the same thing it does in ANTLR 2.7.x?

Yes.

> If so, I'm cool with the above proposed syntax, although I'd prefer  
> {...} ?=> for gated semantic predicate. That way "=>" always means  
> a predicate of some sort.

So, you'd vote for:

(...) =>     syntactic predicate
{...} =>    _hoisting_ disambiguating semantic predicate
{...}? =>  gated semantic predicate

Hmm...the two kinds of sem preds are pretty similar this way.  I do  
like the => implies predicate though.  I wonder what we could do to  
indicate gated.  Loring's original suggestion was


which is verbose but these are not used much and it's clear what we  
mean w/o new syntax.  We could then do

(...) => 	syntactic predicate
{...}?		_hoisting_ disambiguating semantic predicate
( {...}? ) =>  gated semantic predicate

leaving everything the way they are now but adding the last syntax.

Ter



More information about the antlr-interest mailing list