Compilers Questions and Answers – Handle of Right sentinel Grammar – 2

This set of Compilers online test 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

Answer: b
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

Answer: c
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

Answer: c
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.
advertisement
advertisement

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

Answer: b
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

Answer: a
Explanation: Lexical analysis is the process of converting a sequence of characters into a sequence of tokens.
Note: Join free Sanfoundry classes at Telegram or Youtube

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

Answer: a
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

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

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

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

Sanfoundry Global Education & Learning Series – Compilers.

advertisement

To practice all areas of Compilers for online tests, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.