GATE 2024 CS (CS2) – Question 21
Consider two sets. Set X: P. Lexical Analyzer, Q. Syntax Analyzer, R. Intermediate Code Generator, S. Code Optimizer. Set Y: 1. Abstract Syntax Tree, 2. Token, 3. Parse Tree, 4. Constant Folding. Which one of the following options is the CORRECT match from Set X to Set Y?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (B) P – 2; Q – 3; R – 1; S – 4
Explanation
Lexer produces tokens, syntax analyzer builds the parse tree, intermediate code generation works from the abstract syntax tree, and the optimizer performs constant folding.