250+ TOP MCQs on Handle of Right sentinel Grammar and Answers

Compilers online test on “Handle of Right Sentinel Grammar”.

1. Input to code generator is __________
a) Source code
b) Intermediate code
c) Target code
d) All of the mentioned

Answer: b
Clarification: Intermediate code is the input to the code generator.

2. A synthesized attribute is an attribute whose value at a parse tree node depends on __________
a) Attributes at the siblings only
b) Attributes at parent node only
c) Attributes at children nodes only
d) None of the mentioned

Answer: c
Clarification: Synthesized attribute’s value depend on children node only.

3. In a bottom up evaluation of a syntax direction definition, inherited attributes can __________
a) Always be evaluated
b) Be evaluated only if the definition is L –attributed
c) Evaluation only done if the definition has synthesized attributes
d) None of the mentioned

Answer: c
Clarification: Bottom-up parsing identifies and processes the text’s lowest-level, before its mid-level structures, and the highest-level overall structure to last are left.

4. The graph that shows basic blocks and their successor relationship is called __________
a) DAG
b) Flow Chart
c) Control Graph
d) Hamilton graph

Answer: b
Clarification: Flow chart shows basic blocks.

5. _________ or scanning is the process where the stream of characters making up the source program is read from left to right and grouped into tokens.
a) Lexical Analysis
b) Diversion
c) Modelling
d) None of the mentioned

Answer: a
Clarification: Lexical analysis is the process of converting a sequence of characters into a sequence of tokens.

6. _____________ is a graph representation of a derivation.
a) The parse tree
b) Oct tree
c) Binary tree
d) None of the mentioned

Answer: a
Clarification: Parse tree is a representation of the derivation.

7. Which of the following symbols table implementation is based on the property of locality of reference?
a) Hash Table
b) Search tree
c) Self organizing list
d) Linear list

Answer: c
Clarification: Self Organizing list is based on locality of reference.

8. Assume that the SLR parser for a grammar G has n1 states and the LALR parser for G has n2 states. Hence which one is true?
a) N1 is necessarily less than n2
b) N1 is necessarily equal to n2
c) N1 is necessarily greater than n2
d) None of the mentioned

Answer: b
Clarification: The output of lexical analyzer is output token.

Leave a Reply

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