Note: The Integrated Preprocessor is supported for native COBOL only.
An example integrated stackable preprocessor is available in Samples Browser - click
Start > All Programs > Micro Focus Visual COBOL > Samples and open the
Preprocessor sample. 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