Homework #16


This problem requires Lecture 15 and book sections 3.1-3.2.

Exercise 3.6, p.79 - (30 minutes)
Extend the language by adding a new primitive operator minus that take one argument, n and returns -n
--> minus(+(minus(5),9))
-4

This problem is a warm-up for working with the interpreter. The purpose of this problem is to get you used to working with the parser and eval-expression.

To complete this assignment, you will need to do the following:

  1. Modify the grammar specification to include "minus".
  2. Change the interpreter to handle this new primitive function.

Here is the code for the Lecture 15 interpreter to start with.


You must log in first before submitting homework assignments.

Instructions on submitting homework is here


Last updated at 6:59 pm on Thursday, January 22, 2004.