Token

public struct Token<Param, Result> : Hashable where Param : Hashable

The result of parsing a terminal (either via a lexer or via rules).

  • The number of characters in the input that this token encompasses.

    Declaration

    Swift

    public let length: Int
  • The output parameter associated with the parsed terminal.

    Declaration

    Swift

    public let outputParam: Param
  • An optional result computed for this terminal.

    Declaration

    Swift

    public let result: Result?
  • The default initializer.

    Declaration

    Swift

    public init(length: Int, outputParam: Param, result: Result?)
  • Declaration

    Swift

    public func hash(into hasher: inout Hasher)
  • Declaration

    Swift

    public static func == (left: Token<Param, Result>, right: Token<Param, Result>) -> Bool