adplus-dvertising

Welcome to the Compiler Design MCQs Page

Dive deep into the fascinating world of Compiler Design with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Compiler Design, a crucial aspect of GATE CSE Exam. In this section, you will encounter a diverse range of MCQs that cover various aspects of Compiler Design, 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 GATE CSE Exam.

frame-decoration

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

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

Compiler Design MCQs | Page 11 of 12

Q101.
Consider the following grammar. After removing the left recursion from the given grammar the resulting grammar will be

a.

A

b.

B

c.

C

d.

D

Discuss
Answer: (c).C
Q102.
After removing the left recursion from the following grammar,

S → SA⁄SB⁄a⁄b⁄c

the resulting grammar will be

a.

A

b.

B

c.

C

d.

D

Discuss
Answer: (c).C
Q103.
Consider the following simple context-free grammar:

S → Aa ⁄ bAc ⁄ dc ⁄ bda

Determine true (T), false (F) of the following statements:
i) The grammar is SLR (1)
ii) The grammar is LR (1)
iii) The grammar is LALR (1)?
Discuss
Answer: (c).(i) – T (ii) – F (iii) – T
Q104.
Consider the following grammar. Which of the following is true??
Discuss
Answer: (c).Since all LR (0) grammar are SLR, this grammar is SLR
Q105.
Consider the following grammar. Which one of the following is true?
Discuss
Answer: (c).Both a and b
Q106.
What will be the optimized code when the expression P=q*-r+q*-r is represented in DAG specification?

a.

A

b.

B

c.

C

d.

D

Discuss
Answer: (c).C
Q107.
In some phase of a compiler:

Input:
temp1: = int to real (60)
temp2: = id3 * temp1
temp3: = id2 * temp2
id1: = temp3

Output:
temp1: = id3 * 60.0
id1: = id2 + temp1

Where temp1, temp2, temp3 are temporary storage id1, id2, id3 are identifiers. “int to real” is converting int 60 to a real number. The above phase is
Discuss
Answer: (a).Code optimizer
Q108.
Consider the following grammar. For Input string cad, how many times the recursive descent parser will back track?

a.

2

b.

3

c.

4

d.

5

Discuss
Answer: (a).2
Discuss
Answer: (b).The grammar is SLR (1) but not LL (1)
Q110.
Consider the following grammar: If we construct a parsing table for this grammar, the parsing table entry [S’,e] contains?

a.

A

b.

B

c.

C

d.

D

Discuss
Answer: (c).C
Page 11 of 12

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!