Creating Macro Libraries

Macros may appear inline with the text of a circuit, or they may be placed in macro libraries, and accessed automatically. A macro library is a directory whose files contain macro definitions. Each macro must be a separate file, and the file name must exactly match the name of the macro. A macro may be given more than one name by using the UNIX "ln" command to link macro names.

A macro library is often used to define a coordinated set of macros for a particular application. When this is done, it is sometimes necessary to have special initialization and termination macros. One way to use such macros is to force all users to place the initialization and termination macros at appropriate points in the text of their circuits. Another way is to explicitly define initialization and termination macros in the library. The initialization macro must be named "$START" and the termination macro must be named "$END". If an initialization macro is defined, it will be invoked before the first statement of the user's circuit is interpreted. If a termination macro is defined it will be invoked after the last statement of the user's circuit is interpreted.

Several macro libraries may be used in a single run. It is permissible for the same macro-name to appear in several libraries. In this case the form of the UNIX command that invokes the preprocessor determines which library to use for a particular macro. See section 18 for details.