Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v3:grammar [2022/01/09 10:51] neilsv3:grammar [2022/01/09 11:59] (current) – removed neils
Line 1: Line 1:
-====== Grammar ====== 
- 
-This is the formal definition of XC=BASIC's grammar. 
- 
-===== Program ===== 
- 
-<html> 
-<svg xmlns="http://www.w3.org/2000/svg" width="209" height="71"> 
-         <defs> 
-            <style type="text/css"> 
-    @namespace "http://www.w3.org/2000/svg"; 
-    .line                 {fill: none; stroke: #332900; stroke-width: 1;} 
-    .bold-line            {stroke: #141000; shape-rendering: crispEdges; stroke-width: 2;} 
-    .thin-line            {stroke: #1F1800; shape-rendering: crispEdges} 
-    .filled               {fill: #332900; stroke: none;} 
-    text.terminal         {font-family: Verdana, Sans-serif; 
-                            font-size: 12px; 
-                            fill: #141000; 
-                            font-weight: bold; 
-                          } 
-    text.nonterminal      {font-family: Verdana, Sans-serif; 
-                            font-size: 12px; 
-                            fill: #1A1400; 
-                            font-weight: normal; 
-                          } 
-    text.regexp           {font-family: Verdana, Sans-serif; 
-                            font-size: 12px; 
-                            fill: #1F1800; 
-                            font-weight: normal; 
-                          } 
-    rect, circle, polygon {fill: #332900; stroke: #332900;} 
-    rect.terminal         {fill: #FFDB4D; stroke: #332900; stroke-width: 1;} 
-    rect.nonterminal      {fill: #FFEC9E; stroke: #332900; stroke-width: 1;} 
-    rect.text             {fill: none; stroke: none;} 
-    polygon.regexp        {fill: #FFF4C7; stroke: #332900; stroke-width: 1;} 
-  </style> 
-         </defs> 
-         <polygon points="9 51 1 47 1 55"/> 
-         <polygon points="17 51 9 47 9 55"/><a xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#Line" xlink:title="Line"> 
-            <rect x="51" y="3" width="46" height="32"/> 
-            <rect x="49" y="1" width="46" height="32" class="nonterminal"/> 
-            <text class="nonterminal" x="59" y="21">Line</text></a><a xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#EOF" xlink:title="EOF"> 
-            <rect x="137" y="37" width="44" height="32"/> 
-            <rect x="135" y="35" width="44" height="32" class="nonterminal"/> 
-            <text class="nonterminal" x="145" y="55">EOF</text></a><path xmlns:svg="http://www.w3.org/2000/svg" class="line" d="m17 51 h2 m20 0 h10 m0 0 h56 m-86 0 l20 0 m-1 0 q-9 0 -9 -10 l0 -14 q0 -10 10 -10 m66 34 l20 0 m-20 0 q10 0 10 -10 l0 -14 q0 -10 -10 -10 m-66 0 h10 m46 0 h10 m20 34 h10 m44 0 h10 m3 0 h-3"/> 
-         <polygon points="199 51 207 47 207 55"/> 
-         <polygon points="199 51 191 47 191 55"/></svg> 
-</html> 
- 
-  Program  ::= Line* EOF 
- 
-===== Line ===== 
- 
-<html> 
-<svg xmlns="http://www.w3.org/2000/svg" width="339" height="113"> 
-         <defs> 
-            <style type="text/css"> 
-    @namespace "http://www.w3.org/2000/svg"; 
-    .line                 {fill: none; stroke: #332900; stroke-width: 1;} 
-    .bold-line            {stroke: #141000; shape-rendering: crispEdges; stroke-width: 2;} 
-    .thin-line            {stroke: #1F1800; shape-rendering: crispEdges} 
-    .filled               {fill: #332900; stroke: none;} 
-    text.terminal         {font-family: Verdana, Sans-serif; 
-                            font-size: 12px; 
-                            fill: #141000; 
-                            font-weight: bold; 
-                          } 
-    text.nonterminal      {font-family: Verdana, Sans-serif; 
-                            font-size: 12px; 
-                            fill: #1A1400; 
-                            font-weight: normal; 
-                          } 
-    text.regexp           {font-family: Verdana, Sans-serif; 
-                            font-size: 12px; 
-                            fill: #1F1800; 
-                            font-weight: normal; 
-                          } 
-    rect, circle, polygon {fill: #332900; stroke: #332900;} 
-    rect.terminal         {fill: #FFDB4D; stroke: #332900; stroke-width: 1;} 
-    rect.nonterminal      {fill: #FFEC9E; stroke: #332900; stroke-width: 1;} 
-    rect.text             {fill: none; stroke: none;} 
-    polygon.regexp        {fill: #FFF4C7; stroke: #332900; stroke-width: 1;} 
-  </style> 
-         </defs> 
-         <polygon points="9 61 1 57 1 65"/> 
-         <polygon points="17 61 9 57 9 65"/><a xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#Label" xlink:title="Label"> 
-            <rect x="51" y="79" width="54" height="32"/> 
-            <rect x="49" y="77" width="54" height="32" class="nonterminal"/> 
-            <text class="nonterminal" x="59" y="97">Label</text></a><a xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#Statement" xlink:title="Statement"> 
-            <rect x="185" y="47" width="86" height="32"/> 
-            <rect x="183" y="45" width="86" height="32" class="nonterminal"/> 
-            <text class="nonterminal" x="193" y="65">Statement</text></a><rect x="185" y="3" width="24" height="32" rx="10"/> 
-         <rect x="183" y="1" width="24" height="32" class="terminal" rx="10"/> 
-         <text class="terminal" x="193" y="21">:</text> 
-         <path xmlns:svg="http://www.w3.org/2000/svg" class="line" d="m17 61 h2 m20 0 h10 m0 0 h64 m-94 0 h20 m74 0 h20 m-114 0 q10 0 10 10 m94 0 q0 -10 10 -10 m-104 10 v12 m94 0 v-12 m-94 12 q0 10 10 10 m74 0 q10 0 10 -10 m-84 10 h10 m54 0 h10 m60 -32 h10 m86 0 h10 m-126 0 l20 0 m-1 0 q-9 0 -9 -10 l0 -24 q0 -10 10 -10 m106 44 l20 0 m-20 0 q10 0 10 -10 l0 -24 q0 -10 -10 -10 m-106 0 h10 m24 0 h10 m0 0 h62 m-146 44 h20 m146 0 h20 m-186 0 q10 0 10 10 m166 0 q0 -10 10 -10 m-176 10 v14 m166 0 v-14 m-166 14 q0 10 10 10 m146 0 q10 0 10 -10 m-156 10 h10 m0 0 h136 m23 -34 h-3"/> 
-         <polygon points="329 61 337 57 337 65"/> 
-         <polygon points="329 61 321 57 321 65"/></svg> 
-</html> 
- 
-  Line     ::= Label? ( Statement ( ':' Statement )* )? 
- 
-Referenced by: 
-  * [[#program|Program]] 
-