ProductionResult

public struct ProductionResult
extension ProductionResult: ExpressibleByArrayLiteral

A production result contains multiple possible production strings which can all be generated from a given non-terminal.

A production result can be used when creating a production rule with different possible productions:

"A" --> n("B") <|> t("x")
                ^ generates a production result
  • The possible production strings of this result

    Declaration

    Swift

    public var elements: [ProductionString]
  • Creates a new production result.

    Declaration

    Swift

    public init(symbols: [ProductionString])

    Parameters

    symbols

    Possible strings which can be produced

  • Declaration

    Swift

    public typealias ArrayLiteralElement = ProductionString
  • Declaration

    Swift

    public init(arrayLiteral elements: ProductionString...)
  • Creates a new production result from a symbol set where every symbol generates a different result independent of other symbols

    Declaration

    Swift

    init(_ set: SymbolSet)

    Parameters

    set

    The symbol set to create a production result from