CSC 372 - Systems II: Compiler Construction

Dr. R. M. Siegfried

Assignment #3 - LL(1) Grammars and Parse Tables

Due Thursday, March 8, 2007

Problem 1

Using the grammar from Section 3.1.5
E ::= E + T | E - T | T
T ::= T * F | T / F | F
F ::= ( E ) | i
construct parse tree and leftmost derivations for the following expressions:
a.  i*(i+i)
b.  i = i - i
c.  (i+i)/(i-i)

Problem 2

Find the FIRST and FOLLOW sets for the grammar

S::= ABC
A ::= a | Cb | < nil >
B ::= c | dA | < nil >
C :: e | f

[Back to the Assignments Index]