GATE | GATE-CS-2004 | Question 8

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 https://www.geeksforgeeks.org/compilers-set-1/

Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.