Simple interpreter that, when given an arithmetic expression as a string, can return the value.
- Is only useful to show an example of how the evaluator works
- expression_manager
- Parse the expression
- Validate the expression
- Create all the elements of the expression
- Add the elements to a binaryTree
- Program
- element
- binary_tree
- Provide a global point of acces to the operators.
- Construct operators
- Construct variables
- Expression
- Centralize all the messages that the final user could see.
- Centralize all the exceptions of the evaluator
- All Packages
- Provide usefull clases to make a BinaryTree
- Provide algorithms to pass over the BinaryTree
- Order IElements in BynaryTrees in base on their priority
- expression_manager
- Create an OperatorFactory thath given the symbol return the correct Operator
- Create an user_interface
- The intelligence to know what type of element is and create this could be in the package element
sequenceDiagram
program->>+expression_manager: Expression as String
expression_manager->>element: Parsed element as String
element --> element: Convert String to IElement
element ->> expression_manager: IElement as Object
expression_manager->> binary_tree: IElement
binary_tree --> binary_tree: priorize IElement
binary_tree ->> expression_manager: priorized BinaryTree
expression_manager ->> program: Result as a Double