This is the final and most exciting part of your project! Write a code generator or interpreter for Tea programs. Be sure to run at least 1 "real" program as well as the usual examples.
Method 1 Write your interpreter as Java code (and eventually as an Applet )
Method 2 Write an interpreter (actually a code generator) which outputs assembler of your choice or pseudo assembler. You must (hand) document the output code for your examples
Method 3 Translate your AST's and ST's to Java Byte Code
Input: Your AST and Symbol Tables (for a program)
Output You want to show that your program works. An easy way to do this is to add one more field - a value field to your symbol table and print it out when you finish.
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 a practical program works.
Don't try to implement this all at once. Start small.
Hand in Everything, in a nice package. Include the input programs and a screen dump (if you created screens) or symbol table of the programs ; otherwise include the input and output.
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 elaborateal\ gorithm (for expressions - you'll need to add other constructs)
Documentation This should include, at a minimum, a description of the how the program evolved, a page of system info: what software was used, the make files, how to run, etc. An up-to-date grammar should be near the beginning. A TOC should show where everything is.
Send questions and comment to: Karen Lemone