Today, we finish up our discussion of building tables for table-driven parsing from Session 11.
Build a parsing table for the grammar from our opening exercise last time, using the FIRST and FOLLOW sets we built and the algorithm for building a parsing table we learned.
Solution: Peek ahead for a solution. The process is straightforward -- it just requires attention to detail.
Port some Scheme procedures to BigRig, if possible. Trace through grammar. Are there holes in the grammar? Are there holes in the design?
| . | declare | identifier | fixed | float | single | double | $ |
|---|---|---|---|---|---|---|---|
| statement | [1] | . | . | . | . | . | . |
| option-list | . | . | [2] | [2] | [2] | [2] | [3] |
| option | . | . | [4] | [4] | [5] | [5] | |
| scale | . | . | [6] | [7] | . | . | . |
| precision | . | . | . | . | [8] | [9] | . |