Project ForgeSign up free
Compiler Design
Lexical Analysis & Parsing
GATE 2017
Medium

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

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

  • AP→(ii), Q→(iii), R→(iv), S→(i)
  • BP→(ii), Q→(i), R→(iii), S→(iv)
  • P→(iii), Q→(iv), R→(i), S→(ii)
  • DP→(i), Q→(iv), R→(ii), S→(iii)

Explanation

Compiler pipeline: character stream → lexical analyzer → token stream → syntax analyzer → syntax tree → semantic analyzer → intermediate representation → code generator. So the syntax tree is processed by the semantic analyzer (P→iii), the character stream by the lexical analyzer (Q→iv), the intermediate representation by the code generator (R→i), and the token stream by the syntax analyzer (S→ii).

Source: GATE CS 2017 (Session 2) (2017)

This question is part of a 15-day revision cycle — sign in and Project Forge will bring it back the day before you'd forget it.

Start revising free