O'Reilly logo

DocBook 5: The Definitive Guide by Richard L. Hamilton, Norman Walsh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

productionset — A set of EBNF productions

Synopsis

productionset ::= ((((title? & titleabbrev?), infodb.titleforbidden.info) | info db.titleonly.info), (production | productionrecap)+)

Description

A productionset is a collection of Extended Backus-Naur Form (EBNF) productions.

EBNF is a notation for describing the grammar of context-free languages. Even if you aren’t conversant in the programming language concepts of context-free languages and grammars, it’s not really as hard to understand as it sounds.

Processing expectations

Formatted as a displayed block. The detailed processing expectations with respect to individual productions, lefthand sides, and righthand sides are quite complex.

The productions should be numbered.

See Also

constraint, lhs, production, productionrecap, rhs

Examples

A set of EBNF productions describes the legal arrangements of tokens in a language. Consider arithmetic expressions as a simple example.

The expression 3 + 4 is valid and so is 3 + 4 - 5, but 3 - + - 4 is not, nor is 3 + 4 6. We can use EBNF to describe all the possible legal arrangements.

That is expressed in DocBook like this:

<article xmlns='http://docbook.org/ns/docbook'> <title>Example productionset</title> <simplesect><title>EBNF Grammar</title> <productionset><title>Arithemetic Expressions</title> <production xml:id="ebnf.expression"> <lhs>Expression</lhs> <rhs><nonterminal def="#ebnf.arith">ArithExpression</nonterminal> | <nonterminal ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required