
C# 语言规范
iv
版权所有
Microsoft Corporation 1999-2008
。保留所有权利。
2. 词法结构 ................................................................................................................................................................. 33
2.1 程序 ................................................................................................................................................................... 33
2.2 文法 ................................................................................................................................................................... 33
2.2.1 文法表示法 ................................................................................................................................................ 33
2.2.2 词法文法 .................................................................................................................................................... 34
2.2.3 句法文法 .................................................................................................................................................... 34
2.3 词法分析 ........................................................................................................................................................... 34
2.3.1 行结束符 .................................................................................................................................................... 35
2.3.2 注释 ............................................................................................................................................................ 35
2.3.3 空白 ............................................................................................................................................................ 37
2.4 标记 ................................................................................................................................................................... 37
2.4.1 Unicode 字符转义序列............................................................................................................................. 37
2.4.2 标识符 ........................................................................................................................................................ 38
2.4.3 关键字 ........................................................................................................................................................ 40
2.4.4 文本 ............................................................................................................................................................ 40
2.4.4.1 布尔值 ................................................................................................................................................. 40
2.4.4.2 整数 ..................................................................................................................................................... 41
2.4.4.3 实数 ..................................................................................................................................................... 42
2.4.4.4 字符 ..................................................................................................................................................... 42
2.4.4.5 字符串 ................................................................................................................................................. 43
2.4.4.6 null 文本 .............................................................................................................................................. 45
2.4.5 运算符和标点符号 ................................................................................................................................... 45
2.5 预处理指令 ....................................................................................................................................................... 45
2.5.1 条件编译符号 ............................................................................................................................................ 47
2.5.2 预处理表达式 ............................................................................................................................................ 47
2.5.3 声明指令 .................................................................................................................................................... 48
2.5.4 条件编译指令 ............................................................................................................................................ 49
2.5.5 诊断指令 .................................................................................................................................................... 51
2.5.6 区域指令 .................................................................................................................................................... 51
2.5.7 行指令 ........................................................................................................................................................ 52
2.5.8 Pragma 指令............................................................................................................................................... 52
2.5.8.1 Pragma warning ................................................................................................................................... 53
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.