Match the following:
(P) Lexical analysis (i) Leftmost derivation
(Q) Top-down parsing (ii) Type checking
(R) Semantic analysis (iii) Regular expressions
(S) Activation records (iv) Runtime administration
A. P -> iii, Q -> i, R -> ii, S -> iv
B. P -> ii, Q -> i, R -> iii, S -> iv
C. P -> iii, Q -> ii, R -> i, S -> iv
D. P -> iii, Q -> i, R -> iv, S -> ii
Answer: P -> iii, Q -> i, R -> ii, S -> iv => Option A.
Lexical analysis uses regular expressions: Lexical analyzers are specified using regular expressions, then compiled to DFAs. P matches (iii).
Top-down parsing produces leftmost derivation: By definition, top-down parsers expand the leftmost non-terminal, so they produce a leftmost derivation. Q matches (i).
Semantic analysis performs type checking: Semantic analysis goes beyond syntax to check type compatibility, scope, and other semantic rules. R matches (ii).
Activation records are runtime administration: Activation records are a runtime mechanism (not a compile-time phase). Managing them is runtime administration. S matches (iv).