Swift 5 syntax diagram generated from grammar at https://github.com/antlr/grammars-v4/tree/master/swift/swift5

expression_list expression , expression
expression try_operator prefix_expression binary_expressions

expression is referenced by:

array_literal_item capture_list_item condition conditional_operator default_argument_clause dictionary_literal_item expression_list expression_pattern for_in_statement function_call_argument initializer interpolated_string_literal key_path_string_expression parenthesized_expression playground_literal repeat_while_statement return_statement selector_expression statement switch_statement throw_statement tuple_element tuple_type_element where_expression
binary_expressions binary_expression

binary_expressions is referenced by:

expression
binary_expression binary_operator prefix_expression assignment_operator conditional_operator try_operator prefix_expression type_casting_operator

binary_expression is referenced by:

binary_expressions
type_casting_operator is as ? ! type

type_casting_operator is referenced by:

binary_expression
type function_type array_type dictionary_type protocol_composition_type type_identifier tuple_type opaque_type type ? ! . Type . protocol any_type self_type ( type )

type is referenced by:

array_type dictionary_type function_result function_type function_type_argument generic_argument key_path_expression opaque_type pattern same_type_requirement subscript_result tuple_type_element type type_annotation type_casting_operator typealias_assignment union_style_enum_case
self_type Self

self_type is referenced by:

type
any_type Any

any_type is referenced by:

type
opaque_type some type

opaque_type is referenced by:

type union_style_enum_case
tuple_type ( tuple_type_element_list )

tuple_type is referenced by:

type union_style_enum_case
tuple_type_element_list tuple_type_element , tuple_type_element

tuple_type_element_list is referenced by:

tuple_type
tuple_type_element element_name type_annotation type = expression

tuple_type_element is referenced by:

tuple_type_element_list
type_annotation : attributes inout type

type_annotation is referenced by:

closure_parameter function_type_argument parameter pattern protocol_property_declaration tuple_type_element variable_declaration
attributes attribute

attributes is referenced by:

case_label class_declaration constant_declaration default_label deinitializer_declaration didSet_clause enum_declaration extension_declaration function_head function_result function_type function_type_argument getter_clause getter_keyword_clause import_declaration initializer_head parameter protocol_associated_type_declaration protocol_declaration raw_value_style_enum_case_clause setter_clause setter_keyword_clause struct_declaration subscript_head subscript_result type_annotation typealias_declaration union_style_enum_case_clause variable_declaration_head willSet_clause
attribute @ attribute_name attribute_argument_clause

attribute is referenced by:

attributes
attribute_argument_clause ( balanced_tokens )

attribute_argument_clause is referenced by:

attribute
balanced_tokens balanced_token

balanced_tokens is referenced by:

attribute_argument_clause balanced_token
balanced_token ( balanced_tokens ) [ balanced_tokens ] { balanced_tokens } identifier keyword literal operator balanced_token_punctuation

balanced_token is referenced by:

balanced_tokens
balanced_token_punctuation . , : ; = @ # ` ? arrow_operator & !

balanced_token_punctuation is referenced by:

balanced_token
arrow_operator - >

arrow_operator is referenced by:

balanced_token_punctuation function_result function_type subscript_result
operator operator_head operator_characters dot_operator_head dot_operator_characters

operator is referenced by:

balanced_token binary_operator function_call_argument function_name import_path_identifier infix_operator_declaration parenthesized_operator postfix_operator postfix_operator_declaration prefix_operator prefix_operator_declaration
dot_operator_characters dot_operator_character

dot_operator_characters is referenced by:

operator
dot_operator_character . operator_character

dot_operator_character is referenced by:

dot_operator_characters
operator_character operator_head Operator_following_character

operator_character is referenced by:

dot_operator_character operator_characters
Operator_following_character [\u0300-\u036F] [\u1DC0-\u1DFF] [\u20D0-\u20FF] [\uFE00-\uFE0F] [\uFE20-\uFE2F] [\u{E0100}-\u{E01EF}]

Operator_following_character is referenced by:

operator_character
dot_operator_head .

dot_operator_head is referenced by:

operator
operator_characters operator_character

operator_characters is referenced by:

operator
operator_head / = - + ! * % & | < > ^ ~ ? Operator_head_other

operator_head is referenced by:

operator operator_character
Operator_head_other [\u00A1-\u00A7] [\u00A9\u00AB] [\u00AC\u00AE] [\u00B0-\u00B1\u00B6\u00BB\u00BF\u00D7\u00F7] [\u2016-\u2017\u2020-\u2027] [\u2030-\u203E] [\u2041-\u2053] [\u2055-\u205E] [\u2190-\u23FF] [\u2500-\u2775] [\u2794-\u2BFF] [\u2E00-\u2E7F] [\u3001-\u3003] [\u3008-\u3020\u3030]

Operator_head_other is referenced by:

operator_head
literal numeric_literal string_literal boolean_literal nil_literal

literal is referenced by:

balanced_token literal_expression
nil_literal nil

nil_literal is referenced by:

literal
boolean_literal true false

boolean_literal is referenced by:

compilation_condition literal precedence_group_assignment raw_value_literal
string_literal extended_string_literal interpolated_string_literal static_string_literal

string_literal is referenced by:

literal
static_string_literal " Quoted_text_item " """ Multiline_quoted_text """

static_string_literal is referenced by:

