fix 3.4 expressions

This commit is contained in:
stanzhai
2014-06-14 20:59:23 +08:00
parent 21adbd3538
commit e263b4547c
2 changed files with 218 additions and 241 deletions

View File

@ -1,6 +1,5 @@
> 翻译sg552
> 校对numbbbbb
> 翻译sg552
> 校对numbbbbb, stanzhai
# 表达式Expressions
-----------------
@ -19,10 +18,9 @@ Swift 中存在四种表达式: 前缀prefix表达式二元binary
前缀表达式和二元表达式就是对某些表达式使用各种运算符operators。 主要表达式是最短小的表达式,它提供了获取(变量的)值的一种途径。 后缀表达式则允许你建立复杂的表达式,例如配合函数调用和成员访问。 每种表达式都在下面有详细论述~
> 表达式语法
>
> *expression* → *prefix-expression*­*binary-expressions(*opt)
> *expression-list* → *expression*­| *expression*­,­*expression-list*
> 表达式语法
> *表达式* → [*前置表达式*](..\chapter3\04_Expressions.html#prefix_expression) [*二元表达式列表*](..\chapter3\04_Expressions.html#binary_expressions) _可选_
> *表达式列表* → [*表达式*](..\chapter3\04_Expressions.html#expression) | [*表达式*](..\chapter3\04_Expressions.html#expression) **,** [*表达式列表*](..\chapter3\04_Expressions.html#expression_list)
<a name="prefix_expressions"></a>
## 前缀表达式Prefix Expressions
@ -42,18 +40,17 @@ Swift 标准库支持如下的前缀操作符:
作为对上面标准库运算符的补充,你也可以对 某个函数的参数使用 '&'运算符。 更多信息,请参见: "In-Out parameters".
> 表达式语法
>
> *prefix-expression* → *prefix-operator* (opt) *postfix-expression*
> *prefix-expression* → *in-out-expression*­
> *in-out-expression* → &­*identifier*­
> 表达式语法
> *前置表达式* → [*前置运算符*](LexicalStructure.html#prefix_operator) _可选_ [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression)
> *前置表达式* → [*写入写出(in-out)表达式*](..\chapter3\04_Expressions.html#in_out_expression)
> *写入写出(in-out)表达式* → **&** [*标识符*](LexicalStructure.html#identifier)
<a name="binary_expressions"></a>
## 二元表达式Binary Expressions
二元表达式由 "左边参数" + "二元运算符" + "右边参数" 组成, 它有如下的形式:
`left-hand argument` `operator` `right-hand argument`
> `left-hand argument` `operator` `right-hand argument`
Swift 标准库提供了如下的二元运算符:
@ -114,17 +111,18 @@ Swift 标准库提供了如下的二元运算符:
关于这些运算符operators的更多信息请参见Basic Operators and Advanced Operators.
>> 注意
>>
>> 在解析时, 一个二元表达式表示为一个一级数组a flat list, 这个数组List根据运算符的先后顺序被转换成了一个tree. 例如: 2 + 3 * 5 首先被认为是: 2, + , `` 3``, *, 5. 随后它被转换成 tree 2 + 3 * 5
> 注意
> 在解析时, 一个二元表达式表示为一个一级数组a flat list, 这个数组List根据运算符的先后顺序被转换成了一个tree. 例如: 2 + 3 * 5 首先被认为是: 2, + , `` 3``, *, 5. 随后它被转换成 tree 2 + 3 * 5
<p></p>
> 二元表达式语法
> *二元表达式* → [*二元运算符*](LexicalStructure.html#binary_operator) [*前置表达式*](..\chapter3\04_Expressions.html#prefix_expression)
> *二元表达式* → [*赋值运算符*](..\chapter3\04_Expressions.html#assignment_operator) [*前置表达式*](..\chapter3\04_Expressions.html#prefix_expression)
> *二元表达式* → [*条件运算符*](..\chapter3\04_Expressions.html#conditional_operator) [*前置表达式*](..\chapter3\04_Expressions.html#prefix_expression)
> *二元表达式* → [*类型转换运算符*](..\chapter3\04_Expressions.html#type_casting_operator)
> *二元表达式列表* → [*二元表达式*](..\chapter3\04_Expressions.html#binary_expression) [*二元表达式列表*](..\chapter3\04_Expressions.html#binary_expressions) _可选_
> 二元表达式的语法
>
> *binary-expression* → *binary-operator*­*prefix-expression*­
> *binary-expression* → *assignment-operator*­prefix-expression*
> *binary-expression* → *conditional-operator*­prefix-expression*
> *binary-expression* → *type-casting-operator*­
> *binary-expression*s → *binary-expression*­*binary-expressions*(opt)
<a name="assignment_operator"></a>
## 赋值表达式Assignment Operator
@ -132,7 +130,7 @@ Swift 标准库提供了如下的二元运算符:
The assigment operator sets a new value for a given expression. It has the following form:
赋值表达式会对某个给定的表达式赋值。 它有如下的形式;
`expression` = `value`
> `expression` = `value`
就是把右边的 *value* 赋值给左边的 *expression*. 如果左边的*expression* 需要接收多个参数是一个tuple 那么右边必须也是一个具有同样数量参数的tuple. 允许嵌套的tuple
@ -143,40 +141,36 @@ The assigment operator sets a new value for a given expression. It has the follo
赋值运算符不返回任何值。
> 赋值表达式的语法
>
> *assignment-operator* → =­
> 赋值运算符语法
> *赋值运算符* → **=**
<a name="ternary_conditional_operator"></a>
## 三元条件运算符Ternary Conditional Operator
三元条件运算符 是根据条件来获取值。 形式如下:
`condition` ? `expression used if true` : `expression used if false`
> `condition` ? `expression used if true` : `expression used if false`
如果 `condition` 是true, 那么返回 第一个表达式的值(此时不会调用第二个表达式), 否则返回第二个表达式的值(此时不会调用第一个表达式)。
想看三元条件运算符的例子,请参见: Ternary Conditional Operator.
> 三元条件表达式
>
> `conditional-operator` → ?­`expression`­:­
> 三元条件运算符语法
> *三元条件运算符* → **?** [*表达式*](..\chapter3\04_Expressions.html#expression) **:**
<a name="type-casting_operators"></a>
## 类型转换运算符Type-Casting Operators
有两种类型转换操作符: as 和 is. 它们有如下的形式:
`expression` as `type`
`expression` as? `type`
`expression` is `type`
> `expression` as `type`
> `expression` as? `type`
> `expression` is `type`
as 运算符会把`目标表达式`转换成指定的`类型`specified type过程如下
- 如果类型转换成功, 那么目标表达式就会返回指定类型的实例instance. 例如把子类subclass变成父类superclass时.
- 如果转换失败,则会抛出编译错误( compile-time error
- 如果上述两个情况都不是(也就是说,编译器在编译时期无法确定转换能否成功,) 那么目标表达式就会变成指定的类型的optional. is an optional of the specified type 然后在运行时,如果转换成功, 目标表达式就会作为 optional的一部分来返回 否则目标表达式返回nil. 对应的例子是: 把一个 superclass 转换成一个 subclass.
```swift
@ -209,25 +203,23 @@ The check must not be known to be true or false at compile time. The following a
关于类型转换的更多内容和例子,请参见: Type Casting.
> 类型转换的语法
>
> *type-casting-operator* → is­*type*­| as­?(opt)­*type*
> 类型转换运算符(type-casting-operator)语法
> *类型转换运算符* → **is** [*类型*](..\chapter3\03_Types.html#type) | **as** **?** _可选_ [*类型*](..\chapter3\03_Types.html#type)
<a name="primary_expressions"></a>
## 主表达式Primary Expressions
## 主表达式Primary Expressions
`主表达式`是最基本的表达式。 它们可以跟 前缀表达式,二元表达式,后缀表达式以及其他主要表达式组合使用。
`主表达式`是最基本的表达式。 它们可以跟 前缀表达式,二元表达式,后缀表达式以及其他主要表达式组合使用。
> 表达式语法
>
> *primary-expression* → *identifier*­*generic-argument-clause*(opt)
> *primary-expression* → *literal-expression*­
> *primary-expression* → *self-expression*­
> *primary-expression* → *superclass-expression*­
> *primary-expression* → *closure-expression*­
> *primary-expression* → *parenthesized-expression*­
> *primary-expression* → *implicit-member-expression*
> *primary-expression* → *wildcard-expression*
> 主表达式语法
> *主表达式* → [*标识符*](LexicalStructure.html#identifier) [*泛型参数子句*](GenericParametersAndArguments.html#generic_argument_clause) _可选_
> *主表达式* → [*字面量表达式*](..\chapter3\04_Expressions.html#literal_expression)
> *主表达式* → [*self表达式*](..\chapter3\04_Expressions.html#self_expression)
> *主表达式* → [*超类表达式*](..\chapter3\04_Expressions.html#superclass_expression)
> *主表达式* → [*闭包表达式*](..\chapter3\04_Expressions.html#closure_expression)
> *主表达式* → [*圆括号表达式*](..\chapter3\04_Expressions.html#parenthesized_expression)
> *主表达式* → [*隐式成员表达式*](..\chapter3\04_Expressions.html#implicit_member_expression)
> *主表达式* → [*通配符表达式*](..\chapter3\04_Expressions.html#wildcard_expression)
### 字符型表达式Literal Expression
@ -244,37 +236,36 @@ The check must not be known to be true or false at compile time. The following a
一个array literal是一个有序的值的集合。 它的形式是:
[`value 1`, `value 2`, `...`]
> [`value 1`, `value 2`, `...`]
数组中的最后一个表达式可以紧跟一个逗号(','. []表示空数组 。 array literal的type是 T[], 这个T就是数组中元素的type. 如果该数组中有多种type, T则是跟这些type的公共supertype最接近的type.closest common supertype
一个`dictionary literal` 是一个包含无序的键值对key-value pairs的集合它的形式是:
[`key 1`: `value 1`, `key 2`: `value 2`, `...`]
> [`key 1`: `value 1`, `key 2`: `value 2`, `...`]
dictionary 的最后一个表达式可以是一个逗号(','. [:] 表示一个空的dictionary. 它的type是 Dictionary<KeyType, ValueType> 这里KeyType表示 key的type, ValueType表示 value的type 如果这个dictionary 中包含多种 types, 那么KeyType, Value 则对应着它们的公共supertype最接近的type closest common supertype.
> 符型表达式语法
>
> *literal-expression* → *literal*
> *literal-expression* → *array-literal*­| *dictionary-literal*­
> *literal-expression* → *\__FILE__*­| *\__LINE__*­| *\__COLUMN__*­| *\__FUNCTION__*­
> *array-literal* → [­*array-literal-items*­opt­]­
> *array-literal-items* → *array-literal-item*­,­(opt) | ­*array-literal-item*­,­*array-literal-items*­
> *array-literal-item* → *expression*­
> *dictionary-literal* → [­*dictionary-literal-items*­]­ [­:­]­
> *dictionary-literal-items* → *dictionary-literal-item*,­(opt)­| *dictionary-literal-item*­,­*dictionary-literal-items*­
> *dictionary-literal-item* → *expression*­:­*expression*­
> 面量表达式语法
> *字面量表达式* → [*字面量*](LexicalStructure.html#literal)
> *字面量表达式* → [*数组字面量*](..\chapter3\04_Expressions.html#array_literal) | [*字典字面量*](..\chapter3\04_Expressions.html#dictionary_literal)
> *字面量表达式* → **&#95;&#95;FILE&#95;&#95;** | **&#95;&#95;LINE&#95;&#95;** | **&#95;&#95;COLUMN&#95;&#95;** | **&#95;&#95;FUNCTION&#95;&#95;**
> *数组字面量* → **[** [*数组字面量项列表*](..\chapter3\04_Expressions.html#array_literal_items) _可选_ **]**
> *数组字面量项列表* → [*数组字面量项*](..\chapter3\04_Expressions.html#array_literal_item) **,** _可选_ | [*数组字面量项*](..\chapter3\04_Expressions.html#array_literal_item) **,** [*数组字面量项列表*](..\chapter3\04_Expressions.html#array_literal_items)
> *数组字面量项* → [*表达式*](..\chapter3\04_Expressions.html#expression)
> *字典字面量* → **[** [*字典字面量项列表*](..\chapter3\04_Expressions.html#dictionary_literal_items) **]** | **[** **:** **]**
> *字典字面量项列表* → [*字典字面量项*](..\chapter3\04_Expressions.html#dictionary_literal_item) **,** _可选_ | [*字典字面量项*](..\chapter3\04_Expressions.html#dictionary_literal_item) **,** [*字典字面量项列表*](..\chapter3\04_Expressions.html#dictionary_literal_items)
> *字典字面量项* → [*表达式*](..\chapter3\04_Expressions.html#expression) **:** [*表达式*](..\chapter3\04_Expressions.html#expression)
### self表达式Self Expression
self表达式是对 当前type 或者当前instance的引用。它的形式如下
> self
> self.`member name`
> self[`subscript index`]
> self`initializer arguments`
> self.init`initializer arguments`
> self
> self.`member name`
> self[`subscript index`]
> self`initializer arguments`
> self.init`initializer arguments`
如果在 initializer, subscript, instance method中self等同于当前type的instance. 在一个静态方法static method, 类方法class method self等同于当前的type.
@ -301,40 +292,38 @@ struct Point {
}
```
> self表达式语法
>
> *self-expression* → self­
> *self-expression* → self­.­*identifier*­
> *self-expression* → self­[­*expression*­]­
> *self-expression* → self­.­init­
> Self 表达式语法
> *self表达式* → **self**
> *self表达式* → **self** **.** [*标识符*](LexicalStructure.html#identifier)
> *self表达式* → **self** **[** [*表达式*](..\chapter3\04_Expressions.html#expression) **]**
> *self表达式* → **self** **.** **init**
### 超类表达式Superclass Expression
超类表达式可以使我们在某个class中访问它的超类. 它有如下形式:
super.`member name`
super[`subscript index`]
super.init`initializer arguments`
> super.`member name`
> super[`subscript index`]
> super.init`initializer arguments`
形式1 用来访问超类的某个成员member. 形式2 用来访问该超类的 subscript 实现。 形式3 用来访问该超类的 initializer.
子类subclass可以通过超类superclass表达式在它们的 member, subscripting 和 initializers 中来利用它们超类中的某些实现(既有的方法或者逻辑)。
> GRAMMAR OF A SUPERCLASS EXPRESSION
> *superclass-expression* → *superclass-method-expression* | *superclass-subscript-expression*­| *superclass-initializer-expression*
> *superclass-method-expression* → super­.­*identifier*
> *superclass-subscript-expression* → super­[­*expression*­]­
> *superclass-initializer-expression* → super­.­init­
> 超类(superclass)表达式语法
> *超类表达式* → [*超类方法表达式*](..\chapter3\04_Expressions.html#superclass_method_expression) | [*超类下标表达式*](..\chapter3\04_Expressions.html#超类下标表达式) | [*超类构造器表达式*](..\chapter3\04_Expressions.html#superclass_initializer_expression)
> *超类方法表达式* → **super** **.** [*标识符*](LexicalStructure.html#identifier)
> *超类下标表达式* → **super** **[** [*表达式*](..\chapter3\04_Expressions.html#expression) **]**
> *超类构造器表达式* → **super** **.** **init**
### 闭包表达式Closure Expression
闭包closure 表达式可以建立一个闭包(在其他语言中也叫 lambda, 或者 匿名函数anonymous function. 跟函数function的声明一样 闭包closure包含了可执行的代码跟方法主体statement类似 以及接收capture的参数。 它的形式如下:
```swift
{ parameters -> return type in
statements
}
{ parameters -> return type in
statements
}
```
闭包的参数声明形式跟方法中的声明一样, 请参见Function Declaration.
@ -384,22 +373,21 @@ myFunction { [weak parent = self.parent] in printparent!.title }
关于闭包表达式的更多信息和例子,请参见: Closure Expressions.
> 闭包表达式语法
>
> *closure-expression* → {­*closure-signature*­opt­*statements*­}­
> *closure-signature* → *parameter-clause*­*function-result*­(opt)­in­
> *closure-signature* → *identifier-list*­*function-result*­(opt)­in­
> *closure-signature* → *capture-list*­*parameter-clause*­*function-result*­(opt)­in­
> *closure-signature* → *capture-list*­*identifier-list*­*function-result*­(opt)­in­
> *closure-signature* → *capture-list*­in­
> *capture-list* → [­*capture-specifier*­*expression*­]­
> *capture-specifier* → weak­| unowned­| unownedsafe­| unownedunsafe­
> 闭包表达式语法
> *闭包表达式* → **{** [*闭包签名(Signational)*](..\chapter3\04_Expressions.html#closure_signature) _可选_ [*多条语句(Statements)*](..\chapter3\10_Statements.html#statements) **}**
> *闭包签名(Signational)* → [*参数子句*](..\chapter3\05_Declarations.html#parameter_clause) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in**
> *闭包签名(Signational)* → [*标识符列表*](LexicalStructure.html#identifier_list) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in**
> *闭包签名(Signational)* → [*捕获(Capature)列表*](..\chapter3\04_Expressions.html#capture_list) [*参数子句*](..\chapter3\05_Declarations.html#parameter_clause) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in**
> *闭包签名(Signational)* → [*捕获(Capature)列表*](..\chapter3\04_Expressions.html#capture_list) [*标识符列表*](LexicalStructure.html#identifier_list) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in**
> *闭包签名(Signational)* → [*捕获(Capature)列表*](..\chapter3\04_Expressions.html#capture_list) **in**
> *捕获(Capature)列表* → **[** [*捕获(Capature)说明符*](..\chapter3\04_Expressions.html#capture_specifier) [*表达式*](..\chapter3\04_Expressions.html#expression) **]**
> *捕获(Capature)说明符* → **weak** | **unowned** | **unowned(safe)** | **unowned(unsafe)**
### 隐式成员表达式Implicit Member Expression
在可以判断出类型type的上下文context隐式成员表达式是访问某个type的member 例如 class method, enumeration case 的简洁方法。 它的形式是:
.`member name`
> .`member name`
例子:
@ -408,23 +396,21 @@ var x = MyEnumeration.SomeValue
x = .AnotherValue
```
> 隐式成员表达式语法
>
> *implicit-member-expression* → .­*identifier*
> 隐式成员表达式语法
> *隐式成员表达式* → **.** [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier)
### 圆括号表达式Parenthesized Expression
圆括号表达式由多个子表达式和逗号','组成。 每个子表达式前面可以有 identifier x: 这样的可选前缀。形式如下:
`identifier 1`: `expression 1`, `identifier 2`: `expression 2`, `...`
>`identifier 1`: `expression 1`, `identifier 2`: `expression 2`, `...`
圆括号表达式用来建立tuples 然后把它做为参数传递给 function. 如果某个圆括号表达式中只有一个 子表达式那么它的type就是 子表达式的type。例如 1的 type是Int, 而不是Int
> 圆括号表达式的语法
>
> *parenthesized-expression* → ­*expression-element-list* (opt)­­
> *expression-element-list* → *expression-element*­| *expression-element*­,­*expression-element-list*­
> *expression-element* → *expression*­| *identifier*­:­*expression*
> 圆括号表达式(Parenthesized Expression)语法
> *圆括号表达式* → **(** [*表达式元素列表*](..\chapter3\04_Expressions.html#expression_element_list) _可选_ **)**
> *表达式元素列表* → [*表达式元素*](..\chapter3\04_Expressions.html#expression_element) | [*表达式元素*](..\chapter3\04_Expressions.html#expression_element) **,** [*表达式元素列表*](..\chapter3\04_Expressions.html#expression_element_list)
> *表达式元素* → [*表达式*](..\chapter3\04_Expressions.html#expression) | [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) **:** [*表达式*](..\chapter3\04_Expressions.html#expression)
### 通配符表达式Wildcard Expression
@ -435,9 +421,8 @@ x = .AnotherValue
// x is 10, 20 is ignored
```
> 通配符表达式语法
>
> *wildcard-expression* → _­
> 通配符表达式语法
> *通配符表达式* → **_**
<a name="postfix_expressions"></a>
## 后缀表达式Postfix Expressions
@ -451,31 +436,30 @@ Swift 标准库提供了下列后缀表达式:
对于这些操作符的使用,请参见: Basic Operators and Advanced Operators
> 表达式语法
>
> *postfix-expression* → *primary-expression*
> *postfix-expression* → *postfix-expression*­*postfix-operator*
> *postfix-expression* → *function-call-expression*­
> *postfix-expression* → *initializer-expression*­
> *postfix-expression* → *explicit-member-expression*­
> *postfix-expression* → *postfix-self-expression*­
> *postfix-expression* → *dynamic-type-expression*­
> *postfix-expression* → *subscript-expression*­
> *postfix-expression* → *forced-value-expression*­
> *postfix-expression* → *optional-chaining-expression*­
> 表达式语法
> *后置表达式* → [*主表达式*](..\chapter3\04_Expressions.html#primary_expression)
> *后置表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) [*后置运算符*](..\chapter3\02_Lexical_Structure.html#postfix_operator)
> *后置表达式* → [*函数调用表达式*](..\chapter3\04_Expressions.html#function_call_expression)
> *后置表达式* → [*构造器表达式*](..\chapter3\04_Expressions.html#initializer_expression)
> *后置表达式* → [*显示成员表达式*](..\chapter3\04_Expressions.html#explicit_member_expression)
> *后置表达式* → [*后置self表达式*](..\chapter3\04_Expressions.html#postfix_self_expression)
> *后置表达式* → [*动态类型表达式*](..\chapter3\04_Expressions.html#dynamic_type_expression)
> *后置表达式* → [*下标表达式*](..\chapter3\04_Expressions.html#subscript_expression)
> *后置表达式* → [*强制取值(Forced Value)表达式*](..\chapter3\04_Expressions.html#forced_value_expression)
> *后置表达式* → [*可选链(Optional Chaining)表达式*](..\chapter3\04_Expressions.html#optional_chaining_expression)
### 函数调用表达式Function Call Expression
函数调用表达式由函数名和参数列表组成。它的形式如下:
`function name``argument value 1`, `argument value 2`
> `function name``argument value 1`, `argument value 2`
The function name can be any expression whose value is of a function type.
(不用翻译了, 太罗嗦)
如果该function 的声明中指定了参数的名字,那么在调用的时候也必须得写出来. 例如:
`function name``argument name 1`: `argument value 1`, `argument name 2`: `argument value 2`
> `function name``argument name 1`: `argument value 1`, `argument name 2`: `argument value 2`
可以在 函数调用表达式的尾部(最后一个参数之后)加上 一个闭包closure 该闭包会被目标函数理解并执行。它具有如下两种写法:
@ -493,24 +477,23 @@ myData.someMethod {$0 == 13}
myData.someMethod {$0 == 13}
```
> GRAMMAR OF A FUNCTION CALL EXPRESSION
>
> *function-call-expression* → *postfix-expression*­*parenthesized-expression*
> *function-call-expression* → *postfix-expression*­*parenthesized-expression*­(opt)­*trailing-closure*­
> *trailing-closure* → *closure-expression*­
> 函数调用表达式语法
> *函数调用表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) [*圆括号表达式*](..\chapter3\04_Expressions.html#parenthesized_expression)
> *函数调用表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) [*圆括号表达式*](..\chapter3\04_Expressions.html#parenthesized_expression) _可选_ [*后置闭包(Trailing Closure)*](..\chapter3\04_Expressions.html#trailing_closure)
> *后置闭包(Trailing Closure)* → [*闭包表达式*](..\chapter3\04_Expressions.html#closure_expression)
### 初始化函数表达式Initializer Expression
Initializer表达式用来给某个Type初始化。 它的形式如下:
`expression`.init`initializer arguments`
> `expression`.init`initializer arguments`
Initializer表达式用来给某个Type初始化。 跟函数function不同 initializer 不能返回值。
```swift
var x = SomeClass.someClassFunction // ok
var y = SomeClass.init // error
```swift
```
可以通过 initializer 表达式来委托调用delegate to 到superclass的initializers.
@ -523,15 +506,14 @@ class SomeSubClass: SomeSuperClass {
}
```
> initializer表达式语法
>
> *initializer-expression* → *postfix-expression*­.­init­
> 构造器表达式语法
> *构造器表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** **init**
### 显式成员表达式Explicit Member Expression
显示成员表达式允许我们访问type, tuple, module的成员变量。它的形式如下
`expression`.`member name`
> `expression`.`member name`
该member 就是某个type在声明时候所定义declaration or extension 的变量, 例如:
@ -554,25 +536,23 @@ t.0 = t.1
The members of a module access the top-level declarations of that module.
不确定对于某个module的member的调用只能调用在top-level声明中的member.
> 成员表达式语法
>
> *explicit-member-expression* → *postfix-expression*­.­*decimal-digit*­
> *explicit-member-expression* → *postfix-expression*­.­*identifier*­*generic-argument-clause*(opt)
> 成员表达式语法
> *显示成员表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** [*十进制数字*](..\chapter3\02_Lexical_Structure.html#decimal_digit)
> *显示成员表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) [*泛型参数子句*](GenericParametersAndArguments.html#generic_argument_clause) _可选_
### 后缀self表达式Postfix Self Expression
后缀表达式由 某个表达式 + '.self' 组成. 形式如下:
`expression`.self
`type`.self
> `expression`.self
> `type`.self
形式1 表示会返回 expression 的值。例如: x.self 返回 x
形式2返回对应的type。我们可以用它来动态的获取某个instance的type。
> 缀self表达式语法
>
> *postfix-self-expression* → *postfix-expression*­.­self­
> 置Self 表达式语法
> *后置self表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** **self**
### dynamic表达式Dynamic Type Expression
@ -580,7 +560,7 @@ The members of a module access the top-level declarations of that module.
dynamicType 表达式由 某个表达式 + '.dynamicType' 组成。
`expression`.dynamicType
> `expression`.dynamicType
上面的形式中, expression 不能是某type的名字当然了如果我都知道它的名字了还需要动态来获取它吗。动态类型表达式会返回"运行时"某个instance的type, 具体请看下面的列子:
@ -603,41 +583,39 @@ someInstance.dynamicType.printClassName
// prints "SomeSubClass"
```
> dynamic type 表达式
>
> *dynamic-type-expression* → *postfix-expression*­.­dynamicType­
> 动态类型表达式语法
> *动态类型表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** **dynamicType**
### 下标脚本表达式Subscript Expression
下标脚本表达式提供了通过下标脚本访问getter/setter 的方法。它的形式是:
`expression`[`index expressions`]
> `expression`[`index expressions`]
可以通过下标脚本表达式通过getter获取某个值或者通过setter赋予某个值.
关于subscript的声明请参见 Protocol Subscript Declaration.
> 下标脚本表达式的语法
>
> *subscript-expression* → *postfix-expression*­[­*expression-list*­]­
> 附属脚本表达式语法
> *附属脚本表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **[** [*表达式列表*](..\chapter3\04_Expressions.html#expression_list) **]**
### 强制取值表达式Forced-Value Expression
强制取值表达式用来获取某个目标表达式的值该目标表达式的值必须不是nil )。它的形式如下:
`expression`!
> `expression`!
如果该表达式的值不是nil, 则返回对应的值。 否则抛出运行时错误runtime error
> 强制取值表达式的语法
>
> *forced-value-expression* → *postfix-expression*­!­
> 强制取值(Forced Value)语法
> *强制取值(Forced Value)表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **!**
### 可选链表达式Optional-Chaining Expression
可选链表达式由目标表达式 + '?' 组成,形式如下:
`expression`?
> `expression`?
后缀'?' 返回目标表达式的值,把它做为可选的参数传递给后续的表达式
@ -658,6 +636,5 @@ if let unwrappedC = c {
}
```
> 可选链表达式语法
>
> *optional-chaining-expression* → *postfix-expression*­?­
> 可选链表达式语法
> *可选链表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **?**

View File

@ -90,7 +90,7 @@ _________________
> 标记语句语法
> *标记语句(Labeled Statement)* → [*语句标签*](..\chapter3\10_Statements.html#statement_label) [*循环语句*](..\chapter3\10_Statements.html#loop_statement) | [*语句标签*](..\chapter3\10_Statements.html#statement_label) [*switch语句*](..\chapter3\10_Statements.html#switch_statement)
> *语句标签* → [*标签名称*](..\chapter3\10_Statements.html#label_name) **:**
> *标签名称* → [*标识符*](LexicalStructure.html#identifier)
> *标签名称* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier)
<p></p>
@ -181,7 +181,7 @@ _________________
> *导入声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **import** [*导入类型*](..\chapter3\05_Declarations.html#import_kind) _可选_ [*导入路径*](..\chapter3\05_Declarations.html#import_path)
> *导入类型* → **typealias** | **struct** | **class** | **enum** | **protocol** | **var** | **func**
> *导入路径* → [*导入路径标识符*](..\chapter3\05_Declarations.html#import_path_identifier) | [*导入路径标识符*](..\chapter3\05_Declarations.html#import_path_identifier) **.** [*导入路径*](..\chapter3\05_Declarations.html#import_path)
> *导入路径标识符* → [*标识符*](LexicalStructure.html#identifier) | [*运算符*](LexicalStructure.html#operator)
> *导入路径标识符* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) | [*运算符*](..\chapter3\02_Lexical_Structure.html#operator)
<p></p>
@ -200,12 +200,12 @@ _________________
> *变量声明* → [*变量声明头(Head)*](..\chapter3\05_Declarations.html#variable_declaration_head) [*变量名*](..\chapter3\05_Declarations.html#variable_name) [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*getter-setter关键字(Keyword)块*](..\chapter3\05_Declarations.html#getter_setter_keyword_block)
> *变量声明* → [*变量声明头(Head)*](..\chapter3\05_Declarations.html#variable_declaration_head) [*变量名*](..\chapter3\05_Declarations.html#variable_name) [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*构造器*](..\chapter3\05_Declarations.html#initializer) _可选_ [*willSet-didSet代码块*](..\chapter3\05_Declarations.html#willSet_didSet_block)
> *变量声明头(Head)* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*声明描述符(Specifiers)列表*](..\chapter3\05_Declarations.html#declaration_specifiers) _可选_ **var**
> *变量名称* → [*标识符*](LexicalStructure.html#identifier)
> *变量名称* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier)
> *getter-setter块* → **{** [*getter子句*](..\chapter3\05_Declarations.html#getter_clause) [*setter子句*](..\chapter3\05_Declarations.html#setter_clause) _可选_ **}**
> *getter-setter块* → **{** [*setter子句*](..\chapter3\05_Declarations.html#setter_clause) [*getter子句*](..\chapter3\05_Declarations.html#getter_clause) **}**
> *getter子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **get** [*代码块*](..\chapter3\05_Declarations.html#code_block)
> *setter子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **set** [*setter名称*](..\chapter3\05_Declarations.html#setter_name) _可选_ [*代码块*](..\chapter3\05_Declarations.html#code_block)
> *setter名称* → **(** [*标识符*](LexicalStructure.html#identifier) **)**
> *setter名称* → **(** [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) **)**
> *getter-setter关键字(Keyword)块* → **{** [*getter关键字(Keyword)子句*](..\chapter3\05_Declarations.html#getter_keyword_clause) [*setter关键字(Keyword)子句*](..\chapter3\05_Declarations.html#setter_keyword_clause) _可选_ **}**
> *getter-setter关键字(Keyword)块* → **{** [*setter关键字(Keyword)子句*](..\chapter3\05_Declarations.html#setter_keyword_clause) [*getter关键字(Keyword)子句*](..\chapter3\05_Declarations.html#getter_keyword_clause) **}**
> *getter关键字(Keyword)子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **get**
@ -220,7 +220,7 @@ _________________
> 类型别名声明语法
> *类型别名声明* → [*类型别名头(Head)*](..\chapter3\05_Declarations.html#typealias_head) [*类型别名赋值*](..\chapter3\05_Declarations.html#typealias_assignment)
> *类型别名头(Head)* → **typealias** [*类型别名名称*](..\chapter3\05_Declarations.html#typealias_name)
> *类型别名名称* → [*标识符*](LexicalStructure.html#identifier)
> *类型别名名称* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier)
> *类型别名赋值* → **=** [*类型*](..\chapter3\03_Types.html#type)
<p></p>
@ -228,7 +228,7 @@ _________________
> 函数声明语法
> *函数声明* → [*函数头*](..\chapter3\05_Declarations.html#function_head) [*函数名*](..\chapter3\05_Declarations.html#function_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ [*函数签名(Signature)*](..\chapter3\05_Declarations.html#function_signature) [*函数体*](..\chapter3\05_Declarations.html#function_body)
> *函数头* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*声明描述符(Specifiers)列表*](..\chapter3\05_Declarations.html#declaration_specifiers) _可选_ **func**
> *函数名* → [*标识符*](LexicalStructure.html#identifier) | [*运算符*](LexicalStructure.html#operator)
> *函数名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) | [*运算符*](..\chapter3\02_Lexical_Structure.html#operator)
> *函数签名(Signature)* → [*parameter-clauses*](..\chapter3\05_Declarations.html#parameter_clauses) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_
> *函数结果* → **->** [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*类型*](..\chapter3\03_Types.html#type)
> *函数体* → [*代码块*](..\chapter3\05_Declarations.html#code_block)
@ -238,8 +238,8 @@ _________________
> *参数* → **inout** _可选_ **let** _可选_ **#** _可选_ [*参数名*](..\chapter3\05_Declarations.html#parameter_name) [*本地参数名*](..\chapter3\05_Declarations.html#local_parameter_name) _可选_ [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*默认参数子句*](..\chapter3\05_Declarations.html#default_argument_clause) _可选_
> *参数* → **inout** _可选_ **var** **#** _可选_ [*参数名*](..\chapter3\05_Declarations.html#parameter_name) [*本地参数名*](..\chapter3\05_Declarations.html#local_parameter_name) _可选_ [*类型注解*](..\chapter3\03_Types.html#type_annotation) [*默认参数子句*](..\chapter3\05_Declarations.html#default_argument_clause) _可选_
> *参数* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ [*类型*](..\chapter3\03_Types.html#type)
> *参数名* → [*标识符*](LexicalStructure.html#identifier) | **_**
> *本地参数名* → [*标识符*](LexicalStructure.html#identifier) | **_**
> *参数名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) | **_**
> *本地参数名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) | **_**
> *默认参数子句* → **=** [*表达式*](..\chapter3\04_Expressions.html#expression)
<p></p>
@ -252,35 +252,35 @@ _________________
> *联合式(Union Style)的枚举case子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **case** [*联合式(Union Style)的枚举case列表*](..\chapter3\05_Declarations.html#union_style_enum_case_list)
> *联合式(Union Style)的枚举case列表* → [*联合式(Union Style)的case*](..\chapter3\05_Declarations.html#union_style_enum_case) | [*联合式(Union Style)的case*](..\chapter3\05_Declarations.html#union_style_enum_case) **,** [*联合式(Union Style)的枚举case列表*](..\chapter3\05_Declarations.html#union_style_enum_case_list)
> *联合式(Union Style)的case* → [*枚举的case名*](..\chapter3\05_Declarations.html#enum_case_name) [*元组类型*](..\chapter3\03_Types.html#tuple_type) _可选_
> *枚举名* → [*标识符*](LexicalStructure.html#identifier)
> *枚举的case名* → [*标识符*](LexicalStructure.html#identifier)
> *枚举名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier)
> *枚举的case名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier)
> *原始值式枚举* → [*枚举名*](..\chapter3\05_Declarations.html#enum_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ **:** [*类型标识*](..\chapter3\03_Types.html#type_identifier) **{** [*原始值式枚举成员列表*](..\chapter3\05_Declarations.html#raw_value_style_enum_members) _可选_ **}**
> *原始值式枚举成员列表* → [*原始值式枚举成员*](..\chapter3\05_Declarations.html#raw_value_style_enum_member) [*原始值式枚举成员列表*](..\chapter3\05_Declarations.html#raw_value_style_enum_members) _可选_
> *原始值式枚举成员* → [*声明*](..\chapter3\05_Declarations.html#declaration) | [*原始值式枚举case子句*](..\chapter3\05_Declarations.html#raw_value_style_enum_case_clause)
> *原始值式枚举case子句* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **case** [*原始值式枚举case列表*](..\chapter3\05_Declarations.html#raw_value_style_enum_case_list)
> *原始值式枚举case列表* → [*原始值式枚举case*](..\chapter3\05_Declarations.html#raw_value_style_enum_case) | [*原始值式枚举case*](..\chapter3\05_Declarations.html#raw_value_style_enum_case) **,** [*原始值式枚举case列表*](..\chapter3\05_Declarations.html#raw_value_style_enum_case_list)
> *原始值式枚举case* → [*枚举的case名*](..\chapter3\05_Declarations.html#enum_case_name) [*原始值赋值*](..\chapter3\05_Declarations.html#raw_value_assignment) _可选_
> *原始值赋值* → **=** [*字面量*](LexicalStructure.html#literal)
> *原始值赋值* → **=** [*字面量*](..\chapter3\02_Lexical_Structure.html#literal)
<p></p>
> 结构体声明语法
> *结构体声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **struct** [*结构体名称*](..\chapter3\05_Declarations.html#struct_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ [*类型继承子句*](..\chapter3\03_Types.html#type_inheritance_clause) _可选_ [*结构体主体*](..\chapter3\05_Declarations.html#struct_body)
> *结构体名称* → [*标识符*](LexicalStructure.html#identifier)
> *结构体名称* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier)
> *结构体主体* → **{** [*声明(Declarations)列表*](..\chapter3\05_Declarations.html#declarations) _可选_ **}**
<p></p>
> 类声明语法
> *类声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **class** [*类名*](..\chapter3\05_Declarations.html#class_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_parameter_clause) _可选_ [*类型继承子句*](..\chapter3\03_Types.html#type_inheritance_clause) _可选_ [*类主体*](..\chapter3\05_Declarations.html#class_body)
> *类名* → [*标识符*](LexicalStructure.html#identifier)
> *类名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier)
> *类主体* → **{** [*声明(Declarations)列表*](..\chapter3\05_Declarations.html#declarations) _可选_ **}**
<p></p>
> 协议(Protocol)声明语法
> *协议声明* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **protocol** [*协议名*](..\chapter3\05_Declarations.html#protocol_name) [*类型继承子句*](..\chapter3\03_Types.html#type_inheritance_clause) _可选_ [*协议主体*](..\chapter3\05_Declarations.html#protocol_body)
> *协议名* → [*标识符*](LexicalStructure.html#identifier)
> *协议名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier)
> *协议主体* → **{** [*协议成员声明(Declarations)列表*](..\chapter3\05_Declarations.html#protocol_member_declarations) _可选_ **}**
> *协议成员声明* → [*协议属性声明*](..\chapter3\05_Declarations.html#protocol_property_declaration)
> *协议成员声明* → [*协议方法声明*](..\chapter3\05_Declarations.html#protocol_method_declaration)
@ -345,9 +345,9 @@ _________________
> 运算符声明语法
> *运算符声明* → [*前置运算符声明*](..\chapter3\05_Declarations.html#prefix_operator_declaration) | [*后置运算符声明*](..\chapter3\05_Declarations.html#postfix_operator_declaration) | [*中置运算符声明*](..\chapter3\05_Declarations.html#infix_operator_declaration)
> *前置运算符声明* → **运算符** **prefix** [*运算符*](LexicalStructure.html#operator) **{** **}**
> *后置运算符声明* → **运算符** **postfix** [*运算符*](LexicalStructure.html#operator) **{** **}**
> *中置运算符声明* → **运算符** **infix** [*运算符*](LexicalStructure.html#operator) **{** [*中置运算符属性*](..\chapter3\05_Declarations.html#infix_operator_attributes) _可选_ **}**
> *前置运算符声明* → **运算符** **prefix** [*运算符*](..\chapter3\02_Lexical_Structure.html#operator) **{** **}**
> *后置运算符声明* → **运算符** **postfix** [*运算符*](..\chapter3\02_Lexical_Structure.html#operator) **{** **}**
> *中置运算符声明* → **运算符** **infix** [*运算符*](..\chapter3\02_Lexical_Structure.html#operator) **{** [*中置运算符属性*](..\chapter3\05_Declarations.html#infix_operator_attributes) _可选_ **}**
> *中置运算符属性* → [*优先级子句*](..\chapter3\05_Declarations.html#precedence_clause) _可选_ [*结和性子句*](..\chapter3\05_Declarations.html#associativity_clause) _可选_
> *优先级子句* → **precedence** [*优先级水平*](..\chapter3\05_Declarations.html#precedence_level)
> *优先级水平* → 数值 0 到 255
@ -374,7 +374,7 @@ _________________
<p></p>
> 标识符模式语法
> *标识符模式* → [*标识符*](LexicalStructure.html#identifier)
> *标识符模式* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier)
<p></p>
@ -410,7 +410,7 @@ _________________
> 特性语法
> *特色* → **@** [*特性名*](..\chapter3\06_Attributes.html#attribute_name) [*特性参数子句*](..\chapter3\06_Attributes.html#attribute_argument_clause) _可选_
> *特性名* → [*标识符*](LexicalStructure.html#identifier)
> *特性名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier)
> *特性参数子句* → **(** [*平衡令牌列表*](..\chapter3\06_Attributes.html#balanced_tokens) _可选_ **)**
> *特性(Attributes)列表* → [*特色*](..\chapter3\06_Attributes.html#attribute) [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_
> *平衡令牌列表* → [*平衡令牌*](..\chapter3\06_Attributes.html#balanced_token) [*平衡令牌列表*](..\chapter3\06_Attributes.html#balanced_tokens) _可选_
@ -430,14 +430,14 @@ _________________
<p></p>
> 前置表达式语法
> *前置表达式* → [*前置运算符*](LexicalStructure.html#prefix_operator) _可选_ [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression)
> *前置表达式* → [*前置运算符*](..\chapter3\02_Lexical_Structure.html#prefix_operator) _可选_ [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression)
> *前置表达式* → [*写入写出(in-out)表达式*](..\chapter3\04_Expressions.html#in_out_expression)
> *写入写出(in-out)表达式* → **&** [*标识符*](LexicalStructure.html#identifier)
> *写入写出(in-out)表达式* → **&** [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier)
<p></p>
> 二元表达式语法
> *二元表达式* → [*二元运算符*](LexicalStructure.html#binary_operator) [*前置表达式*](..\chapter3\04_Expressions.html#prefix_expression)
> *二元表达式* → [*二元运算符*](..\chapter3\02_Lexical_Structure.html#binary_operator) [*前置表达式*](..\chapter3\04_Expressions.html#prefix_expression)
> *二元表达式* → [*赋值运算符*](..\chapter3\04_Expressions.html#assignment_operator) [*前置表达式*](..\chapter3\04_Expressions.html#prefix_expression)
> *二元表达式* → [*条件运算符*](..\chapter3\04_Expressions.html#conditional_operator) [*前置表达式*](..\chapter3\04_Expressions.html#prefix_expression)
> *二元表达式* → [*类型转换运算符*](..\chapter3\04_Expressions.html#type_casting_operator)
@ -450,8 +450,8 @@ _________________
<p></p>
> 条件运算符语法
> *条件运算符* → **?** [*表达式*](..\chapter3\04_Expressions.html#expression) **:**
> 三元条件运算符语法
> *三元条件运算符* → **?** [*表达式*](..\chapter3\04_Expressions.html#expression) **:**
<p></p>
@ -461,7 +461,7 @@ _________________
<p></p>
> 主表达式语法
> *主表达式* → [*标识符*](LexicalStructure.html#identifier) [*泛型参数子句*](GenericParametersAndArguments.html#generic_argument_clause) _可选_
> *主表达式* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) [*泛型参数子句*](GenericParametersAndArguments.html#generic_argument_clause) _可选_
> *主表达式* → [*字面量表达式*](..\chapter3\04_Expressions.html#literal_expression)
> *主表达式* → [*self表达式*](..\chapter3\04_Expressions.html#self_expression)
> *主表达式* → [*超类表达式*](..\chapter3\04_Expressions.html#superclass_expression)
@ -473,7 +473,7 @@ _________________
<p></p>
> 字面量表达式语法
> *字面量表达式* → [*字面量*](LexicalStructure.html#literal)
> *字面量表达式* → [*字面量*](..\chapter3\02_Lexical_Structure.html#literal)
> *字面量表达式* → [*数组字面量*](..\chapter3\04_Expressions.html#array_literal) | [*字典字面量*](..\chapter3\04_Expressions.html#dictionary_literal)
> *字面量表达式* → **&#95;&#95;FILE&#95;&#95;** | **&#95;&#95;LINE&#95;&#95;** | **&#95;&#95;COLUMN&#95;&#95;** | **&#95;&#95;FUNCTION&#95;&#95;**
> *数组字面量* → **[** [*数组字面量项列表*](..\chapter3\04_Expressions.html#array_literal_items) _可选_ **]**
@ -487,7 +487,7 @@ _________________
> Self 表达式语法
> *self表达式* → **self**
> *self表达式* → **self** **.** [*标识符*](LexicalStructure.html#identifier)
> *self表达式* → **self** **.** [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier)
> *self表达式* → **self** **[** [*表达式*](..\chapter3\04_Expressions.html#expression) **]**
> *self表达式* → **self** **.** **init**
@ -495,7 +495,7 @@ _________________
> 超类表达式语法
> *超类表达式* → [*超类方法表达式*](..\chapter3\04_Expressions.html#superclass_method_expression) | [*超类下标表达式*](..\chapter3\04_Expressions.html#超类下标表达式) | [*超类构造器表达式*](..\chapter3\04_Expressions.html#superclass_initializer_expression)
> *超类方法表达式* → **super** **.** [*标识符*](LexicalStructure.html#identifier)
> *超类方法表达式* → **super** **.** [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier)
> *超类下标表达式* → **super** **[** [*表达式*](..\chapter3\04_Expressions.html#expression) **]**
> *超类构造器表达式* → **super** **.** **init**
@ -504,9 +504,9 @@ _________________
> 闭包表达式语法
> *闭包表达式* → **{** [*闭包签名(Signational)*](..\chapter3\04_Expressions.html#closure_signature) _可选_ [*多条语句(Statements)*](..\chapter3\10_Statements.html#statements) **}**
> *闭包签名(Signational)* → [*参数子句*](..\chapter3\05_Declarations.html#parameter_clause) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in**
> *闭包签名(Signational)* → [*标识符列表*](LexicalStructure.html#identifier_list) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in**
> *闭包签名(Signational)* → [*标识符列表*](..\chapter3\02_Lexical_Structure.html#identifier_list) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in**
> *闭包签名(Signational)* → [*捕获(Capature)列表*](..\chapter3\04_Expressions.html#capture_list) [*参数子句*](..\chapter3\05_Declarations.html#parameter_clause) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in**
> *闭包签名(Signational)* → [*捕获(Capature)列表*](..\chapter3\04_Expressions.html#capture_list) [*标识符列表*](LexicalStructure.html#identifier_list) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in**
> *闭包签名(Signational)* → [*捕获(Capature)列表*](..\chapter3\04_Expressions.html#capture_list) [*标识符列表*](..\chapter3\02_Lexical_Structure.html#identifier_list) [*函数结果*](..\chapter3\05_Declarations.html#function_result) _可选_ **in**
> *闭包签名(Signational)* → [*捕获(Capature)列表*](..\chapter3\04_Expressions.html#capture_list) **in**
> *捕获(Capature)列表* → **[** [*捕获(Capature)说明符*](..\chapter3\04_Expressions.html#capture_specifier) [*表达式*](..\chapter3\04_Expressions.html#expression) **]**
> *捕获(Capature)说明符* → **weak** | **unowned** | **unowned(safe)** | **unowned(unsafe)**
@ -514,14 +514,14 @@ _________________
<p></p>
> 隐式成员表达式语法
> *隐式成员表达式* → **.** [*标识符*](LexicalStructure.html#identifier)
> *隐式成员表达式* → **.** [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier)
<p></p>
> 圆括号表达式(Parenthesized Expression)语法
> *圆括号表达式* → **(** [*表达式元素列表*](..\chapter3\04_Expressions.html#expression_element_list) _可选_ **)**
> *表达式元素列表* → [*表达式元素*](..\chapter3\04_Expressions.html#expression_element) | [*表达式元素*](..\chapter3\04_Expressions.html#expression_element) **,** [*表达式元素列表*](..\chapter3\04_Expressions.html#expression_element_list)
> *表达式元素* → [*表达式*](..\chapter3\04_Expressions.html#expression) | [*标识符*](LexicalStructure.html#identifier) **:** [*表达式*](..\chapter3\04_Expressions.html#expression)
> *表达式元素* → [*表达式*](..\chapter3\04_Expressions.html#expression) | [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) **:** [*表达式*](..\chapter3\04_Expressions.html#expression)
<p></p>
@ -532,7 +532,7 @@ _________________
> 后置表达式语法
> *后置表达式* → [*主表达式*](..\chapter3\04_Expressions.html#primary_expression)
> *后置表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) [*后置运算符*](LexicalStructure.html#postfix_operator)
> *后置表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) [*后置运算符*](..\chapter3\02_Lexical_Structure.html#postfix_operator)
> *后置表达式* → [*函数调用表达式*](..\chapter3\04_Expressions.html#function_call_expression)
> *后置表达式* → [*构造器表达式*](..\chapter3\04_Expressions.html#initializer_expression)
> *后置表达式* → [*显示成员表达式*](..\chapter3\04_Expressions.html#explicit_member_expression)
@ -557,12 +557,12 @@ _________________
<p></p>
> 显式成员表达式语法
> *显示成员表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** [*十进制数字*](LexicalStructure.html#decimal_digit)
> *显示成员表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** [*标识符*](LexicalStructure.html#identifier) [*泛型参数子句*](GenericParametersAndArguments.html#generic_argument_clause) _可选_
> *显示成员表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** [*十进制数字*](..\chapter3\02_Lexical_Structure.html#decimal_digit)
> *显示成员表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) [*泛型参数子句*](GenericParametersAndArguments.html#generic_argument_clause) _可选_
<p></p>
> Self 表达式语法
> 后置Self 表达式语法
> *后置self表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **.** **self**
<p></p>
@ -572,8 +572,8 @@ _________________
<p></p>
> 下标表达式语法
> *下标表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **[** [*表达式列表*](..\chapter3\04_Expressions.html#expression_list) **]**
> 附属脚本表达式语法
> *附属脚本表达式* → [*后置表达式*](..\chapter3\04_Expressions.html#postfix_expression) **[** [*表达式列表*](..\chapter3\04_Expressions.html#expression_list) **]**
<p></p>
@ -589,10 +589,10 @@ _________________
## 词法结构
> 标识符语法
> *标识符* → [*标识符头(Head)*](LexicalStructure.html#identifier_head) [*标识符字符列表*](LexicalStructure.html#identifier_characters) _可选_
> *标识符* → **`** [*标识符头(Head)*](LexicalStructure.html#identifier_head) [*标识符字符列表*](LexicalStructure.html#identifier_characters) _可选_ **`**
> *标识符* → [*隐式参数名*](LexicalStructure.html#implicit_parameter_name)
> *标识符列表* → [*标识符*](LexicalStructure.html#identifier) | [*标识符*](LexicalStructure.html#identifier) **,** [*标识符列表*](LexicalStructure.html#identifier_list)
> *标识符* → [*标识符头(Head)*](..\chapter3\02_Lexical_Structure.html#identifier_head) [*标识符字符列表*](..\chapter3\02_Lexical_Structure.html#identifier_characters) _可选_
> *标识符* → **`** [*标识符头(Head)*](..\chapter3\02_Lexical_Structure.html#identifier_head) [*标识符字符列表*](..\chapter3\02_Lexical_Structure.html#identifier_characters) _可选_ **`**
> *标识符* → [*隐式参数名*](..\chapter3\02_Lexical_Structure.html#implicit_parameter_name)
> *标识符列表* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) | [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier) **,** [*标识符列表*](..\chapter3\02_Lexical_Structure.html#identifier_list)
> *标识符头(Head)* → Upper- or lowercase letter A through Z
> *标识符头(Head)* → U+00A8, U+00AA, U+00AD, U+00AF, U+00B2U+00B5, or U+00B7U+00BA
> *标识符头(Head)* → U+00BCU+00BE, U+00C0U+00D6, U+00D8U+00F6, or U+00F8U+00FF
@ -610,49 +610,49 @@ _________________
> *标识符头(Head)* → U+D0000U+DFFFD or U+E0000U+EFFFD
> *标识符字符* → 数值 0 到 9
> *标识符字符* → U+0300U+036F, U+1DC0U+1DFF, U+20D0U+20FF, or U+FE20U+FE2F
> *标识符字符* → [*标识符头(Head)*](LexicalStructure.html#identifier_head)
> *标识符字符列表* → [*标识符字符*](LexicalStructure.html#identifier_character) [*标识符字符列表*](LexicalStructure.html#identifier_characters) _可选_
> *隐式参数名* → **$** [*十进制数字列表*](LexicalStructure.html#decimal_digits)
> *标识符字符* → [*标识符头(Head)*](..\chapter3\02_Lexical_Structure.html#identifier_head)
> *标识符字符列表* → [*标识符字符*](..\chapter3\02_Lexical_Structure.html#identifier_character) [*标识符字符列表*](..\chapter3\02_Lexical_Structure.html#identifier_characters) _可选_
> *隐式参数名* → **$** [*十进制数字列表*](..\chapter3\02_Lexical_Structure.html#decimal_digits)
<p></p>
> 字面量语法
> *字面量* → [*整型字面量*](LexicalStructure.html#integer_literal) | [*浮点数字面量*](LexicalStructure.html#floating_point_literal) | [*字符串字面量*](LexicalStructure.html#string_literal)
> *字面量* → [*整型字面量*](..\chapter3\02_Lexical_Structure.html#integer_literal) | [*浮点数字面量*](..\chapter3\02_Lexical_Structure.html#floating_point_literal) | [*字符串字面量*](..\chapter3\02_Lexical_Structure.html#string_literal)
<p></p>
> 整型字面量语法
> *整型字面量* → [*二进制字面量*](LexicalStructure.html#binary_literal)
> *整型字面量* → [*八进制字面量*](LexicalStructure.html#octal_literal)
> *整型字面量* → [*十进制字面量*](LexicalStructure.html#decimal_literal)
> *整型字面量* → [*十六进制字面量*](LexicalStructure.html#hexadecimal_literal)
> *二进制字面量* → **0b** [*二进制数字*](LexicalStructure.html#binary_digit) [*二进制字面量字符列表*](LexicalStructure.html#binary_literal_characters) _可选_
> *整型字面量* → [*二进制字面量*](..\chapter3\02_Lexical_Structure.html#binary_literal)
> *整型字面量* → [*八进制字面量*](..\chapter3\02_Lexical_Structure.html#octal_literal)
> *整型字面量* → [*十进制字面量*](..\chapter3\02_Lexical_Structure.html#decimal_literal)
> *整型字面量* → [*十六进制字面量*](..\chapter3\02_Lexical_Structure.html#hexadecimal_literal)
> *二进制字面量* → **0b** [*二进制数字*](..\chapter3\02_Lexical_Structure.html#binary_digit) [*二进制字面量字符列表*](..\chapter3\02_Lexical_Structure.html#binary_literal_characters) _可选_
> *二进制数字* → 数值 0 到 1
> *二进制字面量字符* → [*二进制数字*](LexicalStructure.html#binary_digit) | **_**
> *二进制字面量字符列表* → [*二进制字面量字符*](LexicalStructure.html#binary_literal_character) [*二进制字面量字符列表*](LexicalStructure.html#binary_literal_characters) _可选_
> *八进制字面量* → **0o** [*八进字数字*](LexicalStructure.html#octal_digit) [*八进制字符列表*](LexicalStructure.html#octal_literal_characters) _可选_
> *二进制字面量字符* → [*二进制数字*](..\chapter3\02_Lexical_Structure.html#binary_digit) | **_**
> *二进制字面量字符列表* → [*二进制字面量字符*](..\chapter3\02_Lexical_Structure.html#binary_literal_character) [*二进制字面量字符列表*](..\chapter3\02_Lexical_Structure.html#binary_literal_characters) _可选_
> *八进制字面量* → **0o** [*八进字数字*](..\chapter3\02_Lexical_Structure.html#octal_digit) [*八进制字符列表*](..\chapter3\02_Lexical_Structure.html#octal_literal_characters) _可选_
> *八进字数字* → 数值 0 到 7
> *八进制字符* → [*八进字数字*](LexicalStructure.html#octal_digit) | **_**
> *八进制字符列表* → [*八进制字符*](LexicalStructure.html#octal_literal_character) [*八进制字符列表*](LexicalStructure.html#octal_literal_characters) _可选_
> *十进制字面量* → [*十进制数字*](LexicalStructure.html#decimal_digit) [*十进制字符列表*](LexicalStructure.html#decimal_literal_characters) _可选_
> *八进制字符* → [*八进字数字*](..\chapter3\02_Lexical_Structure.html#octal_digit) | **_**
> *八进制字符列表* → [*八进制字符*](..\chapter3\02_Lexical_Structure.html#octal_literal_character) [*八进制字符列表*](..\chapter3\02_Lexical_Structure.html#octal_literal_characters) _可选_
> *十进制字面量* → [*十进制数字*](..\chapter3\02_Lexical_Structure.html#decimal_digit) [*十进制字符列表*](..\chapter3\02_Lexical_Structure.html#decimal_literal_characters) _可选_
> *十进制数字* → 数值 0 到 9
> *十进制数字列表* → [*十进制数字*](LexicalStructure.html#decimal_digit) [*十进制数字列表*](LexicalStructure.html#decimal_digits) _可选_
> *十进制字符* → [*十进制数字*](LexicalStructure.html#decimal_digit) | **_**
> *十进制字符列表* → [*十进制字符*](LexicalStructure.html#decimal_literal_character) [*十进制字符列表*](LexicalStructure.html#decimal_literal_characters) _可选_
> *十六进制字面量* → **0x** [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制字面量字符列表*](LexicalStructure.html#hexadecimal_literal_characters) _可选_
> *十进制数字列表* → [*十进制数字*](..\chapter3\02_Lexical_Structure.html#decimal_digit) [*十进制数字列表*](..\chapter3\02_Lexical_Structure.html#decimal_digits) _可选_
> *十进制字符* → [*十进制数字*](..\chapter3\02_Lexical_Structure.html#decimal_digit) | **_**
> *十进制字符列表* → [*十进制字符*](..\chapter3\02_Lexical_Structure.html#decimal_literal_character) [*十进制字符列表*](..\chapter3\02_Lexical_Structure.html#decimal_literal_characters) _可选_
> *十六进制字面量* → **0x** [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制字面量字符列表*](..\chapter3\02_Lexical_Structure.html#hexadecimal_literal_characters) _可选_
> *十六进制数字* → 数值 0 到 9, a through f, or A through F
> *十六进制字符* → [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) | **_**
> *十六进制字面量字符列表* → [*十六进制字符*](LexicalStructure.html#hexadecimal_literal_character) [*十六进制字面量字符列表*](LexicalStructure.html#hexadecimal_literal_characters) _可选_
> *十六进制字符* → [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) | **_**
> *十六进制字面量字符列表* → [*十六进制字符*](..\chapter3\02_Lexical_Structure.html#hexadecimal_literal_character) [*十六进制字面量字符列表*](..\chapter3\02_Lexical_Structure.html#hexadecimal_literal_characters) _可选_
<p></p>
> 浮点型字面量语法
> *浮点数字面量* → [*十进制字面量*](LexicalStructure.html#decimal_literal) [*十进制分数*](LexicalStructure.html#decimal_fraction) _可选_ [*十进制指数*](LexicalStructure.html#decimal_exponent) _可选_
> *浮点数字面量* → [*十六进制字面量*](LexicalStructure.html#hexadecimal_literal) [*十六进制分数*](LexicalStructure.html#hexadecimal_fraction) _可选_ [*十六进制指数*](LexicalStructure.html#hexadecimal_exponent)
> *十进制分数* → **.** [*十进制字面量*](LexicalStructure.html#decimal_literal)
> *十进制指数* → [*浮点数e*](LexicalStructure.html#floating_point_e) [*正负号*](LexicalStructure.html#sign) _可选_ [*十进制字面量*](LexicalStructure.html#decimal_literal)
> *十六进制分数* → **.** [*十六进制字面量*](LexicalStructure.html#hexadecimal_literal) _可选_
> *十六进制指数* → [*浮点数p*](LexicalStructure.html#floating_point_p) [*正负号*](LexicalStructure.html#sign) _可选_ [*十六进制字面量*](LexicalStructure.html#hexadecimal_literal)
> *浮点数字面量* → [*十进制字面量*](..\chapter3\02_Lexical_Structure.html#decimal_literal) [*十进制分数*](..\chapter3\02_Lexical_Structure.html#decimal_fraction) _可选_ [*十进制指数*](..\chapter3\02_Lexical_Structure.html#decimal_exponent) _可选_
> *浮点数字面量* → [*十六进制字面量*](..\chapter3\02_Lexical_Structure.html#hexadecimal_literal) [*十六进制分数*](..\chapter3\02_Lexical_Structure.html#hexadecimal_fraction) _可选_ [*十六进制指数*](..\chapter3\02_Lexical_Structure.html#hexadecimal_exponent)
> *十进制分数* → **.** [*十进制字面量*](..\chapter3\02_Lexical_Structure.html#decimal_literal)
> *十进制指数* → [*浮点数e*](..\chapter3\02_Lexical_Structure.html#floating_point_e) [*正负号*](..\chapter3\02_Lexical_Structure.html#sign) _可选_ [*十进制字面量*](..\chapter3\02_Lexical_Structure.html#decimal_literal)
> *十六进制分数* → **.** [*十六进制字面量*](..\chapter3\02_Lexical_Structure.html#hexadecimal_literal) _可选_
> *十六进制指数* → [*浮点数p*](..\chapter3\02_Lexical_Structure.html#floating_point_p) [*正负号*](..\chapter3\02_Lexical_Structure.html#sign) _可选_ [*十六进制字面量*](..\chapter3\02_Lexical_Structure.html#hexadecimal_literal)
> *浮点数e* → **e** | **E**
> *浮点数p* → **p** | **P**
> *正负号* → **+** | **-**
@ -660,24 +660,24 @@ _________________
<p></p>
> 字符型字面量语法
> *字符串字面量* → **"** [*引用文本*](LexicalStructure.html#quoted_text) **"**
> *引用文本* → [*引用文本条目*](LexicalStructure.html#quoted_text_item) [*引用文本*](LexicalStructure.html#quoted_text) _可选_
> *引用文本条目* → [*转义字符*](LexicalStructure.html#escaped_character)
> *字符串字面量* → **"** [*引用文本*](..\chapter3\02_Lexical_Structure.html#quoted_text) **"**
> *引用文本* → [*引用文本条目*](..\chapter3\02_Lexical_Structure.html#quoted_text_item) [*引用文本*](..\chapter3\02_Lexical_Structure.html#quoted_text) _可选_
> *引用文本条目* → [*转义字符*](..\chapter3\02_Lexical_Structure.html#escaped_character)
> *引用文本条目* → **\(** [*表达式*](..\chapter3\04_Expressions.html#expression) **)**
> *引用文本条目* → 除了"­, \­, U+000A, or U+000D的所有Unicode的字符
> *转义字符* → **\0** | **\\** | **\t** | **\n** | **\r** | **\"** | **\'**
> *转义字符* → **\x** [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit)
> *转义字符* → **\u** [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit)
> *转义字符* → **\U** [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit) [*十六进制数字*](LexicalStructure.html#hexadecimal_digit)
> *转义字符* → **\x** [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit)
> *转义字符* → **\u** [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit)
> *转义字符* → **\U** [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit) [*十六进制数字*](..\chapter3\02_Lexical_Structure.html#hexadecimal_digit)
<p></p>
> 运算符语法语法
> *运算符* → [*运算符字符*](LexicalStructure.html#operator_character) [*运算符*](LexicalStructure.html#operator) _可选_
> *运算符* → [*运算符字符*](..\chapter3\02_Lexical_Structure.html#operator_character) [*运算符*](..\chapter3\02_Lexical_Structure.html#operator) _可选_
> *运算符字符* → **/** | **=** | **-** | **+** | **!** | **&#42;** | **%** | **<** | **>** | **&** | **|** | **^** | **~** | **.**
> *二元运算符* → [*运算符*](LexicalStructure.html#operator)
> *前置运算符* → [*运算符*](LexicalStructure.html#operator)
> *后置运算符* → [*运算符*](LexicalStructure.html#operator)
> *二元运算符* → [*运算符*](..\chapter3\02_Lexical_Structure.html#operator)
> *前置运算符* → [*运算符*](..\chapter3\02_Lexical_Structure.html#operator)
> *后置运算符* → [*运算符*](..\chapter3\02_Lexical_Structure.html#operator)
<a name="types"></a>
## 类型
@ -694,7 +694,7 @@ _________________
> 类型标识语法
> *类型标识* → [*类型名称*](..\chapter3\03_Types.html#type_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_argument_clause) _可选_ | [*类型名称*](..\chapter3\03_Types.html#type_name) [*泛型参数子句*](GenericParametersAndArguments.html#generic_argument_clause) _可选_ **.** [*类型标识*](..\chapter3\03_Types.html#type_identifier)
> *类名* → [*标识符*](LexicalStructure.html#identifier)
> *类名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier)
<p></p>
@ -703,7 +703,7 @@ _________________
> *元组类型主体* → [*元组类型的元素列表*](..\chapter3\03_Types.html#tuple_type_element_list) **...** _可选_
> *元组类型的元素列表* → [*元组类型的元素*](..\chapter3\03_Types.html#tuple_type_element) | [*元组类型的元素*](..\chapter3\03_Types.html#tuple_type_element) **,** [*元组类型的元素列表*](..\chapter3\03_Types.html#tuple_type_element_list)
> *元组类型的元素* → [*特性(Attributes)列表*](..\chapter3\06_Attributes.html#attributes) _可选_ **inout** _可选_ [*类型*](..\chapter3\03_Types.html#type) | **inout** _可选_ [*元素名*](..\chapter3\03_Types.html#element_name) [*类型注解*](..\chapter3\03_Types.html#type_annotation)
> *元素名* → [*标识符*](LexicalStructure.html#identifier)
> *元素名* → [*标识符*](..\chapter3\02_Lexical_Structure.html#identifier)
<p></p>