Compiler Design and Construction2081.15 marksNumerical: LR(0) item setsLR parsing
Generate the LR(0) item sets for the following grammar. A→BBA \rightarrow BBA→BBB→bB∣aB \rightarrow bB \mid aB→bB∣a
Generate the LR(0) item sets for the following grammar. A→BBA \rightarrow BBA→BBB→bB∣aB \rightarrow bB \mid aB→bB∣a[5]
Grammar: - $A \to BB$ - $B \to bB \mid a$ Start symbol: $A$. Terminals: ${a, b}$. Non-terminals: ${A, B}$. - $(0)\ A' \to A$ - $(1)\ A \to BB$ - $(2)\ B \to bB$ - $(3)\ B \to a$ $I0 = \text{Closure}({A' \to \cdot A})$ $A' \to \cdot A$ adds $A \to \cdot BB$; dot before $B$ adds