TAL Programmer's Guide
3 Structuring Programs
096254 Tandem Computers Incorporated 3–1
This section describes how you can structure and format a TAL source program. The
structure is the order and level at which major components appear in a program. The
format is the spacing and alignment you use to make the program readable.
Source Files A program consists of one or more source files. A source file can be a complete
program or a part of a modular program. In modular programming, for instance, you
can:
Divide a large program into smaller, more manageable source files
Work independently on a source file while other programmers work on other
source files
Compile and debug each source file separately.
Bind new object code to existing debugged object code, including general-purpose
library routines
Use other languages, such as C or COBOL, for some of the source files
Group procedures into source files by the kinds of tasks the procedures perform;
for example, a source file can provide input/output (I/O) processing and another
can provide error processing
Compilation Units The input to the compiler is a single source file. The source file, however, can contain
SOURCE directives that read in code from other source files. The source file together
with code from other source files that are read in by SOURCE directives compose a
compilation unit.
When you compile a compilation unit, the output is an object file that you can bind
with other object files into a new object file, as described in the Binder Manual.
Structuring
Compilation Units
The structure of a compilation unit is the order and level at which major components
appear. Figure 3-1 shows the structure of a sample compilation unit.
Not all of the components shown in the figure need to appear in a compilation unit.
For example, if your compilation unit is a complete program, instead of a part of a
modular program, the NAME declaration need not appear.