Overview [ Micro Focus COBOL System Reference, Volume 1 ] MPE/iX 5.0 Documentation
Micro Focus COBOL System Reference, Volume 1
Overview
Language preprocessors exist in order to simplify source code. They
convert non-COBOL code within a COBOL program into standard COBOL
allowing the programmer to work more productively. Some commercially
available language preprocessors, such as CICS and SQL, simplify the
coding for accessing resources within programs. There are also many
other preprocessors that are specific to certain data processing
operations and are not generally available.
Such preprocessors are usually invoked as a separate operation from the
compiling phase of the development cycle (and are often known as
"precompilers"). This means not only an extra step in the development
cycle, but also that any debugging tools which rely on the source code
will display the changed source code to the programmer - not the code as
written. This will again lengthen the development cycle.
The Integrated Preprocessor Interface does not have these disadvantages;
the preprocessing phase is so closely integrated with the compiling phase
that it becomes almost invisible. This means that:
* listings contain only original source code
* Animator operates on the original source code
* in add-on products containing the COBOL Editor, errors identified
by the preprocessor can cause a return to the Editor with a
preprocessor-generated error message.
This chapter explains how to write an integrated preprocessor. You
should read it if you are creating a preprocessor for the first time or
if you are migrating a preprocessor from another environment.
Limitations
The close integration of the preprocessor with the Compiler enables
changed source code to be hidden from the user. This can be a
disadvantage in instances where components rely on a strict relationship
between the intermediate code created by the Compiler and the COBOL
statements in the source file, because such components will not always
operate as documented when an integrated preprocessor is used. For
example, if you use the XREF Compiler directive,
the cross reference listing will be inaccurate since cross reference
information for code inserted by the preprocessor will not be shown even
if the original source line referenced the same data items.
MPE/iX 5.0 Documentation