adplus-dvertising

Welcome to the Topdown Parsing MCQs Page

Dive deep into the fascinating world of Topdown Parsing with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Topdown Parsing, a crucial aspect of Compiler Design. In this section, you will encounter a diverse range of MCQs that cover various aspects of Topdown Parsing, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Compiler Design.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Topdown Parsing. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Compiler Design.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Topdown Parsing. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Topdown Parsing MCQs | Page 1 of 2

Q1.
Which of the following derivations does a top-down parser use while parsing an input string?
Discuss
Answer: (a).Leftmost derivation
Q2.
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
Discuss
Answer: (c).Relocation
Q3.
Which of the following grammar rules violate the requirements of an operator grammar?
(i) P -> QR

(ii) P -> QsR

(iii) P -> ε

(iV) P -> QtRr
Discuss
Answer: (b).(i) and (iii) only
Q4.
Compute E.value for the root of the parse tree for the expression:2 # 3 & 5 # 6 &4.
Discuss
Answer: (c).160
Q5.
Given the following expression grammar:
E -> E * F | F+E | F

F -> F-F | id

which of the following is true?
Discuss
Answer: (b).– has higher precedence than *
Q6.
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.
Discuss
Answer: (c).Link time
Q7.
Assume that the SLR parser for a grammar G has n1 states and the LALR parser for G has n2 states.
Discuss
Answer: (b).n1 is necessarily equal to n2
Q8.
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
Discuss
Answer: (b).P-3, Q-1, R-4, S-2
Q9.
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.
Discuss
Answer: (b).I and IV
Q10.
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?
Discuss
Answer: (b).+ is right associative, while ∗ is left associative
Page 1 of 2

Suggested Topics

Are you eager to expand your knowledge beyond Compiler Design? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!