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

[r2004-07-03 08:42:38 by afrisch] MAJ cduce.1

Original author: afrisch
Date: 2004-07-03 08:42:38+00:00
parent 4b4c0821
MAN = cduce.1 dtd2cduce.1 validate.1
all: $(MAN)
.SUFFIXES: .1 .docbook
.docbook.1:
docbook-to-man $< > $@
.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng <steve@ggi-project.org>.
.TH "CDUCE" "1" "23 February 2004" "" ""
.SH NAME
cduce \- The CDuce interpreter
.SH SYNOPSIS
\fBcduce\fR [ \fB OPTIONS\fR\fI ...\fR ] [ \fB \fIfile[.cd]\fB\fR\fI ...\fR ] [ \fB--arg \fIargument\fB\fR\fI ...\fR ]
\fBcduce --compile\fR [ \fB OPTIONS\fR\fI ...\fR ] [ \fB \fIfile[.cd]\fB\fR\fI ...\fR ]
\fBcduce --run\fR [ \fB OPTIONS\fR\fI ...\fR ] [ \fB \fIfile[.cdo]\fB\fR\fI ...\fR ] [ \fB--arg \fIargument\fB\fR\fI ...\fR ]
.SH "DESCRIPTION"
.PP
The \fBcduce\fR command considers all the .cd files on the command
line that follow the options as CDuce sources, and executes them
successively. With the --compile option it produce a file with intermediate code
that can be run by cduce --run (without options the two steps are piped) All the
arguments that follow the --arg option are passed to the source file(s).
.PP
If no CDuce file is given on the command line
then the interpreter uses the standard input and behaves as an interactive
toplevel. Toplevel phrases are processed after each \fB;;\fR. Mutually recursive declarations of types or functions must be contained in a single adjacent sequence of phrases (without \fB;;\fR inbetween).
In order to allow persistence (options \fB--dump\fR, \fB--load\fR, and \fB--save\fR) to operate, you must quit the toplevel with \fB#quit\fR toplevel directive and not with \fBCtrl-D\fR or \fBCtrl-C\fR.
.SH "OPTIONS"
.PP
This program follows usual syntax,
with long options starting with two dashes (`--'). A
summary of the options supported by \fBcduce\fR
is included below.
.SS "GENERIC OPTIONS"
.TP
\fB--compile \fIfile\fB\fR
Produces a file in an intermediate code that can be run by cduce --run
.TP
\fB--dump \fIfile\fB\fR
This option is equivalent to restore the environment previously saved in
\fIfile\fR by the \fB--load \fIfile\fB\fR \fB--save \fIfile\fB\fR.
.TP
\fB--expat\fR
Use the Expat parser for loading XML documents (this option is available only if CDuce was built with Expat support; in that case it is the default option). Cannot be used in conjuction with the \fB--pxp\fR option.
.TP
\fB-h, --help\fR
Display a short help message and exit.
.TP
\fB--license\fR
Show license information and exit.
.TP
\fB--load \fIfile\fB\fR
Restore the environment previously saved in
\fIfile\fR by the \fB--save\fR option.
.TP
\fB--pxp\fR
Use the PXP parser for loading XML documents. Cannot be used in conjuction with the \fB--expat\fR option.
.TP
\fB--quiet\fR
Suppress normal output (typing, results). It is normally
used when the CDuce interpreter is used in the context of batch
processing.
.TP
\fB--run\fR
Executes .cdo files produced by cduce --compile.
.TP
\fB--save \fIfile\fB\fR
This options allows persistence between several invocations of the
interpreter: the current environment (i.e., the set defined types and values) is saved in
\fIfile\fR when the interpreter terminates so that it
can be succesively restored by using \fB--load\fR option
.TP
\fB-v, --version\fR
Show version information and exit.
.SS "PROGRAM OPTIONS"
.PP
.TP
\fB--arg \fIarguments\fB\fR
All the arguments following \fB--arg\fR are passed to the CDuce
program, in the variable \fBargv\fR (of type \fB[ String*
]\fR, which means sequence of character strings).
.SH "REPORTING BUGS"
.PP
Report bugs to <bugs@cduce.org>.
.SH "SEE ALSO"
.PP
A complete documentation, reference manual, tutorial, technical articles on
implementation and theoretical issues, benchmarks, source code, mailing lists
and forums can be found on the \fBCDuce\fR website:
\fIhttp://www.cduce.org\fR.
.SH "AUTHOR"
.PP
Alain Frisch <Alain.Frisch@ens.fr> with small contributions of
Giuseppe Castagna <Giuseppe.Castagna@ens.fr>, and Stefano Zacchiroli <zack@di.ens.fr>.
.\" $Header: /cvsroot/cduce/doc/cduce.1,v 1.11 2004/07/03 08:42:38 afrisch Exp $
.\"
.\" transcript compatibility for postscript use.
.\"
.\" synopsis: .P! <file.ps>
.\"
.de P!
.fl
\!!1 setgray
.fl
\\&.\"
.fl
\!!0 setgray
.fl \" force out current output buffer
\!!save /psv exch def currentpoint translate 0 0 moveto
\!!/showpage{}def
.fl \" prolog
.sy sed -e 's/^/!/' \\$1\" bring in postscript file
\!!psv restore
.
.de pF
.ie \\*(f1 .ds f1 \\n(.f
.el .ie \\*(f2 .ds f2 \\n(.f
.el .ie \\*(f3 .ds f3 \\n(.f
.el .ie \\*(f4 .ds f4 \\n(.f
.el .tm ? font overflow
.ft \\$1
..
.de fP
.ie !\\*(f4 \{\
. ft \\*(f4
. ds f4\"
' br \}
.el .ie !\\*(f3 \{\
. ft \\*(f3
. ds f3\"
' br \}
.el .ie !\\*(f2 \{\
. ft \\*(f2
. ds f2\"
' br \}
.el .ie !\\*(f1 \{\
. ft \\*(f1
. ds f1\"
' br \}
.el .tm ? font underflow
..
.ds f1\"
.ds f2\"
.ds f3\"
.ds f4\"
'\" t
.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n
.TH "cduce" "1"
.SH "NAME"
cduce \(em The CDuce compiler/interpreter/toplevel
.SH "SYNOPSIS"
.PP
\fBcduce\fR [ \fBOPTIONS\fP \&...] [\fB--arg \fBargument\fP\fP \&...]
.PP
\fBcduce\fR [ \fBOPTIONS\fP \&...] [ \fB\fBfile[.cd]\fP\fP] [\fB--arg \fBargument\fP\fP \&...]
.PP
\fBcduce --compile\fR [ \fBOPTIONS\fP \&...] [ \fB\fBfile[.cd]\fP\fP]
.PP
\fBcduce --run\fR [ \fBOPTIONS\fP \&...] [ \fB\fBfile[.cdo]\fP\fP \&...] [\fB--arg \fBargument\fP\fP \&...]
.SH "Description"
.PP
According to the command line arguments,
the \fBcduce\fR command behaves
either as an interactive toplevel, an interpreter, a compiler, or
a loader.
When no input file is given, the command operates as an interactive
toplevel. Toplevel phrases are processed after each
\fB;;\fR. Mutually recursive declarations of types or
functions must be contained in a single adjacent sequence of phrases
(without \fB;;\fR inbetween).
With the \fB--compile\fP option,
the command produces a .cdo file with intermediate code.
One or several .cdo files can be run
later by \fBcduce --run\fR.
When a .cd file is given, but not the \fB--compile\fP,
the unit is compiled and immediatly evaluated, without
producing a .cdo file.
All the arguments that follow the \fB--arg\fP option are
passed to the CDuce program (useless in \fB--compile\fP mode).
.PP
In order to allow persistence in the toplevel(options
\fB--dump\fP, \fB--load\fP, and
\fB--save\fP) to operate, you must quit the toplevel with
\fB#quit\fR toplevel directive and not with
\fBCtrl-D\fR or \fBCtrl-C\fR. This
persistence mechanism is deprecated since the introduction of separate
compilation and will be removed in future releases.
.SH "CDuce/OCaml interface"
.PP
If the CDuce/OCaml interface is enabled, the compiler
looks for a corresponding \fBfoo.cmi\fP file when
compiling a \fBfoo.cd\fP unit.
The resulting \fBfoo.cdo\fP contains the ML stub code
(to export CDuce values to OCaml, and to import OCaml values into CDuce).
When the unit uses OCaml functions, it is not possible to run it
with the \fB--run\fR option. Instead, you have to compile
and link it with the OCaml linker. Please refer to the man page for the
\fBcdo2ml\fR command.
.SH "Options"
.PP
This program follows usual syntax,
with long options starting with two dashes (`--'). A
summary of the options supported by \fBcduce\fR is included below.
.SS "Generic Options"
.IP "\fB--compile\fP \fBfile\fP" 10
Produce a file in an intermediate code that can be run by
\fBcduce --run\fR.
.IP "\fB--run\fP \fBfiles ...\fP" 10
Execute .cdo files produced by \fBcduce --compile\fR.
.IP "\fB--verbose\fP" 10
(for \fB--compile\fP) Display the type of values in the compiled
unit.
.IP "\fB--obj-dir\fP \fBdir\fP" 10
(for \fB--compile\fP) Set the directory where to create
the .cdo file.
.IP "\fB-I\fP \fBdir\fP" 10
Add \fBdir\fP to the list of directory used to find .cdo and .cmi files.
.IP "\fB--stdin\fP" 10
Read CDuce script on standard input.
.IP "\fB--no\fP feature" 10
Disable one of the built-in optional features. The list
of feature and their symbolic name can be obtained with the
\fB-v\fP option. Can be used
for instance to turn the Expat parser off, in order to use PXP,
if both have been included at compile time.
.IP "\fB--debug\fP" 10
Pprint profiling/debugging information.
.IP "\fB-v\fP, \fB--version\fP" 10
Show version information and exit.
.IP "\fB--license\fP" 10
Show license information and exit.
.IP "\fB--dump \fBfile\fP\fP" 10
(Deprecated)
This option is equivalent to restore the environment previously saved in
\fBfile\fP by the \fB--load \fBfile\fP\fP \fB--save \fBfile\fP\fP.
.IP "\fB--load \fBfile\fP\fP" 10
(Deprecated)
Restore the environment previously saved in
\fBfile\fP by the \fB--save\fP option.
.IP "\fB--save \fBfile\fP\fP" 10
(Deprecated)
This options allows persistence between several invocations of the
interpreter: the current environment (i.e., the set defined types and values) is saved in
\fBfile\fP when the interpreter terminates so that it
can be succesively restored by using \fB--load\fP option
.IP "\fB--help\fP" 10
Display a short help message and exit.
.SS "PROGRAM OPTIONS"
.PP
.IP "\fB--arg \fBarguments\fP\fP" 10
All the arguments following \fB--arg\fP are passed to the CDuce
program. They can be fetched from the CDuce program
with the built-in operator \fBargv\fR (of type \fB[] -> [ String*
]\fR).
.SH "Reporting bugs"
.PP
Report bugs to bugs@cduce.org.
.SH "SEE ALSO"
.PP
A complete documentation, reference manual, tutorial, technical articles on
implementation and theoretical issues, benchmarks, source code, mailing lists
and forums can be found on the \fICDuce\fP website:
\fBhttp://www.cduce.org\fP.
.SH "AUTHOR"
.PP
Alain Frisch <Alain.Frisch@ens.fr>. Small contributions by
Giuseppe Castagna <Giuseppe.Castagna@ens.fr>, Julien Demouth <Julien.Demouth@ens.fr>, and Stefano Zacchiroli <zack@di.ens.fr>.
.\" created by instant / docbook-to-man, Sat 03 Jul 2004, 10:40
......@@ -9,29 +9,41 @@
<refnamediv>
<refname>cduce</refname>
<refpurpose>The CDuce interpreter</refpurpose>
<refpurpose>The CDuce compiler/interpreter/toplevel</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>cduce</command>
<arg choice="opt" rep="repeat">
<option>OPTIONS</option>
</arg>
<arg choice="opt" rep="repeat"><option>--arg <filename>argument</filename></option></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>cduce</command>
<arg choice="opt" rep="repeat">
<option>OPTIONS</option>
</arg>
<arg choice="opt">
<option><filename>file[.cd]</filename></option>
</arg>
<arg choice="opt" rep="repeat"><option>--arg <filename>argument</filename></option></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>cduce --compile</command>
<arg choice="opt" rep="repeat">
<option>OPTIONS</option>
</arg>
<arg choice="opt" rep="repeat">
<arg choice="opt">
<option><filename>file[.cd]</filename></option>
</arg>
</cmdsynopsis>
<cmdsynopsis>
<command>cduce --run</command>
<arg choice="opt" rep="repeat">
......@@ -47,21 +59,57 @@
<refsect1>
<title>Description</title>
<para>
The <command>cduce</command> command considers all the .cd files on the command
line that follow the options as CDuce sources, and executes them
successively. With the --compile option it produce a file with intermediate code
that can be run by cduce --run (without options the two steps are piped) All the
arguments that follow the --arg option are passed to the source file(s).
According to the command line arguments,
the <command>cduce</command> command behaves
either as an interactive toplevel, an interpreter, a compiler, or
a loader.
When no input file is given, the command operates as an interactive
toplevel. Toplevel phrases are processed after each
<command>;;</command>. Mutually recursive declarations of types or
functions must be contained in a single adjacent sequence of phrases
(without <command>;;</command> inbetween).
With the <option>--compile</option> option,
the command produces a .cdo file with intermediate code.
One or several .cdo files can be run
later by <command>cduce --run</command>.
When a .cd file is given, but not the <option>--compile</option>,
the unit is compiled and immediatly evaluated, without
producing a .cdo file.
All the arguments that follow the <option>--arg</option> option are
passed to the CDuce program (useless in <option>--compile</option>
mode).
</para>
<para>
If no CDuce file is given on the command line
then the interpreter uses the standard input and behaves as an interactive
toplevel. Toplevel phrases are processed after each <command>;;</command>. Mutually recursive declarations of types or functions must be contained in a single adjacent sequence of phrases (without <command>;;</command> inbetween).
In order to allow persistence (options <option>--dump</option>, <option>--load</option>, and <option>--save</option>) to operate, you must quit the toplevel with <command>#quit</command> toplevel directive and not with <command>Ctrl-D</command> or <command>Ctrl-C</command>.
</para>
<para> In order to allow persistence in the toplevel(options
<option>--dump</option>, <option>--load</option>, and
<option>--save</option>) to operate, you must quit the toplevel with
<command>#quit</command> toplevel directive and not with
<command>Ctrl-D</command> or <command>Ctrl-C</command>. This
persistence mechanism is deprecated since the introduction of separate
compilation and will be removed in future releases. </para>
</refsect1>
<refsect1>
<title>CDuce/OCaml interface</title>
<para>
If the CDuce/OCaml interface is enabled, the compiler
looks for a corresponding <filename>foo.cmi</filename> file when
compiling a <filename>foo.cd</filename> unit.
The resulting <filename>foo.cdo</filename> contains the ML stub code
(to export CDuce values to OCaml, and to import OCaml values into CDuce).
When the unit uses OCaml functions, it is not possible to run it
with the <command>--run</command> option. Instead, you have to compile
and link it with the OCaml linker. Please refer to the man page for the
<command>cdo2ml</command> command.
</para>
</refsect1>
<refsect1>
<title>Options</title>
......@@ -77,88 +125,129 @@ is included below. </para>
<variablelist>
<varlistentry>
<term><option>--compile <filename>file</filename></option></term>
<term><option>--compile</option> <filename>file</filename></term>
<listitem>
<para>
Produces a file in an intermediate code that can be run by cduce --run
Produce a file in an intermediate code that can be run by
<command>cduce --run</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--dump <filename>file</filename></option></term>
<term><option>--run</option> <filename>files ...</filename></term>
<listitem>
<para>
This option is equivalent to restore the environment previously saved in
<filename>file</filename> by the <option>--load <filename>file</filename></option> <option>--save <filename>file</filename></option>.
Execute .cdo files produced by <command>cduce --compile</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--expat</option></term>
<term><option>--verbose</option></term>
<listitem>
<para>Use the Expat parser for loading XML documents (this option is available only if CDuce was built with Expat support; in that case it is the default option). Cannot be used in conjuction with the <option>--pxp</option> option.</para>
<para>
(for <option>--compile</option>) Display the type of values in the compiled
unit.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-h</option>, <option>--help</option></term>
<term><option>--obj-dir</option> <filename>dir</filename></term>
<listitem>
<para>Display a short help message and exit.</para>
<para>
(for <option>--compile</option>) Set the directory where to create
the .cdo file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--license</option></term>
<term><option>-I</option> <filename>dir</filename></term>
<listitem>
<para>Show license information and exit.</para>
<para>
Add <filename>dir</filename> to the list of directory used to find .cdo and .cmi files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--load <filename>file</filename></option></term>
<term><option>--stdin</option></term>
<listitem>
<para>
Restore the environment previously saved in
<filename>file</filename> by the <option>--save</option> option.
Read CDuce script on standard input.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--no</option> feature</term>
<listitem>
<para>Disable one of the built-in optional features. The list
of feature and their symbolic name can be obtained with the
<option>-v</option> option. Can be used
for instance to turn the Expat parser off, in order to use PXP,
if both have been included at compile time.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--pxp</option></term>
<term><option>--debug</option></term>
<listitem>
<para>Use the PXP parser for loading XML documents. Cannot be used in conjuction with the <option>--expat</option> option.
<para>Pprint profiling/debugging information.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--quiet</option></term>
<term><option>-v</option>, <option>--version</option></term>
<listitem>
<para>Suppress normal output (typing, results). It is normally
used when the CDuce interpreter is used in the context of batch
processing.</para>
<para>Show version information and exit.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--license</option></term>
<listitem>
<para>Show license information and exit.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--run</option></term>
<term><option>--dump <filename>file</filename></option></term>
<listitem>
<para>Executes .cdo files produced by cduce --compile.</para>
<para>
(Deprecated)
This option is equivalent to restore the environment previously saved in
<filename>file</filename> by the <option>--load <filename>file</filename></option> <option>--save <filename>file</filename></option>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--load <filename>file</filename></option></term>
<listitem>
<para>
(Deprecated)
Restore the environment previously saved in
<filename>file</filename> by the <option>--save</option> option.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--save <filename>file</filename></option></term>
<listitem>
<para> This options allows persistence between several invocations of the
<para>
(Deprecated)
This options allows persistence between several invocations of the
interpreter: the current environment (i.e., the set defined types and values) is saved in
<filename>file</filename> when the interpreter terminates so that it
can be succesively restored by using <option>--load</option> option
......@@ -166,15 +255,17 @@ can be succesively restored by using <option>--load</option> option
</listitem>
</varlistentry>
<varlistentry>
<term><option>-v</option>, <option>--version</option></term>
<term><option>--help</option></term>
<listitem>
<para>Show version information and exit.</para>
<para>Display a short help message and exit.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
<refsect2>
......@@ -188,8 +279,9 @@ can be succesively restored by using <option>--load</option> option
<listitem>
<para>
All the arguments following <option>--arg</option> are passed to the CDuce
program, in the variable <command>argv</command> (of type <command>[ String*
]</command>, which means sequence of character strings).
program. They can be fetched from the CDuce program
with the built-in operator <command>argv</command> (of type <command>[] -> [ String*
]</command>).
</para>
</listitem>
</varlistentry>
......@@ -202,7 +294,7 @@ program, in the variable <command>argv</command> (of type <command>[ String*
<refsect1>
<title>Reporting bugs</title>
<para>
Report bugs to <email>bugs@cduce.org</email>.
Report bugs to <email>devel@cduce.org</email>.
</para>
</refsect1>
......@@ -224,8 +316,8 @@ and forums can be found on the <emphasis>CDuce</emphasis> website:
<refsect1>
<title>AUTHOR</title>
<para>
Alain Frisch <email>Alain.Frisch@ens.fr</email>. Small contributions by
Giuseppe Castagna <email>Giuseppe.Castagna@ens.fr</email>, Julien Demouth <email>Julien.Demouth@ens.fr</email>, and Stefano Zacchiroli <email>zack@di.ens.fr</email>.
Alain Frisch <email>&lt;Alain.Frisch@ens.fr&gt;</email>. Small contributions by
Giuseppe Castagna <email>&lt;Giuseppe.Castagna@ens.fr&gt;</email>, Julien Demouth <email>&lt;Julien.Demouth@ens.fr&gt;</email>, and Stefano Zacchiroli <email>&lt;zack@di.ens.fr&gt;</email>.
</para>
</refsect1>
......
.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng <steve@ggi-project.org>.
.TH "DTD2CDUCE" "1" "23 February 2004" "" ""
.SH NAME
dtd2cduce \- Transform a DTD file into a set of CDuce type declarations
.SH SYNOPSIS
\fBdtd2cduce\fR [ \fB prefix\fR ] \fB file.dtd\fR
.SH "DESCRIPTION"
.PP
The \fBdtd2cduce\fR reads the file \fIfile.dtd\fR
and outputs on the stadard input that set of CDuce type declarations that
translate the DTD. If a prefix is given in the command line then it is used to
prefix all the type names generated by the command
.SH "TODO"
.PP
Specify on the command line the elements that can be explicitly
kept in the translation in order to factorize it.
.SH "REPORTING BUGS"
.PP
Report bugs to <bugs@cduce.org>.
.SH "AUTHOR"
.PP
Alain Frisch <Alain.Frisch@ens.fr>.
.\" $Header: /cvsroot/cduce/doc/dtd2cduce.1,v 1.2 2004/07/03 08:42:38 afrisch Exp $
.\"
.\" transcript compatibility for postscript use.
.\"
.\" synopsis: .P! <file.ps>
.\"
.de P!
.fl
\!!1 setgray
.fl
\\&.\"
.fl
\!!0 setgray
.fl \" force out current output buffer