UMBC CMSC431, Compiler Design Principles, Fall 2009
Homework Assignments
Show your work for these problems.
- Exercise 3.7.1, part b, page 166.
- Exercise 3.7.2, part b, page 166.
Note: Show the contents of the set S
after line 4 of Algorithm 3.22 for each iteration of the loop.
- Exercise 3.7.3, part d, page 166.
- Exercise 3.9.2, part d, page 186.
Note: Show the values of nullable, firstpos,
lastpos for each node in the syntax tree and show the
values of followpos for each position in the syntax tree.
- Exercise 3.9.4, part b, page 186.
- Exercise 4.2.2, part b, pages 206–207.
- Exercise 4.3.1, part c, page 216.
- Exercise 4.3.3, page 217.
- Exercise 4.4.3, page 231.
- [Adapted from Modern Compiler Design by Grune et al,
Wiley 2000.]
Compute FIRST and FOLLOW for each nonterminal in the grammar below:
S → A B C
A → a A | C
B → b | ε
C → c
Then, show the parse table produced by Algorithm 4.31 (page 224).
- Exercise 4.6.2, page 258.
- Exercise 4.6.3, page 258.
- Exercise 4.6.5, page 258.
- Exercise 4.6.6, page 258.
- Exercise 4.7.1, page 277.
- Exercise 4.7.4, page 278.
- Exercise 4.7.5, page 278.
- Exercise 9.1.1, parts a – e, page 596.
- Exercise 9.1.4, page 596.
- Exercise 9.2.3, page 615.
Last Modified:
22 Jul 2024 11:27:43 EDT
by
Richard Chang
to Fall 2009 CMSC 431 Homepage