Assignment 5
The files for this assignment can be found in h5.tar. Download this file and extract the
files. (They will be extracted to a directory called h5)
The Makefile included will work if you create a blank .depend file first.
Commands to extract, compile, and run are the same as for the
previous assignment.
Assignment
The relevant files for the assignment are:
- mlexer.mll - the specification of the lexical analyzer
- mparser.mly - the specification of the parser
- absyn.ml - contains the grammar for abstract syntax of expressions to be manipulated
- main.ml - the top level
- util.ml - a file with one trivial general function
- Makefile - the makefile
- tests.java - a few simple test cases
- tests.checked - output from running the test cases
- tc.ml - contains the beginnings of your solutions
- tc.mli - interface file for tc.ml
This program will type check a subset of Java. As in the
previous assignment, your code will start with the output of the
parser. See absyn.ml for the type information of these
expressions.
The interface file, tc.mli, gives the types of the
procedures used in tc.ml.
For this assignment, you should do the following.
- Research the correct type rules (use the Java references online).
- Fill in "Not Done" clauses in tc.ml
- Provide extensive Java statements which test for the clauses you
implement.
You are allowed to work in groups of two on this assignment.
Submission
Turn in the files tc.ml on the electronic
submission page. If you worked with a partner, make sure both of
your names are in the file. The person whose username comes first
should be the only one to submit the file.