作为 C++ 语言标准语法部分的核心内容,C++ 语法规范使用 C++ 语法表示法表达。C++ 语法表示法需要我们深入的理解。C++ 标准规定:
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 in constant width type. 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:
选择语法范畴的名字通常依据以下规则选择:
本文地址:http://com.8s8s.com/it/it26159.htm