Preprocessor Programming Language [ HP COBOL II/XL Reference Manual ] MPE/iX 5.0 Documentation
HP COBOL II/XL Reference Manual
Preprocessor Programming Language
The preprocessor programming language is a simple language consisting of
variables and commands. All of the preprocesses are performed at
compile-time. None is performed at run-time.
Table B-1 lists all of the preprocessor commands. They are described
in the remainder of this appendix.
Table B-1. Preprocessor Commands
---------------------------------------------------------------------------
| | |
| Command | Purpose |
| | |
---------------------------------------------------------------------------
| | |
| $COMMENT | Writing comment lines. |
| | |
---------------------------------------------------------------------------
| | |
| $DEFINE | Defining and using macros. |
| $PREPROCESSOR | |
| | |
---------------------------------------------------------------------------
| | |
| $IF | Conditional compilation. |
| $SET | |
| | |
---------------------------------------------------------------------------
| | |
| $INCLUDE | File insertion, merging and editing |
| $EDIT | operations. |
| | |
---------------------------------------------------------------------------
| | |
| [REV BEG]$COPYRIGHT [REV END]ptions affecting compiler output (code and |
| $PAGE | listing). |
| $TITLE[REV BEG] | |
| $VERSION [REV END] | |
| $CONTROL | |
| | |
---------------------------------------------------------------------------
The preprocessor commands have the following format:
$commandname [parameterlist]
Parameters
commandname one of the command names shown in the list above.
parameterlist a list of parameters for a given preprocessor command.
The specific parameters (if any) allowed for a given
preprocessor command are listed later in this section
where the command is described. A list of parameters in
a command must be separated from the command by one or
more spaces, and each parameter specified must be
separated from any succeeding parameter by a comma
optionally followed or preceded by one or more spaces.
Description
The required dollar sign is used to identify a preprocessor command.
This symbol must appear in the first column of a line of source code,
immediately following the sequence number field.
The second, optional, dollar sign is used to indicate that the
preprocessor command of which it is a part is to be executed, but is not
to be copied (in a merging process) to the newfile.
Continuation Lines.
A preprocessor command can be continued to the next line by using a
continuation character as the last nonblank character in the line where
the command is. The continuation character is the ampersand (&).
A continuation character can be used anywhere in a preprocessor command
where a blank can be used and will not change the effect of the command.
Example.
The following is a valid use of the continuation character:
[REV BEG]
001000$CONTROL CROSSREF,&
002000$MAP,LIST
[REV END]
When you continue a preprocessor command to another line, the new line
must contain a single dollar sign in the first column following the
sequence number field of that line, as shown in the example above.
The effect of using a continuation character in a preprocessor command is
equivalent to replacing the continuation character and subsequent dollar
sign with a blank, and concatenating the two lines. So the example above
is equivalent to the following:
[REV BEG]
001000$CONTROL CROSSREF,MAP,LIST
[REV END]
Continuation lines of a preprocessor command are not copied to a newfile
during a merging operation if the preprocessor command begins with two
dollar signs.
Example.
The following preprocessor command is executed but neither line 003000
nor line 004000 is copied to the newfile created by the merging process.
003000$$EDIT VOID=005000, &
004000$ SEQNUM=001000
$COMMENT Command
The $COMMENT command has the following format:
$COMMENT [ comment-text ]
where comment-text is a string containing anything you want to enter.
comment-text requires no delimiters. It ends at the end of the line
where the $COMMENT command is issued unless a continuation character is
used. Use of COBOL comments, "*", is preferred.
The example below illustrates the $COMMENT command:
000100$COMMENT THIS LINE IS AN EXAMPLE OF THE $COMMENT PRE- &
000200$ PROCESSOR COMMAND.
MPE/iX 5.0 Documentation