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.
- A. Lexical analysis
Why not A: “Lexical analysis” is not correct. 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
- B. Intermediate code generation
Why not B: “Intermediate code generation” is not correct. 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
- C. Code generation
Why not C: “Code generation” is not correct. 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
- D. Syntax analysis ✓
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
- Which term refers to the first phase of compilation that converts source code into a sequence of tokens?
- 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.
- Which of the following best names the concept in which the compiler phase that translates source code into an...