2.5 - [lex.digraph] - 【词法.双连符】

请不要转载本文;请不要以任何形式重新出版,发布本文;请在下载本文 24 小时内将其删除;禁止将本文用于商业目的。

2 Lexical conventions [lex]

2.5 Alternative tokens [lex.digraph]

 

2 词法约定 【词法】

2.5 候选标记 【词法.双连符】

 

Alternative token representations are provided for some operators and punctuators16).

 

某些运算符和标点具有候选标记。16)

 

In all respects of the language, each alternative token behaves the same, respectively, as its primary token, except for its spelling17). The set of alternative tokens is defined in Table 2.

Table 2 - alternative tokens
alternativeprimary
<%{
%>}
<:[
:>]
%:#
%:%:##
and&&
bitor|
or||
xor^
compl~
bitand&
and_eq&=
or_eq!=
xor_eq^=
not!
not_eq!=

 

在语言中,所有候选标记除了其拼写外,与其首选标记具有相同的行为。17) 表格 2 里定义了候选标记的集合。

表格 2 - 候选标记
候选标记首选标记
<%{
%>}
<:[
:>]
%:#
%:%:##
and&&
bitor|
or||
xor^
compl~
bitand&
and_eq&=
or_eq!=
xor_eq^=
not!
not_eq!=

 

16) These include "digraphs" and additional reserved words. The term "digraph" (token consisting of two characters) is not perfectly descriptive, since one of the alternative preprocessing-tokens is %:%: and of course several primary tokens contain two characters. Nonetheless, those alternative tokens that aren't lexical keywords are colloquially known as "digraphs".

 

16) 包括“双连符”和额外的保留词。术语“双连符”(包含两个字符的标记)的表达效果比较差,因为一个候选预处理标记为 %:%:,并且几个首选标记也有两个字符。 虽然如此,这些不是关键字词汇的候选标记仍被通俗地称为“双连符”。

 

17) Thus the "stringized" values (16.3.2) of [ and <: will be different, maintaining the source spelling, but the tokens can otherwise be freely interchanged.

 

17) 在“字符串化”值中有所不同(16.3.2),其中的 [ 和 <: 将保持源的拼写形式,而标记却可以被自由地互换。

 

PREV [lex.pptoken] | NEXT [lex.token]上一页 【词法.预处理标记】 | 下一页 【词法.标记】
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值