
Principles of Programming Languages - Midterm
K. Subramani
LCSEE,
West Virginia University,
Morgantown, WV
1 Instructions
1. Each question is worth 4points.
2. Attempt as many problems as you can. You will be given partial credit, as per the policy discussed in class.
3. The Midterm needs to be turned in by 3 : 10 pm., March 2, 2004.
2 Problems
1. Enumerate the different times at which the attributes of a name can be bound. Give one example for each.
2. Briefly explain with examples, the concepts of visibility, scope and scope holes, associated with bindings.
3. Consider the following Expression Grammar:
expr โexpr โexpr |expr / expr |number
number โdigit number |dig it
digit โ0|1|2|3|4|5|6|7|8|9
Identify the problems with the above grammar.
4. Write a new set of rules for the above Expression Grammar such that the problems that you have identified are fixed.
5. Enumerate the different ways in which Computer Scientists have tried to specify semantics of programming lan-
guages, over the years. Identify a shortcoming for each method employed.
1