diagnostic_message file_name raw_value_literal string_literal
Multiline_quoted_text Escaped_character Any Char except: [\\"] " " Escaped_newline

Multiline_quoted_text is referenced by:

Quoted_multi_line_text
Escaped_newline Escape_sequence [\u0009\u0020] Line_break

Escaped_newline is referenced by:

Multiline_quoted_text
Line_break [\u000A\u000D] \u000D \u000A

Line_break is referenced by:

Escaped_newline
Escape_sequence \\ #

Escape_sequence is referenced by:

Escaped_character Escaped_newline
Escaped_character Escape_sequence [0\\tnr"'\u201c] u { Unicode_scalar_digits }

Escaped_character is referenced by:

Multiline_quoted_text Quoted_text_item
Unicode_scalar_digits [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]

Unicode_scalar_digits is referenced by:

Escaped_character
Quoted_text_item Escaped_character Any Char except: ["\n\r\\]

Quoted_text_item is referenced by:

Quoted_text
interpolated_string_literal " Quoted_text_item \\( expression tuple_element , tuple_element_list ) " """ Multiline_quoted_text \\( expression tuple_element , tuple_element_list ) """

interpolated_string_literal is referenced by:

string_literal
tuple_element_list tuple_element , tuple_element

tuple_element_list is referenced by:

interpolated_string_literal tuple_expression
tuple_element identifier : expression

tuple_element is referenced by:

interpolated_string_literal tuple_element_list tuple_expression
extended_string_literal Multi_line_extended_string_open Quoted_multi_line_extended_text Multi_line_extended_string_close Single_line_extended_string_open Any Char except: [\r\n"] Single_line_extended_string_close

extended_string_literal is referenced by:

string_literal
Single_line_extended_string_close " #

Single_line_extended_string_close is referenced by:

extended_string_literal
Single_line_extended_string_open # "

Single_line_extended_string_open is referenced by:

extended_string_literal
Multi_line_extended_string_close """ #

Multi_line_extended_string_close is referenced by:

extended_string_literal
Quoted_multi_line_extended_text Any Char except: ["] " "

Quoted_multi_line_extended_text is referenced by:

extended_string_literal
Multi_line_extended_string_open # """

Multi_line_extended_string_open is referenced by:

extended_string_literal
numeric_literal negate_prefix_operator integer_literal negate_prefix_operator Floating_point_literal

numeric_literal is referenced by:

literal raw_value_literal
Floating_point_literal Decimal_literal Decimal_fraction Decimal_exponent Hexadecimal_literal Hexadecimal_fraction Hexadecimal_exponent

Floating_point_literal is referenced by:

numeric_literal platform_version
Hexadecimal_exponent [pP] [+-] Decimal_literal

Hexadecimal_exponent is referenced by:

Floating_point_literal
Hexadecimal_fraction . [0-9a-fA-F] Hexadecimal_literal_character

Hexadecimal_fraction is referenced by:

Floating_point_literal
Hexadecimal_literal_character [0-9a-fA-F] _

Hexadecimal_literal_character is referenced by:

Hexadecimal_literal_characters
Hexadecimal_literal 0x [0-9a-fA-F] Hexadecimal_literal_character

Hexadecimal_literal is referenced by:

Floating_point_literal integer_literal
Decimal_exponent [eE] [+-] Decimal_literal

Decimal_exponent is referenced by:

Floating_point_literal
Decimal_fraction . Decimal_literal

Decimal_fraction is referenced by:

Floating_point_literal
Decimal_literal [0-9] Decimal_literal_character

Decimal_literal is referenced by:

Decimal_exponent Decimal_fraction Floating_point_literal Hexadecimal_exponent integer_literal line_number platform_version
Decimal_literal_character [0-9] _

Decimal_literal_character is referenced by:

Decimal_literal_characters
integer_literal [0-9] Decimal_literal Binary_literal Octal_literal Hexadecimal_literal

integer_literal is referenced by:

numeric_literal
Octal_literal 0o [0-7] Octal_literal_character

Octal_literal is referenced by:

integer_literal
Octal_literal_character [0-7] _

Octal_literal_character is referenced by:

Octal_literal_characters
Binary_literal 0b [01] Binary_literal_character

Binary_literal is referenced by:

integer_literal
Binary_literal_character [01] _

Binary_literal_character is referenced by:

Binary_literal_characters
negate_prefix_operator -

negate_prefix_operator is referenced by:

numeric_literal
keyword associatedtype class deinit enum extension fileprivate func import init inout internal let open operator private protocol public rethrows static struct subscript typealias var break case continue default defer do else fallthrough for guard if in repeat return switch where while as Any catch false is nil super self Self throw throws true try _ #available #colorLiteral #column #else #elseif #endif #error #file #fileID #fileLiteral #filePath #function #if #imageLiteral #line #selector #sourceLocation #warning

keyword is referenced by:

balanced_token identifier implicit_member_expression
identifier Linux Windows alpha arch arm arm64 assignment blue canImport compiler file green higherThan i386 iOS OSX iOSApplicationExtension line lowerThan macCatalyst macCatalystApplicationExtension macOS macOSApplicationExtension os precedencegroup red resourceName safe simulator some swift targetEnvironment tvOS unsafe watchOS x86_64 associativity convenience dynamic didSet final get infix indirect lazy left mutating none nonmutating optional override postfix precedence prefix protocol required right set Type unowned weak willSet in for guard where default internal private public open as prefix postfix while self Self set class getter setter operator do catch Identifier ` keyword Identifier $ `

identifier is referenced by:

argument_label argument_name attribute_name balanced_token capture_list_item class_name closure_parameter compilation_condition element_name enum_case_name enum_name explicit_member_suffix external_parameter_name function_call_argument function_name identifier_list identifier_pattern implicit_member_expression import_path_identifier in_out_expression key_path_component label_name labeled_trailing_closure local_parameter_name module_name precedence_group_name protocol_name self_expression setter_name struct_name superclass_expression tuple_element tuple_pattern_element type_name typealias_name unqualified_name variable_name
Identifier Identifier_head Identifier_character Implicit_parameter_name Property_wrapper_projection

Identifier is referenced by:

identifier
Property_wrapper_projection $ Identifier_character

Property_wrapper_projection is referenced by:

Identifier
Implicit_parameter_name $ [0-9]

Implicit_parameter_name is referenced by:

Identifier
Identifier_character [0-9] [\u0300-\u036F] [\u1DC0-\u1DFF] [\u20D0-\u20FF] [\uFE20-\uFE2F] Identifier_head

Identifier_character is referenced by:

Identifier_characters
Identifier_head [a-zA-Z] _ \u00A8 \u00AA \u00AD \u00AF [\u00B2-\u00B5] [\u00B7-\u00BA] [\u00BC-\u00BE] [\u00C0-\u00D6] [\u00D8-\u00F6] [\u00F8-\u00FF] [\u0100-\u02FF] [\u0370-\u167F] [\u1681-\u180D] [\u180F-\u1DBF] [\u1E00-\u1FFF] [\u200B-\u200D] [\u202A-\u202E] [\u203F-\u2040] \u2054 [\u2060-\u206F] [\u2070-\u20CF] [\u2100-\u218F] [\u2460-\u24FF] [\u2776-\u2793] [\u2C00-\u2DFF] [\u2E80-\u2FFF] [\u3004-\u3007] [\u3021-\u302F] [\u3031-\u303F] [\u3040-\uD7FF] [\uF900-\uFD3D] [\uFD40-\uFDCF] [\uFDF0-\uFE1F] [\uFE30-\uFE44] [\uFE47-\uFFFD] [\u{10000}-\u{1FFFD}] [\u{20000}-\u{2FFFD}] [\u{30000}-\u{3FFFD}] [\u{40000}-\u{4FFFD}] [\u{50000}-\u{5FFFD}] [\u{60000}-\u{6FFFD}] [\u{70000}-\u{7FFFD}] [\u{80000}-\u{8FFFD}] [\u{90000}-\u{9FFFD}] [\u{A0000}-\u{AFFFD}] [\u{B0000}-\u{BFFFD}] [\u{C0000}-\u{CFFFD}] [\u{D0000}-\u{DFFFD}] [\u{E0000}-\u{EFFFD}]

Identifier_head is referenced by:

Identifier Identifier_character
attribute_name identifier . identifier

attribute_name is referenced by:

attribute
element_name identifier

element_name is referenced by:

tuple_type_element
type_identifier type_name generic_argument_clause . type_identifier

type_identifier is referenced by:

conformance_requirement enum_case_pattern extension_declaration generic_parameter protocol_composition_type same_type_requirement type type_identifier type_inheritance_list
generic_argument_clause < generic_argument_list >

generic_argument_clause is referenced by:

explicit_member_suffix primary_expression type_identifier
generic_argument_list generic_argument , generic_argument

generic_argument_list is referenced by:

generic_argument_clause
generic_argument type

generic_argument is referenced by:

generic_argument_list
type_name identifier

type_name is referenced by:

generic_parameter type_identifier
protocol_composition_type type_identifier & type_identifier trailing_composition_and

protocol_composition_type is referenced by:

conformance_requirement generic_parameter type
trailing_composition_and &

trailing_composition_and is referenced by:

protocol_composition_type
dictionary_type [ type : type ]

dictionary_type is referenced by:

primary_expression type
array_type [ type ]

array_type is referenced by:

primary_expression type
function_type attributes function_type_argument_clause throws arrow_operator type

function_type is referenced by:

type
function_type_argument_clause ( function_type_argument_list range_operator )

function_type_argument_clause is referenced by:

function_type
range_operator . . .

range_operator is referenced by:

closure_parameter function_type_argument_clause parameter
function_type_argument_list function_type_argument , function_type_argument

function_type_argument_list is referenced by:

function_type_argument_clause
function_type_argument attributes inout type argument_label type_annotation

function_type_argument is referenced by:

function_type_argument_list
argument_label identifier

argument_label is referenced by:

function_type_argument
conditional_operator ? expression :

conditional_operator is referenced by:

binary_expression
assignment_operator =

assignment_operator is referenced by:

binary_expression
binary_operator operator

binary_operator is referenced by:

binary_expression
prefix_expression prefix_operator postfix_expression in_out_expression

prefix_expression is referenced by:

binary_expression expression
in_out_expression & identifier

in_out_expression is referenced by:

prefix_expression
postfix_expression primary_expression function_call_suffix initializer_suffix explicit_member_suffix postfix_self_suffix subscript_suffix forced_value_suffix optional_chaining_suffix postfix_operator

postfix_expression is referenced by:

implicit_member_expression prefix_expression
postfix_operator operator

postfix_operator is referenced by:

postfix_expression
optional_chaining_suffix ?

optional_chaining_suffix is referenced by:

postfix_expression
forced_value_suffix !

forced_value_suffix is referenced by:

postfix_expression
subscript_suffix [ function_call_argument_list ]

subscript_suffix is referenced by:

postfix_expression
function_call_argument_list function_call_argument , function_call_argument

function_call_argument_list is referenced by:

function_call_argument_clause key_path_postfix self_expression subscript_suffix superclass_expression
function_call_argument argument_name identifier expression operator

function_call_argument is referenced by:

function_call_argument_list
argument_name identifier :

argument_name is referenced by:

argument_names function_call_argument
postfix_self_suffix . self

postfix_self_suffix is referenced by:

postfix_expression
explicit_member_suffix . [0-9] identifier generic_argument_clause ( argument_names )

explicit_member_suffix is referenced by:

postfix_expression
argument_names argument_name

argument_names is referenced by:

explicit_member_suffix initializer_suffix unqualified_name
initializer_suffix . init ( argument_names )

initializer_suffix is referenced by:

postfix_expression
function_call_suffix function_call_argument_clause trailing_closures function_call_argument_clause

function_call_suffix is referenced by:

postfix_expression
trailing_closures closure_expression labeled_trailing_closures

trailing_closures is referenced by:

function_call_suffix
labeled_trailing_closures labeled_trailing_closure

labeled_trailing_closures is referenced by:

trailing_closures
labeled_trailing_closure identifier : closure_expression

labeled_trailing_closure is referenced by:

labeled_trailing_closures
closure_expression { closure_signature statements }

closure_expression is referenced by:

labeled_trailing_closure primary_expression trailing_closures
statements statement

statements is referenced by:

closure_expression code_block else_directive_clause elseif_directive_clause if_directive_clause switch_case top_level top_level_declaration
statement loop_statement declaration branch_statement labeled_statement control_transfer_statement defer_statement do_statement expression ; compiler_control_statement

statement is referenced by:

statements
compiler_control_statement conditional_compilation_block line_control_statement diagnostic_statement

compiler_control_statement is referenced by:

class_member extension_member protocol_member raw_value_style_enum_member statement struct_member union_style_enum_member
diagnostic_statement #error #warning ( diagnostic_message )

diagnostic_statement is referenced by:

compiler_control_statement
diagnostic_message static_string_literal

diagnostic_message is referenced by:

diagnostic_statement
line_control_statement #sourceLocation ( file : file_name , line : line_number )

line_control_statement is referenced by:

compiler_control_statement
line_number Decimal_literal

line_number is referenced by:

line_control_statement
file_name static_string_literal

file_name is referenced by:

line_control_statement
conditional_compilation_block if_directive_clause elseif_directive_clauses else_directive_clause #endif

conditional_compilation_block is referenced by:

compiler_control_statement
else_directive_clause #else statements

else_directive_clause is referenced by:

conditional_compilation_block
elseif_directive_clauses elseif_directive_clause

elseif_directive_clauses is referenced by:

conditional_compilation_block
elseif_directive_clause #elseif compilation_condition statements

elseif_directive_clause is referenced by:

elseif_directive_clauses switch_elseif_directive_clauses
compilation_condition platform_condition identifier boolean_literal ( compilation_condition ) ! compilation_condition compilation_condition compilation_condition_AND compilation_condition_OR compilation_condition

compilation_condition is referenced by:

compilation_condition elseif_directive_clause if_directive_clause switch_elseif_directive_clause switch_if_directive_clause
compilation_condition_OR | |

compilation_condition_OR is referenced by:

compilation_condition
compilation_condition_AND & &

compilation_condition_AND is referenced by:

compilation_condition
platform_condition os ( operating_system ) arch ( architecture ) swift compiler ( compilation_condition_GE compilation_condition_L swift_version ) canImport ( module_name ) targetEnvironment ( environment )

platform_condition is referenced by:

compilation_condition
environment simulator macCatalyst

environment is referenced by:

platform_condition
module_name identifier . identifier

module_name is referenced by:

platform_condition
swift_version [0-9] swift_version_continuation

swift_version is referenced by:

platform_condition
swift_version_continuation . [0-9] swift_version_continuation

swift_version_continuation is referenced by:

swift_version swift_version_continuation
compilation_condition_L <

compilation_condition_L is referenced by:

platform_condition
compilation_condition_GE > =

compilation_condition_GE is referenced by:

platform_condition
architecture i386 x86_64 arm arm64

architecture is referenced by:

platform_condition
operating_system macOS iOS OSX watchOS tvOS Linux Windows

operating_system is referenced by:

platform_condition
if_directive_clause #if compilation_condition statements

if_directive_clause is referenced by:

conditional_compilation_block
do_statement do code_block catch_clauses

do_statement is referenced by:

labeled_statement statement
catch_clauses catch_clause

catch_clauses is referenced by:

do_statement
catch_clause catch catch_pattern_list code_block

catch_clause is referenced by:

catch_clauses
catch_pattern_list catch_pattern catch_pattern , catch_pattern

catch_pattern_list is referenced by:

catch_clause
catch_pattern pattern where_clause

catch_pattern is referenced by:

catch_pattern_list
where_clause where where_expression

where_clause is referenced by:

case_item_list catch_pattern for_in_statement
where_expression expression

where_expression is referenced by:

where_clause
pattern wildcard_pattern identifier_pattern tuple_pattern type_annotation value_binding_pattern enum_case_pattern optional_pattern is type pattern as type expression_pattern

pattern is referenced by:

case_condition case_item_list catch_pattern for_in_statement optional_binding_condition pattern pattern_initializer tuple_pattern_element value_binding_pattern
expression_pattern expression

expression_pattern is referenced by:

pattern
optional_pattern identifier_pattern ?

optional_pattern is referenced by:

pattern
enum_case_pattern type_identifier . enum_case_name tuple_pattern

enum_case_pattern is referenced by:

pattern
enum_case_name identifier

enum_case_name is referenced by:

enum_case_pattern raw_value_style_enum_case union_style_enum_case
value_binding_pattern var pattern let pattern

value_binding_pattern is referenced by:

pattern
tuple_pattern ( tuple_pattern_element_list )

tuple_pattern is referenced by:

enum_case_pattern pattern
tuple_pattern_element_list tuple_pattern_element , tuple_pattern_element

tuple_pattern_element_list is referenced by:

tuple_pattern
tuple_pattern_element identifier : pattern

tuple_pattern_element is referenced by:

tuple_pattern_element_list
identifier_pattern identifier

identifier_pattern is referenced by:

optional_pattern pattern
wildcard_pattern _

wildcard_pattern is referenced by:

pattern
code_block { statements }

code_block is referenced by:

catch_clause defer_statement deinitializer_declaration didSet_clause do_statement else_clause for_in_statement function_body getter_clause getter_setter_block guard_statement if_statement initializer_body repeat_while_statement setter_clause subscript_declaration while_statement willSet_clause
defer_statement defer code_block

defer_statement is referenced by:

statement
control_transfer_statement break_statement continue_statement fallthrough_statement return_statement throw_statement

control_transfer_statement is referenced by:

statement
throw_statement throw expression

throw_statement is referenced by:

control_transfer_statement
return_statement return expression

return_statement is referenced by:

control_transfer_statement
fallthrough_statement fallthrough

fallthrough_statement is referenced by:

control_transfer_statement
continue_statement continue label_name

continue_statement is referenced by:

control_transfer_statement
label_name identifier

label_name is referenced by:

break_statement continue_statement statement_label
break_statement break label_name

break_statement is referenced by:

control_transfer_statement
labeled_statement statement_label loop_statement if_statement switch_statement do_statement

labeled_statement is referenced by:

statement
switch_statement switch expression { switch_cases }

switch_statement is referenced by:

branch_statement labeled_statement
switch_cases switch_case switch_cases

switch_cases is referenced by:

switch_cases switch_else_directive_clause switch_elseif_directive_clause switch_if_directive_clause switch_statement
switch_case case_label default_label statements conditional_switch_case

switch_case is referenced by:

switch_cases
conditional_switch_case switch_if_directive_clause switch_elseif_directive_clauses switch_else_directive_clause #endif

conditional_switch_case is referenced by:

switch_case
switch_else_directive_clause #else switch_cases

switch_else_directive_clause is referenced by:

conditional_switch_case
switch_elseif_directive_clauses elseif_directive_clause switch_elseif_directive_clauses

switch_elseif_directive_clauses is referenced by:

conditional_switch_case switch_elseif_directive_clauses
switch_if_directive_clause #if compilation_condition switch_cases

switch_if_directive_clause is referenced by:

conditional_switch_case
default_label attributes default :

default_label is referenced by:

switch_case
case_label attributes case case_item_list :

case_label is referenced by:

switch_case
case_item_list pattern where_clause , pattern where_clause

case_item_list is referenced by:

case_label
if_statement if condition_list code_block else_clause

if_statement is referenced by:

branch_statement else_clause labeled_statement
else_clause else code_block else if_statement

else_clause is referenced by:

if_statement
condition_list condition , condition

condition_list is referenced by:

guard_statement if_statement while_statement
condition availability_condition expression case_condition optional_binding_condition

condition is referenced by:

condition_list
optional_binding_condition let var pattern initializer

optional_binding_condition is referenced by:

condition
initializer = expression

initializer is referenced by:

case_condition optional_binding_condition pattern_initializer variable_declaration
case_condition case pattern initializer

case_condition is referenced by:

condition
availability_condition #available ( availability_arguments )

availability_condition is referenced by:

condition
availability_arguments availability_argument , availability_argument

availability_arguments is referenced by:

availability_condition
availability_argument platform_name platform_version *

availability_argument is referenced by:

availability_arguments
platform_version Decimal_literal [0-9] Floating_point_literal . [0-9]

platform_version is referenced by:

availability_argument
platform_name iOS OSX iOSApplicationExtension macOS macOSApplicationExtension macCatalyst macCatalystApplicationExtension watchOS tvOS

platform_name is referenced by:

availability_argument
statement_label label_name :

statement_label is referenced by:

labeled_statement
branch_statement if_statement guard_statement switch_statement

branch_statement is referenced by:

statement
guard_statement guard condition_list else code_block

guard_statement is referenced by:

branch_statement
declaration import_declaration constant_declaration variable_declaration typealias_declaration function_declaration enum_declaration struct_declaration class_declaration protocol_declaration initializer_declaration deinitializer_declaration extension_declaration subscript_declaration operator_declaration precedence_group_declaration ;

declaration is referenced by:

class_member declarations extension_member raw_value_style_enum_member statement struct_member union_style_enum_member
precedence_group_declaration precedencegroup precedence_group_name { precedence_group_attributes }

precedence_group_declaration is referenced by:

declaration
precedence_group_attributes precedence_group_attribute

precedence_group_attributes is referenced by:

precedence_group_declaration
precedence_group_attribute precedence_group_relation precedence_group_assignment precedence_group_associativity

precedence_group_attribute is referenced by:

precedence_group_attributes
precedence_group_associativity associativity : left right none

precedence_group_associativity is referenced by:

precedence_group_attribute
precedence_group_assignment assignment : boolean_literal

precedence_group_assignment is referenced by:

precedence_group_attribute
precedence_group_relation higherThan lowerThan : precedence_group_names

precedence_group_relation is referenced by:

precedence_group_attribute
precedence_group_names precedence_group_name , precedence_group_name

precedence_group_names is referenced by:

precedence_group_relation
precedence_group_name identifier . identifier

precedence_group_name is referenced by:

infix_operator_group precedence_group_declaration precedence_group_names
operator_declaration prefix_operator_declaration postfix_operator_declaration infix_operator_declaration

operator_declaration is referenced by:

declaration
infix_operator_declaration infix operator operator infix_operator_group

infix_operator_declaration is referenced by:

operator_declaration
infix_operator_group : precedence_group_name

infix_operator_group is referenced by:

infix_operator_declaration
postfix_operator_declaration postfix operator operator

postfix_operator_declaration is referenced by:

operator_declaration
prefix_operator_declaration prefix operator operator

prefix_operator_declaration is referenced by:

operator_declaration
subscript_declaration subscript_head subscript_result generic_where_clause code_block getter_setter_block getter_setter_keyword_block

subscript_declaration is referenced by:

declaration
getter_setter_keyword_block { getter_keyword_clause setter_keyword_clause setter_keyword_clause getter_keyword_clause }

getter_setter_keyword_block is referenced by:

protocol_property_declaration protocol_subscript_declaration subscript_declaration variable_declaration
setter_keyword_clause attributes mutation_modifier set

setter_keyword_clause is referenced by:

getter_setter_keyword_block
mutation_modifier mutating nonmutating

mutation_modifier is referenced by:

declaration_modifier getter_clause getter_keyword_clause setter_clause setter_keyword_clause
getter_keyword_clause attributes mutation_modifier get

getter_keyword_clause is referenced by:

getter_setter_keyword_block
getter_setter_block { getter_clause setter_clause setter_clause getter_clause } code_block

getter_setter_block is referenced by:

subscript_declaration variable_declaration
setter_clause attributes mutation_modifier set setter_name code_block

setter_clause is referenced by:

getter_setter_block
setter_name ( identifier )

setter_name is referenced by:

didSet_clause setter_clause willSet_clause
getter_clause attributes mutation_modifier get code_block

getter_clause is referenced by:

getter_setter_block
generic_where_clause where requirement_list

generic_where_clause is referenced by:

class_declaration extension_declaration function_declaration initializer_declaration protocol_associated_type_declaration protocol_declaration protocol_initializer_declaration protocol_method_declaration protocol_subscript_declaration raw_value_style_enum struct_declaration subscript_declaration union_style_enum
requirement_list requirement , requirement

requirement_list is referenced by:

generic_where_clause
requirement conformance_requirement same_type_requirement

requirement is referenced by:

requirement_list
same_type_requirement type_identifier same_type_equals type_identifier type

same_type_requirement is referenced by:

requirement
same_type_equals = =

same_type_equals is referenced by:

same_type_requirement
conformance_requirement type_identifier : type_identifier protocol_composition_type

conformance_requirement is referenced by:

requirement
subscript_result arrow_operator attributes type

subscript_result is referenced by:

protocol_subscript_declaration subscript_declaration
subscript_head attributes declaration_modifiers subscript generic_parameter_clause parameter_clause

subscript_head is referenced by:

protocol_subscript_declaration subscript_declaration
parameter_clause ( parameter_list )

parameter_clause is referenced by:

function_signature initializer_declaration protocol_initializer_declaration subscript_head
parameter_list parameter , parameter

parameter_list is referenced by:

parameter_clause
parameter attributes external_parameter_name local_parameter_name type_annotation default_argument_clause range_operator

parameter is referenced by:

parameter_list
default_argument_clause = expression

default_argument_clause is referenced by:

parameter
local_parameter_name identifier

local_parameter_name is referenced by:

parameter
external_parameter_name identifier

external_parameter_name is referenced by:

parameter
generic_parameter_clause < generic_parameter_list >

generic_parameter_clause is referenced by:

class_declaration function_declaration initializer_declaration protocol_initializer_declaration protocol_method_declaration raw_value_style_enum struct_declaration subscript_head typealias_declaration union_style_enum
generic_parameter_list generic_parameter , generic_parameter

generic_parameter_list is referenced by:

generic_parameter_clause
generic_parameter type_name : type_identifier protocol_composition_type

generic_parameter is referenced by:

generic_parameter_list
declaration_modifiers declaration_modifier

declaration_modifiers is referenced by:

constant_declaration function_head initializer_head subscript_head variable_declaration_head
declaration_modifier class convenience dynamic final infix lazy optional override postfix prefix required static unowned ( safe unsafe ) weak access_level_modifier mutation_modifier

declaration_modifier is referenced by:

declaration_modifiers
access_level_modifier private fileprivate internal public open ( set )

access_level_modifier is referenced by:

class_declaration declaration_modifier enum_declaration extension_declaration protocol_associated_type_declaration protocol_declaration struct_declaration typealias_declaration
extension_declaration attributes access_level_modifier extension type_identifier type_inheritance_clause generic_where_clause extension_body

extension_declaration is referenced by:

declaration
extension_body { extension_members }

extension_body is referenced by:

extension_declaration
extension_members extension_member

extension_members is referenced by:

extension_body
extension_member declaration compiler_control_statement

extension_member is referenced by:

extension_members
type_inheritance_clause : type_inheritance_list

type_inheritance_clause is referenced by:

class_declaration extension_declaration protocol_associated_type_declaration protocol_declaration raw_value_style_enum struct_declaration union_style_enum
type_inheritance_list type_identifier , type_identifier

type_inheritance_list is referenced by:

type_inheritance_clause
deinitializer_declaration attributes deinit code_block

deinitializer_declaration is referenced by:

declaration
initializer_declaration initializer_head generic_parameter_clause parameter_clause throws rethrows generic_where_clause initializer_body

initializer_declaration is referenced by:

declaration
initializer_body code_block

initializer_body is referenced by:

initializer_declaration
initializer_head attributes declaration_modifiers init ? !

initializer_head is referenced by:

initializer_declaration protocol_initializer_declaration
protocol_declaration attributes access_level_modifier protocol protocol_name : class type_inheritance_clause generic_where_clause protocol_body

protocol_declaration is referenced by:

declaration
protocol_body { protocol_members }

protocol_body is referenced by:

protocol_declaration
protocol_members protocol_member

protocol_members is referenced by:

protocol_body
protocol_member protocol_member_declaration compiler_control_statement

protocol_member is referenced by:

protocol_members
protocol_member_declaration protocol_property_declaration protocol_method_declaration protocol_initializer_declaration protocol_subscript_declaration protocol_associated_type_declaration typealias_declaration

protocol_member_declaration is referenced by:

protocol_member
protocol_associated_type_declaration attributes access_level_modifier associatedtype typealias_name type_inheritance_clause typealias_assignment generic_where_clause

protocol_associated_type_declaration is referenced by:

protocol_member_declaration
typealias_assignment = type

typealias_assignment is referenced by:

protocol_associated_type_declaration typealias_declaration
typealias_name identifier

typealias_name is referenced by:

protocol_associated_type_declaration typealias_declaration
protocol_subscript_declaration subscript_head subscript_result generic_where_clause getter_setter_keyword_block

protocol_subscript_declaration is referenced by:

protocol_member_declaration
protocol_initializer_declaration initializer_head generic_parameter_clause parameter_clause throws rethrows generic_where_clause

protocol_initializer_declaration is referenced by:

protocol_member_declaration
protocol_method_declaration function_head function_name generic_parameter_clause function_signature generic_where_clause

protocol_method_declaration is referenced by:

protocol_member_declaration
function_signature parameter_clause throws rethrows function_result

function_signature is referenced by:

function_declaration protocol_method_declaration
function_result arrow_operator attributes type

function_result is referenced by:

closure_signature function_signature
function_name identifier operator

function_name is referenced by:

function_declaration protocol_method_declaration
function_head attributes declaration_modifiers func

function_head is referenced by:

function_declaration protocol_method_declaration
protocol_property_declaration variable_declaration_head variable_name type_annotation getter_setter_keyword_block

protocol_property_declaration is referenced by:

protocol_member_declaration
variable_name identifier

variable_name is referenced by:

protocol_property_declaration variable_declaration
variable_declaration_head attributes declaration_modifiers var

variable_declaration_head is referenced by:

protocol_property_declaration variable_declaration
protocol_name identifier

protocol_name is referenced by:

protocol_declaration
class_declaration attributes access_level_modifier final final access_level_modifier class class_name generic_parameter_clause type_inheritance_clause generic_where_clause class_body

class_declaration is referenced by:

declaration
class_body { class_members }

class_body is referenced by:

class_declaration
class_members class_member

class_members is referenced by:

class_body
class_member declaration compiler_control_statement

class_member is referenced by:

class_members
class_name identifier

class_name is referenced by:

class_declaration
struct_declaration attributes access_level_modifier struct struct_name generic_parameter_clause type_inheritance_clause generic_where_clause struct_body

struct_declaration is referenced by:

declaration
struct_body { struct_members }

struct_body is referenced by:

struct_declaration
struct_members struct_member

struct_members is referenced by:

struct_body
struct_member declaration compiler_control_statement

struct_member is referenced by:

struct_members
struct_name identifier

struct_name is referenced by:

struct_declaration
enum_declaration attributes access_level_modifier union_style_enum raw_value_style_enum

enum_declaration is referenced by:

declaration
raw_value_style_enum enum enum_name generic_parameter_clause type_inheritance_clause generic_where_clause { raw_value_style_enum_members }

raw_value_style_enum is referenced by:

enum_declaration
raw_value_style_enum_members raw_value_style_enum_member

raw_value_style_enum_members is referenced by:

raw_value_style_enum
raw_value_style_enum_member declaration raw_value_style_enum_case_clause compiler_control_statement

raw_value_style_enum_member is referenced by:

raw_value_style_enum_members
raw_value_style_enum_case_clause attributes case raw_value_style_enum_case_list

raw_value_style_enum_case_clause is referenced by:

raw_value_style_enum_member
raw_value_style_enum_case_list raw_value_style_enum_case , raw_value_style_enum_case

raw_value_style_enum_case_list is referenced by:

raw_value_style_enum_case_clause
raw_value_style_enum_case enum_case_name raw_value_assignment

raw_value_style_enum_case is referenced by:

raw_value_style_enum_case_list
raw_value_assignment = raw_value_literal

raw_value_assignment is referenced by:

raw_value_style_enum_case
raw_value_literal numeric_literal static_string_literal boolean_literal

raw_value_literal is referenced by:

raw_value_assignment
enum_name identifier

enum_name is referenced by:

raw_value_style_enum union_style_enum
union_style_enum indirect enum enum_name generic_parameter_clause type_inheritance_clause generic_where_clause { union_style_enum_members }

union_style_enum is referenced by:

enum_declaration
union_style_enum_members union_style_enum_member

union_style_enum_members is referenced by:

union_style_enum
union_style_enum_member declaration union_style_enum_case_clause compiler_control_statement

union_style_enum_member is referenced by:

union_style_enum_members
union_style_enum_case_clause attributes indirect case union_style_enum_case_list

union_style_enum_case_clause is referenced by:

union_style_enum_member
union_style_enum_case_list union_style_enum_case , union_style_enum_case

union_style_enum_case_list is referenced by:

union_style_enum_case_clause
union_style_enum_case opaque_type enum_case_name tuple_type ( type )

union_style_enum_case is referenced by:

union_style_enum_case_list
function_declaration function_head function_name generic_parameter_clause function_signature generic_where_clause function_body

function_declaration is referenced by:

declaration
function_body code_block

function_body is referenced by:

function_declaration
typealias_declaration attributes access_level_modifier typealias typealias_name generic_parameter_clause typealias_assignment

typealias_declaration is referenced by:

declaration protocol_member_declaration
variable_declaration variable_declaration_head variable_name initializer willSet_didSet_block type_annotation getter_setter_block getter_setter_keyword_block initializer willSet_didSet_block pattern_initializer_list

variable_declaration is referenced by:

declaration
pattern_initializer_list pattern_initializer , pattern_initializer

pattern_initializer_list is referenced by:

constant_declaration variable_declaration
pattern_initializer pattern initializer

pattern_initializer is referenced by:

pattern_initializer_list
willSet_didSet_block { willSet_clause didSet_clause didSet_clause willSet_clause }

willSet_didSet_block is referenced by:

variable_declaration
didSet_clause attributes didSet setter_name code_block

didSet_clause is referenced by:

willSet_didSet_block
willSet_clause attributes willSet setter_name code_block

willSet_clause is referenced by:

willSet_didSet_block
constant_declaration attributes declaration_modifiers let pattern_initializer_list

constant_declaration is referenced by:

declaration
import_declaration attributes import import_kind import_path

import_declaration is referenced by:

declaration
import_path import_path_identifier . import_path_identifier

import_path is referenced by:

import_declaration
import_path_identifier identifier operator

import_path_identifier is referenced by:

import_path
import_kind typealias struct class enum protocol let var func

import_kind is referenced by:

import_declaration
loop_statement for_in_statement while_statement repeat_while_statement

loop_statement is referenced by:

labeled_statement statement
repeat_while_statement repeat code_block while expression

repeat_while_statement is referenced by:

loop_statement
while_statement while condition_list code_block

while_statement is referenced by:

loop_statement
for_in_statement for case pattern in expression where_clause code_block

for_in_statement is referenced by:

loop_statement
closure_signature capture_list closure_parameter_clause throws function_result in capture_list in

closure_signature is referenced by:

closure_expression
closure_parameter_clause ( closure_parameter_list ) identifier_list

closure_parameter_clause is referenced by:

closure_signature
identifier_list identifier , identifier

identifier_list is referenced by:

closure_parameter_clause
closure_parameter_list closure_parameter , closure_parameter

closure_parameter_list is referenced by:

closure_parameter_clause
closure_parameter identifier type_annotation range_operator

closure_parameter is referenced by:

closure_parameter_list
capture_list [ capture_list_items ]

capture_list is referenced by:

closure_signature
capture_list_items capture_list_item , capture_list_item

capture_list_items is referenced by:

capture_list
capture_list_item capture_specifier identifier = expression self_expression

capture_list_item is referenced by:

capture_list_items
self_expression self self . identifier self [ function_call_argument_list ] self . init

self_expression is referenced by:

capture_list_item primary_expression
capture_specifier weak unowned ( safe unsafe )

capture_specifier is referenced by:

capture_list_item
function_call_argument_clause ( function_call_argument_list )

function_call_argument_clause is referenced by:

function_call_suffix
primary_expression unqualified_name generic_argument_clause array_type dictionary_type literal_expression self_expression superclass_expression closure_expression parenthesized_operator parenthesized_expression tuple_expression implicit_member_expression wildcard_expression key_path_expression selector_expression key_path_string_expression

primary_expression is referenced by:

postfix_expression
key_path_string_expression #keyPath ( expression )

key_path_string_expression is referenced by:

primary_expression
selector_expression #selector ( getter setter : expression )

selector_expression is referenced by:

primary_expression
key_path_expression \\ type . key_path_components

key_path_expression is referenced by:

primary_expression
key_path_components key_path_component . key_path_component

key_path_components is referenced by:

key_path_expression
key_path_component identifier key_path_postfixes key_path_postfixes

key_path_component is referenced by:

key_path_components
key_path_postfixes key_path_postfix

key_path_postfixes is referenced by:

key_path_component
key_path_postfix ? ! self [ function_call_argument_list ]

key_path_postfix is referenced by:

key_path_postfixes
wildcard_expression _

wildcard_expression is referenced by:

primary_expression
implicit_member_expression . identifier keyword . postfix_expression

implicit_member_expression is referenced by:

primary_expression
tuple_expression ( ) ( tuple_element , tuple_element_list )

tuple_expression is referenced by:

primary_expression
parenthesized_expression ( expression )

parenthesized_expression is referenced by:

primary_expression
parenthesized_operator ( operator )

parenthesized_operator is referenced by:

primary_expression
superclass_expression super . identifier super [ function_call_argument_list ] super . init

superclass_expression is referenced by:

primary_expression
literal_expression literal array_literal dictionary_literal playground_literal #file #fileID #filePath #line #column #function #dsohandle

literal_expression is referenced by:

primary_expression
playground_literal #colorLiteral ( red : expression , green : expression , blue : expression , alpha : expression ) #fileLiteral ( resourceName : expression ) #imageLiteral ( resourceName : expression )

playground_literal is referenced by:

literal_expression
dictionary_literal [ dictionary_literal_items : ]

dictionary_literal is referenced by:

literal_expression
dictionary_literal_items dictionary_literal_item , dictionary_literal_item ,

dictionary_literal_items is referenced by:

dictionary_literal
dictionary_literal_item expression : expression

dictionary_literal_item is referenced by:

dictionary_literal_items
array_literal [ array_literal_items ]

array_literal is referenced by:

literal_expression
array_literal_items array_literal_item , array_literal_item ,

array_literal_items is referenced by:

array_literal
array_literal_item expression

array_literal_item is referenced by:

array_literal_items
unqualified_name identifier ( argument_names )

unqualified_name is referenced by:

primary_expression
prefix_operator operator

prefix_operator is referenced by:

prefix_expression
try_operator try ? !

try_operator is referenced by:

binary_expression expression
top_level_declaration statements
declarations declaration
switch_elseif_directive_clause #elseif compilation_condition switch_cases
top_level statements <End of File>
Line_comment // <ANY CHAR> \n <End of File>
HASHBANG #! <ANY CHAR> [\r\n]
WS [ \n\r\t\u000B\u000C\u0000]