Skip to content
GATEiit

GATE CSE 2017 Session 2 Q15: Match compiler inputs to the phase that processes them

Syllabus topics: Lexical analysis, parsing and syntax-directed translation; Intermediate code generation

Question

Match the following according to input (from the left column) to the compiler phase (in the right column) that processes it:

InputCompiler phase
(P) Syntax tree(i) Code generator
(Q) Character stream(ii) Syntax analyzer
(R) Intermediate representation(iii) Semantic analyzer
(S) Token stream(iv) Lexical analyzer

Try it: multiple choice: exactly one correct option

Select one option
Wrong answer costs 1/3 mark in GATE.
Show answer and explanation

Answer: C (official GATE 2017 final answer key)

Concept used: Compiler phases form a pipeline: characters → lexer → tokens → parser → syntax tree → semantic analysis → intermediate code → code generator.

Concept notes

Loading notes…

First step: List the phases in order and note what each one consumes as its input.

Full step-by-step solution

Loading…

Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.

More questions on Lexical analysis, parsing and syntax-directed translation

Every PYQ on this topic →

Share this question

WhatsAppDownload image

Source: official GATE 2017 Session 2 CS question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key