Remove BASE and PREFIX productions
authorGavin Carothers <gavin@carothers.name>
Tue, 15 May 2012 11:27:53 -0700
changeset 379 4e4b1398ec38
parent 378 42130d6eb777
child 380 14359ee3080c
Remove BASE and PREFIX productions
rdf-turtle/turtle-bnf.html
rdf-turtle/turtle.bnf
--- a/rdf-turtle/turtle-bnf.html	Tue May 15 11:05:47 2012 -0700
+++ b/rdf-turtle/turtle-bnf.html	Tue May 15 11:27:53 2012 -0700
@@ -1,4 +1,4 @@
-<table class="grammar">
+<table  class="grammar">
     <tbody class="grammar-productions">
             <tr id="grammar-production-turtleDoc" data-grammar-original="[1] turtleDoc ::= (statement)*" data-grammar-expression="(&#x27;*&#x27;, (&#x27;id&#x27;, &#x27;statement&#x27;))" >
     <td>[1]<td>
@@ -18,17 +18,17 @@
     <td>::=</td>
     <td>(<a href='#grammar-production-prefixID'>prefixID</a> <code>|</code> <a href='#grammar-production-base'>base</a>)</td>
 </tr>
-            <tr id="grammar-production-prefixID" data-grammar-original="[4] prefixID ::= PREFIX PNAME_NS IRIREF" data-grammar-expression="(&#x27;,&#x27;, [(&#x27;id&#x27;, &#x27;PREFIX&#x27;), (&#x27;id&#x27;, &#x27;PNAME_NS&#x27;), (&#x27;id&#x27;, &#x27;IRIREF&#x27;)])" >
+            <tr id="grammar-production-prefixID" data-grammar-original="[4] prefixID ::= &#x27;@prefix&#x27; ws+ PNAME_NS IRIREF" data-grammar-expression="(&#x27;,&#x27;, [(&quot;&#x27;&quot;, &#x27;@prefix&#x27;), (&#x27;+&#x27;, (&#x27;id&#x27;, &#x27;ws&#x27;)), (&#x27;id&#x27;, &#x27;PNAME_NS&#x27;), (&#x27;id&#x27;, &#x27;IRIREF&#x27;)])" >
     <td>[4]<td>
     <td><code>prefixID</code><td>
     <td>::=</td>
-    <td><a href='#grammar-production-PREFIX'>PREFIX</a> <a href='#grammar-production-PNAME_NS'>PNAME_NS</a> <a href='#grammar-production-IRIREF'>IRIREF</a></td>
+    <td>'<code class='grammar-literal'>@prefix</code>' (<a href='#grammar-production-ws'>ws</a>)<code class='grammar-plus'>+</code> <a href='#grammar-production-PNAME_NS'>PNAME_NS</a> <a href='#grammar-production-IRIREF'>IRIREF</a></td>
 </tr>
-            <tr id="grammar-production-base" data-grammar-original="[5] base ::= BASE IRIREF" data-grammar-expression="(&#x27;,&#x27;, [(&#x27;id&#x27;, &#x27;BASE&#x27;), (&#x27;id&#x27;, &#x27;IRIREF&#x27;)])" >
+            <tr id="grammar-production-base" data-grammar-original="[5] base ::= &#x27;@base&#x27; ws+ IRIREF" data-grammar-expression="(&#x27;,&#x27;, [(&quot;&#x27;&quot;, &#x27;@base&#x27;), (&#x27;+&#x27;, (&#x27;id&#x27;, &#x27;ws&#x27;)), (&#x27;id&#x27;, &#x27;IRIREF&#x27;)])" >
     <td>[5]<td>
     <td><code>base</code><td>
     <td>::=</td>
