Project 7: Alternate OO

In this project, you will complete an interpreter for JayMU. The JayMU system is strikingly different from the other languages in the Jay family in that we're writing a "wimpy interpreter"---it does not try to make a realistic model of memory, and it relies on the underlying Python interpreter's call stack to handle invocations. This allows us to concentrate on the parts that are new.

1. Set-up.

Copy the starter code from the course directory.

cp ~tvandrun/Public/cs365/proj7.tar .

You will complete the interpreterVisitor.py. This will involve not only finishing the InterpreterVisitor but also another visitor to modify the body of the method updates to replace enclosing scope variables with their values.

2. Tasks

You'll notice that interpreter has two instance variables: result, for the result of the most recently evaluated expression, and sigma, for the store. sigma is a dict associating variable names with values. Object values are dicts associating method names with method ASTs. Method ASTs include the return type and list of formals (see jaymu_ast.cfg) in addition to the body. The body is the only thing that gets updated in a method update.

Here is a brief description of what needs to be done for each visit method that needs to be finished.

3. To turn in

To turn in this project, please copy your interpreterVisitor to

/cslab.all/ubuntu/cs365/turnin/xxxxxx/proj7

where "xxxxxx" is [elliot|payton|davidemmanuel|nathan|gill|brandon|sean|simon]. I will grade your project by running it against a collection of test files.

Due: Fri, April 25, 5:00 pm. This will overlap with project 8.


Thomas VanDrunen
Last modified: Tue Mar 25 13:18:27 CDT 2014