Compute an LR(0) GOTO closure
Parsing & Syntax Analysis

Answer & solution
Official answer: 9
Step through it (3 steps)
Approach: Move dots over S only where S immediately follows the dot, then close the resulting item set.
1. Derivation. The initial closure contains S′→·S and S→·SS, plus the other four S-start items and A→·d#, B→·@. GOTO on S shifts the first two into S′→S· and S→S·S. The latter requires closure under S, adding all five S-start items: ·SS, ·Aa, ·bAc, ·Bc, ·bBa. Closure of their leading A/B adds A→·d# and B→·@. The total is 2+5+2=9 distinct LR(0) items; SLR FOLLOW sets do not change this item-set construction.
2. Explanation and checks. The full resulting set is S′→S·; S→S·S; S→·SS; S→·Aa; S→·bAc; S→·Bc; S→·bBa; A→·d#; B→·@. The item S→·SS does not generate endlessly many items: closure is a set and revisiting the same production adds no duplicate. Terminals b,d,@ do not cause further closure expansion. Both # and @ are explicitly terminals here, so neither denotes epsilon or the end marker. FOLLOW sets govern SLR reduction entries, not this GOTO construction.



