We use an extended BNF grammar to describe the syntax of Larch/C++. The extensions are as follows [Ledgard80].
terminal
.
In a few cases it is also necessary to quote terminal symbols,
such as when using `|
' as a terminal symbol instead of a
meta-symbol (see section 4.10 Special Symbols).
[
and ]
are terminals.
For example, the following gives a production for a non-empty list of init-declarators, separated by commas.
init-declarator-list ::= init-declarator [ ,
init-declarator ] ...
To remind the reader that the notation `...' means zero or more repetitions, we try to use `...' only following optional text, although in cases such as the following the brackets and the enclosed nonterminal could have been omitted.
type-specifier-seq ::= type-specifier [ type-specifier ] ...
As in the above examples, we follow the evolving C++ standard [ANSI95] in using nonterminal names of the form X-list to mean a comma-separated list, and nonterminal names of the form X-seq to mean a sequence not separated by commas.
We use "//" to start a comment (to you, the reader) in the grammar.
Go to the first, previous, next, last section, table of contents.