Using the parse macro instruction to define command syntax
A Command Processor that uses the Parse Service Routine must build a parameter control list (PCL) to define the syntax of acceptable command or subcommand operands. Each acceptable operand is described by a parameter control entry (PCE) within the PCL. The Parse Service Routine compares the operands within the command buffer against the PCL to determine if valid command or subcommand operands have been entered.
The command processor builds the PCL, and the PCEs within it, using the parse macro instructions. These macro instructions generate the PCL and establish symbolic references for the parameter descriptor list (PDL). The Parse Service Routine returns the PDL to the command processor to describe the results of comparing the operands in the command buffer with the PCL. The PDL is composed of separate entries (PDEs) for each of the command operands found in the command buffer.
Table 1 describes the functions of each of the parse macro instructions.
| Macro instruction | Function |
|---|---|
| IKJPARM | Begins the PCL and establishes a symbolic reference for the PDL. |
| IKJPOSIT | Builds a PCE to describe a positional operand that contains delimiters, but not including positional operands described by IKJTERM, IKJOPER, IKJIDENT or IKJRSVWD. |
| IKJTERM | Builds a PCE for a positional operand that can be a constant, statement number or variable. |
| IKJOPER | Builds a PCE that describes an expression. |
| IKJRSVWD | Builds a PCE to describe a reserved word operand. It can also be used with IKJTERM to describe a reserved word constant, or with IKJOPER to describe the operator portion of an expression. |
| IKJIDENT | Builds a PCE that describes a positional operand that does not depend upon a particular delimiter. |
| IKJKEYWD | Builds a PCE that describes a keyword operand. |
| IKJNAME | Builds a PCE that describes the possible names that can be entered for a keyword or reserved word operand. |
| IKJSUBF | Builds a PCE that indicates the beginning of a keyword subfield description. |
| IKJUNFLD | Builds a PCE to indicate that unidentified keyword operands can be encountered and specifies the address of a verify exit routine to be given control. |
| IKJENDP | Indicates the end of the PCL. |
| IKJRLSA | Releases any virtual storage allocated by the parse service routine for the PDL that remains after parse returns control to its caller. |
- The IKJPOSIT, IKJTERM, IKJOPER, IKJRSVWD, IKJIDENT, IKJKEYWD, IKJNAME, and IKJSUBF macro instructions describe the positional and keyword operands valid for the command processor. The command processor uses the label fields of these macro instructions to reference fields within the DSECT that maps the PDL returned by the Parse Service Routine.
The macros that generate input to parse can be issued by a program that is loaded above 16 MB in virtual storage. The IKJRLSA macro can be issued in either 24-or 31-bit addressing mode. If the PCL resides above 16 MB in virtual storage, you should not attempt to update it in a validity checking routine after the PCL has been passed to parse. However, if the PCL resides below 16 MB, you can update the PCL in a validity checking routine after passing it to parse.