MCS-388 Homework 2 (Spring 2003)

Due: March 5, 2003

  1. Do exercise 3.7, parts h and i only, from page 147.

  2. Eliminate left recursion from the following grammar:
    A -> B | c
    B -> Ad | e
    

  3. For the grammar
    S -> (S)S | epsilon
    
    1. Construct the FIRST and FOLLOW sets.
    2. Construct the predictive parsing table.
    3. Show (in the style of Figure 4.16, p. 188) the actions of the predictive parser on input (())().

  4. Is the following grammar LL(1)? Justify your answer.
    S -> aSbS | bSaS | epsilon
    


Course web site: http://www.gac.edu/~max/courses/S2003/MCS-388/
Instructor: Max Hailperin <max@gac.edu>