The C standard does not bother to distinguish between different kinds of errors encountered during parsing, but it is possible to categorise errors according to which clause of the standard applies.
The second line in your query (
int /* n; -- assuming that there is no
*/ in the remaining program text) is covered by a requirement in the description of phases of translation, §188.8.131.52/1; in particular, in phase 3: (emphasis added)
- The source file is decomposed into preprocessing tokens and sequences of
white-space characters (including comments). A source file shall not end in a
partial preprocessing token or in a partial comment. Each comment is replaced by
one space character. New-line characters are retained. Whether each nonempty
sequence of white-space characters other than new-line is retained or replaced by
one space character is implementation-defined.
The other two errors are also produced in phase 3, because the unmatched quote cannot be decomposed into a preprocessing token. The error is mentioned specifically in §6.4/3:
- A token is the minimal lexical element of the language in translation phases 7 and 8. The categories of tokens are: keywords, identifiers, constants, string literals, and punctuators. A preprocessing token is the minimal lexical element of the language in translation phases 3 through 6. The categories of preprocessing tokens are: header names, identifiers, preprocessing numbers, character constants, string literals, punctuators, and single non-white-space characters that do not lexically match the other preprocessing token categories. If a
' or a
" character matches the last category, the behavior is undefined.
That probably justifies the use of the phrase "lexical error", at least as an informal description.