•  Parser 

The Parser converts a mathematical expression to a tree.

As humans, we read and write math as a line of text. If you were to type a math expression, it would probably look something like this:

(1 + 2) - abs(-3) * x²


You could also just look at that math expression and use your intuition to prioritize where to start simplifying. But a computer will understand the expression best when it’s stored in a tree. These trees can be surprisingly complicated — even a short expression like (1 + 2) - abs(-3) * x² becomes this tree:

          (-)
/   \
( )   (*)
/     /   \
(+)    abs   (^)
/   \    |   /   \
1     2  -3  x     2

See more

#### Declaration

Swift

public class Parser
•  Lexer 

The Lexer is converting a sequence of characters (mathematical expression) into a sequence of Token

See more

#### Declaration

Swift

public class Lexer
•  Grouper 

The Grouper is the class that will be in charged of converting an array of Token into an array of Group in the process of parsing a mathematical expression.

See more

#### Declaration

Swift

public class Grouper
•  Group 

A Group is a intermediate representation object for representing a mathematical expression. This is the object that allows the tokens to be grouped together to convert them into nodes. In particular, it is in charge of recognizing parentheses and preanalysing them before passing the expression to Parser.

See more

#### Declaration

Swift

public class Group : NSObject
•  Node 

An entity that helps build a tree when parsing math expressions

See more

#### Declaration

Swift

public protocol Node : NSObject
•  CellAddressNode 

A Node for cell adress such as A2 or $HH$26

See more

#### Declaration

Swift

public class CellAddressNode : NSObject, Node
•  ExpressionNode 

An ExpressionNode is a Node containing 1 or more expression.

See more

#### Declaration

Swift

public class ExpressionNode : NSObject, Node
•  ParenthesisNode 

A ParenthesisNode is an ExpressionNode used to treat parenthesis

See more

#### Declaration

Swift

public class ParenthesisNode : ExpressionNode
•  ConstantNode 

This is a Node object that represents a number as a BigDouble

See more

#### Declaration

Swift

public class ConstantNode : NSObject, Node
•  SymbolNode 

A Node for mathematical symbols such as x or y

See more

#### Declaration

Swift

public class SymbolNode : NSObject, Node
•  StringNode 

A special Node for string expression (works excusively in table mode)

See more

#### Declaration

Swift

public class StringNode : NSObject, Node
•  OperatorNode 

A type of Node for representing mathematical operations

See more

#### Declaration

Swift

public class OperatorNode : NSObject, Node
•  FunctionNode 

A Node that represents a mathematical function

See more

#### Declaration

Swift

public class FunctionNode : NSObject, Node
•  NullNode 

This is a Node object that represents an empty Node

See more

#### Declaration

Swift

public class NullNode : NSObject, Node