Macros and Macro Processors
A Macro is a unit of specification for program generation through expansion (like a function). Macro consists of a name, a set of formal parameters and a body of code. When a macro is called the using the macro name with the set of actual parameters then the name with the parameters is replaced by the code generated from its body. This process is called macro expansion. Two types of Macro Expansion 1. Lexical expansion. 2. Semantic expansion. Lexical Expansion It is the process of replacing one character string with another character string during program generation.( actual parameters in place of formal parameters). Semantic Expansion In simple words, semantic expansion implies generation of instructions tailored to the requirements of a specific usage. Macro Definition and Call A macro definition starts with a reserved keyword MACRO and ends with a keyword MEND. The statements enclosed in between these keywords include macro definition and its body.