Match all items in Group 1 with correct options from those given in Group 2.…

2009

Match all items in Group 1 with correct options from those given in Group 2.

Group 1 Group 2

P. Regular expression 1. Syntax analysis

Q. Pushdown automata 2. Code generation

R. Dataflow analysis 3. Lexical analysis

S. Register allocation 4. Code optimization

  1. A.

    P-4. Q-1, R-2, S-3

  2. B.

    P-3, Q-1, R-4, S-2

  3. C.

    P-3, Q-4, R-1, S-2

  4. D.

    P-2, Q-1, R-4, S-3

Attempted by 181 students.

Show answer & explanation

Correct answer: B

Correct matching: Regular expression → Lexical analysis (3); Pushdown automata → Syntax analysis (1); Dataflow analysis → Code optimization (4); Register allocation → Code generation (2).

  • Regular expression → Lexical analysis (3): Regular expressions specify token patterns used by the lexer to perform tokenization.

  • Pushdown automata → Syntax analysis (1): Pushdown automata recognize context-free languages, which underlie parser behavior in syntax analysis.

  • Dataflow analysis → Code optimization (4): Dataflow analysis is used by optimization passes to determine variable liveness, reachability, and other properties that enable safe optimizations.

  • Register allocation → Code generation (2): Register allocation assigns variables to machine registers and is performed during the back-end/code-generation phase.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir