Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
220b5c21
Commit
220b5c21
authored
Jul 10, 2007
by
Pietro Abate
Browse files
[r2004-06-28 09:55:12 by afrisch] Get rid of cdml
Original author: afrisch Date: 2004-06-28 09:55:12+00:00
parent
7ce36d7b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Makefile.distrib
View file @
220b5c21
...
...
@@ -92,10 +92,10 @@ INSTALL := $(shell which install)
all
:
cduce dtd2cduce validate cdo2ml
ifneq
($(ML_INTERFACE), false)
all
:
c
dm
l.$(EXTENSION_LIB)
all
:
c
Duce_al
l.$(EXTENSION_LIB)
endif
install
:
all install_
cdml
install
:
all install_
lib
mkdir
-p
$(BINDIR)
mkdir
-p
$(MANDIR)
/man1
$(INSTALL)
-m755
cduce
$(EXE)
dtd2cduce
$(EXE)
\
...
...
@@ -104,12 +104,12 @@ install: all install_cdml
$(INSTALL)
-m644
doc/dtd2cduce.1
$(MANDIR)
/man1/
$(INSTALL)
-m644
doc/validate.1
$(MANDIR)
/man1/
install_
cdml
:
install_
lib
:
ifneq
($(ML_INTERFACE), false)
$(OCAMLFIND)
install
cduce META
\
c
dm
l.
$(EXTENSION_LIB)
cdo2cmo/cdml.cmi
\
cDuce
_all.cmi oCaml_all.
$(EXTENSION_LIB)
\
$(
wildcard
*
.a
)
oCaml_all.cmi
c
Duce_all.cmi cDuce_al
l.
$(EXTENSION_LIB)
\
oCaml
_all.cmi oCaml_all.
$(EXTENSION_LIB)
\
$(
wildcard
*
.a
)
endif
uninstall
:
...
...
@@ -212,18 +212,15 @@ cduce_packed: cduce_packed.$(EXTENSION)
$(LINK)
$(INCLUDES)
-o
$@
$(ML_LIB)
$^
$(EXTRA_LINK_OPTS)
c
dm
l.$(EXTENSION_LIB)
:
$(OBJECTS:.cmo=.$(EXTENSION))
c
Duce_al
l.$(EXTENSION_LIB)
:
$(OBJECTS:.cmo=.$(EXTENSION))
echo
'version="
$(VERSION)
"'
>
META
echo
'requires="
$(PACKAGES)
camlp4.gramlib"'
>>
META
echo
'description="Runtime support for CDuce"'
>>
META
echo
'archive(byte)="oCaml_all.cma,c
dm
l.cma"'
>>
META
echo
'archive(native)="oCaml_all.cmxa,c
dm
l.cmxa"'
>>
META
echo
'archive(byte)="oCaml_all.cma,c
Duce_al
l.cma"'
>>
META
echo
'archive(native)="oCaml_all.cmxa,c
Duce_al
l.cmxa"'
>>
META
$(COMPILE)
-o
cDuce_all.
$(EXTENSION)
-pack
$^
$(COMPILE)
-c
cdo2cmo/cdml.mli
$(COMPILE)
-c
cdo2cmo/cdml.ml
$(COMPILE)
-a
-o
cdml.
$(EXTENSION_LIB)
\
cDuce_all.
$(EXTENSION)
\
cdo2cmo/cdml.
$(EXTENSION)
$(COMPILE)
-a
-o
cDuce_all.
$(EXTENSION_LIB)
\
cDuce_all.
$(EXTENSION)
oCaml_all.$(EXTENSION_LIB)
:
cd
cdo2cmo
;
$(MAKE)
PREFIX
=
$(ML_MODULES)
MODEL
=
$(ML_INTERFACE)
$@
...
...
cdo2cmo/cdml.mli
View file @
220b5c21
(** [any] is the used to represent all CDuce possible values ( = Value.t ). *)
(*
type any
open CDuce_all
...
...
@@ -64,3 +65,4 @@ val cduce2ocaml_tuple_4 : 'a cd2ml -> 'b cd2ml -> 'c cd2ml -> 'd cd2ml -> Value.
val ocaml2cduce_unit : unit -> Value.t
val cduce2ocaml_unit : Value.t -> unit
*)
ocamliface/mlstub.ml
View file @
220b5c21
...
...
@@ -225,9 +225,9 @@ and to_cd_descr e = function
in
<:
expr
<
Value
.
record
$
list_lit
l
$
>>
)
|
Abstract
"int"
->
<:
expr
<
ocaml2cduce_int
$
e
$
>>
|
Abstract
"char"
->
<:
expr
<
ocaml2cduce_char
$
e
$
>>
|
Abstract
"string"
->
<:
expr
<
ocaml2cduce_string
$
e
$
>>
|
Abstract
"int"
->
<:
expr
<
Value
.
ocaml2cduce_int
$
e
$
>>
|
Abstract
"char"
->
<:
expr
<
Value
.
ocaml2cduce_char
$
e
$
>>
|
Abstract
"string"
->
<:
expr
<
Value
.
ocaml2cduce_string
$
e
$
>>
|
Abstract
s
->
<:
expr
<
Value
.
abstract
$
str
:
String
.
escaped
s
$
$
e
$
>>
|
Builtin
(
"list"
,
[
t
])
->
(* Value.sequence_rev (List.rev_map fun_t <...>) *)
...
...
@@ -351,9 +351,9 @@ and to_ml_descr e = function
<:
expr
<
Value
.
get_field
$
x
$
$
label_ascii
lab
$
>>
t
))
l
in
<:
expr
<
{
$
list
:
l
$
}
>>
)
|
Abstract
"int"
->
<:
expr
<
cduce2ocaml_int
$
e
$
>>
|
Abstract
"char"
->
<:
expr
<
cduce2ocaml_char
$
e
$
>>
|
Abstract
"string"
->
<:
expr
<
cduce2ocaml_string
$
e
$
>>
|
Abstract
"int"
->
<:
expr
<
Value
.
cduce2ocaml_int
$
e
$
>>
|
Abstract
"char"
->
<:
expr
<
Value
.
cduce2ocaml_char
$
e
$
>>
|
Abstract
"string"
->
<:
expr
<
Value
.
cduce2ocaml_string
$
e
$
>>
|
Abstract
s
->
<:
expr
<
Value
.
get_abstract
$
e
$
>>
|
Builtin
(
"list"
,
[
t
])
->
(* List.rev_map fun_t (Value.get_sequence_rev <...> *)
...
...
@@ -451,7 +451,6 @@ let stub name ty_env c_env values =
let (v1,v2,...,vn) =
let module C = struct
let cu = ...
open Cdml
open CDuce_all
let types = ...
let rec <global translation functions>
...
...
@@ -466,8 +465,7 @@ let stub name ty_env c_env values =
let
items_pat
=
List
.
map
(
fun
(
p
,_,_
)
->
p
)
items
in
let
m
=
[
<:
str_item
<
open
Cdml
>>;
<:
str_item
<
open
CDuce_all
>>;
[
<:
str_item
<
open
CDuce_all
>>;
<:
str_item
<
value
types
=
Librarian
.
registered_types
cu
>>
]
@
(
if
g
=
[]
then
[]
else
[
<:
str_item
<
value
rec
$
list
:
g
$
>>
])
@
[
<:
str_item
<
declare
$
list
:
exts
$
end
>>;
...
...
runtime/value.ml
View file @
220b5c21
...
...
@@ -589,3 +589,21 @@ let mk_ext_ref t get set =
and
set
=
Abstraction
([
t
,
Sequence
.
nil_type
]
,
fun
v
->
set
v
;
nil
)
in
Record
(
Builtin_defs
.
mk_ref
~
get
~
set
)
let
ocaml2cduce_int
i
=
Integer
(
Intervals
.
V
.
from_int
i
)
let
cduce2ocaml_int
=
function
|
Integer
i
->
Intervals
.
V
.
get_int
i
|
_
->
assert
false
let
ocaml2cduce_string
=
string_latin1
let
cduce2ocaml_string
=
get_string_latin1
let
ocaml2cduce_char
c
=
Char
(
Chars
.
V
.
mk_char
c
)
let
cduce2ocaml_char
=
function
|
Char
c
->
Chars
.
V
.
to_char
c
|
_
->
assert
false
runtime/value.mli
View file @
220b5c21
...
...
@@ -103,3 +103,10 @@ val ( |<>| ): t -> t -> bool
val
set_cdr
:
t
->
t
->
unit
val
append_cdr
:
t
->
t
->
t
val
ocaml2cduce_int
:
int
->
t
val
cduce2ocaml_int
:
t
->
int
val
ocaml2cduce_string
:
string
->
t
val
cduce2ocaml_string
:
t
->
string
val
ocaml2cduce_char
:
char
->
t
val
cduce2ocaml_char
:
t
->
char
tests/ocaml/Makefile
View file @
220b5c21
# Do "make install_cdml" before running this test
STATIC
=
STATIC
=
-static
run
:
ocamlc
-c
a.mli
...
...
types/intervals.ml
View file @
220b5c21
...
...
@@ -15,6 +15,7 @@ let equal = eq_big_int
let
check
i
=
()
let
from_int
i
=
big_int_of_int
i
(* TODO: better serialization of bigints !!! *)
let
serialize
t
i
=
Serialize
.
Put
.
string
t
(
string_of_big_int
i
)
...
...
types/intervals.mli
View file @
220b5c21
...
...
@@ -2,6 +2,7 @@ module V : sig
include
Custom
.
T
val
print
:
Format
.
formatter
->
t
->
unit
val
mk
:
string
->
t
val
from_int
:
int
->
t
val
to_string
:
t
->
string
val
is_int
:
t
->
bool
...
...
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