The translator which performs macro calls expansion is called :

2015

The translator which performs macro calls expansion is called :

  1. A.

    Macro processor

  2. B.

    Micro pre-processor

  3. C.

    Macro pre-processor

  4. D.

    Dynamic linker

Attempted by 424 students.

Show answer & explanation

Correct answer: C

Answer: Macro pre-processor

Explanation:

  • A macro pre-processor performs macro call expansion as a preprocessing step before compilation. It replaces macro invocations with their corresponding definitions (textual substitution).

  • The output of the macro pre-processor is source text with macros expanded; that output is then passed to the compiler.

  • Example: if a macro defines PI as 3.14, any occurrence of PI is replaced with 3.14 by the pre-processor before compilation.

Why the other choices are incorrect:

  • "Macro processor": This is an informal term and can be ambiguous. The standard and precise term for the translator that expands macros before compilation is macro pre-processor.

  • "Micro pre-processor": Not a recognized standard term in compiler design; likely a confusion with other terms.

  • Dynamic linker: Operates at link/load time to resolve symbols and link modules or libraries, not at the preprocessing stage for macro expansion.

Takeaway: The component responsible for expanding macros before compilation is the macro pre-processor.

Explore the full course: Mppsc Assistant Professor