-    <td><a href='#grammar-production-BASE'>BASE</a> <a href='#grammar-production-IRIREF'>IRIREF</a></td>
+    <td>'<code class='grammar-literal'>@base</code>' (<a href='#grammar-production-ws'>ws</a>)<code class='grammar-plus'>+</code> <a href='#grammar-production-IRIREF'>IRIREF</a></td>
 </tr>
             <tr id="grammar-production-triples" data-grammar-original="[6] triples ::= subject predicateObjectList" data-grammar-expression="(&#x27;,&#x27;, [(&#x27;id&#x27;, &#x27;subject&#x27;), (&#x27;id&#x27;, &#x27;predicateObjectList&#x27;)])" >
     <td>[6]<td>
@@ -158,18 +158,6 @@
 </tr>
     </tbody>
     <tbody class="grammar-terminals">
-            <tr id="grammar-production-BASE" data-grammar-original="[17] BASE ::= &quot;@base&quot;" data-grammar-expression="(&quot;&#x27;&quot;, &#x27;@base&#x27;)" class='grammar-token'>
-    <td>[17]<td>
-    <td><code>BASE</code><td>
-    <td>::=</td>
-    <td>'<code class='grammar-literal'>@base</code>'</td>
-</tr>
-            <tr id="grammar-production-PREFIX" data-grammar-original="[18] PREFIX ::= &quot;@prefix&quot;" data-grammar-expression="(&quot;&#x27;&quot;, &#x27;@prefix&#x27;)" class='grammar-token'>
-    <td>[18]<td>
-    <td><code>PREFIX</code><td>
-    <td>::=</td>
-    <td>'<code class='grammar-literal'>@prefix</code>'</td>
-</tr>
             <tr id="grammar-production-IRIREF" data-grammar-original="[132s] IRIREF ::= &#x27;&lt;&#x27; ([^&lt;&gt;&quot;{}|^`\]-[#x00-#x20])* | UCHAR &#x27;&gt;&#x27;" data-grammar-expression="(&#x27;|&#x27;, [(&#x27;,&#x27;, [(&quot;&#x27;&quot;, &#x27;&lt;&#x27;), (&#x27;*&#x27;, (&#x27;-&#x27;, [(&#x27;[&#x27;, &#x27;^&lt;&gt;&quot;{}|^`\\&#x27;), (&#x27;[&#x27;, &#x27;#x00-#x20&#x27;)]))]), (&#x27;,&#x27;, [(&#x27;id&#x27;, &#x27;UCHAR&#x27;), (&quot;&#x27;&quot;, &#x27;&gt;&#x27;)])])" class='grammar-token'>
     <td>[132s]<td>
     <td><code>IRIREF</code><td>
@@ -194,11 +182,11 @@
     <td>::=</td>
     <td>'<code class='grammar-literal'>_:</code>' (<a href='#grammar-production-PN_CHARS_U'>PN_CHARS_U</a> <code>|</code> [<code class='grammar-chars'>0-9</code>]) (((<a href='#grammar-production-PN_CHARS'>PN_CHARS</a> <code>|</code> '<code class='grammar-literal'>.</code>'))<code class='grammar-star'>*</code> <a href='#grammar-production-PN_CHARS'>PN_CHARS</a>)?</td>
 </tr>
-            <tr id="grammar-production-LANGTAG" data-grammar-original="[19] LANGTAG ::= BASE| PREFIX| &quot;@&quot; [a-zA-Z]+ ( &quot;-&quot; [a-zA-Z0-9]+ )*" data-grammar-expression="(&#x27;|&#x27;, [(&#x27;id&#x27;, &#x27;BASE&#x27;), (&#x27;id&#x27;, &#x27;PREFIX&#x27;), (&#x27;,&#x27;, [(&quot;&#x27;&quot;, &#x27;@&#x27;), (&#x27;+&#x27;, (&#x27;[&#x27;, &#x27;a-zA-Z&#x27;)), (&#x27;*&#x27;, (&#x27;,&#x27;, [(&quot;&#x27;&quot;, &#x27;-&#x27;), (&#x27;+&#x27;, (&#x27;[&#x27;, &#x27;a-zA-Z0-9&#x27;))]))])])" class='grammar-token'>
+            <tr id="grammar-production-LANGTAG" data-grammar-original="[19] LANGTAG ::= &quot;@&quot; [a-zA-Z]+ ( &quot;-&quot; [a-zA-Z0-9]+ )*" data-grammar-expression="(&#x27;,&#x27;, [(&quot;&#x27;&quot;, &#x27;@&#x27;), (&#x27;+&#x27;, (&#x27;[&#x27;, &#x27;a-zA-Z&#x27;)), (&#x27;*&#x27;, (&#x27;,&#x27;, [(&quot;&#x27;&quot;, &#x27;-&#x27;), (&#x27;+&#x27;, (&#x27;[&#x27;, &#x27;a-zA-Z0-9&#x27;))]))])" class='grammar-token'>
     <td>[19]<td>
     <td><code>LANGTAG</code><td>
     <td>::=</td>
