A simple calculator language implemented using Flex (lex) and Bison (yacc).
- Integer variables
- Arithmetic expressions
- Input and print statements
- Simple commenting:
$&(at the start of line
calc.l— Lexical analyzer (Flex file)calc.y— Parser (Bison file)
- Make sure you have Flex, Bison, and GCC installed.
- Run:
flex calc.l bison -d calc.y gcc lex.yy.c calc.tab.c -o calcprog - After compiling, run the interpreter:
./calcprog
