This is toy project to learn
- how to create lexer, parser
- how to work interpreter
Also, this is the good theme to exercise a new programming language you're learning.
toy
Rust
$ git clone https://github.com/togami2864/calculator.git
$ cargo build
$ cargo run
$ cargo run
> 1 + 1
2
> 2 - 1
1
> 2 * 3
6
> 2/2
1
> (1 + 1) * 5
10
> 1 / 0
DivisionByZero: This operation will panic at runtime
> ( 2 + 4 (
UnexpectedToken: Expected ), but got (
> a
Illegal Token: Illegal
> ....