1. What is an Object program?
a) Program written in machine language
b) Program to be translated into machine language
c) Translation of high-level language into machine language
d) None of the mentioned
Explanation: Since the input is the source language and the output that we get after the analysis is the machine language.
2. Which concept of FSA is used in the compiler?
a) Lexical analysis
b) Parser
c) Code generation
d) Code optimization
Explanation: Because the lexer performs its analysis by going from one stage to another.
3. Which concept of grammar is used in the compiler?
a) Lexical analysis
b) Parser
c) Code generation
d) Code optimization
Explanation: As the lexical analysis of a grammar takes place in phases hence it is synonymous to parser.
4. Which of the following are Lexemes?
a) Identifiers
b) Constants
c) Keywords
d) All of the mentioned
Explanation: Different Lexical Classes or Tokens or Lexemes Identifiers, Constants, Keywords, Operators.
5. What constitutes the stages of the compilation process?
a) Feasibility study, system, design, and testing
b) Implementation and documentation
c) Lexical analysis, syntax, Analysis and code generation
d) None of the mentioned
Explanation: As defined in the compilation process.
6. 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
Explanation: As per the definition of Lexical Analyser which states that lexical analysis is the process of converting a sequence of characters into tokens.
7. Parsing is also known as ________
a) Lexical Analysis
b) Syntax Analysis
c) Semantic Analysis
d) Code Generation
Explanation: Parsing or syntactic analysis is the process of analysing a string of symbols and conforming to the rules of grammar.
8. A compiler program written in a high level language is called ________
a) Source Program
b) Object Program
c) Machine Language Program
d) None of the mentioned
Explanation: The input that we give in high level language is also known as the source language.
9. 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
Explanation: For the convince of the user compilers are made re-enterable.
10. Which of the following is not a feature of compiler?
a) Scan the entire program first and translate into machine code
b) To remove syntax errors
c) Slow for debugging
d) Execution time is more
Explanation: The objective of the compiler is clearly not to increase the execution time of the program.