Syntax diagrams

To change the format of syntax diagrams throughout the information center, go to Preferences in the Home navigation panel, select Syntax diagrams and select your preferred format.

Syntax diagrams can be displayed in three formats: railroad diagram format, dotted decimal format, and Backus-Naur format (BNF). This page provides information about each format.

Railroad diagrams are a visual format suitable for sighted users of the information center. Dotted decimal format and BNF are text-based formats that are more helpful for blind or partially-sighted users. For the benefit of screen reader users, dotted decimal format and BNF are described in this Help topic before railroad diagrams.

Of the text-based formats, BNF is more challenging for beginners to understand than dotted decimal and railroad diagram formats.

Tip for Screen Reader Users: Ensure that your screen reader is formatted to read out all punctuation before reading syntax diagrams and viewing this this Help topic.

Dotted decimal format

In dotted decimal format, each syntax element is written on a separate line. Single compound syntax elements are two or more syntax elements that appear in consecutive order. The absence of consecutive syntax elements can also represent a single compound syntax element as well.

Each line starts with a dotted decimal number; for example, 3 or 3.1 or 3.1.1. For screen reader users, to hear these numbers correctly make sure that your screen reader is formatted to read out punctuation. All the syntax elements that have the same dotted decimal number (for example, all the syntax elements that have the number 3.1) are mutually exclusive alternatives. If you hear the lines "3.1 USERID" and "3.1 SYSTEMID", your syntax can include either USERID or SYSTEMID, but not both.

The dotted decimal numbering level denotes the level of nesting. For example, if a syntax element with dotted decimal number 3 is followed by a series of syntax elements with dotted decimal number 3.1, all the syntax elements numbered 3.1 are subordinate to the syntax element numbered 3.

Characters (such as commas) separate a string of syntax elements and display in the syntax just before the items they separate. These characters might appear on the same line as each item or on a separate line with the same dotted decimal number as the relevant items. The line may also show another symbol giving information about the syntax elements. For example, the lines 5.1*, 5.1 LASTRUN, and 5.1 DELETE indicate that if you use more than one of syntax elements LASTRUN and DELETE, they must be separated by a comma. If no separator is given, assume that a blank separates each syntax element.

A syntax element preceded by the % symbol indicates a reference defined elsewhere. The string following the % symbol is the name of a syntax fragment rather than a literal. For example, the line 2.1 %OP1 means that you should refer to separate syntax fragment OP1.

Certain words and symbols are used next to the dotted decimal numbers in order to provide additional information about syntax elements. Occasionally, these words and symbols might occur at the beginning of the element itself. For ease of identification, if a word or symbol is part of a syntax element, it will be preceded by the backslash (\) character. The * symbol can be used next to a dotted decimal number to indicate that the syntax element repeats. For example, syntax element *FILE with the dotted decimal number 3 is given the format 3\*FILE. Format 3* FILE indicates that syntax element FILE repeats. Format 3* \* FILE indicates that syntax element * FILE repeats.

The words and symbols used with dotted decimal numbers are as follows:

BNF (Backus-Naur format)

In BNF, the syntax is written out in a single line. Square brackets [ ], braces { }, and the vertical bar symbol |, are used to describe the syntax. Collectively, these symbols are known as controls.

Blanks are used to separate the syntax elements from the square brackets, braces, and vertical bars. Use your screen reader's "speak next word" (usually Control+LeftArrow key) and "speak prior word" (usually Control+RightArrow key) to move between successive BNF controls and syntax elements.

The characters you need to include when constructing your command (left and right brackets and separators such as a commas) are located at the point at which you need to enter them from your keyboard. For example, a left bracket may be read out before a list of options. In some programming languages such as C and C++, square brackets, braces and the vertical bar symbol are used within the language. For ease of identification where the square bracket, brace, or vertical bar symbol appears in the syntax diagram as a part of the programming language, it is preceded by the backslash (\). If you hear "\{", enter the "{" when you are constructing your command because the "{" is not a part of the syntax diagram structure.

The BNF rendering works as follows:

Railroad diagram format

Railroad diagrams are a visual format suitable for sighted users of the information center. This section describes how to read syntax diagrams in Railroad Diagram Format.