Mini language modeled after a calculator
Project description
Calc Interpreter
A mini-language modeled after a calculator implemented in Python 3. The program currently only lexes basic mathematical expressions. It supports infix (using Shunting Yard Algorithm) and postfix (Reverse Polish Notation).
Usage
The best way to run the program currently is to execute the REPL and can be done in a python file or through your terminal.
Assuming your present working directory is inside the cloned repo, you can run the following command without the comment.
# inside /clone_path/expr_calc/
python -m expr_calc
Enabling postfix expression mode is also possible. Using infix expressions in postfix mode is currently undefined and so is using postfix expressions in infix mode.
python -m expr_calc --postfix
Features
- Infix expressions
- Postfix expressions
- Basic operators such as
+, -, *, /, %, ^
- Tokens created from an expression can also be fetched if one wanted to do so
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for expr_calc-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | faddb562f1d8be2ec181990748763986a0863488dc5133d3f14e317daa64da26 |
|
MD5 | cab7932cef5f61331e75b54e2236a343 |
|
BLAKE2b-256 | 79a56b1c25da794ae556b0bcf9264ef97f7db6c71b285dce94409afb737b7174 |