1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
4
<meta name="robots" content="noindex">
5
<title>Legend Context Free Grammar</title>
7
<H1>Legend Context Free Grammar</H1></center>
9
<font color="#000000">The syntax rules are described in
10
<b><i>EBNF</i></b> ( Extended Backus-Naur-Form ).
11
A startsymbol must exist for each source file type. That means the syntax
12
of each file must match the corresponding start rule.
13
The other are internal helper rules. </font><font color="#000000"></font>
14
<p><font color="#000000">Each <b><i><font size="+1">rule</font></i></b>
15
is structured as follows: <Rule Type: <b><i>start</i></b> or <b><i>let</i></b>> </font>
16
<<font color="#B22222">Rule Identifier</font>> :: <EBNF-konform Expression>
17
<br>An <b><i><font size="+1">EBNF-konform expression</font></i></b> defines a part
18
of the language syntax. It consists of a set of alternative productions i.e.
19
partial expressions, separated by the character '|'.
20
<p>A production is specified with the help of the following elements and operators:
24
<b><i><font size="+1">Expression1 Expression2 ... ExpressionN</font></i></b></li>
26
<br>Concatenation of partial expressions
28
<b><i><font size="+1">Expression1 | Expression2 | ... | ExpressionN</font></i></b></li>
30
<br>Union of partial expressions ( alternatives )
32
<b><i><font size="+1">[ Expression ]</font></i></b></li>
34
<br>Optional partial expression
36
<b><i><font size="+1">{ Expression }</font></i></b></li>
38
<br>Iteration of a partial expression ( 0 .. )
40
<b><i><font size="+1">Expression +</font></i></b></li>
42
<br>Iteration of a partial expression ( 1 .. )
44
<b><i><font size="+1">( Expression )</font></i></b></li>
46
<br>Combination of a partial expression ( subexpression )
48
<b><i><font color="#3366FF"><font size="+1">Token Identifier</font></font></i></b></li>
50
<br><font color="#000000">... from the regular grammar</font>
52
<b><i><font color="#3366FF"><font size="+1">Rule Identifier<br>
53
</font></font></i></b><font color="#000000">... from the context-free grammar</font></li>
55
<b><i><font color="#009900"><font size="+1">Keyword<br>
56
</font></font></i></b><font color="#000000">Constant string / character sequence</font><br>
59
<b><i><font color="#000000"><font size="+1">[other]<br>
60
</font></font></i></b><font color="#000000">Special keyword denoting the
61
character sequences from the set 'Sigma* \ Tokenset'</font><br>
64
<br><font color="#000000"></font> </ul>