Syntax diagrams are used to illustrate the format of statements and some basic language elements. Read syntax diagrams from left to right and top to bottom.
The following terminology, symbols, and concepts are used in syntax diagrams:
|
, |
comma |
> |
greater than symbol |
|
. |
period |
<- |
less than symbol |
|
( |
open parenthesis |
= |
equal sign |
|
) |
close parenthesis |
¬ |
not sign |
|
+ |
addition |
- |
subtraction |
|
* |
multiplication |
/ |
division |
The following is a diagram of a statement without parameters:
Statement Without Parameters
►►─ COMMAND ──────────────────────────────────────────────────────────────────►◄
For this statement, you must write the following:
COMMAND
Required parameters appear on the same horizontal line, the main path of the diagram, as the command or statement. The parameters must be separated by one or more blanks.
Statement with Required Parameters
►►─ COMMAND ─ PARM1 ─ PARM2 ──────────────────────────────────────────────────►◄
You must write the following:
COMMAND PARM1 PARM2
Delimiters, such as parentheses, around parameters or clauses must be included.
Delimiters Around Parameters
►►─ COMMAND ─ (PARM1) ─ PARM2='variable' ─────────────────────────────────────►◄
If the word variable is a valid entry, you must write the following:
COMMAND (PARM1) PARM2='variable'
When you see a vertical list of parameters as shown in the following example, you must choose one of the parameters. This indicates that one entry is required, and only one of the displayed parameters is allowed in the statement.
Choice of Required Parameters
►►─ COMMAND ─┬─ PARM1 ─┬──────────────────────────────────────────────────────►◄ ├─ PARM2 ─┤ └─ PARM3 ─┘
You can choose one of the parameters from the vertical list, such as in the following examples:
COMMAND PARM1 COMMAND PARM2 COMMAND PARM3
When a required parameter in a syntax diagram has a default value, the default value appears with a left-facing arrow, and it indicates the value for the parameter if the command is not specified. If you specify the command, you must code the parameter and specify one of the displayed values.
Default Value for a Required Parameter
►►─ COMMAND ─ PARM1= ─┬─ YES ◄ ─┬─ PARM2 ─────────────────────────────────────►◄ └─ NO ────┘
If you specify the command, you must write one of the following:
COMMAND PARM1=NO PARM2 COMMAND PARM1=YES PARM2
A single optional parameter appears below the horizontal line that marks the main path.
Optional Parameter
►►─ COMMAND ─┬─────────────┬──────────────────────────────────────────────────►◄ └─ PARAMETER ─┘
You can choose (or not) to use the optional parameter, as shown in the following examples:
COMMAND COMMAND PARAMETER
If you have a choice of more than one optional parameter, the parameters appear in a vertical list below the main path.
Choice of Optional Parameters
►►─ COMMAND ─┬─────────┬──────────────────────────────────────────────────────►◄ ├─ PARM1 ─┤ └─ PARM2 ─┘
You can choose any of the parameters from the vertical list, or you can write the statement without an optional parameter, such as in the following examples:
COMMAND COMMAND PARM1 COMMAND PARM2
In some statements, you can specify a single parameter more than once. A repeat symbol indicates that you can specify multiple parameters.
Repeatable Variable Parameter
┌────────────┐ ►►─ COMMAND ─▼─ variable ─┴───────────────────────────────────────────────────►◄
In the preceding diagram, the word variable is in lowercase italics, indicating that it is a value you supply, but it is also on the main path, which means that you are required to specify at least one entry. The repeat symbol indicates that you can specify a parameter more than once. Assume that you have three values named VALUEX, VALUEY, and VALUEZ for the variable. The following are some of the statements you might write:
COMMAND VALUEX COMMAND VALUEX VALUEY COMMAND VALUEX VALUEX VALUEZ
If the repeat symbol contains punctuation such as a comma, you must separate multiple parameters with the punctuation. The following diagram includes the repeat symbol, a comma, and parentheses.
Separator with Repeatable Variable and Delimiter
┌─ , ────────┐ ►►─ COMMAND ─ ( ─▼─ variable ─┴─ ) ───────────────────────────────────────────►◄
In the preceding diagram, the word variable is in lowercase italics, indicating that it is a value you supply. It is also on the main path, which means that you must specify at least one entry. The repeat symbol indicates that you can specify more than one variable and that you must separate the entries with commas. The parentheses indicate that the group of entries must be enclosed within parentheses. Assume that you have three values named VALUEA, VALUEB, and VALUEC for the variable. The following are some of the statements you can write:
COMMAND (VALUEC) COMMAND (VALUEB,VALUEC) COMMAND (VALUEB,VALUEA) COMMAND (VALUEA,VALUEB,VALUEC)
The following diagram shows a list of parameters with the repeat symbol:
Optional Repeatable Parameters
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ►►─ COMMAND ─▼─┬─────────┬─┴─▼─┬─────────┬─┴─▼─┬─────────┬─┴──────────────────►◄ └─ PARM1 ─┘ └─ PARM2 ─┘ └─ PARM3 ─┘
The following are some of the statements you can write:
COMMAND PARM1 COMMAND PARM1 PARM2 PARM3 COMMAND PARM1 PARM1 PARM3
The placement of YES in the following diagram indicates that it is the default value for the parameter. If you do not include the parameter when you write the statement, the result is the same as if you had actually specified the parameter with the default value.
Default Value for a Parameter
►►─ COMMAND ─┬──────────────────────┬─ PARM2 ─────────────────────────────────►◄ └─ PARM1= ─┬─ YES ◄ ─┬─┘ └─ NO ────┘
For this command, COMMAND PARM2 is the equivalent of COMMAND PARM1=YES PARM2.
In some syntax diagrams, a set of several parameters is represented by a single reference.
Variables Representing Several Parameters
►►─ COMMAND ─┬─────────────────────┬──────────────────────────────────────────►◄ ├─ PARM1 ─────────────┤ └─┤ parameter-block ├─┘
Expansion of parameter-block
├──┬─────────────────────┬─────────────────────────────────────────────────────┤ ├─ PARM2 ─────────────┤ └─ PARM3 ─┬─────────┬─┘ ├─ PARM4 ─┤ └─ PARM5 ─┘
The parameter-block can be displayed in a separate syntax diagram.
Choices you can make from this syntax diagram therefore include, but are not limited to, the following:
COMMAND PARM1 COMMAND PARM3 COMMAND PARM3 PARM4
Note: Before you can specify PARM4 or PARM5 in this command, you must specify PARM3.
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|