Bottom-Up Parsing/LALR(1) Example 1: Difference between revisions
From Wiki**3
< Bottom-Up Parsing
No edit summary |
m (LALR(1) Example 1 moved to Bottom-Up Parsing/LALR(1) Example 1) |
(No difference)
|
Revision as of 19:35, 28 May 2009
Consider the following grammar. <text> A -> C x A | ε B -> x C y | x C C -> x B x | z </text>
- Build the LALR(1) parser table. If conflicts exist, assume YACC's behavior.
- Show the differences to LR(0) and SLR(1) parsers.
- Compact the parse table, eliminating and propagating reductions.
- Show the stack and input states, as well as the parser actions, for the sequence xxzxx.
- Solution
There is a "bug" in this solution: in the compacted table, L3 in state 10 should be in the column corresponding to y (corresponding to the shift to state 11 in the uncompacted table).