How to format DITA's syntax-diagram notation

DITA's programming domain contains a complex specialization of <figure> called <syntaxdiagram>. A syntax diagram represents the syntax of programming statements, commands, bindings, and so forth. Its elements represent groupings and organization of the parts of syntax that go into a statement, method, or function as used in programming or a command used in the console operation of a computer.

A related element, called <synph> (short for syntax phrase), allows encoding inline representations of programming syntax, and contains many of the same elements as syntaxdiagram. It does not the grouping elements,which represent block constructions. The formatting of its constituent elements is the same as for the main syntax-diagram, other than being all flow-oriented. Basically, <synph> is to HTML's <span> as <syntax-diagram> is to HTML's <div> or <table>, except that the DITA specialization contains only syntax-related markup.

Two other elements in DITA's software domain cover the simple case of dialog or interaction between a computer and a user: <systemoutput> and <userinput>. By contrast, the <syntaxdiagram> and <synph> family covers actual programming syntax, not interaction.

Within this topic is a description of how to read the Railroad Track form of output:

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/db2/rbafzmsthowtous.htm

Output options that should be considered:

Don to look up the published IBM Technical Report on how to author Syntax Diagram markup (out of Raleigh about 10 years ago)

Status: still looking. Might be a Technical Disclosure instead--different publishing site.

Links Analysis of syntax diagrams (background on relationship of railroad track visualization to BNF):

Other publications:

Examples online:

The head of IBM's iSeries documentation group provided these samples from their web site.

Smaller diagrams - go down to "Built-in functions" and follow most any link under there:

Larger groups in one set of syntax:

Syntax overload - follow this link, and scroll down to "CASE expressions" for a reasonably complex one, and to "CAST specification" for a really big one (there are other big ones in here too):

SyntaxDiagram (last edited 2006-10-25 20:31:10 by )