GATE CS 2017, set 2 · Question 5 · Compiler Design · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer

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
  1. (A) P → (ii), Q → (iii), R → (iv), S → (i)
  2. (B) P → (ii), Q → (i), R → (iii), S → (iv)
  3. (C) P → (iii), Q → (iv), R → (i), S → (ii)
  4. (D) P → (i), Q → (iv), R → (ii), S → (iii)
Answer

Answer (C)

Answer from the official GATE CS 2017 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes