Node

public protocol Node : NSObject

An entity that helps build a tree when parsing math expressions

  • This will be the string representation of the Node, it may change depending on the type of the Node

    Declaration

    Swift

    var content: String { get set }
  • The name in camelCase of the Node.

    Ex: "ExpressionNode" or "OperatorNode"

    Declaration

    Swift

    var type: String { get }
  • The Node’s children in the expression tree

    Declaration

    Swift

    var children: [Node] { get set }
  • Evaluate the mathematical expression behind each nodes

    Declaration

    Swift

    func evaluate(_ params: [String : BigNumber], _ fList: [String : (([CellValue]) throws -> CellValue)]) throws -> CellValue

    Parameters

    params

    The object that contains all the variable

  • Compiles the Node and each of its children for easier parsing / evaluation

    Declaration

    Swift

    func compile() -> Node
  • Gives String representation of the node

    Declaration

    Swift

    func toString() -> String
  • Gives Tex (String) representation of the node

    Declaration

    Swift

    func toTex() -> String
  • The depth of the Node in a Tree

    Declaration

    Swift

    var depth: Int? { get set }
  • The depth of the deepest children of the Node in a Tree

    Declaration

    Swift

    var maxDepth: Int? { get set }