Skip to content

Compiler Design

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.

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

More Compiler Design MCQs