Including and Processing EQUEL/Ada Package Specifications
The above variant of the include statement can be used only to include package specifications. The preprocessor reads the specified file, processing all variables declared in the package, and generates the Ada with and use clauses using the last component of the file name (excluding the file extension) as the package name. If the last component of the file name has a trailing underscore, as is the standard in VAX/VMS Ada package specification files, then that trailing underscore is removed in the generated context clauses. The preprocessor does not generate an output file because it is assumed that the package specification has already been compiled.
The following example demonstrates this variant of the include statement. Assume that the specification of package "employee" is in file "employee_.qa" and that a procedure "empentry" is in file "empentry.qa".
Contents of "employee_.qa":
## package employee is
## ename: String(1..20);
## eage: Integer;
## esalary: Float;
## end employee;
Contents of "empentry.qa":
## include "[joe.ada.empfiles]employee_.qa"
## procedure empentry is
## begin
-- Statements using variables in package "employee"
## end empentry;
The EQUEL/Ada preprocessor modifies the include line to the Ada with and use clauses by extracting the last component of the file name:
with employee;
use employee;
The above two clauses appear in the output file "empentry.ada." The preprocessor does not generate an output file for "employee_.qa," and the package "employee" must have already been compiled in order to compile the "empentry.ada" file.
Assuming that the files "employee_.qa" and "empentry.qa" appear as shown above, the following sequence of VMS commands should be executed in order to compile "empentry.ada":
$ eqa employee_.qa
$ eqa empentry.qa
$ ada employee_.ada
$ ada empentry.ada
You must still follow the Ada rules specifying the order of compilation. The EQUEL preprocessor does not affect these compilation rules.