SE580: Homework 4

Deadline: 5.30pm, Thursday 9 October 2003.

Homework

Download and unpack the interpreter archive for this course, and make sure you can compile and run the interpreter.

  cd interpreter
  javac hobbes/test/Main.java
  java hobbes.test.Main tests/Test*.hob
  java hobbes.test.Main tests/Fail*.hob

When you run the interpreter, you will get messages saying "Tests failed". Your homework is to get rid of these messages!

Note that the typechecker compiles, but it does not check most programs! In particular, there are a number of tests called Fail*.hob which should not typecheck, but which currently do. This is what you should concentrate on!

This week, the problem is that the static semantics of Hobbes is not complete. It is missing most of the cases for Block in hobbes/statics/TypeCheck.java. You should edit hobbes/statics/TypeCheck.java to finish the interpreter.

You should add comments to the code, indicating which edits you made, for example:

  // Edited by Wilma Flintstone:
  print ("hello");
  // End of edits.

Once you have a working edited version of TypeCheck.java, create a zip archive containing that file, plus any other files you edited, and submit it using Courses OnLine.