Five classes of tokens: operators, separators, identifiers, keywords, and constants.
(1) operators and separators.
! % ^ & * - + = ~ | . < > / ?
+= -= *= /= %=
<<= >>= &= ^= |=
--> ++ -- << >>
<= >= == != && ||
() [] {} , ; : ...
<% %> <: :> %: %:%: (see the section 001)
(2) identifiers
(a). An identifier, or name, is a sequence of Latin capital and small letters, digits, and LOWLINE character. An identifier must bot begin with a digit, and it must not have the same spelling as a keyword.
(b). Beginning with C99, identifiers may also contain unversal character names and other implementation-defined multibyte characters. Unversal characters must not be used to place a diagit at the beginning of an identifier and further restricted to be "letter-like" character and not puncuators.
(c). Identifiers sensitive of case.
(d). All identifiers may not beginning with an underscore and followed by ethier a capital(uppercase) letter or another underscore because which all are reserved for standard library.
(e). Internal identidfiers: C89 requires implementation to permit a minimum of 31 significant character in identifiers, and C99 raises this minimum to 63 characters.
(f). External identifiers: C89 requires a minimum capacity of only six characters, not counting letter case. C99 raises this to 31 characters, including letter case. But allowing unversal character names to be treated as 6 characters or 10 characters.
(3). Keywords
auto _Bool break case char _Complex const continue default restrict do double
else enum extern float for goto if _Imaginary inline int long register return short
signed sizeof static struct switch typedef union unsigned void volatile while
(4). Constants. It's more complicated than forwards. The next section will note the constants.
C语言标识符与关键字详解
本文详细介绍了C语言中的五种标记:运算符、分隔符、标识符、关键字和常量。重点讲解了标识符的命名规则,包括合法字符、大小写敏感性、保留标识符等内容,并列举了所有C语言的关键字。

被折叠的 条评论
为什么被折叠?



