SyntaxProtocol
The protocol SyntaxProtocol has at least 315 conforming types available.
The protocol SyntaxProtocol has at least 315 conforming types available.
import SwiftSyntaxA library for working with Swift code.
struct AccessorBlockSyntaxenum Accessorsstruct AccessorDeclListSyntaxstruct AccessorDeclSyntaxstruct AccessorEffectSpecifiersSyntaxstruct AccessorParametersSyntaxstruct ActorDeclSyntaxstruct ArrayElementListSyntaxstruct ArrayElementSyntaxAn element inside an array literal.
struct ArrayExprSyntaxAn array literal.
struct ArrayTypeSyntaxstruct ArrowExprSyntaxThe arrow when a type is used at a position that syntactically expectes an expression.
struct AsExprSyntaxThe cast of an expressison to a different type.
struct AssignmentExprSyntaxstruct AssociatedTypeDeclSyntaxAn associatedtype declaration
struct AttributeListSyntaxA list of attributes that can be attached to a declaration.
enum Elementstruct AttributeSyntaxAn @ attribute.
enum Argumentsstruct AttributedTypeSyntaxstruct AvailabilityArgumentListSyntaxstruct AvailabilityArgumentSyntaxA single argument to an @available argument like *, iOS 10.1, or message: "This has been deprecated".
enum Argumentstruct AvailabilityConditionSyntaxstruct AvailabilityLabeledArgumentSyntaxAn argument to an @available attribute that consists of a label and a value, e.g. message: "This has been deprecated".
enum Valuestruct AwaitExprSyntaxstruct BackDeployedAttributeArgumentsSyntaxA collection of arguments for the @backDeployed attribute
struct BinaryOperatorExprSyntaxAn operator like + or -.
struct BooleanLiteralExprSyntaxstruct BorrowExprSyntaxstruct BreakStmtSyntaxstruct CatchClauseListSyntaxstruct CatchClauseSyntaxstruct CatchItemListSyntaxstruct CatchItemSyntaxstruct ClassDeclSyntaxA class declaration
struct ClassRestrictionTypeSyntaxstruct ClosureCaptureClauseSyntaxstruct ClosureCaptureListSyntaxstruct ClosureCaptureSpecifierSyntaxstruct ClosureCaptureSyntaxstruct ClosureExprSyntaxstruct ClosureParameterClauseSyntaxstruct ClosureParameterListSyntaxstruct ClosureParameterSyntaxstruct ClosureShorthandParameterListSyntaxA list of closure parameters that are not parenthesized and don’t have type annotations.
struct ClosureShorthandParameterSyntaxstruct ClosureSignatureSyntaxenum ParameterClausestruct CodeBlockItemListSyntaxstruct CodeBlockItemSyntaxA CodeBlockItem is any Syntax node that appears on its own line inside a CodeBlock.
enum Itemstruct CodeBlockSyntaxstruct CompositionTypeElementListSyntaxstruct CompositionTypeElementSyntaxstruct CompositionTypeSyntaxstruct ConditionElementListSyntaxstruct ConditionElementSyntaxenum Conditionstruct ConformanceRequirementSyntaxstruct ConsumeExprSyntaxstruct ContinueStmtSyntaxstruct ConventionAttributeArgumentsSyntaxThe arguments for the ‘@convention(…)’.
struct ConventionWitnessMethodAttributeArgumentsSyntaxThe arguments for the ‘@convention(witness_method: …)’.
struct CopyExprSyntaxstruct DeclModifierDetailSyntaxstruct DeclModifierListSyntaxstruct DeclModifierSyntaxstruct DeclNameArgumentListSyntaxstruct DeclNameArgumentSyntaxstruct DeclNameArgumentsSyntaxstruct DeclReferenceExprSyntaxstruct DeclSyntaxstruct DeferStmtSyntaxstruct DeinitializerDeclSyntaxA deinit declaration
struct DeinitializerEffectSpecifiersSyntaxstruct DerivativeAttributeArgumentsSyntaxThe arguments for the ‘@derivative(of:)’ and ‘@transpose(of:)’ attributes: the ‘of:’ label, the original declaration name, and an optional differentiability parameter list.
struct DesignatedTypeListSyntaxstruct DesignatedTypeSyntaxstruct DictionaryElementListSyntaxstruct DictionaryElementSyntaxAn element inside a dictionary literal.
struct DictionaryExprSyntaxA dictionary literal
enum Contentstruct DictionaryTypeSyntaxstruct DifferentiabilityArgumentListSyntaxstruct DifferentiabilityArgumentSyntaxA differentiability argument: either the “self” identifier, a function parameter name, or a function parameter index.
struct DifferentiabilityArgumentsSyntaxThe differentiability arguments.
struct DifferentiabilityWithRespectToArgumentSyntaxA clause containing differentiability parameters.
enum Argumentsstruct DifferentiableAttributeArgumentsSyntaxThe arguments for the @differentiable attribute: an optional differentiability kind, an optional differentiability parameter clause, and an optional ‘where’ clause.
struct DiscardAssignmentExprSyntaxA _ that discards a value inside an assignment.
struct DiscardStmtSyntaxstruct DoExprSyntaxA do block with one of more optional catch clauses.
struct DoStmtSyntaxstruct DocumentationAttributeArgumentListSyntaxThe arguments of the ‘@_documentation’ attribute
struct DocumentationAttributeArgumentSyntaxenum Valuestruct DynamicReplacementAttributeArgumentsSyntaxThe arguments for the ‘@_dynamicReplacement’ attribute
struct EditorPlaceholderDeclSyntaxAn editor placeholder, e.g. <#declaration#> that is used in a position that expects a declaration.
struct EditorPlaceholderExprSyntaxstruct EffectsAttributeArgumentListSyntaxThe arguments of the ‘@_effects’ attribute. These will be parsed during the SIL stage.
struct EnumCaseDeclSyntaxA case declaration of a Swift enum. It can have 1 or more EnumCaseElements inside, each declaring a different case of the enum.
struct EnumCaseElementListSyntaxA collection of 0 or more EnumCaseElementSyntaxs.
struct EnumCaseElementSyntaxAn element of an enum case, containing the name of the case and, optionally, either associated values or an assignment to a raw value.
struct EnumCaseParameterClauseSyntaxstruct EnumCaseParameterListSyntaxstruct EnumCaseParameterSyntaxstruct EnumDeclSyntaxA Swift enum declaration.
struct ExposeAttributeArgumentsSyntaxThe arguments for the ‘@_expose’ attribute
struct ExprListSyntaxA list of expressions connected by operators. This list is contained by a SequenceExprSyntax.
struct ExprSyntaxstruct ExpressionPatternSyntaxA pattern that contains an ExprSyntaxProtocol.
struct ExpressionSegmentSyntaxAn interpolated expression inside a string literal.
struct ExpressionStmtSyntaxstruct ExtensionDeclSyntaxAn extension declaration.
struct FallThroughStmtSyntaxstruct FloatLiteralExprSyntaxstruct ForStmtSyntaxstruct ForceUnwrapExprSyntaxstruct FunctionCallExprSyntaxstruct FunctionDeclSyntaxA Swift func declaration.
struct FunctionEffectSpecifiersSyntaxstruct FunctionParameterClauseSyntaxstruct FunctionParameterListSyntaxA list of function parameters that are type annotated and a label. The function parameters are represented by FunctionParameterListSyntax.
struct FunctionParameterSyntaxA function parameter
struct FunctionSignatureSyntaxA function signature that defines the interface of the function.
struct FunctionTypeSyntaxstruct GenericArgumentClauseSyntaxstruct GenericArgumentListSyntaxstruct GenericArgumentSyntaxenum Argumentstruct GenericParameterClauseSyntaxThe parameter clause that defines the generic parameters.
struct GenericParameterListSyntaxstruct GenericParameterSyntaxstruct GenericRequirementListSyntaxstruct GenericRequirementSyntaxenum Requirementstruct GenericSpecializationExprSyntaxstruct GenericWhereClauseSyntaxA where clause that places additional constraints on generic parameters like where Element: Hashable.
struct GuardStmtSyntaxstruct IdentifierPatternSyntaxA pattern that contains a TokenSyntax.
struct IdentifierTypeSyntaxstruct IfConfigClauseListSyntaxstruct IfConfigClauseSyntaxenum Elementsstruct IfConfigDeclSyntaxstruct IfExprSyntaxenum ElseBodystruct ImplementsAttributeArgumentsSyntaxThe arguments for the @_implements attribute of the form Type, methodName(arg1Label:arg2Label:)
struct ImplicitlyUnwrappedOptionalTypeSyntaxstruct ImportDeclSyntaxAn import declaration
struct ImportPathComponentListSyntaxstruct ImportPathComponentSyntaxstruct InOutExprSyntaxAn expression prefixed with & to pass an argument to an inout parameter.
struct InfixOperatorExprSyntaxAn infix operator call like 1 + 2.
struct InheritanceClauseSyntaxstruct InheritedTypeListSyntaxstruct InheritedTypeSyntaxstruct InitializerClauseSyntaxstruct InitializerDeclSyntaxAn init declaration
struct IntegerLiteralExprSyntaxstruct IsExprSyntaxChecks if an expression is of a given type.
struct IsTypePatternSyntaxstruct KeyPathComponentListSyntaxThe components of a key path
struct KeyPathComponentSyntaxA single key path component
enum Componentstruct KeyPathExprSyntaxA key path.
struct KeyPathOptionalComponentSyntaxA key path component like ? or !.
struct KeyPathPropertyComponentSyntaxA key path component like .property or .1.
struct KeyPathSubscriptComponentSyntaxA key path component like .[17]
struct LabeledExprListSyntaxstruct LabeledExprSyntaxAn expression that is prefixed by a label.
struct LabeledSpecializeArgumentSyntaxA labeled argument for the @_specialize attribute like exported: true
struct LabeledStmtSyntaxstruct LayoutRequirementSyntaxstruct LifetimeSpecifierArgumentListSyntaxstruct LifetimeSpecifierArgumentSyntaxA single argument that can be added to a lifetime specifier like borrow, mutate, consume or copy.
struct LifetimeTypeSpecifierSyntaxA specifier that specifies function parameter on whose lifetime a type depends
struct MacroDeclSyntaxstruct MacroExpansionDeclSyntaxThe expansion of a freestanding macro in a position that expects a declaration.
struct MacroExpansionExprSyntaxThe expansion of a freestanding macro in a position that expects an expression.
struct MatchingPatternConditionSyntaxstruct MemberAccessExprSyntaxAn expression that access a member like a function or a property.
struct MemberBlockItemListSyntaxstruct MemberBlockItemSyntaxA member declaration of a type consisting of a declaration and an optional semicolon;
struct MemberBlockSyntaxstruct MemberTypeSyntaxstruct MetatypeTypeSyntaxstruct MissingDeclSyntaxIn case the source code is missing a declaration, this node stands in place of the missing declaration.
struct MissingExprSyntaxIn case the source code is missing an expression, this node stands in place of the missing expression.
struct MissingPatternSyntaxIn case the source code is missing a pattern, this node stands in place of the missing pattern.
struct MissingStmtSyntaxIn case the source code is missing a statement, this node stands in place of the missing statement.
struct MissingSyntaxIn case the source code is missing a syntax node, this node stands in place of the missing node.
struct MissingTypeSyntaxIn case the source code is missing a type, this node stands in place of the missing type.
struct MultipleTrailingClosureElementListSyntaxstruct MultipleTrailingClosureElementSyntaxstruct NamedOpaqueReturnTypeSyntaxstruct NilLiteralExprSyntaxstruct ObjCSelectorPieceListSyntaxstruct ObjCSelectorPieceSyntaxA piece of an Objective-C selector. Either consisting of just an identifier for a nullary selector, an identifier and a colon for a labeled argument or just a colon for an unlabeled argument
struct OpaqueReturnTypeOfAttributeArgumentsSyntaxThe arguments for the ‘@_opaqueReturnTypeOf()’.
struct OperatorDeclSyntaxA Swift operator declaration.
struct OperatorPrecedenceAndTypesSyntaxA clause to specify precedence group in infix operator declarations, and designated types in any operator declaration.
struct OptionalBindingConditionSyntaxstruct OptionalChainingExprSyntaxstruct OptionalTypeSyntaxstruct OriginallyDefinedInAttributeArgumentsSyntaxThe arguments for the ‘@_originallyDefinedIn’ attribute
struct PackElementExprSyntaxA pack element expression spelled with each.
struct PackElementTypeSyntaxstruct PackExpansionExprSyntaxA pack expansion expression spelled with repeat.
struct PackExpansionTypeSyntaxstruct PatternBindingListSyntaxstruct PatternBindingSyntaxDefines variables inside a variable declaration.
struct PatternExprSyntaxstruct PatternSyntaxstruct PlatformVersionItemListSyntaxstruct PlatformVersionItemSyntaxA single platform/version pair in an attribute, e.g. iOS 10.1.
struct PlatformVersionSyntaxAn argument to @available that restricts the availability on a certain platform to a version, e.g. iOS 10 or swift 3.4.
struct PostfixIfConfigExprSyntaxstruct PostfixOperatorExprSyntaxstruct PoundSourceLocationArgumentsSyntaxstruct PoundSourceLocationSyntaxstruct PrecedenceGroupAssignmentSyntaxSpecifies the precedence of an operator when used in an operation that includes optional chaining.
struct PrecedenceGroupAssociativitySyntaxSpecifies how a sequence of operators with the same precedence level are grouped together in the absence of grouping parentheses.
struct PrecedenceGroupAttributeListSyntaxenum Elementstruct PrecedenceGroupDeclSyntaxA Swift precedencegroup declaration.
struct PrecedenceGroupNameListSyntaxstruct PrecedenceGroupNameSyntaxstruct PrecedenceGroupRelationSyntaxSpecify the new precedence group’s relation to existing precedence groups.
struct PrefixOperatorExprSyntaxA prefix operator applied to a value.
struct PrimaryAssociatedTypeClauseSyntaxstruct PrimaryAssociatedTypeListSyntaxstruct PrimaryAssociatedTypeSyntaxstruct ProtocolDeclSyntaxA protocol declaration
struct RegexLiteralExprSyntaxstruct RepeatStmtSyntaxstruct ReturnClauseSyntaxstruct ReturnStmtSyntaxstruct SameTypeRequirementSyntaxenum LeftTypeenum RightTypestruct SequenceExprSyntaxA flat list of expressions before operator folding using the SwiftOperators library.
struct SimpleStringLiteralExprSyntaxA simple string that can’t contain string interpolation and cannot have raw string delimiters.
struct SimpleStringLiteralSegmentListSyntaxString literal segments that only can contain non string interpolated or extended escaped strings
struct SimpleTypeSpecifierSyntaxA specifier that can be attached to a type to eg. mark a parameter as inout or consuming
struct SomeOrAnyTypeSyntaxstruct SourceFileSyntaxstruct SpecializeAttributeArgumentListSyntaxA collection of arguments for the @_specialize attribute
enum Elementstruct SpecializeAvailabilityArgumentSyntaxThe availability argument for the _specialize attribute
struct SpecializeTargetFunctionArgumentSyntaxA labeled argument for the @_specialize attribute with a function decl value like target: myFunc(_:)
struct StmtSyntaxstruct StringLiteralExprSyntaxA string literal.
struct StringLiteralSegmentListSyntaxenum Elementstruct StringSegmentSyntaxA literal segment inside a string segment.
struct StructDeclSyntaxA struct declaration
struct SubscriptCallExprSyntaxstruct SubscriptDeclSyntaxstruct SuperExprSyntaxstruct SuppressedTypeSyntaxstruct SwitchCaseItemListSyntaxstruct SwitchCaseItemSyntaxstruct SwitchCaseLabelSyntaxstruct SwitchCaseListSyntaxenum Elementstruct SwitchCaseSyntaxenum Labelstruct SwitchDefaultLabelSyntaxstruct SwitchExprSyntaxA switch expression.
struct SyntaxA Syntax node represents a tree of nodes with tokens at the leaves. Each node has accessors for its known children, and allows efficient iteration over the children through its children property.
struct TernaryExprSyntaxThe ternary operator with operator precedences resolved.
struct ThenStmtSyntaxA statement used to indicate the produced value from an if/switch expression.
struct ThrowStmtSyntaxstruct ThrowsClauseSyntaxstruct TokenSyntaxA Syntax node representing a single token.
struct TryExprSyntaxAn expression prefixed with try.
struct TupleExprSyntaxstruct TuplePatternElementListSyntaxA list of TuplePatternElementSyntax.
struct TuplePatternElementSyntaxAn element that represents a single tuple value in TuplePatternElementListSyntax.
struct TuplePatternSyntaxA pattern that contains a list of other pattern.
struct TupleTypeElementListSyntaxstruct TupleTypeElementSyntaxstruct TupleTypeSyntaxstruct TypeAliasDeclSyntaxstruct TypeAnnotationSyntaxstruct TypeEffectSpecifiersSyntaxstruct TypeExprSyntaxstruct TypeInitializerClauseSyntaxstruct TypeSpecifierListSyntaxenum Elementstruct TypeSyntaxstruct UnavailableFromAsyncAttributeArgumentsSyntaxThe arguments for the ‘@_unavailableFromAsync’ attribute
struct UnderscorePrivateAttributeArgumentsSyntaxThe arguments for the ‘@_private’ attribute
struct UnexpectedNodesSyntaxA collection of syntax nodes that occurred in the source code but could not be used to form a valid syntax tree.
struct UnresolvedAsExprSyntaxThe as keyword without any operands.
struct UnresolvedIsExprSyntaxThe is keyword without any operands.
struct UnresolvedTernaryExprSyntaxThe middle section of a ternary operator between ? and :.
struct ValueBindingPatternSyntaxstruct VariableDeclSyntaxDeclaration of one or more variables
struct VersionComponentListSyntaxstruct VersionComponentSyntaxAn element to represent a single component in a version, like .1.
struct VersionTupleSyntaxA version number like 1.2.0. Only the first version component is required. There might be an arbitrary number of following components.
struct WhereClauseSyntaxstruct WhileStmtSyntaxstruct WildcardPatternSyntaxA pattern that represent a wildcard.
struct YieldStmtSyntaxenum YieldedExpressionsstruct YieldedExpressionListSyntaxstruct YieldedExpressionSyntaxstruct YieldedExpressionsClauseSyntaxstruct _CanImportExprSyntaxstruct _CanImportVersionInfoSyntax