Algebra - Advanced

  • 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)-\left|-3\right|\times x^2
    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)-\left|-3\right|\times x^2 becomes this tree:

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

    Declaration

    Swift

    public class Parser
  • The Lexer is converting a sequence of characters (mathematical expression) into a sequence of Token

    See more

    Declaration

    Swift

    public class Lexer
  • 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
  • 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
  • An entity that helps build a tree when parsing math expressions

    See more

    Declaration

    Swift

    public protocol Node : NSObject
  • A Node for cell adress such as A2 or $HH$26

    See more

    Declaration

    Swift

    public class CellAddressNode : NSObject, Node
  • An ExpressionNode is a Node containing 1 or more expression.

    See more

    Declaration

    Swift

    public class ExpressionNode : NSObject, Node
  • A ParenthesisNode is an ExpressionNode used to treat parenthesis

    See more

    Declaration

    Swift

    public class ParenthesisNode : ExpressionNode
  • This is a Node object that represents a number as a BigDouble

    See more

    Declaration

    Swift

    public class ConstantNode : NSObject, Node
  • A Node for mathematical symbols such as x or y

    See more

    Declaration

    Swift

    public class SymbolNode : NSObject, Node
  • A special Node for string expression (works excusively in table mode)

    See more

    Declaration

    Swift

    public class StringNode : NSObject, Node
  • A type of Node for representing mathematical operations

    See more

    Declaration

    Swift

    public class OperatorNode : NSObject, Node
  • A Node that represents a mathematical function

    See more

    Declaration

    Swift

    public class FunctionNode : NSObject, Node
  • This is a Node object that represents an empty Node

    See more

    Declaration

    Swift

    public class NullNode : NSObject, Node