Consider the following expression grammar G: E -> E - T | T T -> T + F | F F…

2017

Consider the following expression grammar G:

E -> E - T | T T -> T + F | F F -> (E) | id

Which of the following grammars are not left recursive, but equivalent to G ?

  1. A.

    E -> E - T | T

    T -> T + F | F

    F -> (E) | id

  2. B.

    E -> TE'

    E' -> -TE' | ε

    T -> T + F | F

    F -> (E) | id

  3. C.

    E -> TX

    X -> -TX | ε

    T -> FY

    Y -> +FY | ε

    F -> (E) | id

  4. D.

    E -> TX | (TX)

    X -> -TX | +TX | ε

    T -> id

Attempted by 228 students.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir