GATE 2017 CS (CS2) – Question 15
Match compiler inputs P: syntax tree, Q: character stream, R: intermediate representation, S: token stream, to phases (i) code generator, (ii) syntax analyzer, (iii) semantic analyzer, (iv) lexical analyzer.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (C) P–iii,Q–iv,R–i,S–ii
Explanation
Semantic analysis checks the syntax tree, P–iii. Lexical analysis consumes characters, Q–iv. Code generation consumes an intermediate representation, R–i. Syntax analysis consumes tokens, S–ii. The resulting mapping is C.