Explore topic-wise MCQs in Compilers.

This section includes 8 Mcqs, each offering curated multiple-choice questions to sharpen your Compilers knowledge and support exam preparation. Choose a topic below to get started.

1.

THE_OUTPUT_OF_LEXICAL_ANALYZER_IS_A?$

A. Set of regular expressions
B. Syntax tree
C. Set of tokens
D. Strings of character
Answer» D. Strings of character
2.

The_output_of_a_lexical_analyzer_is$

A. Machine code
B. Intermediate code
C. Stream of tokens
D. Parse tree
Answer» D. Parse tree
3.

Task of the lexical analysi?

A. None of the mentioned
B. To build a literal and identifier table
C. To build a uniform symbol table
D. Both
Answer» E.
4.

The lexical analyzer takes _________as input and produces a stream of _______as output.

A. Source program, tokens
B. Token, source program
C. Either A and B
D. None of the mentioned
Answer» B. Token, source program
5.

Which of the following is used for grouping of characters into tokens?

A. Parser
B. Code optimization
C. Code generator
D. Lexical analyzer
Answer» E.
6.

_________ 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
B. Diversion
C. Modelling
D. None of the mentioned
Answer» B. Diversion
7.

A simple two-pass assembler does which of the following in the first pass

A. Space for the literals
B. Total length of the program
C. It builds the symbol table for the symbols and their values.
D. All of the mentioned
Answer» E.
8.

Given the language L-{ab, aa, baa}, which of the following strings are in LG?

A. abaabaaabaa
B. aaaabaaaa
C. baaaaabaaaab
D. baaaaabaa
Answer» D. baaaaabaa