> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/ios/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/ios/swift/statement.md).

# statement

🚧 施工中

[Swift](/ios/swift.md) ⟩ statement

{% hint style="warning" %}
Swift code consists of <mark style="color:purple;">**statements**</mark>.
{% endhint %}

{% tabs %}
{% tab title="🔴 主題" %}

* <mark style="color:yellow;">**syntax features**</mark>
  * [semicolon (;)](/ios/swift/statement/semicolon.md)
* <mark style="color:yellow;">**kinds of**</mark>**&#x20;**<mark style="color:purple;">**statements**</mark>
  * [simple statement](/ios/swift/statement/simple.md) - consists of&#x20;
    * an [expression](/ios/swift/statement/simple/expr.md) ⭐️  (evaluated to a value)
    * or a [declaration](/ios/swift/statement/simple/declaration.md) ⭐️  (define new variable or type)
  * [flow control](/ios/swift/flow.md)
    * [loop](/ios/swift/flow/loop.md)
    * [branch](/ios/swift/flow/branch.md)
    * [control transfer](/ios/swift/flow/transfer.md)
      * break, continue, fallthrough, throw, return 🚧
  * [compiler control statement](/ios/swift/statement/compiler.md)
    * conditional compilation block (#if ... #endif) 🚧
    * line control statement (#sourceLocation) 🚧
    * compile-time diagnostic statement (#error, #warning) 🚧
  * <mark style="color:yellow;">**other statements**</mark>
    * [do](/ios/swift/statement/do.md) statement
    * defer statement 🚧
    * labeled statement 🚧
    * availability condition (#available, ...) 🚧
      {% endtab %}

{% tab title="🔸 定義" %}
{% hint style="info" %}
GRAMMAR OF A STATEMENT

* <mark style="color:green;">**statement**</mark> →&#x20;
  * [expression](https://docs.swift.org/swift-book/ReferenceManual/Expressions.html#grammar_expression) `;`opt
  * [declaration](https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#grammar_declaration) `;`opt
  * [loop-statement](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#grammar_loop-statement) `;`opt
  * [branch-statement](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#grammar_branch-statement) `;`opt
  * [labeled-statement](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#grammar_labeled-statement) `;`opt
  * [control-transfer-statement](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#grammar_control-transfer-statement) `;`opt
  * [defer-statement](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#grammar_defer-statement) `;`opt
  * [do-statement](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#grammar_do-statement) `;`opt
  * [compiler-control-statement](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#grammar_compiler-control-statement)
* <mark style="color:green;">**statements**</mark> → [statement](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#grammar_statement) [statements](https://docs.swift.org/swift-book/ReferenceManual/Statements.html#grammar_statements) opt
  {% endhint %}
  {% endtab %}

{% tab title="📘 手冊" %}

* [ ] [Statements](https://docs.swift.org/swift-book/ReferenceManual/Statements.html)
  {% endtab %}
  {% endtabs %}
