IntermediateRepresentationNode

public struct IntermediateRepresentationNode : Node

An entry in the tree.

  • The token created

    Declaration

    Swift

    public let token: TokenType
  • The range of the match in the source string

    Declaration

    Swift

    public let range: Range<String.UnicodeScalarView.Index>
  • Children of this node

    Declaration

    Swift

    public let children: [IntermediateRepresentationNode]
  • Any associated annotations made on the token

    Declaration

    Swift

    public let annotations: [RuleAnnotation : RuleAnnotationValue]
  • Creates a new instance with no value

    -Parameter for: The TokenType the node captures -Parameter at: The range the token was matched at in the original source string -Prameter annotations: Any annotations that should be stored with the node

    Declaration

    Swift

    public init(for token: TokenType, at range: Range<String.UnicodeScalarView.Index>, annotations: RuleAnnotations)
  • Creates a new instance

    -Parameter for: The TokenType the node captures -Parameter at: The range the token was matched at in the original source string -Parameter children: Any child nodes of this node -Prameter annotations: Any annotations that should be stored with the node

    Declaration

    Swift

    public init(for token: TokenType, at range: Range<String.UnicodeScalarView.Index>, children: [IntermediateRepresentationNode], annotations: RuleAnnotations)