section 2.2 ebnf
authorLuc Moreau <l.moreau@ecs.soton.ac.uk>
Tue, 10 Jul 2012 14:41:41 +0100
changeset 3880 be348622dfa9
parent 3879 02adbb03fdeb
child 3881 16252dbed73f
section 2.2 ebnf
model/prov-n.html
--- a/model/prov-n.html	Tue Jul 10 14:40:04 2012 +0100
+++ b/model/prov-n.html	Tue Jul 10 14:41:41 2012 +0100
@@ -32,10 +32,6 @@
 	border-color: gray;
 	-moz-border-radius: ;
 }
-.grammarRef {
-    font-family: "Consolas", "Inconsolata", "Liberation", "Monaco", "Monospace", monospace ;
-    text-size: 90% ;
-}
 </style>
 
     <script src="grammar/ll.js" class="remove"></script>
@@ -504,48 +500,72 @@
 
 <p>The grammar is specified using a subset of the Extended Backus-Naur
 Form (EBNF) notation, as defined in Extensible Markup Language (XML) 1.1
-[[XML11]] section <a
+[[!XML11]] section <a
 href="http://www.w3.org/TR/2006/REC-xml11-20060816/#sec-notation">6
 Notation</a>.
 </p>
 
 <p>
-The below provides an introduction to the EBNF notation used in
+The text below provides an introduction to the EBNF notation used in
 this document.</p>
-<div class="grammar">
+
+
+<p>
   EBNF specifies a series of production rules (<dfn>production</dfn>). 
-  Each production rule in the grammar defines a symbol <span
-  class="nonterminal">E</span> (the <dfn>non-terminal symbol</dfn>)
+A production rule in the grammar defines a symbol 
+ <code class="grammarRef">expr</code>  (<dfn>non-terminal symbol</dfn>)
   using the following form:</p>
 
-<span class="nonterminal">E</span>&nbsp;::= <em>term</em>
+
+<div class='grammar'>
+ <code class="grammarRef">expr</code> &nbsp;::= <em>term</em>
+</div>
+
+
+A production rule in the grammar defines a symbol 
+ <code class="grammarRef"><code class="grammarRef">&lt;TERMINAL&gt;</code></code>  (<dfn>terminal symbol</dfn>)
+  using the following form:</p>
+
+<div class='grammar'>
+ <code class="grammarRef">&lt;TERMINAL&gt;</code> &nbsp;::= <em>term</em>
+</div>
+
+<p>Symbols are written with an initial capital letter if they are the start symbol of a regular language, otherwise with an initial lowercase letter. </p>
+
+
+
 
 <p>Within the term on the right-hand side of a rule, the following
 <em>term</em>s are used to match strings of one or more characters:
 <ul>
 <li> 
-<span class="nonterminal">E</span>: matches production for non-terminal symbol E.
-</li>
-
-<li> 
-<span class="name">abc</span>: matches the literal string inside the single quotes.
+ <code class="grammarRef">expr</code>: matches production for non-terminal symbol <code class="grammarRef">expr</code>
 </li>
 
 
 <li> 
-<span class="optional"><em>term</em></span>: optional, matches <em>term</em> or nothing.
+ <code class="grammarRef">TERMINAL</code>: matches production for terminal symbol <code class="grammarRef">TERMINAL</code>
 </li>
 
 <li> 
-<span class="plus"><em>term</em></span>: matches one or more occurrences of <em>term</em>.
+ <code class="grammarRef">"abc"</code>: matches the literal string inside the single quotes.
+</li>
+
+
+<li> 
+ <code class="grammarRef">(term)?</code>: optional, matches <em>term</em> or nothing.
 </li>
 
 <li> 
-<span class="star"><em>term</em></span>: matches zero or more occurrences of <em>term</em>.
+ <code class="grammarRef">(term)+</code>: matches one or more occurrences of <em>term</em>.
 </li>
 
 <li> 
-<span class="choice"><em>term</em> | <em>term</em></span>: matches one of the two <em>terms</em>.
+ <code class="grammarRef">(term)*</code>: matches zero or more occurrences of <em>term</em>.
+</li>
+
+<li> 
+ <code class="grammarRef">(term | term)</code>: matches one of the two <em>terms</em>.
 </li>
 
 </ul>
@@ -2151,13 +2171,13 @@
 -->
 
 
-<p>A PROV-N qualified name <code class="content"><a class="grammarRef" href="#prod-QUALIFIED_NAME">QUALIFIED_NAME</a></code> has a more permissive syntax then XML's <code class="content"><a href="http://www.w3.org/TR/2009/REC-xml-names-20091208/#NT-QName">QName</a></code> [[!XML-NAMES]]
+<p>A PROV-N qualified name (production <code class="content"><a class="grammarRef" href="#prod-QUALIFIED_NAME">QUALIFIED_NAME</a></code>) has a more permissive syntax then XML's <code class="content"><a href="http://www.w3.org/TR/2009/REC-xml-names-20091208/#NT-QName">QName</a></code> [[!XML-NAMES]]
 and SPARQL <code class="content"><a href="http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/#rPrefixedName">PrefixedName</a></code> [[!RDF-SPARQL-QUERY]]. 
-A PROV-N qualified name <code class="content"><a class="grammarRef" href="#prod-QUALIFIED_NAME">QUALIFIED_NAME</a></code> consists of a prefix and a local part. Prefixes follow the production <code class="content"><a class="grammarRef" href="http://www.w3.org/TR/rdf-sparql-query/#rPN_PREFIX">PN_PREFIX</a></code> defined by SPARQL [[!RDF-SPARQL-QUERY]]. Local parts have to be conformant with <code class="content"><a class="grammarRef" href="#prod-PN_LOCAL">PN_LOCAL</a></code>, which extends the original SPARQL <code class="content"><a class="grammarRef" href="http://www.w3.org/TR/rdf-sparql-query/#rPN_LOCAL">PN_LOCAL</a></code> definition 
+A <code class="content"><a class="grammarRef" href="#prod-QUALIFIED_NAME">QUALIFIED_NAME</a></code> consists of a prefix and a local part. Prefixes follow the production <code class="content"><a class="grammarRef" href="http://www.w3.org/TR/rdf-sparql-query/#rPN_PREFIX">PN_PREFIX</a></code> defined by SPARQL [[!RDF-SPARQL-QUERY]]. Local parts have to be conformant with <code class="content"><a class="grammarRef" href="#prod-PN_LOCAL">PN_LOCAL</a></code>, which extends the original SPARQL <code class="content"><a class="grammarRef" href="http://www.w3.org/TR/rdf-sparql-query/#rPN_LOCAL">PN_LOCAL</a></code> definition 
 by allowing further characters (see <code class="content"><a class="grammarRef" href="#prod-PN_CHARS_OTHERS">PN_CHARS_OTHERS</a></code>):</p>
 <ul>
 <li> an extra set of characters commonly encountered in IRIs;
-<li> %-escaped charaters (see <code class="content"><a class="grammarRef" href="#prod-PERCENT">PERCENT</a></code>) to be interpreted as per
+<li> %-escaped characters (see <code class="content"><a class="grammarRef" href="#prod-PERCENT">PERCENT</a></code>) to be interpreted as per
  Section 3.1.  Mapping of IRIs to URIs in [[!RFC3987]];</li>
 <li> and \-escaped characters (see <code class="content"><a class="grammarRef" href="#prod-PN_CHARS_ESC">PN_CHARS_ESC</a></code>).</li>
 </ul>