Subtopic 5 of 6
5.5LALR(1)
Merge CLR(1) states that have the same core (same items ignoring lookaheads). Same number of states as LR(0)/SLR. May introduce reduce/reduce conflicts, never shift/reduce ones that CLR did not have.
| Parser | States | Conflicts | Verdict |
|---|---|---|---|
| LR(0) | 7 | 0 | accepts |
| SLR(1) | 7 | 0 | accepts |
| LALR(1) | 7 | 0 | accepts |
| CLR(1) | 10 | 0 | accepts |
LR(0), SLR and LALR always have the same number of states; CLR(1) can have many more. LALR merges CLR states that share a core, so it can create reduce/reduce conflicts but never new shift/reduce ones.
Previous year questions: Bottom-up Parsing (LR family) (12)
PYQs are grouped by topic, so this is the full set for Bottom-up Parsing (LR family); try the ones that match this subtopic. Open all 12 on the topic page.