CS 421: Programming Languages and Compilers
Machine Problem 2 (MP2)

Update (01/27/11 6.39PM): As was mentioned on the newsgroup, the MP due date has been pushed back a day, so it is now due on the 02/01 at 11.59pm. However, the extra late days have not been extended — so the last date this MP can be turned in is still 02/02.

There has also been an additional file posted on this page (on the right) and on the newsgroup called Pretty Print, it demonstrates how to do a traversal of the program structure. This might be helpful to consult if you're running into syntactical difficulties with Ocaml.

MP2 will give you practice dealing with recursive data structures and symbol tables. Keep in mind that your solution must define every required function, otherwise the grading program will not compile and you will receive no points for the entire homework set. For example, if you decide not to implement the function splat (for whatever reason), you need to have it defined as:
let splat x = raise (Failure(""))

IMPORTANT: Make sure that you read the README file in the grader bundle . This file contains important information.

Also, make sure you read the "Guide for Doing MPs".

Files
mp2.pdf
mp2grader.tar.gz
MiniJava Syntax
Pretty Print (Example)
mp2-sol.ml