I started my journey into recursive parsers, and was looking into C Grammar, trying to understand how it works to replicate it in my code.
Then I saw this:
assignmentExpression
: conditionalExpression
| unaryExpression assignmentOperator assignmentExpression
| DigitSequence // for
;
and this part in particular:
unaryExpression assignmentOperator assignmentExpression
With my (poor and probably wrong) understanding, a unary expression can be a Constant (if you follow the rest of the grammar), then it looks like this 1 = 1
is valid, which is obviously wrong. I searched for C parsers, even the GCC source code, and the assignmentExpression functions never really have any code related to the unaryExpression part.
So I'm really confused; I'm probably missing something very important here.