I can't figure out what the syntax means in C99. Here, when I say C99, I mean ISO / IEC 9899: 1999. Well, I think that part of the grammar syntax has not changed much since ANSI C, C89.
Take for example from this question :
6.5.5 Multiplicative operators
Syntax
multiplicative-expression:
cast-expression
multiplicative-expression * cast-expression
multiplicative-expression / cast-expression
multiplicative-expression % cast-expression
Constraints
Each of the operands shall have arithmetic type. The operands of the % operator
shall have integer type.
Semantics
The usual arithmetic conversions are performed on the operands.
The result of the binary * operator is the product of the operands.
The result of the / operator is the quotient
I wonder why in the syntax of multiplicative operators we have a "cast-expression"? And what grammar can this syntax mean? In this question, @Avi said that in
a*b*c
"c must be parsed as expression-cast," I can't figure it out.
Take another example from c99 6.6.1, syntax for constant expressions
Syntax
constant-expression:
conditional-expression
why does this conditional expression appear here? Can someone show me how to explain this syntax? Thanks to everyone in advance.