Liste des Groupes | Revenir à cl c |
On 2024-09-08, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
>On 08.09.2024 16:12, James Kuyper wrote:>
>On 9/8/24 00:39, Janis Papanagnou wrote:>
...
>That's why I immediately see the necessity that compiler creators>
need to know them in detail to _implement_ "C". And that's why I
cannot see how the statement of the C-standard's "most important
purpose" would
sound reasonable (to me). ...
>
I agree - the most important purpose is for implementors, not
developers.
>... I mean, what will a programmer get from the "C" standard that>
a well written text book doesn't provide?
What the C standard says is more precise and more complete than
what most textbooks say.
Exactly. And this precision is what makes standard often difficult
to read (for programming purposes for "ordinary" folks).
The C grammar is not presented in a nice way in ISO C.
>
It uses nonsensical categories. For instance a basic expression
like A is considered a unary-expression. A newcomer looking at the
grammar for assignment will be wondering how on Earth the A in A = B
is a unary expression, when it contains no unary operator.
>
The unary-expression is not given in the immediately preceding
section, and no section references are given; you have to go
searching through the document to find it.
>
I also suspect programmers not versed in parsing and grammars will
not intuit that assignment associates right to left. Someone who
remembers their compiler course from university will know that the
right hand side
>
"unary-expression assignment-operator assignment-expression"
>
has the assignment-expression on the right, and is therefore
identified as right-recursive, and that leads to right association.
>
I strongly suspect that the vast majority of the C coders on the
planet (as well as users of other languages that have operator
grammars) refer to operator precedence tables that fit on one
page, rather than flipping around in a telescopic grammar that
goes on for pages.
Les messages affichés proviennent d'usenet.