Skip to content

About

🧮 Mathematical expression parser

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

29 Commits

Folders and files

Repository files navigation

Expression parser

main workflow badge

Description

The main (entry) script runs a console app expecting an expression input. It uses ExpressionParser to parse a raw input (string) returning token/error list, and SyntaxAnalysisException to build a syntax tree using parsed tokens (if no parsing exceptions occured). In case of any syntax error it raises a SyntaxAnalysisException reffering to error token. Parallel tree module contails functions for convering a syntax tree into its parallel form; they also optimize operations, open brackets applying minus and reduce unary operations. Expression view logs execution results during parsing. Equivalent forms module contains commutativity and distributivity expression opearations. Dynamic conveyor simulates calculations for a given expressions allowing to set different layers count and operations time.
Unit tests cover different behavior cases using the mentioned modules. Many valid and invalid test cases can be found there.

Commands

Create venv:

python -m venv venv

Activate venv:

source venv/bin/activate

Dectivate venv:

deactivate

Install dependencies:

pip install -r requirements.txt

Run the script:

python main.py

Run tests:

python -m unittest

About

🧮 Mathematical expression parser

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages