2.13.2 - [lex.ccon] - 【词法.字符常量】
来源:互联网 发布:sql insert into 顺序 编辑:程序博客网 时间:2024/05/22 10:36
2 Lexical conventions [lex]2.13 Literals [lex.literal]2.13.2 Character literals [lex.ccon]
| 2 词法约定 【词法】2.13 文字量 【词法.文字量】2.13.2 字符文字量 【词法.字符常量】
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
character-literal:' c-char-sequence' L' c-char-sequence' c-char-sequence: c-char: escape-sequence: simple-escape-sequence: one of octal-escape-sequence: hexadecimal-escape-sequence:
| 字符-文字量:' c-字符-序列' L' c-字符-序列' c-字符-序列: c-字符: 转义-序列: 简单-转义-序列: 下列之一 八进制-转义-序列: 十六进制-转义-序列:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A character literal is one or more characters enclosed in single quotes, as in 'x' , optionally preceded by the letter L , as in L'x' . A character literal that does not begin with L is an ordinary character literal, also referred to as a narrow-character literal. An ordinary character literal that contains a single c-char has type char , with value equal to the numerical value of the encoding of the c-char in the execution character set. An ordinary character literal that contains more than one c-char is a multicharacter literal. A multicharacter literal has type int and implementation-defined value.
| 字符文字量是被单引号包围的一个或多个字符,如 'x' ,也可跟在字母 L 后面,如 L'x' 。 前面没有 L 的字符文字量是普通字符文字量,也叫做窄字符文字量。包含单个 c-字符的普通字符文字量具有类型 char , 与执行字符集中该 c-字符的编码数值相等。包含多个 c-字符的普通字符文字量是多字符文字量。多字符文字量的类型是 int ,其值由实现定义。
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A character literal that begins with the letter L , such as L'x' , is a wide-character literal. A wide-character literal has type wchar_t .23) The value of a wide-character literal containing a single c-char has value equal to the numerical value of the encoding of the c-char in the execution wide-character set. The value of a wide-character literal containing multiple c-chars is implementation-defined.
| 以 L 开始的字符文字量是宽字符文字量,如 L'x' 。宽字符文字量具有类型 wchar_t 。23) 包含一个 c-字符的宽字符文字量的值与执行宽字符集中该 c-字符的编码数值相等。包含多个 c-字符的宽字符文字量的值由实现定义。
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Certain nongraphic characters, the single quote ' , the double quote " , the question mark ? , and the backslash / , can be represented according to Table 5.
The double quote
| 某些非图形字符,单引号 ',双引号 ",问号 ?,以及反斜线 /,按照表格 5 来说明。
双引号
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The escape / ooo consists of the backslash followed by one, two, or three octal digits that are taken to specify the value of the desired character. The escape /x hhh consists of the backslash followed by x followed by one or more hexadecimal digits that are taken to specify the value of the desired character. There is no limit to the number of digits in a hexadecimal sequence. A sequence of octal or hexadecimal digits is terminated by the first character that is not an octal digit or a hexadecimal digit, respectively. The value of a character literal is implementation-defined if it falls outside of the implementation-defined range defined for char (for ordinary literals) or wchar_t (for wide literals).
| 由反斜线后面跟着一个,两个或三个八进制数字构成的转义序列 /ooo,用以代表其所指定字符的值。由反斜线后面跟着 x 再跟着一个或多个十六进制数字构成的转义序列 /xhhh,用以代表其所指定字符的值。十六进制序列的数字个数没有限制。八进制或十六进制数字序列分别在遇到第一个不是八进制或十六进制数字的字符时结束。当字符文字量的值超过由实现定义的 char(对于普通文字量)或 wchar_t(对于宽文字量)的数值范围时,其值由实现定义。
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A universal-character-name is translated to the encoding, in the execution character set, of the character named. If there is no such encoding, the universal-character-name is translated to an implementation-defined encoding. [Note: in translation phase 1, a universal-character-name is introduced whenever an actual extended character is encountered in the source text. Therefore, all extended characters are described in terms of universal-character-names. However, the actual compiler implementation may use its own native character set, so long as the same results are obtained. ]
| 统一字符名称被翻译成其命名的字符在运行字符集中的编码。如果此编码不存在,则统一字符名称被翻译成实现定义的编码。【注:在翻译阶段 1,一旦某扩展字符在源文本中出现,统一字符名称就被引入。因此,所有扩展字符都按照统一字符名称来表示。然而,只要能够产生相同结果,实际编译器实现可以使用其自己的本地字符集。】
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
23) They are intended for character sets where a character does not fit into a single byte.
| 23) 它们由不能用单个字节表达字符的字符集利用。
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PREV [lex.icon] | NEXT [lex.fcon] | 上一页 【词法.整型常量】 | 下一页 【词法.浮点常量】 |
- 2.13.2 - [lex.ccon] - 【词法.字符常量】
- 2.13.1 - [lex.icon] - 【词法.整数常量】
- 2.13.3 - [lex.fcon] - 【词法.浮点常量】
- 2.13.5 - [lex.bool] - 【词法.布尔常量】
- 2 - [lex] - 【词法】
- 2.13 - [lex.literal] - 【词法.文字量】
- 2.13.4 - [lex.string] - 【词法.字符串】
- lex词法分析
- LEX/FLEX词法分析器
- lex语言词法分析
- Lex词法分析器
- 2.1 - [lex.phases] - 【词法.阶段】
- 2.2 - [lex.charset] - 【词法.字符集】
- 2.3 - [lex.trigraph] - 【词法.三连符】
- 2.6 - [lex.token] - 【词法.标记】
- 2.7 - [lex.comment] - 【词法.注释】
- 2.8 - [lex.header] - 【词法.头】
- 2.10 - [lex.name] - 【词法.名字】
- 破解天王星磁极之谜
- 选择日期js
- 提高Java程序内存效率
- 行为学奇妙的联觉
- 谴责:明明是转贴,就是不标明出处
- 2.13.2 - [lex.ccon] - 【词法.字符常量】
- 决定放手去搏了--人生是个show场而设计是门艺术
- 在客户端获取上传图片的大小
- PHPLIB Template入门系列 - 3 块的应用
- 嗅探的时候,防火墙能发现吗? (整理至安焦)
- 3G"中国标准"明年实现商用[NEWS]
- J2ME 2D小游戏入门之旅(四) 加入子弹群,实现碰撞运算
- J2ME 2D小游戏入门之旅(五) 实现爆炸效果、并加入道具导弹
- J2ME 2D小游戏入门之旅(六) 计时器和奖惩与评价