2/14/'20:

Activity 3:

Process:

1. Make sure your group includes one student who was not in your group for either the first or the second activity.

As before:
2. Make sure everyone in your group knows everyone else.
3. On a sheet of standard notebook paper, write down the names of all the students who are in your group.
4. Each student should consider the question below individually for about three to five minutes.
5. Discuss each others' ideas as a group for about seven or eight minutes.
6. Have one student write down the *group's* consensus (or majority)
answer to the question on the sheet of paper that has everyone's name
on it. The written answer should be no more than two-thirds of the
page in length; other students may suggest, hopefully minor, changes
in the answer. Give the answer sheet to Neelam.

7. The whole process should take no more than 15-20 minutes.

We saw that the "OO" approach to the Core interpreter, with as many classes as the number of non-terminals in the Core grammar with a separate object that is an instance of the appropriate class representing each node in the abstract parse tree, provides for greater type-safety than the approach in which we had a single ParseTree class with the entire abstract parse tree being an instance of that class.

This is a two-part question:

a. What precisely is the additional type-safety that the OO approach (with multiple classes) provides? Explain with a simple example.

b. Why is the approach with the single ParseTree class not able to provide this same type-safety? Explain briefly.