Consider the following context-free grammar where the start symbol is and the set of terminals is .
The following is a partially-filled LL(1) parsing table (rows S, A, B; columns a, b, c, d, $).
Which one of the following options represents the CORRECT combination for the numbered cells in the parsing table?
Note: In the options, "blank" denotes that the corresponding cell is empty.
Tap to open full sizeFigure description
LL(1) parsing table with columns a, b, c, d, and rows S, A, B. Row S: a = S -> AaAb; b = S -> BbBa; c = (1); d = (2); = empty. Row A: a = A -> epsilon; b = (3); c = A -> cS; d = empty; = empty. Row B: a = (4); b = B -> epsilon; c = empty; d = B -> dS; = empty.
- (A)
(1) S -> AaAb (2) S -> BbBa (3) A -> epsilon (4) B -> epsilon
- (B)
(1) S -> BbBa (2) S -> AaAb (3) A -> epsilon (4) B -> epsilon
- (C)
(1) S -> AaAb (2) S -> BbBa (3) blank (4) blank
- (D)
(1) S -> BbBa (2) S -> AaAb (3) blank (4) blank