This is the moment we have been working like mad for 16 weeks to get to! The moment of truth. We build the compiler! I have selected 200+ test files that will be compiled using your compiler. The compile statement is generally:

c- testfile.c-
which will create a

For debugging purposes you might want to look at the Unit tests to focus in on missing functionality. Each file will be compiled with your compiler and the resulting tm code will be run on TM 3.5b. The output of the TM run will be compared to the expected output. If it passes the test an OK will be given. If not the difference will be printed.

I have augmented the -P option on the compiler to produce the size information for nodes for compound blocks. Be sure to check that out in the code example .out files.

You may use emitcode.cpp and emitcode.h to emit tm instructions. The current version of the tm machine is tm.c and is an extension of the tm from the book. Here is the manual for the tiny machine: tmDescription35.pdf.

You do not have to do the following in this assignment:

  • whole array value assignments, array initializations, and array comparisons. You will have to do array indexing and array sizes have to be set properly.
  • static variables.