cduce.docbook 6.25 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V3.1//EN">

<refentry id="cduce">

<refmeta>
<refentrytitle>cduce</refentrytitle>
<manvolnum>1</manvolnum>
</refmeta>

<refnamediv>
<refname>cduce</refname>
<refpurpose>The CDuce interpreter</refpurpose>
</refnamediv>

<refsynopsisdiv>
<cmdsynopsis>
<command>cduce</command>
18 19
<arg choice="opt" rep="repeat">
  <option>OPTIONS</option>
20 21
</arg>
<arg choice="opt" rep="repeat">
22
  <option><filename>file[.cd]</filename></option>
23
</arg>
24
<arg choice="opt" rep="repeat"><option>--arg <filename>argument</filename></option></arg>
25
</cmdsynopsis>
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
<cmdsynopsis>
<command>cduce --compile</command>
<arg choice="opt" rep="repeat">
  <option>OPTIONS</option>
</arg>
<arg choice="opt" rep="repeat">
  <option><filename>file[.cd]</filename></option>
</arg>
</cmdsynopsis>
<cmdsynopsis>
<command>cduce --run</command>
<arg choice="opt" rep="repeat">
  <option>OPTIONS</option>
</arg>
<arg choice="opt" rep="repeat">
  <option><filename>file[.cdo]</filename></option>
</arg>
<arg choice="opt" rep="repeat"><option>--arg <filename>argument</filename></option></arg>
</cmdsynopsis>
45 46 47 48 49 50 51
</refsynopsisdiv>

<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
52 53 54
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).
55 56 57 58 59 60
</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).

61
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>.
62 63 64 65 66 67 68
</para>
</refsect1>


<refsect1>
<title>Options</title>
<para>
69
This program follows usual syntax,
70 71 72 73 74 75 76 77 78
with long options starting with two dashes (`--'). A
summary of the options supported by <command>cduce</command>
is included below.		</para>
		

<refsect2>
<title>Generic Options</title>
<variablelist>

79 80 81 82 83 84 85 86 87
<varlistentry>
<term><option>--compile <filename>file</filename></option></term>
<listitem>
<para>
Produces a file in an intermediate code that can be run by cduce --run
</para>
</listitem>
</varlistentry>

88 89 90
<varlistentry>
<term><option>--dump <filename>file</filename></option></term>
<listitem>
91 92 93 94
<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>.
</para>
95 96 97 98
</listitem>
</varlistentry>


99 100 101
<varlistentry>
<term><option>--expat</option></term>
<listitem>
102
<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>
103 104 105
</listitem>
</varlistentry>

106
<varlistentry>
107
<term><option>-h</option>, <option>--help</option></term>
108 109 110 111 112 113 114 115 116
<listitem>
<para>Display a short help message and exit.</para>
</listitem>
</varlistentry>


<varlistentry>
<term><option>--license</option></term>
<listitem>
117
<para>Show license information and exit.</para>
118 119 120
</listitem>
</varlistentry>

121 122 123 124 125 126 127 128 129 130 131 132 133 134
<varlistentry>
<term><option>--load <filename>file</filename></option></term>
<listitem>
<para>
Restore the environment previously saved in
<filename>file</filename> by the <option>--save</option> option.
</para>
</listitem>
</varlistentry>


<varlistentry>
<term><option>--pxp</option></term>
<listitem>
135
<para>Use the PXP parser for loading XML documents. Cannot be used in conjuction with the <option>--expat</option> option.
136 137 138
</para>
</listitem>
</varlistentry>
139 140 141 142 143 144 145 146 147 148

<varlistentry>
<term><option>--quiet</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>
</listitem>
</varlistentry>

149 150 151 152 153 154 155 156 157

<varlistentry>
<term><option>--run</option></term>
<listitem>
<para>Executes .cdo files produced by cduce --compile.</para>
</listitem>
</varlistentry>


158 159 160 161 162 163 164 165 166 167 168
<varlistentry>
<term><option>--save <filename>file</filename></option></term>
<listitem>
<para> 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
</para>
</listitem>
</varlistentry>

169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185

<varlistentry>
<term><option>-v</option>, <option>--version</option></term>
<listitem>
<para>Show version information and exit.</para>
</listitem>
</varlistentry>
</variablelist>

</refsect2>

<refsect2>
<title>PROGRAM OPTIONS</title>
<para>
<variablelist>

<varlistentry>
186
<term><option>--arg <filename>arguments</filename></option></term>
187 188 189

<listitem>
<para>
190
All the arguments following <option>--arg</option> are passed to the CDuce
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
program, in the variable <command>argv</command> (of type <command>[ String*
]</command>, which means sequence of character strings).
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect2>

</refsect1>
	
<refsect1>
<title>Reporting bugs</title>
<para>
Report bugs to <email>bugs@cduce.org</email>.
</para>

</refsect1>



	
<refsect1>
<title>SEE ALSO</title>
<para>
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 <emphasis>CDuce</emphasis> website:
<filename>http://www.cduce.org</filename>.
</para>

</refsect1>

<refsect1>
<title>AUTHOR</title>
<para>
227 228
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>.
229 230 231 232 233 234 235 236
</para>

</refsect1>




</refentry>