Compiler Design - Practice Set 4
Compiler Design - Practice Set 4
2. The lexical analyzer takes _________ as input and produces a stream of _______ as output.
a) Source program, tokens
b) Token, source program
c) Either of the two
d) None of the mentioned
Answer: a
Explanation: As per the definition of Lexical Analyser which states that lexical analysis is the process of
converting a sequence of characters into tokens.
5. System program such a compiler are designed so that they are ________
a) Re-enterable
b) Non-Usable
c) Serially usable
d) None of the mentioned
Answer: a
Explanation: For the convince of the user compilers are made re-enterable.
7. A system program that brings together separately compiled modules of a program into a form
language that is suitable for execution.
a) Assembler
b) Linking loader
c) Cross compiler
d) None of the mentioned
Answer: b
Explanation: A loader which brings together the functions of a relocating loader with the ability to
combine a number of program segments that have been independently compiled into an executable
program.
8. A programmer by mistakes writes a program to multiply two numbers instead of dividing them, how
can this error be detected?
a) Compiler
b) Interpreter
c) Compiler or interpreter
d) None of the mentioned
Answer: d
Explanation: This is a logical error that can’t be detected by any compiler or interpreter.