← ⬆️ Bottom-up Parsing (LR family)
Subtopic 4 of 6

5.4CLR(1) = canonical LR

Items carry an exact lookahead: [A → α • β, a]. Most powerful, but many more states (can be hundreds of times larger).

States10
Conflicts0
I0
S' → • S , $
S → • C C , $
C → • c C , c/d
C → • d , c/d
S→I1 C→I2 c→I3 d→I4
I1
S' → S • , $
no transitions
I2
S → C • C , $
C → • c C , $
C → • d , $
C→I5 c→I6 d→I7
I3
C → • c C , c/d
C → c • C , c/d
C → • d , c/d
c→I3 C→I8 d→I4
I4
C → d • , c/d
no transitions
I5
S → C C • , $
no transitions
I6
C → • c C , $
C → c • C , $
C → • d , $
c→I6 C→I9 d→I7
I7
C → d • , $
no transitions
I8
C → c C • , c/d
no transitions
I9
C → c C • , $
no transitions

Closure adds items for every non-terminal right after the dot; goto(I, X) moves the dot over X. LR(1) items carry a lookahead set after the comma.

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.