Figure 4.5 Macro Call Entering Word Queue
The macro processor recognizes a macro call and begins to execute macro APP, as
follows:
1. The macro processor creates a local symbol table for the macro. The macro
processor examines the previously compiled definition of the macro. If there are any
parameters, variable declarations, or computed GOTO statements in the macro
definition, the macro processor adds entries for the parameters and variables to the
newly created local symbol table.
2. The macro processor further examines the previously compiled macro definition for
parameters to the macro. If no parameters were defined in the macro definition, the
macro processor begins to execute the compiled instructions of the macro. If any
parameters were contained in the definition, the macro processor removes tokens
from the input stack to obtain values for positional parameters and non-default
values for keyword parameters. The values for parameters found in the input stack
are placed in the appropriate entry in the local symbol table.
Note: Before executing any compiled instructions, the macro processor removes
only enough tokens from the input stack to ensure that any tokens that are
supplied by the user and pertain to the macro call have been removed.
3. The macro processor encounters the compiled %IF instruction and recognizes that
the next item will be text containing a condition.
4. The macro processor places the text &sysday=Friday on the input stack ahead of
the remaining text in the program. (See the following figure). The macro processor
waits for the word scanner to tokenize the generated text.
How the Macro Processor Executes a Compiled Macro 43