BaseMax / PythonExpressionInterpreter
Simple Math Interpreter in Python
README
Python Expression Interpreter
Simple Math Interpreter in Python
Using
python main.py
Example
calc > 5
5.0
calc > -110
-110.0
calc > --110
110.0
calc > ---110
-110.0
calc > 5*4+5
25.0
calc > 5/2+4*4+(5/4-2)+1/1
18.75
Unit Testing
python -m unittest lexer_test
python -m unittest parser_test
python -m unittest interpreter_test
References
- https://www.youtube.com/watch?v=88lmIMHhYNs
- https://www.youtube.com/watch?v=TwKWUj033vY
- https://www.youtube.com/watch?v=45epnUwFALo
- https://www.youtube.com/watch?v=tczjDCbykyM
