A extended calculator using flex and bison.
File | Description |
---|---|
calc.l | lexical rules |
calc.y | grammar rules |
util1.h | functons for calculator(eg. variables setting...) |
util.h | functions for calculator(eg. MI_TO_KM, MOD...) |
input.txt | the file calculator would read |
bison -d cal.y
flex calc.l
g++ lex.yy.c calc.tab.c -o calculator
or
make.sh
bison -d cal.y
flex calc.l
g++ lex.yy.c calc.tab.c -o calculator
or
./make.sh
calculator
./calculator
type int "exit", "quit", "EXIT" or "QUIT" to exit.