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
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 aTree
Declaration
Swift
var depth: Int? { get set }
-
The depth of the deepest children of the
Node
in aTree
Declaration
Swift
var maxDepth: Int? { get set }