Explanation
The correct matches between Group 1 and Group 2 are as follows:
P. Intermediate representation
corresponds to 2. Code generation. Intermediate representations are used in compilers as a bridge between the front-end (parsing and semantic analysis) and the back-end (code generation and optimization).
Q. Top-down parsing
corresponds to 3. Leftmost derivation. Top-down parsers construct a parse tree by starting from the root and working down to the leaves, and they typically use leftmost derivations to derive the input string.
R. Runtime environments
corresponds to 1. Activation records. Runtime environments manage the execution of a program, and activation records (or stack frames) are a key component used to store information about active procedures or functions during runtime.
S. Register Allocation
corresponds to 4. Graph colouring. Register allocation is a crucial optimization phase in compilers where program variables are assigned to physical registers. This problem is often modeled as a graph coloring problem, where nodes represent variables and edges represent interference (variables that are live at the same time), and colors represent registers.
Therefore, the correct option is (c) P-2, Q-3, R-1, S-4.