C++研究笔记(5)语法描述的格式
2004-10-28 04:07
253 查看
作为 C++ 语言标准语法部分的核心内容,C++ 语法规范使用 C++ 语法表示法表达。C++ 语法表示法需要我们深入的理解。C++ 标准规定:
{ expressionopt }
indicates an optional expression enclosed in braces.
在本标准使用的语法表示法中,语法范畴由斜体字表示,字面的词汇和字符用等宽字体表示。除了少量情况用带有“之一”语句标志的一整行列出长串的候选条目外,都分别列在单独的行上。可选的终结符或非终结符被标以“opt”下标,于是
{ expressionopt }
表示被包围在花括号中的一个可选表达式。
Names for syntactic categories have generally been chosen according to the following rules:
选择语法范畴的名字通常依据以下规则选择:
X-name is a use of an identifier in a context that determines its meaning (e.g. class-name, typedef-name).
某名称 表示通过上下文决定的某个标识符(比如 类名称,类型定义名称)。
X-id is an identifier with no context-dependent meaning (e.g. qualified-id).
某标识 表示上下文无关的标识符(比如 限定标识)。
X-seq is one or more X's without intervening delimiters (e.g. declaration-seq is a sequence of declarations).
某序列 表示一个或多个无分隔符的某条目(比如 声明序列 是一系列声明)。
X-list is one or more X's separated by intervening comma (e.g. expression-list is a sequence of expressions separated by commas).
某列表 表示一个或多个被逗号分隔的某条目(比如 表达式列表 是一系列被逗号分隔的表达式)。
1.6 Syntax notation [syntax]
In the syntax notation used in this International Standard, syntactic categories are indicated by italic type, and literal words and characters inconstant widthtype. Alternatives are listed on separate lines except in a few cases where a long set of alternatives is presented on one line, marked by the phrase “one of.” An optional terminal or nonterminal symbol is indicated by the subscript “opt,” so
{ expressionopt }
indicates an optional expression enclosed in braces.
在本标准使用的语法表示法中,语法范畴由斜体字表示,字面的词汇和字符用等宽字体表示。除了少量情况用带有“之一”语句标志的一整行列出长串的候选条目外,都分别列在单独的行上。可选的终结符或非终结符被标以“opt”下标,于是
{ expressionopt }
表示被包围在花括号中的一个可选表达式。
Names for syntactic categories have generally been chosen according to the following rules:
选择语法范畴的名字通常依据以下规则选择:
X-name is a use of an identifier in a context that determines its meaning (e.g. class-name, typedef-name).
某名称 表示通过上下文决定的某个标识符(比如 类名称,类型定义名称)。
X-id is an identifier with no context-dependent meaning (e.g. qualified-id).
某标识 表示上下文无关的标识符(比如 限定标识)。
X-seq is one or more X's without intervening delimiters (e.g. declaration-seq is a sequence of declarations).
某序列 表示一个或多个无分隔符的某条目(比如 声明序列 是一系列声明)。
X-list is one or more X's separated by intervening comma (e.g. expression-list is a sequence of expressions separated by commas).
某列表 表示一个或多个被逗号分隔的某条目(比如 表达式列表 是一系列被逗号分隔的表达式)。
相关文章推荐
- C++ 学习笔记 <1> C++ 语法基础知识
- C++库研究笔记——Linux下是否需要使用memory pool?
- css学习笔记20160115css语法格式选择器
- C++学习笔记:异常的基本语法
- 国嵌嵌入式学习笔记-链接器脚本语法格式
- 一个无聊男人的疯狂《数据结构与算法分析-C++描述》学习笔记 用C++/lua/python/bash的四重实现(3) 最大子序列和问题
- C++研究笔记(3)其他定义
- VS2013MFC对话框工程学习笔记九 - C++语法的的学习
- C++学习笔记:函数指针语法基础以及函数指针做函数参数的思想剖析
- C++学习笔记(一) 基础语法 —参考阿发你好
- c# 语法笔记 适用于从C++转过的,用于速查
- C++库研究笔记-Makefile(1)
- C++研究笔记(4)实现遵从性
- <学习html>第一天笔记-浏览器内核、web标准、html标准语法格式
- 【Linux学习笔记】Linux C中内联汇编的语法格式及使用方法(Inline Assembly in Linux C)
- c++语法笔记(一)
- C++基本语法笔记
- c# 语法笔记 适用于从C++转过的,用于速查
- C++学习笔记(一) 补充篇 基础语法 — 参考慕课网 值得推荐!
- C++研究笔记(6)存储模型和对象模型