Consider the following grammar, where {#, &, x, y} are terminals: S → P P → QR…

Consider the following grammar, where {#, &, x, y} are terminals:

S → P
P → QR | TQR
Q → Q# | ε
R → & | ε
T → x | y

Select the correct option.

  1. A.

    FIRST(P) = {#, x, y, ε}

  2. B.

    FIRST(P) = {#, x, y, &}

  3. C.

    FIRST(P) = {#, x, y}

  4. D.

    FIRST(P) = {#, &, x, y, ε}

Attempted by 119 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…