[antlr-interest] Re: Semantic predicates that aren't & hoisting

David Jung jungdl at ornl.gov
Thu Mar 10 11:15:56 PST 2005


eprice at vettro.com said:
> David Jung <jungdl at ornl.gov> writes:
>
>> Actually I was trying to simplify my description.  I'd like to have
>> an optional semi-colon after the last expression.  This is so that
>> users coming from java/C++ could write 'naturally' both:
>>
>> {
>>   f();
>>   g();
>>   h();
>> }
>>
>> and
>>
>> a = {f();g();h()};
>
> Hmm, what about the following:
>
>  if (foo) {};
>  else {}
>
> Should that be legal?

It would be better if it wasn't.
In my previous posts I've said I don't want to
require a ';' after an expr that ends with an exprList,
but in reality it would be better is it wasn't allowed.
There are two different choices here
(given that ';' is required to separate expr's when the first doesn't
end in an exprList):

1) require/allow/disallow ';' after expr with a training exprList
2) require/allow/disallow ';' after last expr in an exprList

I was trying to avoid the complication of discussing 2), but
perhaps it isn't completely independent of 1).
Ideally I'd like 1) disallow, 2) allow - but I don't know
how to do it :(
-David.



More information about the antlr-interest mailing list