CS712/CS812
Homework 2
Spring 2004
Due Date: Monday April 26


start   -> class
class   -> fields methods
fields  -> fields field
fields  ->
field   -> INT ID SEMI
methods -> method methods
methods ->
method  -> INT ID LP RP SEMI

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. Is the grammar LR(0)? Why or why not?

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

  6. Is the grammar LALR(1)? Why or why not?

  7. Is the grammar LR(1)? Why or why not?

Support your answers to the last four questions by computing and providing the configuration sets with the associated context/lookahead information.

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

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