Assignment III

Due date Feb. 28.


1.  Consider the grammar in problem 2.38 of the text (p. 189). Note the
conventions : a colon to separate left-hand size and right-hand side 
(instead of ::=  or  ->) a question mark for optional constructs
(instead of {}), and terminal symbols between single quotes.


a) Add the production (big simplification):
    expression : id

b) The grammar is left-recursive. In order to make it acceptable for
a top-down parser, remove the left recursion.

c) Compute the First and Follow sets for all the non-terminals in
this new grammar.

d) Build the LL (1) parse table for this grammar. If there are
conflicts, modify the grammar so that it becomes LL (1).