">Range Grammar</h3>
<p>Putting all this together, here is a Backus-Naur grammar for ranges,
for the benefit of parser authors:</p>
<pre><code class="lang-bnf">range-set  ::= range ( logical-or range ) *
logical-or ::= ( &#39; &#39; ) * &#39;||&#39; ( &#39; &#39; ) *
range      ::= hyphen | simple ( &#39; &#39; simple ) * | &#39;&#39;
hyphen     ::= partial &#39; - &#39; partial
simple     ::= primitive | partial | tilde | caret
primitive  ::= ( &#39;&lt;&#39; | &#39;&gt;&#39; | &#39;&gt;=&#39; | &#39;&lt;=