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 6 of 12

Q51.
Consider the following statements:

(I) The output of a lexical analyzer is groups of characters.
(II) Total number of tokens in printf("i=%d, &i=%x", i, &i); are 11.
(III) Symbol table can be implementation by using array and hash table but not tree.

Which of the following statement(s) is/are correct?
Discuss
Answer: (d).None of these
Discuss
Answer: (b).Type checking is done before parsing.
Q53.
A lexical analyzer uses the following patterns to recognize three tokens T1, T2, and T3 over the alphabet {a,b,c}.

T1: a?(b∣c)*a
T2: b?(a∣c)*b
T3: c?(b∣a)*c

Note that ‘x?’ means 0 or 1 occurrence of the symbol x. Note also that the analyzer outputs the token that matches the longest possible prefix. If the string bbaacabc is processes by the analyzer, which one of the following is the sequence of tokens it outputs?
Discuss
Answer: (d).T3T3
Q54.
Match the description of several parts of a classic optimizing compiler in List - I, with the names of those parts in List - II:
Discuss
Answer: (a).(1)
Q55.
The output of a lexical analyzer is
Discuss
Answer: (d).A stream of tokens
Q56.
The number of tokens in the following C statement is printf("i=%d, &i=%x", i&i);
Discuss
Answer: (d).9
Q57.
A particular BNF definition for a "word" is given by the following rules. Which of the following lexical entries can be derived from < word > ?
I. pick
II. picks
III. c44
Discuss
Answer: (d).lI and III only
Q58.
For the grammar below, a partial LL(1) parsing table is also presented along with the grammar. Entries that need to be filled are indicated as E1, E2, and E3. ε is the empty string, $ indicates end of input, and, | separates alternate right hand sides of productions.

a.

A

b.

B

c.

C

d.

D

Discuss
Answer: (a).A
Q59.
Consider the following statement:

if (expression)
statement
else
statement

Which of the following describes the above statement?
Discuss
Answer: (b).Context free grammar
Discuss
Answer: (a).It causes recursive decent parser to loop forever
Page 6 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!