function types syntax
Rémi Forax
forax at univ-mlv.fr
Tue Jan 5 15:28:16 PST 2010
Le 05/01/2010 17:30, Peter Levart a écrit :
> On Tuesday 05 January 2010 17:04:42 Rémi Forax wrote:
>
>> From the JLS3 grammar, an Expression can be a PrimaryNoNewArray that
>> can be derived to a parenthesis expression and it can also be a
>> CastExpression.
>> So cast can appear where parenthesized function call can appear.
>>
> Ok, but CastExpression (15.16) is defined as:
>
> CastExpression:
> ( PrimitiveType Dims opt ) UnaryExpression
> ( ReferenceType ) UnaryExpressionNotPlusMinus
>
> ... so "( ReferenceType )" has to be followed by UnaryExpressionNotPlusMinus to be recognised as CastExpression, whereas "parenthesized function call" (I think) can never be followed by anything that looks like UnaryExpressionNotPlusMinus.
>
> It would be best to find a full contra-example...
>
Ok, my point was "you need to change the grammar" and it seems you agree
about that.
Else the contra-example:
f( (Integer()) - 1);
>
>> Example:
>> 2 + (A()) ...
>>
>>
> What did you have in mind for "..." ?
>
> Regards, Peter
>
cheers,
Rémi
More information about the lambda-dev
mailing list