|
|
In article <5c21f815-e1e6-468e-8630-cc72dad60a09@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
JoseMariaSola <JoseMariaSola@xxxxxxxxx> wrote:
>Here is part of the grammar:
>
>unary-expression:
> postfix-expression
> ++ unary-expression
> -- unary-expression
> unary-operator cast-expression
> sizeof unary-expression
> sizeof ( type-name )
>
>unary-operator: one of
> & * + - ? !
>
>cast-expression:
> unary-expression
> ( type-name ) cast-expression
>
>
>Why sizeof, (type-name), ++ and -- aren't unary-operators?
You could include sizeof in unary-operator, but you'd still need the
special case of a type-name operand requiring parentheses, and it
seems clearer to keep them together in the list. Similarly ++ and --
would still have to appear in postfix-expression. Both of these are
just matters of taste really. I don't see how you could do
(type-name), because a unary-operator is something that precedes its
operand, and the parentheses of a cast have to go around the operand.
-- Richard
--
:wq
|
|