For the grammar below, a partial LL(1) parsing table is also presented along…

GATE · 2012 · CS · Computer Science & IT

For the grammar below, a partial LL(1) parsing table is also presented along with the grammar. Entries that need to be filled are indicated as E1, E2, and E3. ε\varepsilon is the empty string, $ indicates end of input, and, | separates alternate right hand sides of productions.

S →\to a A b B | b A a B | ε\varepsilon

A →\to S

B →\to S

The appropriate entries for E1, E2, and E3 are

  1. A.

    E1: S →\to aAbB, A →\to S

    E2: S →\to bAaB, B →\to S

    E3: B →\to S

  2. B.

    E1: S →\to aAbB, S →\toε\varepsilon

    E2: S →\to bAaB, S →\toε\varepsilon

    E3: S →\toε\varepsilon

  3. C.

    E1: S →\to aAbB, S →\toε\varepsilon

    E2: S →\to bAaB, S →\toε\varepsilon

    E3: B →\to S

  4. D.

    E1: A →\to S, S →\toε\varepsilon

    E2: B →\to S, S →\toε\varepsilon

    E3: B →\to S

Attempted by 178 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…