calcc
- a simple calculator (compiler version) - is a sample application using
CPARSEC2 library
calcc
parses an integer arithmetic expression, and generates x86_64 assembly
code. (i.e. compiles an integer arithmetic expression)
make
- Usage
- calcc <expression>
$ ./bin/calcc '10 + 2 * 3' > tmp.s
$ gcc -o tmp tmp.s
$ ./tmp
$ echo $?
16
$ ./bin/calcc '(10 + 2) * 3' > tmp.s
$ gcc -o tmp tmp.s
$ ./tmp
$ echo $?
36