Was this helpful?
Generating an Executable Program
Once you have written your EQUEL program, the preprocessor must convert the EQUEL statements into C code. This section describes the use of the EQUEL preprocessor. Additionally, it describes how to compile and link the resulting code to obtain an executable file.
The EQUEL Preprocessor Command
The following command line invokes the C preprocessor:
eqc {flags} {filename}
flags
Specifies one or more of the following flags:
-d
Adds debugging information to the runtime database error messages EQUEL generates. The source file name, line number, and the erroneous statement itself are printed 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 ".c".
-iN
Sets integer size to N bytes. N is 1, 2, or 4. The default is 4.
-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 C 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 ".qc".
-o
Directs the preprocessor not to generate output files for include files.
This flag does not affect the translated include statements in the main program. The preprocessor generates a default extension for the translated include file statements unless you use the -o.ext flag.
-o. ext
Specifies the extension the preprocessor gives to both the translated include statements in the main program and the generated output files. If this flag is not provided, the default extension is "c." If you use this flag in combination with the -o flag, then the preprocessor generates the specified extension for the translated include statements, but does not generate new output files for the include statements.
-s
Reads input from standard input and generates C 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 Control-D for Linux.
-w
Prints warning messages
-#|-p
Generates # line directives to the C compiler (by default, they are in comments). This flag can prove helpful when debugging the error messages from the C compiler.
-?
Shows the available command line options for eqc
The EQUEL/C preprocessor assumes that input files are named with the extension ".qc". You can override this default by specifying the file extension of the input file(s) on the command line. The output of the preprocessor is a file of generated C statements with the same name and the extension ".c".
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 for eqc.
Eqc Command Examples
eqc file1
Preprocesses "file1.qc" to "file1.c"
eqc -l file2.xc
Preprocesses "file2.xc" to "file2.c" and creates listing "file2.lis"
eqc -s
Accepts input from standard input and writes generated code to standard output
eqc -ffile3.out file3
Preprocesses "file3.qc" to "file3.out"
eqc
Displays a list of flags available for this command
The C Compiler
Linux: The preprocessor generates C code. You can use the Linux cc command to compile this code. All the cc command line options can be used.
The following example preprocesses and compiles the file "test1".
eqc test1.qc
cc -c test1.c  
Note:  Check the Readme file for any operating system specific information on compiling and linking EQUEL/C programs.
Last modified date: 08/14/2024