cduce.1 5.86 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
.\" $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