Commit c7b23af6 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2005-03-04 14:53:51 by afrisch] doc

Original author: afrisch
Date: 2005-03-04 14:53:51+00:00
parent 539728a9
......@@ -15,10 +15,11 @@ let () =
let v = ref [] in
(try while true do
let s = input_line ic in
if s = "" then raise End_of_file;
match s.[0] with
| 'A'..'Z' -> v := s :: !v
| _ -> err "Names must start with a capitalized letter"
if s != "" then
match s.[0] with
| 'A'..'Z' -> v := s :: !v
| '#' -> ()
| _ -> err "Names must start with a capitalized letter"
done
with End_of_file -> ());
let s = Mlstub.gen_wrapper !v in
......
......@@ -370,7 +370,8 @@ The first argument is the file name of the resulting toplevel.
The second points to a file whose contents specify a set of built-in
OCaml values to be embedded in the toplevel. Each line must either
be a qualified value (like <code>List.map</code>) or
the name of an OCaml unit (like <code>List</code>).
the name of an OCaml unit (like <code>List</code>). Empty lines
and lines starting with a sharp character are ignored.
</p>
</box>
......
......@@ -172,16 +172,6 @@ or <code>let %%p%% : %%t%% = %%e%%</code>.</li>
<li>Evaluation statements (an expression to evaluate).</li>
<li>Debugging statements:
<sample><![CDATA[
debug filter %%t%% %%p%% {{ inference for pattern matching }}
debug accept %%p%% {{ type accepted by a pattern }}
debug sample %%t%% {{ compute a sample from a type }}
debug subtype %%t%%1 %%t2%% {{ check subtyping }}
debug compile %%t%% %%p%%1 ... %%pn%% {{ compilation of pattern matching }}
]]></sample>
</li>
<li>Textual inclusion <code>include "%%other_cduce_script.cd%%"</code>;
note that cycle of inclusion are detected and automatically broken.
Filename are relative to the directory of the current file
......@@ -200,30 +190,14 @@ and global namespace default <code>namespace "%%...%%"</code>
or <code>using %%alias%% = %%unit%%</code>:
gives an alternative name for a pre-compiled unit. Values
and types from <code>%%unit%%.cdo</code> can be referred to either as
<code>%%alias%%:%%ident%%</code>
or as <code>%%unit%%:%%ident%%</code>.
<code>%%alias%%.%%ident%%</code>
or as <code>%%unit%%.%%ident%%</code>.
</li>
</ul>
</box>
<box title="Comments" link="comment">
<p>
CDuce supports two style of comments: <code>(* ... *)</code>
and <code>/* ... */</code>. The first style allows the programmer
to put a piece a code apart. Nesting is allowed, and strings
within simple or double quotes are not searched for the end-marker
<code>*)</code>. In particular, simple quotes (and apostrophes)
have to be balanced inside a <code>(* ... *)</code> comment.
The other style <code>/* ... */</code> is more adapted to textual
comments. They cannot be nested and quotes are not treated
specially inside the comment.
</p>
</box>
<box title="Toplevel" link="toplevel">
<p>
......@@ -284,4 +258,54 @@ You can use an external wrapper such as
</box>
<box title="Lexical entities" link="lex">
<p>
The <b>identifiers</b> (for variables, types, recursive patterns)
are qualified names, in the sense of
<a
href="http://www.w3.org/TR/REC-xml-names/">XML Namespaces</a>.
The chapter <local href="namespaces"/> explains how to declare
namespace prefixes in CDuce. Identifiers are resolved as XML
attributes (which means that the default namespace does not apply).
</p>
<p>
The dot must be protected by a backslash in identifiers, to avoid
ambiguity with the dot notation.
</p>
<p>
The dot notation serves several purposes:
</p>
<ul>
<li>
to refer to values and types declared in a separate CDuce compilation unit;
</li>
<li>
to refer to values from OCaml compilation unit
(see <local href="manual_interfacewithocaml"/>);
</li>
<li>
to refer to schema components
(see <local href="manual_schema"/>);
</li>
<li>
to select a field from a record expression.
</li>
</ul>
<p>
CDuce supports two style of <b>comments</b>: <code>(* ... *)</code>
and <code>/* ... */</code>. The first style allows the programmer
to put a piece a code apart. Nesting is allowed, and strings
within simple or double quotes are not searched for the end-marker
<code>*)</code>. In particular, simple quotes (and apostrophes)
have to be balanced inside a <code>(* ... *)</code> comment.
The other style <code>/* ... */</code> is more adapted to textual
comments. They cannot be nested and quotes are not treated
specially inside the comment.
</p>
</box>
</page>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment