CS 674
Assignment 8
Due Wednesday, December 2nd
Refer to this
class diagram
in the following exercises.
- Add constructors (and role names, as useful) for Compound,
Assignment and Block in the class diagram.
- A Type is either an IntType or a
BooleanType. Add the class declarations to the object
diagram for the Simple Intermediate Language.
- In the class diagram, a Block introduces an identifier into
a statement. Extend Block so that the identifier has a
Type associated with it.
- Parameterize the Env class over the class that can be
associated with an identifier. Express the current environment in
terms of the parameterized environment and show a new class of
environment associating identifiers with types.
- Using the visitor pattern, define the visitor classes for the
Expression and Statement classes.
- Add the modifications to the class diagram from the previous 5
exercises to your implementation of the class diagram.