Liste des Groupes | Revenir à cl c |
On 2024-08-30, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:...
However, the compilers I've tried produce the same diagnostic (not a>
syntax error message) for both. Probably they use a tweaked grammar
that allows more a general expression as the LHS of an assignment,
and catch errors later in semantic analysis, for the purpose of
producing diagnostics that are easier to understand. It's obvious
that in `x + 1 = y`, the programmer (probably) intended `x + 1`
to be the LHS of an assignment. These compilers (I tried gcc,
clang, and tcc) are clever enough to recognize that.
A standard operator precedence parsing algorithm such as Shunting Yard
cannot help but parse that.
Les messages affichés proviennent d'usenet.