TAL Programmer's Guide

Compiling With Source Directives
Compiling Programs
14–10 096254 Tandem Computers Incorporated
Compiling With
SOURCE Directives
You can specify a SOURCE directive in a source file to read in source code from other
source files. In the SOURCE directive, specify the source file name, followed by an
optional list of one or more section names enclosed in parentheses. If you omit the list
of section names, the compiler reads in the entire file.
Section Names If you specify SOURCE with no section names, the compiler processes the specified
source file until an end of file occurs. The compiler treats any SECTION directives in
the source file as comments.
If you specify SOURCE with section names, the compiler processes the source file until
it reads all the specified sections. A section begins with a SECTION directive and ends
with another SECTION directive or the end of the file, whichever comes first.
The compiler reads the sections in order of appearance in the source file, not in the
order specified in the SOURCE directive. If you want the compiler to read sections in
a particular order, use a separate SOURCE directive for each section and place the
SOURCE directives in the desired order.
Nesting Levels You can nest SOURCE directives to a maximum of seven levels, not counting the
original outermost source file. For example, the deepest nesting allowed is as follows:
1. The MAIN file F sources in file F1.
2. File F1 sources in file F2.
3. File F2 sources in file F3.
4. File F3 sources in file F4.
5. File F4 sources in file F5.
6. File F5 sources in file F6.
7. File F6 sources in file F7.
Effect of Other Directives If LIST and NOSUPPRESS are in effect after a SOURCE directive completes execution,
the compiler prints a line identifying the source file to which it reverts and begins
reading at the line following the SOURCE directive.
You can precede SOURCE with NOLIST to suppress the listings of procedures to be
read in. Place NOLIST and SOURCE on the same line, because the line containing
NOLIST is not suppressed:
?PUSHLIST, NOLIST, SOURCE $src.current.routines
!Suppress listings; read in external declarations of routines
?POPLIST
If USEGLOBALS is in effect, the compiler ignores all SOURCE directives until it
encounters BEGINCOMPILATION. For more information on how these directives
interact, see “Compiling With Saved Global Data” later in this section.