CS712/CS812
Homework 2
Spring 2008
Due Date: Wednesday April 2


s     -> label s1
s1    -> ID EQ e
s1    -> GOTO ID IF e
s1    -> e
label -> ID COLON label
label -> 
e     -> NUMBER
e     -> ID etail
etail -> 
etail -> LPAREN plist RPAREN
plist -> 
plist -> e ptail
ptail -> 
ptail -> COMMA e ptail

Given the above grammar:

  1. Which nonterminals are null deriving?

  2. For each nonterminal, compute its First set.

  3. For each nonterminal, compute its Follow set.

  4. Compute the LL(1) Predict Sets for this grammar.

  5. Is the grammar LL(1)? Why or why not?

Please turn-in your homework in class on Wednesday April 2. If you cannot be in class that day, please make arrangements to give me your paper in advance. No late papers will be accepted.

You are expected to do your own work on this assignment.


Last modified on March 26, 2008.

Comments and questions should be directed to hatcher@unh.edu