This set of Compilers Multiple Choice Questions & Answers (MCQs) focuses on “Handle of Right Sentinel Grammar – 2”.
1. Input to code generator is __________
a) Source code
b) Intermediate code
c) Target code
d) All of the mentioned
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: The output of lexical analyzer is output token.
Sanfoundry Global Education & Learning Series – Compilers.
To practice all areas of Compilers, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Check Computer Science Books
- Check Compiler Design Books
- Practice MCA MCQs
- Practice Computer Science MCQs
- Apply for Computer Science Internship