Project 1 - Interpreter

Project 1 is intended to serve as a quick review of Java, a gentle introduction to the first few concepts in the textbook, and a handy testcase for students to try out the electronic submission and automated grading environments.

Project 1 is to be completed individually.

Due date: 2004 Sep 01 (Wed) 12:00 Noon.


Directions:

  • Read Chapter 1 of Appel.
  • Download Java code for "straight-line" language abstract syntax trees, here.
  • Download skeleton code for "straight-line" language interpreter, here.
  • In working directory, compile the abstract syntax tree classes. (javac StraightLine.java.)
  • In Interpreter.java, implement the rest of the interpreter code where indicated by comments, as explained in textbook and in lecture.
  • Compile and run interpreter. (javac Interpreter.java; java Interpreter.)
    You will need manually built AST's (abstract syntax trees) stored in a class called Program.
    A couple of example programs are provided here and here.
    You would do well to construct additional testcases.
  • Debug until done.

  • What To Turn In:

    Submit the file Interpreter.java. Your interpreter should work with the unaltered abstract syntax tree classes we have provided, and with any proper Program.java file we provide for testing.

    Submit your code using the turnin command on the lab machines.
       turnin -c cs352=0X01 -p project1
    where "0X01" should be your division number. Please see the manpage for turnin for other helpful option.


    Back

    [Rev 1.1 2004 Aug 24 16:54 DWB]