Assignment 2
Due on Feb 10 before lecture.
Email your solutions to bchandra@eecs.umich.edu.
Preferably, email them as an attachment, with the filename: your_unique_name.zip
Problem 1a
Consider the language of Featherweight Java discussed in class (Figures
1, 2, 3 in the
Featherweight Java paper).
Your goal for this project is to implement a type checker for Featherweight
Java.
A partial implementation of a type checker is available from below:
The README file describes how to build Featherweight Java.
Note that several methods of the type checker are not yet implemented
properly. These include the following:
-
fj.types.ClassTable.override
-
fj.types.ClassTable.subtype
-
fj.typecheck.TypeChecker.checkProgram
-
fj.typecheck.TypeChecker.checkMethod
-
fj.typecheck.TypeChecker.checkVarTerm
-
fj.typecheck.TypeChecker.checkFieldTerm
-
fj.typecheck.TypeChecker.checkCallTerm
-
fj.typecheck.TypeChecker.checkNewTerm
-
fj.typecheck.TypeChecker.checkCastTerm
Implement the above methods to complete the implementation of a type
checker for Featherweight Java. Please submit the source code of your type
checker.
Problem 1b
Your goal for this problem is to test your above type checker
implementation. The tests directory supplied to you contains a bare
minimal test suite. Write a more comprehensive test suite by writing both
type-correct and type-incorrect example programs that thoroughly test your
implementation. Please submit your test suite.