This document discusses the ELENA macro processor. It explains that ELENA was developed as a research tool, not a commercial product, but its design and implementation techniques could be used to develop other general-purpose macro processors. It provides details on how macro definitions are composed of a header and body in ELENA, with parameters identified by % characters. Macro expansion can include unique labels, macro-time variables, instructions, and conditional statements like IF. Examples are given of macro headers and how they could be invoked.
2. macro processor
A general-purpose macro processor or
general purpose preprocessor is a macro processor
that is not tied to or integrated with a particular language
or piece of software.
A macro processor is a program that copies a stream of
text from one place to another, making a systematic set
of replacements as it does so.
Macro processors are often embedded in other
programs, such as assemblers and compilers.
Sometimes they are standalone programs that can be
used to process any kind of text.
3. THE ELENA MACRO PROCESSOR
ELENA was developed as a researched tool, not as a
commercial software product.
However the same design and implementation
techniques could be used in developing other general-
purpose macro processors.
Further information about ELENA can be found in
Barcucci and Pelacani(1984).
4. The ELENA Macro Processor
Macro definitions in ELENA are composed of a header
and a body
The header consists of keywords and parameter
markers, which are identified by the character %
At least one of the first two token s in a macro header
must be a keyword, not a parameter marker
The macro processor appends a numeric value to create
unique labels
ELENA provides macro-time variables and macro-time
instructions that can be used to control the macro
expansion
The IF statement is a macro-time conditional “go to”
statement
The macro is identified by the sequence of keywords that
appear in its header
5. For example, a macro with the header
%1 = %2 + %3
Could be invoked as
ALPHA = BETA + GAMMA
and a macro with header
ADD %1 TO THE VALUE OF %2
could be invoked as
ADD 10 TO THE VALUE OF INDEX