1.9k views

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 $\rightarrow$ Q R

2. P $\rightarrow$ Q s R

3. P $\rightarrow \: ε$

4. P $\rightarrow$ Q t R r

1. (I) only
2. (I) and (III) only
3. (II) and (III) only
4. (III) and (IV) only
0
ans-B

Operator grammar  cannot contain

1. Nullable variable
2. Two adjacent non-terminal on $\text{RHS}$ of production
edited by
(I) P --> QR is not possible since two Non Terminal  should include one operator as Terminal.
(II) Correct
(III)  incorrect.
(IV) Correct.

so I and III violate the requirements of an operator grammar.

Hence (B) is correct option
0
is PQ-->RsT is operator grammar or not?
+8

no, PQ-->RsT will also not be in operator grammer, because

PQ is present in LHS means it has also been generated by some production like V ---> αPQβ which is also in grammer and voilating operator precedence condition..

0
No, PQ-> RsT is not context free, so it cant be operator grammar.