CS712/CS812
Homework 2
Spring 2002
Due Date: Monday May 6


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. Compute the First sets for the nonterminals of the grammar.

  2. Compute the Follow sets for the nonterminals of the grammar.

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

  4. Explain why the Predict Sets demonstrate that the grammar is not LL(1).

Please turn-in your homework in class on Monday May 6. 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 April 26, 2002.

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