]
>
LR Parsing
7.2 LR Parsing
| 1. | S’ | | S |
| 2. | S | | bAb |
| 3. | A | | (B |
| 4. | | | a |
| 5. | B | | Aa) |
Input: b ( ( a a ) a ) b
- LR parsers recognize the same languages as deterministic pushdown
automata
- LR parsers use LR-items to remember
- Candidate production rules to be used in reductions
- Current positions within the candidate rules
- The LR-items are recorded in the pushdown memory, instead of recording just
nonterminal and terminal symbols.
- Each LR-item stands for a nonterminal or terminal symbol and the context in
which the symbol may appear