Match the LIST-I with LIST-II LIST-I (Input) LIST-II (Compiler Phase) A.…

2026

Match the LIST-I with LIST-II

LIST-I (Input)

LIST-II (Compiler Phase)

A. Syntax Tree

I. Code Generator

B. Character Stream

II. Syntax Analyzer

C. Intermediate Representation

III. Semantic Analyzer

D. Token Stream

IV. Lexical Analyzer

Choose the correct answer from the options given below:

  1. A.

    A-II, B-III, C-IV, D-I

  2. B.

    A-III, B-IV, C-I, D-II

  3. C.

    A-III, B-I, C-IV, D-II

  4. D.

    A-I, B-IV, C-II, D-III

Attempted by 158 students.

Show answer & explanation

Correct answer: B

A compiler processes source code through a fixed pipeline of phases, and each phase is defined by the specific data structure it takes as input and the one it hands off as output: raw source characters flow into Lexical Analysis, which yields a token stream; the token stream flows into Syntax Analysis, which yields a syntax tree; the syntax tree flows into Semantic Analysis, which yields an annotated form that becomes the intermediate representation; and the intermediate representation flows into Code Generation, which yields the target code.

  1. Character Stream is the raw, untokenized source text — by definition this is the input the very first phase, the Lexical Analyzer, works on, giving B-IV.

  2. The Lexical Analyzer's output, the Token Stream, is exactly what the next phase, the Syntax Analyzer, consumes to build a parse tree, giving D-II.

  3. The Syntax Analyzer's output, the Syntax Tree, is exactly what the next phase, the Semantic Analyzer, consumes to check meaning and scope, giving A-III.

  4. The Semantic Analyzer's annotated output becomes the Intermediate Representation, which is exactly what the final phase, the Code Generator, consumes to emit target code, giving C-I.

Each of the four phases (I-IV) is used exactly once and each list-I item (A-D) is used exactly once, so this is a valid one-to-one matching; it also traces the pipeline in strict order — Lexical Analyzer, then Syntax Analyzer, then Semantic Analyzer, then Code Generator — with no phase skipped or repeated, confirming the combination is internally consistent.

So the full matching is A-III, B-IV, C-I, D-II.

Explore the full course: Mppsc Assistant Professor