- Write a parser and interpreter for the WAE language discussed
in the text. (This is an extension of the AE language seen in class.) The textbook can be of great assistance in this part
of the assignment; it provides an abstract syntax datatype
and the beginnings of a parser and an interpreter.
- Once you've written and tested the parser and
interpreter for WAE, extend it with the features described below.
In each part of the assignment, implement the function
parse, which consumes an expression in the language's
concrete syntax and returns the abstract syntax representation of that
expression. parse must accept only expressions in the
syntax of the language.
In addition to parse, you must implement the function
interp, which consumes an abstract syntax expression (as
returned by the parse function) and returns a Scheme
number.
You must include a contract for every function that you write
and include test cases that amply exercise all of the code you've
written. (Note that DrScheme will
tell you if any of your code is untested.) Test cases are available, but I would very much like to see you (possibly with a partner) develop as diabolical (and therefore complete) a set of cases as possible.