This is a program that parses a RPN Notation Equation and prints the result. Based off of rpn.py by @wd5gnr.
This is a POC! Features may be added or removed as seen fit.
See the LICENSE file. TLDR - MIT License
Usage: rpn_calculator.exe [OPTIONS]
Options:
-e, --expression <EXPRESSION> Reverse Polish Notation Equation
-t, --test-info Show some test info and exit.
-h, --help Print help
-V, --version Print version
Use cargo build
to build the source.
cd <Checkout directory>
cargo run -- --expression "2 8 +"
As of 02/23/2024, rpn-rs understands the following operators:
Operator | Description |
---|---|
+ | Addition |
- | Subtraction |
* | Multiplication |
/ | Division |
^ | Power Of |
! | Store Top Of Stack in a tempVar |
@ | Retrieve tempVar and push to Top Of Stack |
? | Dump the stack |
& | Dump the tempVar list |