Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE-CS-2004 | Question 8

  • Last Updated : 23 Dec, 2019

Which of the following grammar rules violate the requirements of an operator grammar ? P, Q, R are nonterminals, and r, s, t are terminals.

1.    P → Q R                    
2.    P → Q s R
3.    P → ε       
4.    P → Q t R r 

(A) 1 only
(B) 1 and 3 only
(C) 2 and 3 only
(D) 3 and 4 only


Answer: (B)

Explanation: See Question 4 of http://www.geeksforgeeks.org/compilers-set-1/.

Operator grammar should not have two or more variables in its production side by side, and should not have null productions.

Quiz of this Question

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :