Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 19bb6433bb07a8b16410504336791904 > files > 216

ocaml-doc-3.06-5mdk.ppc.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>

<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.06-7 of 2001-11-14">
<TITLE>
 Lexical conventions
</TITLE>
</HEAD>
<BODY TEXT=black BGCOLOR=white>
<A HREF="manual008.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="manual010.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#66ff66"><DIV ALIGN=center><TABLE>
<TR><TD><A NAME="htoc51"><B><FONT SIZE=5>6.1</FONT></B></A></TD>
<TD WIDTH="100%" ALIGN=center><B><FONT SIZE=5>Lexical conventions</FONT></B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE>
<BR>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#98ff98"><DIV ALIGN=center><TABLE>
<TR><TD><B>Blanks</B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE><BR>
The following characters are considered as blanks: space, newline,
horizontal tabulation, carriage return, line feed and form feed. Blanks are
ignored, but they separate adjacent identifiers, literals and
keywords that would otherwise be confused as one single identifier,
literal or keyword.<BR>
<BR>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#98ff98"><DIV ALIGN=center><TABLE>
<TR><TD><B>Comments</B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE><BR>
Comments are introduced by the two characters <TT>(*</TT>, with no
intervening blanks, and terminated by the characters <TT>*)</TT>, with
no intervening blanks. Comments are treated as blank characters.
Comments do not occur inside string or character literals. Nested
comments are handled correctly.<BR>
<BR>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#98ff98"><DIV ALIGN=center><TABLE>
<TR><TD><B>Identifiers</B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE><BR>
<DIV ALIGN=center><TABLE CELLSPACING=2 CELLPADDING=0>
<TR><TD ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>ident</FONT></I></TT></TD>
<TD ALIGN=right NOWRAP>::=</TD>
<TD ALIGN=left NOWRAP> (<TT><I><FONT COLOR=maroon>letter</FONT></I></TT>| <TT><FONT COLOR=blue>_</FONT></TT>) { <TT><I><FONT COLOR=maroon>letter</FONT></I></TT>| <TT><FONT COLOR=blue>0</FONT></TT>...<TT><FONT COLOR=blue>9</FONT></TT>| <TT><FONT COLOR=blue>_</FONT></TT>| <TT><FONT COLOR=blue>'</FONT></TT> }</TD>
</TR>
<TR><TD ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>letter</FONT></I></TT></TD>
<TD ALIGN=right NOWRAP>::=</TD>
<TD ALIGN=left NOWRAP> <TT><FONT COLOR=blue>A</FONT></TT> ... <TT><FONT COLOR=blue>Z</FONT></TT> |  <TT><FONT COLOR=blue>a</FONT></TT> ... <TT><FONT COLOR=blue>z</FONT></TT></TD>
</TR></TABLE></DIV><BR>
Identifiers are sequences of letters, digits, <TT>_</TT> (the underscore
character), and <TT>'</TT> (the single quote), starting with a
letter or an underscore.
Letters contain at least the 52 lowercase and uppercase
letters from the ASCII set. The current implementation (except on
MacOS) also recognizes as letters all accented characters from the ISO
8859-1 (``ISO Latin 1'') set. All characters in an identifier are
meaningful. The current implementation places no limits on the number
of characters of an identifier.<BR>
<BR>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#98ff98"><DIV ALIGN=center><TABLE>
<TR><TD><B>Integer literals</B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE><BR>
<DIV ALIGN=center><TABLE CELLSPACING=2 CELLPADDING=0>
<TR><TD ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>integer-literal</FONT></I></TT></TD>
<TD ALIGN=right NOWRAP>::=</TD>
<TD ALIGN=left NOWRAP>
 [<TT><FONT COLOR=blue>-</FONT></TT>] { <TT><FONT COLOR=blue>0</FONT></TT>...<TT><FONT COLOR=blue>9</FONT></TT> }<SUP><FONT SIZE=2>+</FONT></SUP></TD>
</TR>
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
<TD ALIGN=right NOWRAP>|</TD>
<TD ALIGN=left NOWRAP> [<TT><FONT COLOR=blue>-</FONT></TT>] (<TT><FONT COLOR=blue>0x</FONT></TT>| <TT><FONT COLOR=blue>0X</FONT></TT>) { <TT><FONT COLOR=blue>0</FONT></TT>...<TT><FONT COLOR=blue>9</FONT></TT>| <TT><FONT COLOR=blue>A</FONT></TT>...<TT><FONT COLOR=blue>F</FONT></TT>| <TT><FONT COLOR=blue>a</FONT></TT>...<TT><FONT COLOR=blue>f</FONT></TT> }<SUP><FONT SIZE=2>+</FONT></SUP></TD>
</TR>
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
<TD ALIGN=right NOWRAP>|</TD>
<TD ALIGN=left NOWRAP> [<TT><FONT COLOR=blue>-</FONT></TT>] (<TT><FONT COLOR=blue>0o</FONT></TT>| <TT><FONT COLOR=blue>0O</FONT></TT>) { <TT><FONT COLOR=blue>0</FONT></TT>...<TT><FONT COLOR=blue>7</FONT></TT> }<SUP><FONT SIZE=2>+</FONT></SUP></TD>
</TR>
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
<TD ALIGN=right NOWRAP>|</TD>
<TD ALIGN=left NOWRAP> [<TT><FONT COLOR=blue>-</FONT></TT>] (<TT><FONT COLOR=blue>0b</FONT></TT>| <TT><FONT COLOR=blue>0B</FONT></TT>) { <TT><FONT COLOR=blue>0</FONT></TT>...<TT><FONT COLOR=blue>1</FONT></TT> }<SUP><FONT SIZE=2>+</FONT></SUP></TD>
</TR></TABLE></DIV><BR>
An integer literal is a sequence of one or more digits, optionally
preceded by a minus sign. By default, integer literals are in decimal
(radix 10). The following prefixes select a different radix:
<BR>
<DIV ALIGN=center><TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1 WIDTH="80%">
<TR><TD ALIGN=center NOWRAP><B>Prefix</B></TD>
<TD ALIGN=center NOWRAP><B>Radix</B></TD>
</TR>
<TR><TD ALIGN=left NOWRAP>
<TT>0x</TT>, <TT>0X</TT></TD>
<TD ALIGN=left NOWRAP>hexadecimal (radix 16)</TD>
</TR>
<TR><TD ALIGN=left NOWRAP><TT>0o</TT>, <TT>0O</TT></TD>
<TD ALIGN=left NOWRAP>octal (radix 8)</TD>
</TR>
<TR><TD ALIGN=left NOWRAP><TT>0b</TT>, <TT>0B</TT></TD>
<TD ALIGN=left NOWRAP>binary (radix 2)</TD>
</TR></TABLE></DIV><BR>

(The initial <TT>0</TT> is the digit zero; the <TT>O</TT> for octal is the letter O.)
The interpretation of integer literals that fall outside the range of
representable integer values is undefined.<BR>
<BR>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#98ff98"><DIV ALIGN=center><TABLE>
<TR><TD><B>Floating-point literals</B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE><BR>
<DIV ALIGN=center><TABLE CELLSPACING=2 CELLPADDING=0>
<TR><TD ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>float-literal</FONT></I></TT></TD>
<TD ALIGN=right NOWRAP>::=</TD>
<TD ALIGN=left NOWRAP>
 [<TT><FONT COLOR=blue>-</FONT></TT>] { <TT><FONT COLOR=blue>0</FONT></TT>...<TT><FONT COLOR=blue>9</FONT></TT> }<SUP><FONT SIZE=2>+</FONT></SUP> [<TT><FONT COLOR=blue>.</FONT></TT> { <TT><FONT COLOR=blue>0</FONT></TT>...<TT><FONT COLOR=blue>9</FONT></TT> }]
 [(<TT><FONT COLOR=blue>e</FONT></TT>| <TT><FONT COLOR=blue>E</FONT></TT>) [<TT><FONT COLOR=blue>+</FONT></TT>| <TT><FONT COLOR=blue>-</FONT></TT>] { <TT><FONT COLOR=blue>0</FONT></TT>...<TT><FONT COLOR=blue>9</FONT></TT> }<SUP><FONT SIZE=2>+</FONT></SUP>]</TD>
</TR></TABLE></DIV><BR>
Floating-point decimals consist in an integer part, a decimal part and
an exponent part. The integer part is a sequence of one or more
digits, optionally preceded by a minus sign. The decimal part is a
decimal point followed by zero, one or more digits.
The exponent part is the character <TT>e</TT> or <TT>E</TT> followed by an
optional <TT>+</TT> or <TT>-</TT> sign, followed by one or more digits.
The decimal part or the exponent part can be omitted, but not both to
avoid ambiguity with integer literals.
The interpretation of floating-point literals that fall outside the
range of representable floating-point values is undefined.<BR>
<BR>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#98ff98"><DIV ALIGN=center><TABLE>
<TR><TD><B>Character literals</B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE>
<A NAME="s:characterliteral"></A><BR>
<DIV ALIGN=center><TABLE CELLSPACING=2 CELLPADDING=0>
<TR><TD ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>char-literal</FONT></I></TT></TD>
<TD ALIGN=right NOWRAP>::=</TD>
<TD ALIGN=left NOWRAP>
 <TT><FONT COLOR=blue>'</FONT></TT> <TT><I><FONT COLOR=maroon>regular-char</FONT></I></TT> <TT><FONT COLOR=blue>'</FONT></TT></TD>
</TR>
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
<TD ALIGN=right NOWRAP>|</TD>
<TD ALIGN=left NOWRAP> <TT><FONT COLOR=blue>'</FONT></TT> <TT><I><FONT COLOR=maroon>escape-sequence</FONT></I></TT> <TT><FONT COLOR=blue>'</FONT></TT></TD>
</TR>
<TR><TD ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>escape-sequence</FONT></I></TT></TD>
<TD ALIGN=right NOWRAP>::=</TD>
<TD ALIGN=left NOWRAP>
 <TT><FONT COLOR=blue>\</FONT></TT> (<TT><FONT COLOR=blue>\</FONT></TT> |  <TT><FONT COLOR=blue>"</FONT></TT> |  <TT><FONT COLOR=blue>'</FONT></TT> |  <TT><FONT COLOR=blue>n</FONT></TT> |  <TT><FONT COLOR=blue>t</FONT></TT> |  <TT><FONT COLOR=blue>b</FONT></TT> |  <TT><FONT COLOR=blue>r</FONT></TT>)</TD>
</TR>
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
<TD ALIGN=right NOWRAP>|</TD>
<TD ALIGN=left NOWRAP> <TT><FONT COLOR=blue>\</FONT></TT> (<TT><FONT COLOR=blue>0</FONT></TT>...<TT><FONT COLOR=blue>9</FONT></TT>) (<TT><FONT COLOR=blue>0</FONT></TT>...<TT><FONT COLOR=blue>9</FONT></TT>) (<TT><FONT COLOR=blue>0</FONT></TT>...<TT><FONT COLOR=blue>9</FONT></TT>)</TD>
</TR></TABLE></DIV><BR>
Character literals are delimited by <TT>'</TT> (single quote) characters.
The two single quotes enclose either one character different from
<TT>'</TT> and <TT>\</TT>, or one of the escape sequences below:
<BR>
<DIV ALIGN=center><TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1 WIDTH="80%">
<TR><TD ALIGN=center NOWRAP><B>Sequence</B></TD>
<TD ALIGN=center NOWRAP><B>Character denoted</B></TD>
</TR>
<TR><TD ALIGN=left NOWRAP>
<TT>\\</TT></TD>
<TD ALIGN=left NOWRAP>backslash (<TT>\</TT>)</TD>
</TR>
<TR><TD ALIGN=left NOWRAP><TT>\"</TT></TD>
<TD ALIGN=left NOWRAP>double quote (<TT>"</TT>)</TD>
</TR>
<TR><TD ALIGN=left NOWRAP><TT>\'</TT></TD>
<TD ALIGN=left NOWRAP>single quote (<TT>'</TT>)</TD>
</TR>
<TR><TD ALIGN=left NOWRAP><TT>\n</TT></TD>
<TD ALIGN=left NOWRAP>linefeed (LF)</TD>
</TR>
<TR><TD ALIGN=left NOWRAP><TT>\r</TT></TD>
<TD ALIGN=left NOWRAP>carriage return (CR)</TD>
</TR>
<TR><TD ALIGN=left NOWRAP><TT>\t</TT></TD>
<TD ALIGN=left NOWRAP>horizontal tabulation (TAB)</TD>
</TR>
<TR><TD ALIGN=left NOWRAP><TT>\b</TT></TD>
<TD ALIGN=left NOWRAP>backspace (BS)</TD>
</TR>
<TR><TD ALIGN=left NOWRAP><TT>\</TT><I>ddd</I></TD>
<TD ALIGN=left NOWRAP>the character with ASCII code <I>ddd</I> in decimal</TD>
</TR></TABLE></DIV><BR>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#98ff98"><DIV ALIGN=center><TABLE>
<TR><TD><B>String literals</B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE>
<A NAME="s:stringliteral"></A><BR>
<DIV ALIGN=center><TABLE CELLSPACING=2 CELLPADDING=0>
<TR><TD ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>string-literal</FONT></I></TT></TD>
<TD ALIGN=right NOWRAP>::=</TD>
<TD ALIGN=left NOWRAP>
 <TT><FONT COLOR=blue>"</FONT></TT> { <TT><I><FONT COLOR=maroon>string-character</FONT></I></TT> } <TT><FONT COLOR=blue>"</FONT></TT></TD>
</TR>
<TR><TD ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>string-character</FONT></I></TT></TD>
<TD ALIGN=right NOWRAP>::=</TD>
<TD ALIGN=left NOWRAP>
 <TT><I><FONT COLOR=maroon>regular-char-str</FONT></I></TT></TD>
</TR>
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
<TD ALIGN=right NOWRAP>|</TD>
<TD ALIGN=left NOWRAP> <TT><I><FONT COLOR=maroon>escape-sequence</FONT></I></TT></TD>
</TR></TABLE></DIV><BR>
String literals are delimited by <TT>"</TT> (double quote) characters.
The two double quotes enclose a sequence of either characters
different from <TT>"</TT> and <TT>\</TT>, or escape sequences from the
table given above for character literals.<BR>
<BR>
To allow splitting long string literals across lines, the sequence
<TT>\</TT><I>newline</I>&nbsp;<I>blanks</I> (a <TT>\</TT> at end-of-line followed by any
number of blanks at the beginning of the next line) is ignored inside
string literals.<BR>
<BR>
The current implementation places practically no restrictions on the
length of string literals.<BR>
<BR>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#98ff98"><DIV ALIGN=center><TABLE>
<TR><TD><B>Naming labels</B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE><BR>
To avoid ambiguities, naming labels cannot just be defined
syntactically as the sequence of the three tokens <TT>~</TT>, <TT><I><FONT COLOR=maroon>ident</FONT></I></TT> and
<TT>:</TT>, and have to be defined at the lexical level.<BR>
<DIV ALIGN=center><TABLE CELLSPACING=2 CELLPADDING=0>
<TR><TD ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>label</FONT></I></TT> </TD>
<TD ALIGN=right NOWRAP>::=</TD>
<TD ALIGN=left NOWRAP> <TT><FONT COLOR=blue>~</FONT></TT> (<TT><FONT COLOR=blue>a</FONT></TT> ... <TT><FONT COLOR=blue>z</FONT></TT>) { <TT><I><FONT COLOR=maroon>letter</FONT></I></TT>| <TT><FONT COLOR=blue>0</FONT></TT>...<TT><FONT COLOR=blue>9</FONT></TT>| <TT><FONT COLOR=blue>_</FONT></TT>| <TT><FONT COLOR=blue>'</FONT></TT> } <TT><FONT COLOR=blue>:</FONT></TT></TD>
</TR>
<TR><TD ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>optlabel</FONT></I></TT> </TD>
<TD ALIGN=right NOWRAP>::=</TD>
<TD ALIGN=left NOWRAP> <TT><FONT COLOR=blue>?</FONT></TT> (<TT><FONT COLOR=blue>a</FONT></TT> ... <TT><FONT COLOR=blue>z</FONT></TT>) { <TT><I><FONT COLOR=maroon>letter</FONT></I></TT>| <TT><FONT COLOR=blue>0</FONT></TT>...<TT><FONT COLOR=blue>9</FONT></TT>| <TT><FONT COLOR=blue>_</FONT></TT>| <TT><FONT COLOR=blue>'</FONT></TT> } <TT><FONT COLOR=blue>:</FONT></TT></TD>
</TR></TABLE></DIV><BR>
Naming labels come in two flavours: <TT><I><FONT COLOR=maroon>label</FONT></I></TT> for normal arguments and
<TT><I><FONT COLOR=maroon>optlabel</FONT></I></TT> for optional ones. They are simply distinguished by their
first character, either <TT>~</TT> or <TT>?</TT>.<BR>
<BR>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#98ff98"><DIV ALIGN=center><TABLE>
<TR><TD><B>Prefix and infix symbols</B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE><BR>
<DIV ALIGN=center><TABLE CELLSPACING=2 CELLPADDING=0>
<TR><TD ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>infix-symbol</FONT></I></TT></TD>
<TD ALIGN=right NOWRAP>::=</TD>
<TD ALIGN=left NOWRAP>
 (<TT><FONT COLOR=blue>=</FONT></TT> |  <TT><FONT COLOR=blue>&lt;</FONT></TT> |  <TT><FONT COLOR=blue>&gt;</FONT></TT> |  <TT><FONT COLOR=blue>@</FONT></TT> |  <TT><FONT COLOR=blue>^</FONT></TT> |  <TT><FONT COLOR=blue>|</FONT></TT> |  <TT><FONT COLOR=blue>&amp;</FONT></TT> | 
 <TT><FONT COLOR=blue>+</FONT></TT> |  <TT><FONT COLOR=blue>-</FONT></TT> |  <TT><FONT COLOR=blue>*</FONT></TT> |  <TT><FONT COLOR=blue>/</FONT></TT> |  <TT><FONT COLOR=blue>$</FONT></TT> |  <TT><FONT COLOR=blue>%</FONT></TT>) { <TT><I><FONT COLOR=maroon>operator-char</FONT></I></TT> }</TD>
</TR>
<TR><TD ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>prefix-symbol</FONT></I></TT></TD>
<TD ALIGN=right NOWRAP>::=</TD>
<TD ALIGN=left NOWRAP>
 (<TT><FONT COLOR=blue>!</FONT></TT> |  <TT><FONT COLOR=blue>?</FONT></TT> |  <TT><FONT COLOR=blue>~</FONT></TT>) { <TT><I><FONT COLOR=maroon>operator-char</FONT></I></TT> }</TD>
</TR>
<TR><TD ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>operator-char</FONT></I></TT></TD>
<TD ALIGN=right NOWRAP>::=</TD>
<TD ALIGN=left NOWRAP>
 <TT><FONT COLOR=blue>!</FONT></TT> |  <TT><FONT COLOR=blue>$</FONT></TT> |  <TT><FONT COLOR=blue>%</FONT></TT> |  <TT><FONT COLOR=blue>&amp;</FONT></TT> |  <TT><FONT COLOR=blue>*</FONT></TT> |  <TT><FONT COLOR=blue>+</FONT></TT> |  <TT><FONT COLOR=blue>-</FONT></TT> |  <TT><FONT COLOR=blue>.</FONT></TT> | 
 <TT><FONT COLOR=blue>/</FONT></TT> |  <TT><FONT COLOR=blue>:</FONT></TT> |  <TT><FONT COLOR=blue>&lt;</FONT></TT> |  <TT><FONT COLOR=blue>=</FONT></TT> |  <TT><FONT COLOR=blue>&gt;</FONT></TT> |  <TT><FONT COLOR=blue>?</FONT></TT> |  <TT><FONT COLOR=blue>@</FONT></TT> | 
 <TT><FONT COLOR=blue>^</FONT></TT> |  <TT><FONT COLOR=blue>|</FONT></TT> |  <TT><FONT COLOR=blue>~</FONT></TT></TD>
</TR></TABLE></DIV><BR>
Sequences of ``operator characters'', such as <TT>&lt;=&gt;</TT> or <TT>!!</TT>,
are read as a single token from the <TT><I><FONT COLOR=maroon>infix-symbol</FONT></I></TT> or <TT><I><FONT COLOR=maroon>prefix-symbol</FONT></I></TT>
class. These symbols are parsed as prefix and infix operators inside
expressions, but otherwise behave much as identifiers.
<BR>
<BR>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#98ff98"><DIV ALIGN=center><TABLE>
<TR><TD><B>Keywords</B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE><BR>
The identifiers below are reserved as keywords, and cannot be employed
otherwise:
<PRE>
      and         as          assert      asr         begin       class
      closed      constraint  do          done        downto      else
      end         exception   external    false       for         fun
      function    functor     if          in          include     inherit
      land        lazy        let         lor         lsl         lsr
      lxor        match       method      mod         module      mutable
      new         of          open        or          parser      private
      rec         sig         struct      then        to          true
      try         type        val         virtual     when        while
      with        
</PRE>The following character sequences are also keywords:
<PRE>
    #     &amp;     '     (     )     *     ,     -&gt;    ?
    ??    .     ..    .(    .[    :     ::    :=    ;
    ;;    &lt;-    =     [     [|    [&lt;    {&lt;    ]     |]
    &gt;]    &gt;}    _     `     {     |     }     ~
</PRE>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#98ff98"><DIV ALIGN=center><TABLE>
<TR><TD><B>Ambiguities</B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE><BR>
Lexical ambiguities are resolved according to the ``longest match''
rule: when a character sequence can be decomposed into two tokens in
several different ways, the decomposition retained is the one with the
longest first token.<BR>
<BR>
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%">
<TR><TD BGCOLOR="#98ff98"><DIV ALIGN=center><TABLE>
<TR><TD><B>Line number directives</B></TD>
</TR></TABLE></DIV></TD>
</TR></TABLE><BR>
<DIV ALIGN=center><TABLE CELLSPACING=2 CELLPADDING=0>
<TR><TD ALIGN=right NOWRAP>
<TT><I><FONT COLOR=maroon>linenum-directive</FONT></I></TT></TD>
<TD ALIGN=right NOWRAP>::=</TD>
<TD ALIGN=left NOWRAP>
 <TT><FONT COLOR=blue>#</FONT></TT> {<TT><FONT COLOR=blue>0</FONT></TT> ... <TT><FONT COLOR=blue>9</FONT></TT>}<SUP><FONT SIZE=2>+</FONT></SUP></TD>
</TR>
<TR><TD ALIGN=right NOWRAP>&nbsp;</TD>
<TD ALIGN=right NOWRAP>|</TD>
<TD ALIGN=left NOWRAP> <TT><FONT COLOR=blue>#</FONT></TT> {<TT><FONT COLOR=blue>0</FONT></TT> ... <TT><FONT COLOR=blue>9</FONT></TT>}<SUP><FONT SIZE=2>+</FONT></SUP> <TT><FONT COLOR=blue>"</FONT></TT> { <TT><I><FONT COLOR=maroon>string-character</FONT></I></TT> } <TT><FONT COLOR=blue>"</FONT></TT></TD>
</TR></TABLE></DIV><BR>
Preprocessors that generate Caml source code can insert line number
directives in their output so that error messages produced by the
compiler contain line numbers and file names referring to the source
file before preprocessing, instead of after preprocessing.
A line number directive is composed of a <TT>#</TT> (sharp sign), followed by
a positive integer (the source line number), optionally followed by a
character string (the source file name).
Line number directives are treated as blank characters during lexical
analysis.

<BR>
<BR>
<HR>
<A HREF="manual008.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="manual010.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>