Skip to content

umoho/calc-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Calc

A simple calculator.

Usage

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>

Build

No dependencies yet, just simply use:

cargo build --release

to build the binary.

FFI

Foreign function interface for the C programming language, has 4 functions.

For more information, please view src/lib.rs.

About

A simple calculator, Rust implemention.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages