Consider the Following Context Free Grammar (G) :- S → A B B → + A B | ε A → C…

PYQ UGC NET 2026

Consider the Following Context Free Grammar (G) :-

S → A B

B → + A B | ε

A → C D

D → * C D | ε

C → [ S ] | x

Variable = { S, A, B, C, D }

Terminals = { +, *, [, ], x }

What will be the FIRST(S) & FIRST(D)?

  1. A.

    FIRST(S) = { +, [, x }; FIRST(D) = { +, * }

  2. B.

    FIRST(S) = { [, ], x }; FIRST(D) = { +, ε }

  3. C.

    FIRST(S) = { [, x }; FIRST(D) = { *, ε }

  4. D.

    FIRST(S) = { [, x, ε }; FIRST(D) = { *, ε }

Attempted by 15 students.

Sign up free to check your answer

Sign up free

Explore the full course: Nta Ugc Net Paper 2

Loading lesson…