Which grammar rules violate the requirement of the operator gramm

Which grammar rules violate the requirement of the operator gramm
|

Which grammar rules violate the requirement of the operator grammar? A, B, C are variables and a, b, c are terminals.

i. A → BC

ii. A → CcBb

iii. A → BaC

iv. A → ε

A. i and ii

B. i and iii

C. i and iv

D. i only

Please scroll down to see the correct answer and solution guide.

Right Answer is: C

SOLUTION

Concept

An operator precedence parser is a bottom-up parser that interprets an operator grammar.

This parser is only used for operator grammars.

Ambiguous grammars are not allowed in any parser except operator precedence parser.

It is applicable only to a small class of grammars.

Explanation:

Statement i:  A → BC (Violates)

Two non-terminals are not allowed to be adjacent to each other in operator grammar

Statement ii: A → CcBb (Does not violate)

It is an operator grammar

Statement iii:  A → BaC (Does not violate)

It is an operator grammar

Statement iv: A → ε (Violates)

An empty string in production or null production is not allowed in operator grammar