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

[r2005-07-07 15:32:44 by afrisch] MAJ manuel

Original author: afrisch
Date: 2005-07-07 15:32:44+00:00
parent 25858708
......@@ -17,14 +17,6 @@ let version () =
List.iter (fun (n,d) -> Printf.eprintf "- %s: %s\n" n d) (Config.descrs ());
exit 0
let license () =
Printf.eprintf "\n\
The CDuce interpreter is distributed under the terms of the Q Public \n\
License version 1.0 (included in the sources). The Choice of Law section\n\
been modified from the original Q Public.\n\n
exit 0
let specs =
[ "--compile", Arg.Set compile,
"compile the given CDuce file";
......@@ -53,10 +45,8 @@ let specs =
" print CDuce version, and list built-in optional features";
"--version", Arg.Unit version,
"print CDuce version, and list built-in optional features";
"--license", Arg.Unit license,
"print CDuce license";
"--mlstub", Arg.Set mlstub,
" produce stub ML code from a compiled unit";
" produce stub ML code from a compiled unit";
let ppf = Format.std_formatter
......@@ -96,14 +96,12 @@ order to use PXP, if both have been included at compile time.
and built-in optional features, and exit.
<li> <code>--license</code>. Show license information and exit.
<li> <code>--mlstub</code>. See <local href="manual_interfacewithocaml"/>.
<li> <code>--help</code>. Show usage information about the command line.
<li> <code>--noquery-optim</code>. Do not optimize queries. </li>
......@@ -168,9 +166,14 @@ let g (x : Int) : Int = x + 1
<li>Global bindings <code>let %%p%% = %%e%%</code>
or <code>let %%p%% : %%t%% = %%e%%</code>.</li>
(bind the result of the expression <code>%%e%%</code> using the
pattern <code>%%p%%</code>),
<code>let %%p%% : %%t%% = %%e%%</code>
(gives a less precise type to the expression),
<code>let %%p%% :? %%t%% = %%e$$</code>
(dynamically checks that the expression has some type).</li>
<li>Evaluation statements (an expression to evaluate).</li>
<li>Evaluation statements: an expression to evaluate.</li>
<li>Textual inclusion <code>include ""</code>;
note that cycle of inclusion are detected and automatically broken.
......@@ -178,22 +181,21 @@ Filename are relative to the directory of the current file
(or the current directory in the toplevel).
<li>Global namespace binding <code>namespace %%p%% = "%%...%%"</code>
and global namespace default <code>namespace "%%...%%"</code>
(see <local href="namespaces"/>).
<li>Global namespace binding: see <local href="namespaces"/>.</li>
<li>Schema declaration <code>schema %%name%% = "%%...%%"</code>
(see <local href="manual_schema">XML Schema</local>).</li>
<li>Schema declaration: see <local href="manual_schema"/>.</li>
<li>Alias for an external unit <code>using %%alias%% = "%%unit%%"</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
or as <code>%%unit%%.%%ident%%</code>.
<li>Alias for an external unit <code>using %%alias%% =
"%%unit%%"</code> or <code>using %%alias%% = %%unit%%</code>: gives an
alternative name for a pre-compiled unit. Values, types, namespace
prefixes, schema from <code>%%unit%%.cdo</code> can be referred to
either as <code>%%alias%%.%%ident%%</code> or as
<code>%%unit%%.%%ident%%</code>. </li>
<li>Open an external unit <code>open %%u%%</code>: the effect of this
statement is to import all the idenfiers exported by the compilation
unit <code>%%u%%</code> into the current scope. These identifiers
are also re-exported by the current unit.</li>
......@@ -266,13 +268,16 @@ You can use an external wrapper such as
<box title="Lexical entities" link="lex">
The <b>identifiers</b> (for variables, types, recursive patterns)
The <b>identifiers</b> (for variables, types, recursive patterns, ...)
are qualified names, in the sense of
href="">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).
All the identifiers are in the same scope. For instance, there cannot be
simultaneously a type and variable (or a schema, a namespace prefix, an alias
for an external unit) with the same name.
......@@ -87,6 +87,49 @@ others, the current set of global bindings.
<box title="Reusing namespace declarations" link="reuse">
A global namespace declaration actually defines an identifier which is
exported by the current compilation unit. It is possible to use
this identifier in another unit to redefine another prefix with the
same namespace URI. E.g., if the unit <code>a</code> contains:
namespace ns = ""
then, in another unit, it is possible to declare:
namespace ans = a.ns
The <code>open</code> statement operates on namespace declarations;
all the declarations from the open'ed unit are re-exported by the
current unit.
<box title="XML Schema and namespaces" link="ns">
If an XML Schema has been bound to some identifier (in the current
compilation unit or another one), it is possible to use this
identifier in the right-hand side of a namespace declarations. The
namespace URI is the targetNamespace of the XML Schema. E.g.:
schema s = "..."
namespace ns = s
<box title="Types for atoms" link="types">
......@@ -635,6 +635,7 @@ val xml : Any = <ignored_tag From="">[
<box title="Unsupported XML Schema features" link="nonsupp">
The support for XML Schema embedded in CDuce does not attempt
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