A simple calculator.
If the name of the binary is calculator,
To calculate:
$ calculator -c <EXPRESSION>
# or
$ calculator --calc <EXPRESSION>
# or simply input expressions in calculator's shell:
$ calculator
# and type 'quit' to exit<EXPRESSION> is recommended to add quotes,
such as '42', "1 + 1".
You can view token stream by:
$ calculator -l <EXPRESSION>
# or
$ calculator --lexeme <EXPRESSION>And show the tree by:
$ calculator -t <EXPRESSION>
# or
$ calculator --tree <EXPRESSION>No dependencies yet, just simply use:
cargo build --releaseto build the binary.
Foreign function interface for the C programming language, has 4 functions.
For more information, please view src/lib.rs.