Assignment #7 - Interpreter/Code Generator

Due: Monday, April 20

10 points

This is the final and most exciting part of your project! Write a simulator that will interpret Tea programs, executing the instructions in the program one by one. You may want to add graphics that show values changing.

Alternatively, you may output assembly language instructions for a real or pseudo machine.

If you are really brave, you may want to put out Java Virtual machine code (I'll be adding references for this)

In the first 2 cases, code your interpreter/code generator as an Applet if you have time.

Input: Your AST and Symbol Tables (for a program)

Output 1: (for up to 5 points) Program 1 works

Output 2: (for up to 7 points) Program 2 works

Output 3: (for up to 8.5 points) Program 3 works

Output 4: (for up to 10+ points) Everything including your enhancements works.

Don't try to implement this all at once. Start small.

Hand in Everything, in a nice package. Include the input programs and screen dumps of the programs if you created screens; otherwise include the input and output.

I strongly recommend for the last (10 point version) that you run some real programs.

Method: The ast can be intepreted a number of ways. Section 11.3 shows code being generated by a simple tree walk. Section 11.7 shows a more elaborate algorithm (for expressions - you'll need to add other constructs)

Send questions and comment to: Karen Lemone