Calculator (for 454 students)

Based on your code generator, write a calculator that takes an expression of integer constants and outputs the result of the expression.


% cat exp_file
% caculator exp_file

The semantics of arithmatic operations is the same as integer operations in C (so 5/3 = 1).  The extra amount of coding should be small.  Once you have the code generator complete, you can make another copy of your code and instead of generating code for <program>, you let the calculator to evaluate <expression>.  The new code needs to evaluate the expression in the left-associative order, same as you do in code generation.

Submit your calculator with code generator.  The Makefile should produce both executables.