CS712/CS812
Homework 1
Spring 1998


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).

This assignment must be submitted (no later than) in class on Wednesday April 15. No late papers will be accepted.

Remember: as always you are expected to do your own work on this assignment.


Last modified on April 5, 1997.

Comments and questions should be directed to pjh@cs.unh.edu