[antlr-interest] still more => wars ;)
Terence Parr
parrt at cs.usfca.edu
Thu Dec 8 15:14:25 PST 2005
On Dec 8, 2005, at 3:07 PM, Martin Probst wrote:
>> 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
>
> Something missing here?
Sorry...I meant: ({...}?)=>
>> 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
>
> Well, 7 special characters for the semantic predicate is certainly
> verbose
Yes, but I suspect you'll not need a gated pred very often. Less
then once a grammar.
> , but in my opinion not more accessible.
Well, it's an idiom rather than explicit syntax. It does mean what
we say though: fail if the predicate fails. Note that it is a valid
syntactic predicate.
> Plus it probably doesn't
> mean much to new users. Plus there hoisting semantic predicates get
> the
> syntax which is now used for semantic predicates, which are closer to
> gated ones, or not? Is there purpose in there?
Yes, but hoisted is what we want; we just don't have them in v2.
Normally you'll do the terse {...}?.
I'm not in love with the ({...}?)=> but it doesn't require new syntax
at all.
Ter
More information about the antlr-interest
mailing list