/usr/share/mozart/doc/notation/node2.html is in mozart-doc 1.4.0-8ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>2 Lexical Syntax</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node1.html#chapter.intro"><< Prev</A></TD><TD><A href="index.html">- Up -</A></TD><TD><A href="node3.html#chapter.context-free">Next >></A></TD></TR></TABLE><DIV id="chapter.lexical"><H1><A name="chapter.lexical">2 Lexical Syntax</A></H1><P> A <EM>program text</EM> is a sequence of <EM>characters</EM> represented by integers following ISO 8859-1 <A href="bib.html#iso_8859_1">[ISO87]</A>, also called ``Latin 1''. In this section, we describe how such a sequence is split into a sequence of <EM>words</EM>. Each word represents zero or more <EM>tokens</EM> such that the result is a sequence of tokens. We call this process <EM>tokenization</EM>. In this section, we give regular expressions for the different kinds of words and describe the resulting tokens. </P><DIV class="apropos"><P class="margin">Resolving Ambiguities</P><P> The splitting of a sequence of characters using these regular expressions is not unique. We use the usual left to right longest match tokenization obtaining either error or a unique sequence of tokens from a given sequence of characters. Longest match means that if two or more prefixes of the remaining character string are matched by (possibly different) regular expressions, we select the match that accepts the longest prefix. Note that the regular expressions are designed such that left to right longest match tokenization is unique. </P></DIV><DIV class="apropos"><P class="margin">Lexical Errors</P><P> When no regular expression matches a prefix of the remaining character string, we speak of a <EM>lexical error</EM>. Such an input sequence does not represent a valid Oz program. </P></DIV><H2><A name="label4">2.1 Character Class Definitions</A></H2><P> This section defines character classes used in the regular expressions given in the remainder of the chapter. Note that these regular expressions do not - on their own - define any splitting of the input into words. </P><P> We use NUL to denote the ISO character with code 0 and <<I>any character</I>> to denote the set of all ISO characters. </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>upper-case letter</I>></TD><TD align="center"> ::= </TD><TD><CODE>A</CODE> | ... | <CODE>Z</CODE> | <CODE>À</CODE> | ... | <CODE>Ö</CODE> | <CODE>Ø</CODE> | ... | <CODE>Þ</CODE></TD></TR></TABLE></BLOCKQUOTE><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>lower-case letter</I>></TD><TD align="center"> ::= </TD><TD><CODE>a</CODE> | ... | <CODE>z</CODE> | <CODE>ß</CODE> | ... | <CODE>ö</CODE> | <CODE>ø</CODE> | ... | <CODE>ÿ</CODE></TD></TR></TABLE></BLOCKQUOTE><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>digit</I>></TD><TD align="center"> ::= </TD><TD><CODE>0</CODE> | ... | <CODE>9</CODE></TD></TR></TABLE></BLOCKQUOTE><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>non-zero digit</I>></TD><TD align="center"> ::= </TD><TD><CODE>1</CODE> | ... | <CODE>9</CODE></TD></TR></TABLE></BLOCKQUOTE><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>alphanumerical</I>></TD><TD align="center"> ::= </TD><TD><<I>upper-case letter</I>> | <<I>lower-case letter</I>> | <<I>digit</I>> | <CODE>_</CODE></TD></TR></TABLE></BLOCKQUOTE><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>atom char</I>></TD><TD align="center"> ::= </TD><TD><<I>any character</I>> - ( <CODE>'</CODE> | <CODE>\</CODE> | NUL )</TD></TR></TABLE></BLOCKQUOTE><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>string char</I>></TD><TD align="center"> ::= </TD><TD><<I>any character</I>> - ( <CODE><SPAN class="string">"</SPAN></CODE> | <CODE>\</CODE> | NUL )</TD></TR></TABLE></BLOCKQUOTE><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>variable char</I>></TD><TD align="center"> ::= </TD><TD><<I>any character</I>> - ( <CODE>`</CODE> | <CODE>\</CODE> | NUL )</TD></TR></TABLE></BLOCKQUOTE><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>escape character</I>></TD><TD align="center"> ::= </TD><TD><CODE>a</CODE> | <CODE>b</CODE> | <CODE>f</CODE> | <CODE>n</CODE> | <CODE>r</CODE> | <CODE>t</CODE> | <CODE>v</CODE> | <CODE>\</CODE> | <CODE>'</CODE> | <CODE><SPAN class="string">"</SPAN></CODE> | <CODE>`</CODE> | <CODE>&</CODE></TD></TR></TABLE></BLOCKQUOTE><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>octal digit</I>></TD><TD align="center"> ::= </TD><TD><CODE>0</CODE> | ... | <CODE>7</CODE></TD></TR></TABLE></BLOCKQUOTE><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>hex digit</I>></TD><TD align="center"> ::= </TD><TD><CODE>0</CODE> | ... | <CODE>9</CODE> | <CODE>A</CODE> | ... | <CODE>F</CODE> | <CODE>a</CODE> | ... | <CODE>f</CODE></TD></TR></TABLE></BLOCKQUOTE><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>binary digit</I>></TD><TD align="center"> ::= </TD><TD><CODE>0</CODE> | <CODE>1</CODE></TD></TR></TABLE></BLOCKQUOTE><P> </P><DIV class="apropos"><P class="margin">Pseudo-Characters</P><P> In the classes of words <<I>variable</I>>, <<I>atom</I>>, <<I>string</I>>, and <<I>character</I>> we use pseudo-characters, which represent single characters in different notations. </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>pseudo char</I>></TD><TD align="center"> ::= </TD><TD><CODE>\</CODE> <<I>octal digit</I>> <<I>octal digit</I>> <<I>octal digit</I>></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD><CODE>\</CODE> ( <CODE>x</CODE> | <CODE>X</CODE> ) <<I>hex digit</I>> <<I>hex digit</I>></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD><CODE>\</CODE> <<I>escape character</I>></TD></TR></TABLE></BLOCKQUOTE><P> Pseudo-characters allow to enter any ISO 8859-1 character using octal or hexadecimal notation. Octal notation is restricted to numbers less than 256. The NUL character (ISO code 0) is forbidden. The pseudo-characters <CODE>\a</CODE> (= <CODE>\007</CODE>), <CODE>\b</CODE> (= <CODE>\010</CODE>), <CODE>\f</CODE> (= <CODE>\014</CODE>), <CODE>\n</CODE> (= <CODE>\012</CODE>), <CODE>\r</CODE> (= <CODE>\015</CODE>), <CODE>\t</CODE> (= <CODE>\011</CODE>), <CODE>\v</CODE> (= <CODE>\013</CODE>) denote special purpose characters, and <CODE>\\</CODE> (= <CODE>\134</CODE>), <CODE>\'</CODE> (= <CODE>\047</CODE>), <CODE>\"</CODE> (= <CODE>\042</CODE>), <CODE>\`</CODE> (= <CODE>\140</CODE>), <CODE>\&</CODE> (= <CODE>\046</CODE>) denote their second component character. </P></DIV><H2><A name="label5">2.2 Spaces and Comments</A></H2><P> Spaces are tab (code 9), newline (code 10), vertical tab (code 11), form feed (code 12), carriage return (code 13), and blank (code 32). </P><P> A comment is: </P><UL><LI><P>a sequence of characters from <CODE>%</CODE> until the end of the line or file, </P></LI><LI><P>a sequence of characters within and including the comment brackets <CODE>/*</CODE> and <CODE>*/</CODE>, in which <CODE>/*</CODE> and <CODE>*/</CODE> are properly nested, and </P></LI><LI><P>the character <CODE>?</CODE>. </P></LI></UL><P> </P><P> Spaces and comments produce no tokens. This means that they are ignored, except that they separate words form each other. </P><H2><A name="label6">2.3 Keywords</A></H2><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>keyword</I>></TD><TD align="center"> ::= </TD><TD><CODE><SPAN class="keyword">andthen</SPAN></CODE> | <CODE><SPAN class="keyword">at</SPAN></CODE> | <CODE><SPAN class="keyword">attr</SPAN></CODE> | <CODE><SPAN class="keyword">case</SPAN></CODE> | <CODE><SPAN class="keyword">catch</SPAN></CODE> | <CODE><SPAN class="keyword">choice</SPAN></CODE></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD><CODE><SPAN class="keyword">class</SPAN></CODE> | <CODE><SPAN class="keyword">cond</SPAN></CODE> | <CODE><SPAN class="keyword">declare</SPAN></CODE> | <CODE><SPAN class="keyword">define</SPAN></CODE> | <CODE><SPAN class="keyword">dis</SPAN></CODE></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD><CODE><SPAN class="keyword">div</SPAN></CODE> | <CODE><SPAN class="keyword">else</SPAN></CODE> | <CODE><SPAN class="keyword">elsecase</SPAN></CODE> | <CODE><SPAN class="keyword">elseif</SPAN></CODE> | <CODE><SPAN class="keyword">end</SPAN></CODE></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD><CODE><SPAN class="keyword">export</SPAN></CODE> | <CODE><SPAN class="keyword">fail</SPAN></CODE> | <CODE><SPAN class="keyword">false</SPAN></CODE> | <CODE><SPAN class="keyword">feat</SPAN></CODE> | <CODE><SPAN class="keyword">finally</SPAN></CODE> | <CODE><SPAN class="keyword">from</SPAN></CODE></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD><CODE><SPAN class="keyword">fun</SPAN></CODE> | <CODE><SPAN class="keyword">functor</SPAN></CODE> | <CODE><SPAN class="keyword">if</SPAN></CODE> | <CODE><SPAN class="keyword">import</SPAN></CODE> | <CODE><SPAN class="keyword">in</SPAN></CODE> | <CODE><SPAN class="keyword">local</SPAN></CODE></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD><CODE><SPAN class="keyword">lock</SPAN></CODE> | <CODE><SPAN class="keyword">meth</SPAN></CODE> | <CODE><SPAN class="keyword">mod</SPAN></CODE> | <CODE><SPAN class="keyword">not</SPAN></CODE> | <CODE><SPAN class="keyword">of</SPAN></CODE> | <CODE><SPAN class="keyword">or</SPAN></CODE> | <CODE><SPAN class="keyword">orelse</SPAN></CODE></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD><CODE><SPAN class="keyword">prepare</SPAN></CODE> | <CODE><SPAN class="keyword">proc</SPAN></CODE> | <CODE><SPAN class="keyword">prop</SPAN></CODE> | <CODE><SPAN class="keyword">raise</SPAN></CODE> | <CODE><SPAN class="keyword">require</SPAN></CODE></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD><CODE><SPAN class="keyword">self</SPAN></CODE> | <CODE><SPAN class="keyword">skip</SPAN></CODE> | <CODE><SPAN class="keyword">then</SPAN></CODE> | <CODE><SPAN class="keyword">thread</SPAN></CODE> | <CODE><SPAN class="keyword">true</SPAN></CODE> | <CODE><SPAN class="keyword">try</SPAN></CODE></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD><CODE><SPAN class="keyword">unit</SPAN></CODE> | <CODE>(</CODE> | <CODE>)</CODE> | <CODE>[</CODE> | <CODE>]</CODE> | <CODE>{</CODE> | <CODE>}</CODE></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD><CODE><SPAN class="keyword">|</SPAN></CODE> | <CODE><SPAN class="keyword">#</SPAN></CODE> | <CODE>:</CODE> | <CODE><SPAN class="keyword">...</SPAN></CODE> | <CODE>=</CODE> | <CODE><SPAN class="keyword">.</SPAN></CODE> | <CODE><SPAN class="keyword">:=</SPAN></CODE> | <CODE>^</CODE> | <CODE><SPAN class="keyword">[]</SPAN></CODE> | <CODE>$</CODE></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD><CODE><SPAN class="keyword">!</SPAN></CODE> | <CODE>_</CODE> | <CODE><SPAN class="keyword">~</SPAN></CODE> | <CODE><SPAN class="keyword">+</SPAN></CODE> | <CODE><SPAN class="keyword">-</SPAN></CODE> | <CODE><SPAN class="keyword">*</SPAN></CODE> | <CODE><SPAN class="keyword">/</SPAN></CODE> | <CODE><SPAN class="keyword">@</SPAN></CODE> | <CODE><SPAN class="keyword"><-</SPAN></CODE></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD><CODE><SPAN class="keyword">,</SPAN></CODE> | <CODE><SPAN class="keyword">!!</SPAN></CODE> | <CODE><SPAN class="keyword"><=</SPAN></CODE> | <CODE><SPAN class="keyword">==</SPAN></CODE> | <CODE><SPAN class="keyword">\=</SPAN></CODE> | <CODE><SPAN class="keyword"><</SPAN></CODE> | <CODE><SPAN class="keyword">=<</SPAN></CODE> | <CODE><SPAN class="keyword">></SPAN></CODE></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD><CODE><SPAN class="keyword">>=</SPAN></CODE> | <CODE><SPAN class="keyword">=:</SPAN></CODE> | <CODE><SPAN class="keyword">\=:</SPAN></CODE> | <CODE><SPAN class="keyword"><:</SPAN></CODE> | <CODE><SPAN class="keyword">=<:</SPAN></CODE> | <CODE><SPAN class="keyword">>:</SPAN></CODE> | <CODE><SPAN class="keyword">>=:</SPAN></CODE> | <CODE><SPAN class="keyword">::</SPAN></CODE> | <CODE><SPAN class="keyword">:::</SPAN></CODE></TD></TR></TABLE></BLOCKQUOTE><P>Each keyword represents itself as token. </P><H2><A name="label7">2.4 Variables</A></H2><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>variable</I>></TD><TD align="center"> ::= </TD><TD><<I>upper-case letter</I>> { <<I>alphanumerical</I>> }</TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD><CODE>`</CODE> { <<I>variable char</I>> | <<I>pseudo char</I>> } <CODE>`</CODE></TD></TR></TABLE></BLOCKQUOTE><P> A word of the form <<I>variable</I>> represents a variable token of the form <IMG alt="\lfloor" src="latex5.png"><CODE>variable</CODE>, <I>n</I>+<IMG alt="\rfloor" src="latex6.png">, where <I>n</I>+ is the sequence of characters that make up the word, including the possibly surrounding <CODE>`</CODE> characters. </P><P> For example, the word <CODE>Xs</CODE> represents the token <IMG alt="\lfloor" src="latex5.png"><CODE>variable</CODE>, 88 115<IMG alt="\rfloor" src="latex6.png"> and the word <CODE><SPAN class="string">`\n`</SPAN></CODE> represents the token <IMG alt="\lfloor" src="latex5.png"><CODE>variable</CODE>, 96 10 96<IMG alt="\rfloor" src="latex6.png">. Variable tokens are denoted by the terminal symbol <<I>variable</I>> in the following context-free grammars. </P><H2><A name="label8">2.5 Atoms</A></H2><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>atom</I>></TD><TD align="center"> ::= </TD><TD><<I>lower-case letter</I>> { <<I>alphanumerical</I>> } - <<I>keyword</I>></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD><CODE>'</CODE> { <<I>atom char</I>> | <<I>pseudo char</I>> } <CODE>'</CODE></TD></TR></TABLE></BLOCKQUOTE><P> A word of the form <<I>atom</I>> represents an atom token of the form <IMG alt="\lfloor" src="latex5.png"><CODE>atom</CODE>, <I>n</I>*<IMG alt="\rfloor" src="latex6.png">, where <I>n</I>* is the sequence of characters that make up the word, excluding the possibly surrounding <CODE>'</CODE> characters. </P><P> For example, the word <CODE>atom</CODE> represents the token <IMG alt="\lfloor" src="latex5.png"><CODE>atom</CODE>, 97 116 111 109<IMG alt="\rfloor" src="latex6.png"> and the word <CODE><SPAN class="string">'\n'</SPAN></CODE> represents the token <IMG alt="\lfloor" src="latex5.png"><CODE>atom</CODE>, 10<IMG alt="\rfloor" src="latex6.png">. Atom tokens are denoted by the terminal symbol <<I>atom</I>> in the following context-free grammars. </P><H2><A name="label9">2.6 Labels</A></H2><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>label</I>></TD><TD align="center"> ::= </TD><TD>( <<I>variable</I>> | <<I>atom</I>> | <CODE>true</CODE> | <CODE>false</CODE> | <CODE>unit</CODE> ) <CODE>(</CODE></TD></TR></TABLE></BLOCKQUOTE><P> A word of the form <<I>label</I>> represents a sequence of two tokens. The first is a label token of the form <IMG alt="\lfloor" src="latex5.png"><CODE>variablelabel</CODE>, <I>n</I>+<IMG alt="\rfloor" src="latex6.png">, <IMG alt="\lfloor" src="latex5.png"><CODE>atomlabel</CODE>, <I>n</I>*<IMG alt="\rfloor" src="latex6.png"> (similar to the corresponding tokens for words of the form <<I>variable</I>> and <<I>atom</I>>), <CODE>truelabel</CODE>, <CODE>falselabel</CODE>, or <CODE>unitlabel</CODE>. The second token is the keyword <CODE>(</CODE>. For example, the word <CODE>Xs(</CODE> represents the tokens <IMG alt="\lfloor" src="latex5.png"><CODE>variablelabel</CODE>, 88 115<IMG alt="\rfloor" src="latex6.png"> and <CODE>(</CODE>, and the word <CODE><SPAN class="keyword">true</SPAN>(</CODE> represents the tokens <CODE>truelabel</CODE> and <CODE>(</CODE>. The label tokens are denoted by the terminal symbols <<I>variable label</I>>, <<I>atom label</I>>, <<I>unit label</I>>, <<I>true label</I>>, and <<I>false label</I>> in the following context-free grammars. </P><H2><A name="label10">2.7 Integers</A></H2><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>int</I>></TD><TD align="center"> ::= </TD><TD>[ <CODE>~</CODE> ] ( <CODE>0</CODE> | <<I>non-zero digit</I>> { <<I>digit</I>> } ) </TD><TD align="left"><I> % decimal representation</I></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD>[ <CODE>~</CODE> ] <CODE>0</CODE> { <<I>octal digit</I>> }+ </TD><TD align="left"><I> % octal representation</I></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD>[ <CODE>~</CODE> ] <CODE>0</CODE> ( <CODE>x</CODE> | <CODE>X</CODE> ) { <<I>hex digit</I>> }+ </TD><TD align="left"><I> % hexadecimal representation</I></TD></TR><TR valign="top"><TD></TD><TD align="center"> | </TD><TD>[ <CODE>~</CODE> ] <CODE>0</CODE> ( <CODE>b</CODE> | <CODE>B</CODE> ) { <<I>binary digit</I>> }+ </TD><TD align="left"><I> % binary representation</I></TD></TR></TABLE></BLOCKQUOTE><P> A word of the form <<I>int</I>> represents an integer token of the form <IMG alt="\lfloor" src="latex5.png"><CODE>int</CODE>, <I>n</I><IMG alt="\rfloor" src="latex6.png">, where <I>n</I> represents the integer for which <<I>int</I>> is the representation. </P><P> For example, the word <CODE><SPAN class="keyword">~</SPAN>159</CODE> represents the token <IMG alt="\lfloor" src="latex5.png"><CODE>int</CODE>, -159<IMG alt="\rfloor" src="latex6.png">, the word <CODE>077</CODE> the token <IMG alt="\lfloor" src="latex5.png"><CODE>int</CODE>, 63<IMG alt="\rfloor" src="latex6.png">, the word <CODE>0xFF</CODE> the token <IMG alt="\lfloor" src="latex5.png"><CODE>int</CODE>, 255<IMG alt="\rfloor" src="latex6.png">, and the word <CODE><SPAN class="keyword">~</SPAN>0b11111</CODE> the token <IMG alt="\lfloor" src="latex5.png"><CODE>int</CODE>, -31<IMG alt="\rfloor" src="latex6.png">. Integer tokens are denoted by the terminal symbol <<I>int</I>> in the following context-free grammars. </P><H2><A name="label11">2.8 Floats</A></H2><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>float</I>></TD><TD align="center"> ::= </TD><TD>[ <CODE>~</CODE> ] { <<I>digit</I>> }+ <CODE>.</CODE> { <<I>digit</I>> } [ ( <CODE>e</CODE> | <CODE>E</CODE> ) [ <CODE>~</CODE> ] { <<I>digit</I>> }+ ]</TD></TR></TABLE></BLOCKQUOTE><P> A word of the form <<I>float</I>> represents a float token of the form <IMG alt="\lfloor" src="latex5.png"><CODE>float</CODE>, <I>f</I><IMG alt="\rfloor" src="latex6.png">, where <I>f</I> represents the floating point number for which the word is the decimal representation. The letters <CODE>e</CODE> and <CODE>E</CODE> both indicate the exponent to 10. </P><P> For example, the word <CODE><SPAN class="keyword">~</SPAN>1<SPAN class="keyword">.</SPAN>5e2</CODE> represents the token <IMG alt="\lfloor" src="latex5.png"><CODE>float</CODE>, -150.0<IMG alt="\rfloor" src="latex6.png">. Float tokens are denoted by the terminal symbol <<I>float</I>> in the following context-free grammars. </P><P> The syntax of floats is implementation-dependent in that syntactically correct floats may be approximated by the compiler if they cannot be represented by the implementation. </P><H2><A name="label12">2.9 Strings</A></H2><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>string</I>></TD><TD align="center"> ::= </TD><TD><CODE><SPAN class="string">"</SPAN></CODE> { <<I>string char</I>> | <<I>pseudo char</I>> } <CODE><SPAN class="string">"</SPAN></CODE></TD></TR></TABLE></BLOCKQUOTE><P> The word <CODE><SPAN class="string">""</SPAN></CODE> represents the token <IMG alt="\lfloor" src="latex5.png"><CODE>atom</CODE>, 110 105 108<IMG alt="\rfloor" src="latex6.png">, which denotes the empty list <CODE>nil</CODE>. A word of the form <CODE><SPAN class="string">"</SPAN></CODE><IMG alt="c_1" src="latex7.png"> ... <IMG alt="c_m" src="latex8.png"><CODE><SPAN class="string">"</SPAN></CODE>, where <IMG alt="m \geq 1" src="latex9.png">, represents a sequence of <IMG alt="m + 2" src="latex10.png"> tokens of the form <CODE>[</CODE> <IMG alt="n_1" src="latex11.png"> ... <IMG alt="n_m" src="latex12.png"> <CODE>]</CODE>, where the <IMG alt="n_i" src="latex13.png"> represent integer tokens according to the ISO 8859-1 code of <IMG alt="c_i" src="latex14.png">. </P><P> For example, the word <CODE><SPAN class="string">"ab"</SPAN></CODE> represents the sequence of tokens <CODE>[</CODE> <IMG alt="\lfloor" src="latex5.png"><CODE>int</CODE>, 97<IMG alt="\rfloor" src="latex6.png"> <IMG alt="\lfloor" src="latex5.png"><CODE>int</CODE>, 98<IMG alt="\rfloor" src="latex6.png"> <CODE>]</CODE>. </P><H2><A name="label13">2.10 Characters</A></H2><P> </P><BLOCKQUOTE><TABLE border="0" cellpadding="0" cellspacing="0"><TR valign="top"><TD><<I>character</I>></TD><TD align="center"> ::= </TD><TD><CODE>&</CODE> ( <<I>any character</I>> - ( <CODE>\</CODE> | NUL ) | <<I>pseudo char</I>> )</TD></TR></TABLE></BLOCKQUOTE><P> A word of the form <<I>character</I>> represents the integer token according to the code of the character denoted by the word without the <CODE>&</CODE> prefix. </P><P> For example, the word <CODE><SPAN class="string">&a</SPAN></CODE> represents the token <IMG alt="\lfloor" src="latex5.png"><CODE>int</CODE>, 97<IMG alt="\rfloor" src="latex6.png">. </P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node1.html#chapter.intro"><< Prev</A></TD><TD><A href="index.html">- Up -</A></TD><TD><A href="node3.html#chapter.context-free">Next >></A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.iscs.nus.edu.sg/~henz">Martin Henz</A> and <A href="http://www.ps.uni-sb.de/~kornstae/">Leif Kornstaedt</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|