Which term refers to the first phase of compilation that converts source code into a sequence of tokens?
Difficulty: Medium
About this MCQ
This Medium Compiler Design MCQ checks one syllabus fact.
The question is: “Which term refers to the first phase of compilation that converts source code into a sequence of tokens?”
The accepted answer is A. Lexical analysis. Lexical analysis is the person, body, or term that satisfies “Which term refers to the first phase of compilation that converts source code into a sequence of tokens” (option A). Option B (“Compiler”) does not match the stem; it is a near-miss used to catch incomplete recall of Lexical analysis. Option C (“Code generation”) does not match the stem; it is a near-miss used to catch incomplete recall of Lexical analysis. Remaining alternatives (Recursive descent parser) fall outside the same rule and should be eliminated once Lexical analysis is identified. Compiler Design questions of this type reward precise definitions rather than approximate associations. Compiler Design recall of this distinction is a regular item in FPSC, PPSC, NTS, and CSS papers.
- A. Lexical analysis ✓
- B. Compiler
Why not B: “Compiler” is not correct. The accepted answer is A. Lexical analysis. Lexical analysis is the person, body, or term that satisfies “Which term refers to the first phase of compilation that converts source code into a sequence of tokens” (option A). O
- C. Code generation
Why not C: “Code generation” is not correct. The accepted answer is A. Lexical analysis. Lexical analysis is the person, body, or term that satisfies “Which term refers to the first phase of compilation that converts source code into a sequence of tokens” (option A). O
- D. Recursive descent parser
Why not D: “Recursive descent parser” is not correct. The accepted answer is A. Lexical analysis. Lexical analysis is the person, body, or term that satisfies “Which term refers to the first phase of compilation that converts source code into a sequence of tokens” (option A). O
Correct answer
A. Lexical analysis
Explanation
Lexical analysis is the person, body, or term that satisfies “Which term refers to the first phase of compilation that converts source code into a sequence of tokens” (option A). Option B (“Compiler”) does not match the stem; it is a near-miss used to catch incomplete recall of Lexical analysis. Option C (“Code generation”) does not match the stem; it is a near-miss used to catch incomplete recall of Lexical analysis. Remaining alternatives (Recursive descent parser) fall outside the same rule and should be eliminated once Lexical analysis is identified. Compiler Design questions of this type reward precise definitions rather than approximate associations. Compiler Design recall of this distinction is a regular item in FPSC, PPSC, NTS, and CSS papers.
Source: Compiler Design Official Reference Guide
Tags: computer science, compiler design, compilers, programming languages
Submitted by: MCQsHub Editorial
Related MCQs
- What is the name for the compiler phase that checks whether tokens conform to the grammatical structure of the...
- Which of the following best describes Syntax analysis?
- Identify the correct concept described as: the compiler phase that checks source code for meaningful correctne...
- Semantic analysis is best defined as which of the following?
- A data structure used by a compiler to store information about variables, functions, and identifiers. What is...
- Choose the correct description of Symbol table.