2.6 - [lex.token] - 【词法.标记】

本文深入探讨C语言的词法分析,包括标记(tokens)的识别,如字面量(literals)、字符(characters)、注释(comments)的处理,以及包含指令(include)和缩进(tabs)的使用规范。了解这些基础知识对于理解和编写C程序至关重要。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

2 Lexical conventions [lex]

2.6 Tokens [lex.token]

 

2 词法约定 【词法】

2.6 标记 【词法.标记】

 

    token:
        identifier
        keyword
        literal
        operator
        punctuator

 

    标记:
        标识符
        关键字
        文字量
        运算符
        标点

 

There are five kinds of tokens: identifiers, keywords, literals,18) operators, and other separators. Blanks horizontal and vertical tabs, newlines, formfeeds, and comments (collectively, "white space"), as described below, are ignored except as they serve to separate tokens. [Note: Some white space is required to separate otherwise adjacent identifiers, keywords, numeric literals, and alternative tokens containing alphabetic characters. ]

 

共有五种标记:标识符,关键字,文字量18),运算符,以及其他分隔符。如下文描述,空格,水平表格,垂直表格,换行,换页,以及注释(统一称为“空白”),将被用来分隔标记并被忽略。【注:相邻的标识符,关键字,数字文字量,和包含字母字符的候选标记之间需要用一些空白分隔开。】

 

18) Literals include strings and character and numeric literals.

 

18) 文字量包括字符串,字符和数字文字量。

 

PREV [lex.digraph] | NEXT [lex.comment]上一页 【词法.双连符】 | 下一页 【词法.注释】
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值