Liste des Groupes | Revenir à cl c |
bart <bc@freeuk.com> writes:I see that the C grammar treats both kinds of 'break' as a jump. I for one generate two separate constructs for the two kinds. That requires keeping track of the stack of nested switch/while/for/dowhile statements.
[...]You need input from a symbol table in order to parse C, a table thatYes. (I've mentioned this a number of times.)
the parser needs to maintain as it processes source code. That will
tell you whether a particular identifier is a typename or not.
There are issues also with keywords like 'break'.What issues?
If you're referring to the fact that break can apply either to a loop orIt can be very much a problem. Suppose you have an if-else chain within a loop that contains loop-break. Later you upgrade it to switch. Now it no longer jumps to the end of the loop, but the end of the switch.
to a switch, that's a potential source of confusion, but it shouldn't be
a problem once you're aware of it.
Les messages affichés proviennent d'usenet.