&lt;!DOCTYPE simplesect PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
          "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"&gt;
&lt;simplesect&gt;&lt;title&gt;EBNF Grammar&lt;/title&gt;

&lt;productionset&gt;&lt;title&gt;Arithemetic Expressions&lt;/title&gt;
&lt;production id="ebnf.expression"&gt;
  &lt;lhs&gt;Expression&lt;/lhs&gt;
  &lt;rhs&gt;&lt;nonterminal def="#ebnf.arith"&gt;ArithExpression&lt;/nonterminal&gt; |
       &lt;nonterminal def="#ebnf.mult"&gt;MultExpression&lt;/nonterminal&gt;
  &lt;lineannotation&gt;Does this grammar actually get precedence right?
  &lt;/lineannotation&gt;
  &lt;/rhs&gt;
&lt;/production&gt;
&lt;production id="ebnf.arith"&gt;
  &lt;lhs&gt;ArithExpression&lt;/lhs&gt;
  &lt;rhs&gt;&lt;nonterminal def="#ebnf.expression"&gt;Expression&lt;/nonterminal&gt;
       '+'
       &lt;nonterminal def="#ebnf.mult"&gt;MultExpression&lt;/nonterminal&gt; |
       &lt;nonterminal def="#ebnf.expression"&gt;Expression&lt;/nonterminal&gt;
       '-'
       &lt;nonterminal def="#ebnf.mult"&gt;MultExpression&lt;/nonterminal&gt;
  &lt;/rhs&gt;
&lt;/production&gt;
&lt;production id="ebnf.mult"&gt;
  &lt;lhs&gt;MultExpression&lt;/lhs&gt;
  &lt;rhs&gt;&lt;nonterminal def="#ebnf.mult"&gt;MultExpression&lt;/nonterminal&gt;
       '*'
       &lt;nonterminal def="#ebnf.mult"&gt;MultExpression&lt;/nonterminal&gt; |
       &lt;nonterminal def="#ebnf.mult"&gt;MultExpression&lt;/nonterminal&gt;
       '/'
       &lt;nonterminal def="#ebnf.mult"&gt;MultExpression&lt;/nonterminal&gt; |
       &lt;nonterminal def="#ebnf.number"&gt;Number&lt;/nonterminal&gt;
  &lt;/rhs&gt;
  &lt;constraint linkend="div0"/&gt;
&lt;/production&gt;
&lt;production id="ebnf.number"&gt;
  &lt;lhs&gt;Number&lt;/lhs&gt;
  &lt;rhs&gt;[0-9]+&lt;/rhs&gt;
&lt;/production&gt;
&lt;/productionset&gt;

&lt;constraintdef id="div0"&gt;
&lt;title&gt;Division by Zero&lt;/title&gt;
&lt;para&gt;Division by zero is an error.&lt;/para&gt;
&lt;/constraintdef&gt;
&lt;/simplesect&gt;

