(Continuing the same grammar S → aAbB | bAaB | ε, A → S, B → S.) A partial LL(1) parsing table is:
| a | b | $ S | E1 | E2 | S→ε A | A→S | A→S | error B | B→S | B→S | E3
The appropriate entries for E1, E2, and E3 are
- AE1: S→aAbB, A→S; E2: S→bAaB, B→S; E3: B→S
- BE1: S→aAbB, S→ε; E2: S→bAaB, S→ε; E3: S→ε
- E1: S→aAbB, S→ε; E2: S→bAaB, S→ε; E3: B→S
- DE1: A→S, S→ε; E2: B→S, S→ε; E3: B→S
Explanation
Since ε ∈ FIRST(S), the production S→ε must be entered under every terminal in FOLLOW(S) = {a, b, $} — so both the 'a' and 'b' columns for row S get S→ε added alongside their respective S→aAbB / S→bAaB entries (E1, E2). For row B, since ε ∈ FIRST(S) = FIRST(B) and $ ∈ FOLLOW(B), the production B→S must also be entered under the '$' column, giving E3 = B→S (matching the already-filled a,b columns for row B).
Source: GATE CS 2012 (2012)
This question is part of a 15-day revision cycle — sign in and Project Forge will bring it back the day before you'd forget it.