SymbolTable

public class SymbolTable<Symbol> where Symbol : SymbolType

Undocumented

  • ast

    Undocumented

    Declaration

    Swift

    public let ast: STLR.Grammar
  • Creates a new symbol table for the specified grammar. The table will be empty, and the caller should subsequently call build(), resolve(), then validate() before the table can be used. *

    Declaration

    Swift

    public init(_ grammr: STLR.Grammar)
  • Builds the symbol table. Implementers of the SymbolType should not attempt to resolve recursion at this stage, but create a forward reference that can be turned into a final reference in the resolution phase. *

    Declaration

    Swift

    public func build() throws
  • Any evaluation of symbols (for example as a result of recursion) that were left as forward references should be resolved at this stage. *

    Declaration

    Swift

    public func resolve() throws
  • A final validation step to ensure there are no issues in the table. *

    Declaration

    Swift

    public func validate() throws
  • Undocumented

    Declaration

    Swift

    public func isLeftHandRecursive(_ identifier: String) -> Bool