In the C99 standard, the expressions allow for precedence and associativity.
Precedence is documented quite well since the order in which the operators appear in the
The grammar itself specifies associativity, by the productions used:
multiplicative-expression:
cast-expression
multiplicative-expression * cast-expression
This means that in a * b * c
, c
must be parsed as a cast-expression
, and a * b
as one multiplicative-expression
, before further parsing of a * b
itself. Thus the left-associativity of multiplication is forced into the syntax-tree by the parsing rules.