9–1 9–2
Design of a simple macro processor: • Modifications to improve efficiency of macro
expansion: To be discussed in class.
Assumptions:
Carrying out expansion (Step 2.2(a)):
(a) All macro definitions appear at the
beginning. • See Handout 9.2.
(b) The body of a macro does not contain an- Extending the simple design:
other macro definition or call.
I. Handling use-before-definition:
High-level Outline: See Handout 9.2.
Notes regarding the outline: • Definitions and call may occur in any order.
• Step 1: Need to choose a data structure. • Assume no nested definitions or nested calls.
9–5 9–6