Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cduce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
19
Issues
19
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cduce
cduce
Commits
58b311ad
Commit
58b311ad
authored
Jul 10, 2007
by
Pietro Abate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[r2003-05-25 17:26:23 by cvscast] Doc
Original author: cvscast Date: 2003-05-25 17:26:23+00:00
parent
b9c7e1ea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
13 deletions
+35
-13
README
README
+9
-6
driver/run.ml
driver/run.ml
+1
-2
web/examples/mutrec.cd
web/examples/mutrec.cd
+2
-3
web/manual/interpreter.xml
web/manual/interpreter.xml
+23
-2
No files found.
README
View file @
58b311ad
...
...
@@ -28,24 +28,24 @@ Overview of the distribution
See the INSTALL file for Installation instructions.
1. CDuce command-line interpreter
1. CDuce command-line interpreter
/ toplevel
For performance reasons, it is advised to build it using OCaml native code
compiler (by default in the Makefile).
Usage:
cduce [options] [CDuce files] -- [arguments for the CDuce program]
cduce [options] [CDuce files] --
arg
[arguments for the CDuce program]
The arguments following the -- are passed to the CDuce program
The arguments following the --
arg
are passed to the CDuce program
in the argv variable (having type [ String* ], which means: sequence
of character strings).
The option -quiet suppresses normal output (typing, results). It is
The option -
-
quiet suppresses normal output (typing, results). It is
normally used when the CDuce interpreter is used in the context
of batch processing.
The option -dump followed by a filename allows persistence between
The option -
-
dump followed by a filename allows persistence between
several invocations of the interpreter: the current environment
(defined types and values) is saved to the file when the interpreter
terminates and it is restored if the interpreter is started again with
...
...
@@ -53,7 +53,10 @@ the same option. Note that only the arguments after -- on the first
invocation in a session are passed to the CDuce program.
When no CDuce file is given on the command line, the interpreter
uses the standard input.
behaves as a toplevel. Phrases are interpreted when the user type
";;". Of course, mutually recursive definition (types or functions)
must be entirely contained in an adjacent sequence of phrases
(without ";;" inbetween).
2. CDuce CGI interface
...
...
driver/run.ml
View file @
58b311ad
...
...
@@ -55,7 +55,6 @@ let read i =
flush
stdout
;
first_line
:=
false
;
let
c
=
input_char
stdin
in
flush
stderr
;
bol
:=
(
not
first
)
&&
c
=
'\n'
;
Some
c
...
...
@@ -68,7 +67,7 @@ let toploop () =
ignore
(
Cduce
.
toplevel
ppf
ppf_err
input
);
loop
()
in
try
loop
()
with
End_of_file
->
exit
0
with
End_of_file
->
()
let
do_file
s
=
let
chan
=
open_in
s
in
...
...
web/examples/mutrec.cd
View file @
58b311ad
(* A
ll the types submitted at once
are mutually recursive *)
(* A
djacent type declarations
are mutually recursive *)
type T = <t>S;;
type S = [ (Char | T)* ];;
let x : S = [ 'abc' <t>['def'] 'ghi' ];;
(* Consecutive function definitions (without any other toplevel phrase
in the middle) are grouped together *)
(* Similarly for toplevel function definitions *)
let fun f (x : Int) : Int = g x;;
let fun g (x : Int) : Int = 3;;
...
...
web/manual/interpreter.xml
View file @
58b311ad
...
...
@@ -40,11 +40,32 @@ CDuce program(s). </li>
version number and exit immediately.
</li>
<li>
All the other arguments on the command line are considered CDuce
scripts, which are executed successively. If no CDuce file is given on
the command line, the interpreter uses the standard input.
</li>
scripts, which are executed successively.
</li>
</ul>
</box>
<box
title=
"Toplevel"
link=
"toplevel"
>
<p>
If no CDuce file is given on the command line, the interpreter
behaves as an interactive toplevel.
</p>
<p>
Toplevel phrases are processed after each
<code>
;;
</code>
.
Mutually recursive declaration of types or functions
must be contained in a single adjacent sequence of phrases
(without
<code>
;;
</code>
inbetween).
</p>
<p>
The toplevel has no line editing facilities.
You can use an external wrapper such as
<a
href=
"http://pauillac.inria.fr/~ddr/"
>
ledit
</a>
.
</p>
</box>
</page>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment