Skip to content

Compiler Design

What is the name for the compiler phase that checks whether tokens conform to the grammatical structure of the language?

Difficulty: Medium

About this MCQ

This Medium Compiler Design MCQ checks one syllabus fact.

The question is: “What is the name for the compiler phase that checks whether tokens conform to the grammatical structure of the language?”

The accepted answer is D. Syntax analysis. Syntax analysis is the fact required by “What is the name for the compiler phase that checks whether tokens conform to the grammatical structure of the language” (option D). Option A (“Lexical analysis”) does not match the stem; it is a near-miss used to catch incomplete recall of Syntax analysis. Option B (“Intermediate code generation”) does not match the stem; it is a near-miss used to catch incomplete recall of Syntax analysis. Remaining alternatives (Code generation) fall outside the same rule and should be eliminated once Syntax 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

D. Syntax analysis

Explanation

Syntax analysis is the fact required by “What is the name for the compiler phase that checks whether tokens conform to the grammatical structure of the language” (option D). Option A (“Lexical analysis”) does not match the stem; it is a near-miss used to catch incomplete recall of Syntax analysis. Option B (“Intermediate code generation”) does not match the stem; it is a near-miss used to catch incomplete recall of Syntax analysis. Remaining alternatives (Code generation) fall outside the same rule and should be eliminated once Syntax 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