edited by
6,239 views
13 votes
13 votes

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

  1. $A \rightarrow BC$
  2. $A \rightarrow CcBb$
  3. $A \rightarrow BaC$
  4. $A \rightarrow \epsilon$

 

  1. $(i)$ only 
  2. $(i)$ and $(ii)$
  3. $(i)$ and $(iii)$
  4. $(i)$ and $(iv)$
edited by

3 Answers

Best answer
15 votes
15 votes

A/c to Operator precedence Grammar Two production should not be Adjacent (for exp as they are given in Option A) to each other .And there should not be any Eps Production .Why two production should not be Adjacent to each other is. In general when we write any Mathematical expression in Let take the C Language we are  not going to have 2 identifier side by side that is why we should see that Production should not be side by side.

So Correct Option Must be A and D because they violate the condition .

selected by
3 votes
3 votes
option A

operator grammar is racist, it does not let two non terminals come together,

in short, no production has either an empty right-hand side or two adjacent nonterminals in its right-hand side.

actually option D should also not be allowed
0 votes
0 votes

Option A will be right option for it.

Because in between two variable there should be exist a terminal then such grammar is called as operator grammar.

Example of operator grammar.

  1. A→CcBbA→CcBb
  2. A→BaCA→BaC
  3. A→ϵ
  4. Example of not to be operator grammar is
  5. A->BCCB
Answer:

Related questions

10 votes
10 votes
2 answers
1
9 votes
9 votes
2 answers
2
go_editor asked Jun 17, 2016
2,136 views
Yacc stands foryet accept compiler constructsyet accept compiler compileryet another compiler constructsyet another compiler compiler
10 votes
10 votes
3 answers
3
go_editor asked Jun 17, 2016
3,553 views
Which one of the following is a top-down parser?Recursive descent parserShift left associative parser$\text{SLR}(k)$ parser$\text{LR}(k)$ parser
1 votes
1 votes
2 answers
4
Hirak asked Jun 14, 2019
1,288 views
In operator precedence parsing we have the rule that production cannot have two adjacent non-terminals or an epsilon production, so this production, S ab is allowed but ...