How skysaksham/math-expression-evaluator works
This is a small, single-file Python expression evaluator, usable from a terminal or imported through evaluate(). Its workflow normalizes input, validates it, tokenizes it, evaluates nested brackets, then applies unary handling and arithmetic operators. The README documents the supported operators and error cases; the sampled source shows the call structure. All repository components belong to evaluator.py, so no subsystem groups are needed.
Main entry points: evaluator.py Expression Evaluation
Components 12
Other components
- Expression User
- Evaluate Entry
evaluator.py - Input Normalize
evaluator.py - Syntax Validate
evaluator.py - Tokenize Expression
evaluator.py - Bracket Evaluation
evaluator.py - Expression Evaluation
evaluator.py - Unary Operators
evaluator.py - Exponentiation
evaluator.py - Division
evaluator.py - Multiplication
evaluator.py - Addition Subtraction
evaluator.py
Connections 12
- Expression User → Input Normalize: enters expression
- Evaluate Entry → Input Normalize: calls
- Evaluate Entry → Syntax Validate: validates input
- Evaluate Entry → Tokenize Expression: tokenizes input
- Evaluate Entry → Bracket Evaluation: evaluates tokens
- Bracket Evaluation → Expression Evaluation: evaluates contents
- Expression Evaluation → Unary Operators: handles unary
- Expression Evaluation → Exponentiation: evaluates powers
- Expression Evaluation → Division: evaluates division
- Expression Evaluation → Multiplication: evaluates products
- Expression Evaluation → Addition Subtraction: evaluates sums
- Evaluate Entry → Expression User: returns result