Francis said:
Ah ok, does the way to parse is coming from the 'syntax' section of
each operators ?
Yes. For any operator that takes a right operand, that operand must be
an expression that lies immediately to the right of the operator. In the
case of ++*p, you have a choice of '*' (which is not an expression, it's
just an operator), or "*p" (which is an expression). You do not have the
choice of using "p" alone as the operand. The same is true if you
replace 'right' with 'left' everywhere in the preceding sentence.
The C standard doesn't use the concept of operator precedence. It uses
grammar productions, instead. However, ith only a few exceptions, the
grammar can be explained using the concept of precedence (the ?:
operator is the main exception). But precedence only matters when there
are two different operators that could operate on the same operand, and
that is only possible if the operand is in a position so it could
otherwise be either the left operand for one operator or the right
operand of the other operator.
For instance, precedence can be used to explain the grammar rule that
requires a + b * c to be parsed as a + (b * c) rather than (a + b) * c.
That's because 'b' lies between the '+' and the '*'. However, there's
not even an option to parse it as either (a + c) * b or b + (a * c),
because 'c' is in the wrong position to be the right operand of '+', and
'a' is in the wrong position to be the left operand of '*'.
Similarly, in the expression "++*p", 'p' is in the wrong position to be
the right operand of '++'.