250+ TOP MCQs on Data Structure for Representing Parsing Table

Compilers online quiz on “Data Structure for Representing Parsing Table”.

1. In operator precedence parsing whose precedence relations are defined _________
a) For all pair of non-terminals
b) For all pair of terminals
c) To delimit the handle
d) None of the mentioned

Answer: a
Clarification: There are two important properties for these operator precedence parsers is that it does not appear on the right side of any production and no production has two adjacent no terminals.

2. LR parsers are attractive because _________
a) It can be constructed to recognize CFG corresponding to almost all programming constructs
b) It does not backtrack
c) It can be constructed to recognize CFG corresponding to almost all programming constructs & It does not backtrack
d) None of the mentioned

Answer: c
Clarification: These above mentioned are the reasons why LR parser is considered to be attractive

3. Which is the most powerful parser?
a) SLR
b) LALR
c) Canonical LR
d) Operator Precedence

Answer: c
Clarification: The most powerful parser is Canonical LR

4. ( Z,* ) be a structure, and * is defined by n * m =maximum (n, m) Which of the following statements is true for ( Z, * )?
a) ( Z,* ) is a monoid
b) ( Z,* ) is an algebraic group
c) ( Z,* ) is a group
d) None of the mentioned

Answer: d
Clarification: It is neither a monoid nor a simple group nor algebraic group

5. The address code involves _____________
a) Exactly 3 address
b) At most Three address
c) No unary operators
d) None of the mentioned

Answer: d
Clarification: In computer science, three-address is an intermediate code used by optimizing compilers to aid in the implementation of code-improving transformations.

6. An intermediate code form is ___________
a) Postfix Notation
b) Syntax Trees
c) Three address code
d) All of the mentioned

Answer: d
Clarification: Intermediate code generator takes input from its predecessor phase, semantic analyzer, in the form of an annotated syntax tree.

Leave a Reply

Your email address will not be published. Required fields are marked *