Written work 5
Due on March 1st @ 3:00 PM (in class, to Drew, or at Engineering front office)
Not accepted late
Question 1

Recall that Jeff is a statically-scoped language. Assume a new variant of Jeff, called Jeff', that uses the exact same syntax as Jeff but is dynamically-scoped. Provide an input file that would be valid in both Jeff or Jeff', but prints a different result based on which scoping system is used. Show what the output would be either under scheme.

Question 2

Provide an input file that would be valid in Jeff', but not in Jeff.

Question 3

Explain the difference between an SLR and an LR(0) parser. Provide an example grammar that is SLR-parseable but not LR(0) parseable.

Question 4

Draw the symbol table at the point in name analysis after line 11 but before line 12.

1. void func(int arg){
2.   int a;
3. }
4. void funk(int arg){
5.    int l;
6.    if (l > 2){
7.       int m;
8.       m = l;
9.    }
10.   if (l < 2){
11.      int n;
12.      n = l;
13.   }
14. }