<syntaxdiagram>
A syntax diagram represents the syntax of a command, function call, or programming language statement.
Rendering expectations
Traditionally, the syntax diagram is formatted with "railroad tracks" that connect the units of the syntax together, but the presentation might vary depending on the output media.
Specialization hierarchy
The <syntaxdiagram>
element is specialized from
<fig>
. It is defined in the syntax-diagram domain module, which is
a specialization of the programming domain module.
Attributes
The following attributes are available on this element: display attributes and universal attributes.
Example
The following code sample shows how a
<syntaxdiagram>
can be used to illustrate
the syntax of a basic file-copy command. The initial
COPYF
command is followed by the input directory
and file name. The input is followed by a choice of either an
output directory (and optional file name) or a file name.
<syntaxdiagram>
<title>CopyFile</title>
<groupseq><kwd>COPYF</kwd></groupseq>
<groupcomp><var>input-directory</var><kwd>*INFILE</kwd></groupcomp>
<groupchoice>
<groupcomp><var>output-directory</var><kwd importance="optional">*OUTFILE</kwd></groupcomp>
<groupcomp><kwd>*OUTFILE</kwd></groupcomp>
</groupchoice>
</syntaxdiagram>