C# 语言规范
2. 词法结构 37
2.1 程序 37
2.2 文法 37
2.2.1 文法表示法........................................................................................................................................37
2.2.2 词法文法............................................................................................................................................38
2.2.3 句法文法............................................................................................................................................38
2.3 词法分析 38
2.3.1 行结束符............................................................................................................................................39
2.3.2 注释....................................................................................................................................................39
2.3.3 空白....................................................................................................................................................41
2.4 标记 41
2.4.1 Unicode 字符转义序列......................................................................................................................41
2.4.2 标识符................................................................................................................................................42
2.4.3 关键字................................................................................................................................................44
2.4.4 文本....................................................................................................................................................44
2.4.4.1 布尔值..........................................................................................................................................44
2.4.4.2 整数..............................................................................................................................................45
2.4.4.3 实数..............................................................................................................................................46
2.4.4.4 字符..............................................................................................................................................46
2.4.4.5 字符串..........................................................................................................................................47
2.4.4.6 null 文本.......................................................................................................................................49
2.4.5 运算符和标点符号.............................................................................................................................49
2.5 预处理指令 49
2.5.1 条件编译符号....................................................................................................................................51
2.5.2 预处理表达式....................................................................................................................................51
2.5.3 声明指令............................................................................................................................................52
2.5.4 条件编译指令....................................................................................................................................53
2.5.5 诊断指令............................................................................................................................................55
2.5.6 区域指令............................................................................................................................................55
2.5.7 行指令................................................................................................................................................56
2.5.8 Pragma 指令.......................................................................................................................................56
2.5.8.1 Pragma warning............................................................................................................................57
3. 基本概念 59
iv
版权所有
Microsoft Corporation1998 1999-2008
。保留所有权利。