adplus-dvertising
frame-decoration

Question

Which grammar rules violate the requirements of an operator grammar ?
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

Posted under Compiler Design

Answer: (b).1 and 3 only

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which grammar rules violate the requirements of an operator grammar ? 1. P → Q R 2. P → Q s R 3. P → ε 4. P → Q t R r

Similar Questions

Discover Related MCQs

Q. Consider the grammar
E → E + n | E × n | n

For a sentence n + n × n, the handles in the right-sentential form of the reduction are

Q. The grammar A → AA | (A) | e is not suitable for predictive-parsing because the grammar is

Q. Consider the grammar defined by the following production rules
S –> T * P

T –> U | T * U

P –> Q + P | Q

Q –> Id

U –> Id

Which one of the following is TRUE?

Q. Find the TRUE statement?
I. There exist parsing algorithms for some programming languages which has O(3) complexity.

II. A programming language which allows recursion can be implemented

with static storage allocation.

III. No L-attributed definition can be evaluated in The framework

of bottom-up parsing.

IV. Code improving transformations can be performed at both intermediate code level and source

Language.

Q. Match the following.
P. Regular expression 1. Syntax analysis

Q. Pushdown automata 2. Code generation

R. Dataflow analysis 3. Lexical analysis

S. Register allocation 4. Code optimization

Q. Assume that the SLR parser for a grammar G has n1 states and the LALR parser for G has n2 states.

Q. Consider a program P that consists of two source modules M1(contains reference to a function defined in M2) and M2 contained in two different files.

Q. Given the following expression grammar:
E -> E * F | F+E | F

F -> F-F | id

which of the following is true?

Q. Compute E.value for the root of the parse tree for the expression:2 # 3 & 5 # 6 &4.

Q. Which of the following grammar rules violate the requirements of an operator grammar?
(i) P -> QR

(ii) P -> QsR

(iii) P -> ε

(iV) P -> QtRr

Q. The process of assigning load addresses to the various parts of the program and adjusting the code and data in the program to reflect the assigned addresses is called

Q. Which of the following derivations does a top-down parser use while parsing an input string?