Appendix E. Information for Preprocessor Providers
An RPG preprocessor which merges the main source and the copy files into a new source member must observe the following rules related to code containing the special directive **FREE.
Special directive **END-FREE is available for use by preprocessors to indicate the end of fully-free code in a preprocessed source member which merges the main source file and the copy files into a single source file.
- If the preprocessor is merging copy files into the preprocessed output:
- The preprocessor must insert **END-FREE into the preprocessor output at the end of the copy file, if the copy file was in fully free-form mode and the file containing the /COPY or /INCLUDE directive was not in fully free-form mode.
- The preprocessor may insert additional **FREE and **END-FREE lines if it is convenient, provided that **FREE is only inserted when the preprocessed code is in column-limited source mode, and that **END-FREE is only inserted when the preprocessed code is in fully free-form source mode.
- The preprocessor must insert **FREE into the preprocessor output at the end of the copy file, if the copy file was not in fully free-form mode and the file containing the /COPY or /INCLUDE directive was in fully free-form mode.
- The remainder of inserted lines containing **FREE or **END-FREE must be blank.
- The **FREE and **END-FREE special directives must be balanced in the output source, except that it is not necessary for the source to end with **END-FREE if the source ends in full-free mode.
- When to accept a special directive:
- **FREE and **END-FREE may only be coded between statements.
- **FREE cannot be specified when the source is in full free-form mode.
- **END-FREE cannot be specified when the source is in column-limited mode.
- **FREE can only be specified in the first line of a copy file.
- **END-FREE cannot be specified in a copy file.
- If the special directive is not accepted, and the preprocessor chooses to continue preprocessing, the preprocessor must not copy the invalid special directive to the output of the preprocessor.