-    <td>(<a href='#grammar-production-BASE'>BASE</a> <code>|</code> <a href='#grammar-production-PREFIX'>PREFIX</a> <code>|</code> '<code class='grammar-literal'>@</code>' ([<code class='grammar-chars'>a-zA-Z</code>])<code class='grammar-plus'>+</code> ('<code class='grammar-literal'>-</code>' ([<code class='grammar-chars'>a-zA-Z0-9</code>])<code class='grammar-plus'>+</code>)<code class='grammar-star'>*</code>)</td>
+    <td>'<code class='grammar-literal'>@</code>' ([<code class='grammar-chars'>a-zA-Z</code>])<code class='grammar-plus'>+</code> ('<code class='grammar-literal'>-</code>' ([<code class='grammar-chars'>a-zA-Z0-9</code>])<code class='grammar-plus'>+</code>)<code class='grammar-star'>*</code></td>
 </tr>
             <tr id="grammar-production-INTEGER" data-grammar-original="[20] INTEGER ::= [+-]? [0-9]+" data-grammar-expression="(&#x27;,&#x27;, [(&#x27;?&#x27;, (&#x27;[&#x27;, &#x27;+-&#x27;)), (&#x27;+&#x27;, (&#x27;[&#x27;, &#x27;0-9&#x27;))])" class='grammar-token'>
     <td>[20]<td>
--- a/rdf-turtle/turtle.bnf	Tue May 15 11:05:47 2012 -0700
+++ b/rdf-turtle/turtle.bnf	Tue May 15 11:27:53 2012 -0700
@@ -4,9 +4,9 @@
  | triples "." 
 [3] directive ::= prefixID 
  | base 
-[4] prefixID ::= PREFIX PNAME_NS IRIREF 
+[4] prefixID ::= '@prefix' ws+ PNAME_NS IRIREF 
  
-[5] base ::= BASE IRIREF 
+[5] base ::= '@base' ws+ IRIREF 
  
 [6] triples ::= subject predicateObjectList 
  
@@ -62,10 +62,6 @@
 
 @terminals
 
-[17] BASE ::= "@base" 
- 
-[18] PREFIX ::= "@prefix" 
-
 [132s] IRIREF ::= '<' ([^<>"{}|^`\]-[#x00-#x20])* | UCHAR '>'
  
 [133s] PNAME_NS ::= PN_PREFIX? ":" 
@@ -74,9 +70,7 @@
  
 [135s] BLANK_NODE_LABEL ::= '_:' ( PN_CHARS_U | [0-9] ) ((PN_CHARS|'.')* PN_CHARS)?
  
-[19] LANGTAG ::= BASE 
- | PREFIX 
- | "@" [a-zA-Z]+ ( "-" [a-zA-Z0-9]+ )* 
+[19] LANGTAG ::= "@" [a-zA-Z]+ ( "-" [a-zA-Z0-9]+ )* 
 [20] INTEGER ::= [+-]? [0-9]+
  
 [21] DECIMAL ::= [+-]? [0-9]+ "." [0-9]+