GATE / CS ARCHIVE

GATE CSE 1995 / QUESTION 1.11

Macro definition parameters

Compiler Design · Compiler Phases, Linking & Loading · Full GATE CSE 1995 paper

GATE 1995, Q1.11 1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Compiler Phases, Linking & Loading

Question 1.11, GATE 1995: In macro Add x,y with body Load y; Mul x; Store y, are x,y variables, identifiers, actual parameters or formal parameters?
Tap to enlarge
Your answer
Answer & solution

Answer: D: formal parameters (no official key was published)

The names x and y appear in the macro definition and stand for values or text supplied by each invocation. They are therefore formal parameters. An invocation such as Add A,B supplies actual parameters A and B, which replace the corresponding formals during expansion. Although formal names are also identifiers in a broad lexical sense, “formal parameters” is the specific role asked here. They need not denote runtime storage variables of the expanded program.

Original paper, page 2