Exercise 6: Featherweight Java

Hand in:Friday, December 24.

The provided framework is self-contained and can be downloaded as zip.

Assignment

In this assignment you will implement Featherweight Java as presented in the document Featherweight Java A Minimal Core Calculus for Java and GJ" by Atsushi Igarashi, Benjamin Pierce and Philip Wadler in 1999. You should be able to follow the paper directly for this implementation.

You have to implement both a type checker and an interpreter for Featherweight Java. The input program has to be type checked, and if it is type correct the type is printed then each step of the reduction is printed on a separate line. If there is a type error, a meaningful error message and the offending position in the source code has to be printed.

Framework description

To get you up to speed, we included a full building parser for the language. You are free to modify it if it doesn't suit your needs (or find some bugs). You can even write your own parser from scratch. This framework is entirely optional. A few remarks about the framework: