Note: The Integrated Preprocessor is supported for native COBOL only.
A sample integrated stackable preprocessor application, is available in the Visual COBOL Samples Browser under
COBOL > Preprocessor. For instructions on how to start the Visual COBOL Samples Browser, see
To start the Samples Browser; then follow the instructions in the sample readme to build and debug the preprocessor.
The example preprocessor can be used as a basis for other preprocessors, and demonstrates the following:
- How the preprocessor is invoked and opens source input
- How source is passed without editing to the Compiler
- How source is edited and then passed to the Compiler
- How COPY statements are processed
- How warnings and errors are produced
- How preprocessors are stacked, in this case with CP. (CP can be used to handle COPY REPLACING and other complex parsing).
Specification of the Example Preprocessors
The example preprocessor recognizes and processes several verbs as follows:
- MOV is converted to MOVE
- DIS is converted to two lines, the first being a DISPLAY of a blank line and the second containing the original line with the word DIS replaced by DISPLAY
- RETRIEVE is converted to COPY, and is expanded by the preprocessor