The GATE Grind

GATE 2016 CS (CS2) – Question 29

Compiler Design · Lexical Analysis · 1 mark · Multiple choice

Match P: lexical analysis; Q: top-down parsing; R: semantic analysis; S: runtime environments, with (i) leftmost derivation, (ii) type checking, (iii) regular expressions, (iv) activation records.

  1. P–i, Q–ii, R–iv, S–iii
  2. P–iii, Q–i, R–ii, S–iv
  3. P–ii, Q–iii, R–i, S–iv
  4. P–iv, Q–i, R–ii, S–iii

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (B) P–iii, Q–i, R–ii, S–iv

Explanation

Lexical analysis recognizes tokens using regular expressions, P–iii. Top-down parsing constructs leftmost derivations, Q–i. Semantic analysis performs type checking, R–ii. Runtime procedure environments use activation records, S–iv. Therefore B.

More Lexical Analysis questions

All Lexical Analysis questions →