Skip to content

ISRO Scientist/Engineer CSE 2020Compiler Design › Parsing

ISRO Scientist/Engineer CSE 2020 PYQ: A grammar is defined as $A \rightarrow BC$ $B \rightarrow x \mid Bx$ $C \rightarrow B \mid D$ $D \rightarrow…

A grammar is defined as

  • $A \rightarrow BC$
  • $B \rightarrow x \mid Bx$
  • $C \rightarrow B \mid D$
  • $D \rightarrow y \mid Ey$
  • $E \rightarrow z$

The non terminal alphabet of the grammar is

  1. A
    $\{A,B,C,D,E\}$
    Correct answer
  2. B
    $\{B,C,D,E\}$
  3. C
    $\{A,B,C,D,E,x,y,z\}$
  4. D
    $\{x,y,z\}$

Answer

(A) $\{A,B,C,D,E\}$

Approach

Identify the non-terminal symbols as the capital letters appearing on the left-hand side of the production rules. Terminals are the lowercase symbols that appear only on the right-hand side.

Reviewed by ISRO IQ Editorial Team.