Match the following: (P) Lexical analysis (i) Leftmost derivation (Q) Top down…
2016
Match the following:
(P) Lexical analysis | (i) Leftmost derivation |
(Q) Top down parsing | (ii) Type checking |
(R)Semantic analysis | (iii) Regular expressions |
(S) Runtime environments | (iv) Activation records |
- A.
P ↔ i, Q ↔ ii, R ↔ iv, S ↔ iii
- B.
P ↔ iii, Q ↔ i, R ↔ ii, S ↔ iv
- C.
P ↔ ii, Q ↔ iii, R ↔ i, S ↔ iv
- D.
P ↔ iv, Q ↔ i, R ↔ ii, S ↔ iii
Attempted by 155 students.
Show answer & explanation
Correct answer: B
Key matching:
Lexical analysis → Regular expressions. Lexical analyzers use regular expressions (and finite automata) to recognize tokens.
Top-down parsing → Leftmost derivation. Top-down parsers expand the leftmost nonterminal first, producing a leftmost derivation of the input.
Semantic analysis → Type checking. Semantic analysis checks types, scopes, and other meaning-related properties.
Runtime environments → Activation records. Runtime environments use activation records (stack frames) to manage procedure calls, local variables, and return addresses.
So the correct matching is: P ↔ iii, Q ↔ i, R ↔ ii, S ↔ iv.
A video solution is available for this question — log in and enroll to watch it.