Was this helpful?
Generating an Executable Program
Once you have written your EQUEL program, it must be preprocessed to convert the EQUEL statements into Ada code. This section describes the use of the EQUEL preprocessor. Additionally, it describes how to compile and link the resulting code.
The EQUEL Preprocessor Command
The Ada preprocessor is invoked by the following command line:
eqa {flags} {filename}
where flags are
-d
Adds debugging information to the runtime database error messages generated by EQUEL. The source file name, line number, and the erroneous statement itself are printed along with the error message.
-f[filename]
Writes preprocessor output to the named file. If the -f flag is specified without a filename, the output is sent to standard output, one screen at a time. If the -f flag is omitted, output is given the basename of the input file, suffixed ".ada".
-l
Writes preprocessor error messages to the preprocessor's listing file, as well as to the terminal. The listing file includes preprocessor error messages and your source text in a file named filename.lis, where filename is the name of the input file.
-lo
Like -l, but the generated Ada code also appears in the listing file
-n. ext
Specifies the extension used for filenames in ## include and ## include inline statements in the source code. If -n is omitted, include filenames in the source code must be given the extension ".qa".
-s
Reads input from standard input and generates Ada code to standard output. This is useful for testing statements you are not familiar with. If the -l option is specified with this flag, the listing file is called "stdin.lis." To terminate the interactive session, type Ctrl Z.
-w
Prints warning messages
-?
Shows what command line options are available for eqa
The EQUEL/Ada preprocessor assumes that input files are named with the extension ".qa". This default can be overridden by specifying the file extension of the input file(s) on the command line. The output of the preprocessor is a file of generated Ada statements with the same name and the extension ".ada".
If you enter the command without specifying any flags or a filename, Ingres displays a list of flags available for the command.
The following table presents the options available with eqa.
Eqa Command Examples
The following are eqa command examples.
eqa file1
Preprocesses "file1.qa" to "file1.ada"
eqa -l file2.xa
Preprocesses "file2.xa" to "file3.ada" and creates listing "file3.lis"
eqa -s
Accepts input from standard input and writes generated code to standard output
eqa -ffile4.out file4
Preprocesses "file4.qa" to "file4.out"
eqa
Displays a list of flags available for this command
The ACS Environment and the Ada Compiler
The EQUEL/Ada preprocessor generates Ada code that you compile into your program library. You should use the VMS ada command to compile this code into your Ada program library.
The following sections describe the Ada program library and EQUEL programs.
Note:  Check the Readme file for any operating system specific information on compiling and linking EQUEL/Ada programs.
Entering EQUEL Package Specifications
Once you have set up an Ada program library, you must add two EQUEL units to your library. The units are package specifications that describe to the Ada compiler all the calls that the preprocessor generates. The source for both these units is in the file:
ii_system:[ingres.files]eqdef.ada
After you have defined your current program library by means of the acs set library command, you should enter the two units into your program library by issuing the following commands:
$ copy ii_system:[ingres.files]eqdef.ada []
$ ada eqdef.ada
$ delete eqdef.ada
The last step is not needed if you intend to compile the closure of a particular program from the source files at a later date. However, you should not modify the file if it is left in your directory.
The two EQUEL units need only be entered once into your program library. Of course, if a new release of EQUEL/Ada includes modifications to the file "eqdef.ada," the file should be copied and recompiled.
By issuing the following command, you will find the two new unit names "EQUEL" and "EQUEL_FORMS" in the library.
$ acs dir equel*
Defining Long Floating-point Storage
The storage representation format of long floating-point variables must be d_float. (For information, see Ada Variables and Data Types. This is because the EQUEL runtime system uses that format for floating-point conversions. If your EQUEL program has long_float variables that interact with the EQUEL runtime system, you must make sure they are stored in the d_float format. The default Ada format is g_float. A convenient way to control the format of all long float variables is to issue the acs set pragma program command. For example, by issuing the following command you redefine the program library characteristics for long_float from the default to d_float:
$ acs set pragma/long_float=d_float
A second remedy to this particular problem is to issue the statement:
pragma long_float(d_float)
in the source file of each compilation unit that uses floating-point variables. You may also explicitly declare the EQUEL variables with type d_float, as defined in package SYSTEM.
The following example is a typical command file that sets up a new Ada program library with the EQUEL package specifications and the d_float numerical format. The name of the new program library is passed in as a parameter:
$ acs create library [.'p1']
$ acs set library [.'p1']
$ acs set pragma/long_float=d_float
$ copy ii_system:[ingres.files]eqdef.ada []
$ ada eqdef.ada
$ delete eqdef.ada.
$ exit
The Ada Compiler
Once you have entered the EQUEL packages into the Ada program library, you can compile the Ada file generated by the preprocessor. The following example preprocesses and compiles the file "test1." Note that both the EQUEL/Ada preprocessor and the Ada compiler assume the default extensions:
$ eqa test1
$ ada/list test1
Linking an EQUEL Program
EQUEL programs require procedures from several VMS shared libraries in order to run properly. Once you have preprocessed and compiled an EQUEL program, you can link it. Assuming your program unit is called "dbentry," use the following link command:
$ acs link dbentry,-
 ii_system:[ingres.files]equel/opt
It is recommended that you do not explicitly link in the libraries referenced in the EQUEL.OPT file. The members of these libraries change with different releases of Ingres. Consequently, you may be required to change your link command files in order to link your EQUEL programs.
Assembling and Linking Precompiled Forms
The technique of declaring a pre-compiled form to the FRS is discussed in the QUEL Reference Guide. To use such a form in your program, you must also follow the steps described here.
In VIFRED, you can select a menu item to compile a form. When you do this, VIFRED creates a file in your directory describing the form in the VAX-11 MACRO language. VIFRED lets you select the name for the file. Once you have created the MACRO file this way, you can assemble it into linkable object code with the VMS command:
macro filename
The output of this command is a file with the extension ".obj". You then link this object file with your program (in this case named "formentry") by listing it in the link command, as in the following example:
$ acs link formentry,-
 empform.obj,-
 ii_system:[ingres.files]equel/opt
Linking an EQUEL Program without Shared Libraries
While the use of shared libraries in linking EQUEL programs is recommended for optimal performance and ease of maintenance, non-shared versions of the libraries have been included in case you require them. Non-shared libraries required by EQUEL are listed in the equel.noshare options file. The options file must be included in your link command after all user modules. The libraries must be specified in the order given in the options file.
The following example demonstrates the link command of an EQUEL program unit called "dbentry" that has been preprocessed and compiled:
$ acs link dbentry,-
 ii_system:[ingres.files]equel.noshare/opt
Last modified date: 06/10/2024