Rational Developer for System z

Preprocessor overview

A preprocessor transforms preprocessor statements into language syntax before a program is compiled. A preprocessor can reside on the local computer or remotely on a host computer. A property group is used to define a preprocessor and associate it with a file.

During compile time, the associated preprocessor is invoked to transform the preprocessor statement into code. You can also specify to invoke the preprocessor during editing of a file, to help identify coding issues before compiling. Use the Preprocessor Integration preference for the editor to trigger running the preprocessor during edit.

The Editor Configuration page contains the following properties are used to define the location of the preprocessor and configure a remote preprocessor.
Use local preprocessors
The preprocessor is located on the local computer.
Use remote preprocessors
The preprocessor is located on a remote computer.
If remote preprocessor is selected, there are several properties that must be defined to configure the preprocessor, such as:
Note: In the PL/I Editor, after local preprocessors are invoked, the PL/I macro preprocessor is invoked if either the MACRO or PP compiler option is specified. These options can be specified in the property group or PROCESS statement in the program.

Limitations

There are several limitations associated with using a preprocessor within the editor:
  • Not all preprocessor statements within an EXEC block might be identified
  • Real-time syntax checking programs that contain preprocessor statements which contain only the beginning or ending of a language comment
  • All preprocessor statements might not be identified if the code is reorganized
  • Preprocessor statements that modify text in another location of a program might not be identified

Considerations

The Preprocessor Integration preferences can be configured to ignore certain text changes made by your preprocessors. You might need to toggle these settings, so that format changes done by the preprocessor are not interpreted as language syntax statements generated by the preprocessor.

The COBOL Editor and the PL/I Editor provide highlighting of the generated preprocessor code, allowing you to see the preprocessor generated code. The default annotation is a vertical blue line at the left side of the editor. This information assists in determining the optimal preference setting for your environment. The LPEX Editor does not identify preprocessor generated code.

To make preprocessor generated statements easier to identify, use the Syntax Coloring to set annotations to another setting such as bold. Or, set the Annotations preference for the text editor being used or turn on Show in Overview Ruler preference.


Feedback