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
44bf9263
Commit
44bf9263
authored
Oct 05, 2007
by
Pietro Abate
Browse files
[r2005-03-22 17:20:57 by afrisch] Empty log message
Original author: afrisch Date: 2005-03-22 17:20:57+00:00
parent
160bc85f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Makefile.types
View file @
44bf9263
...
...
@@ -47,6 +47,8 @@ SRC= \
compile/lambda.ml
\
runtime/value.mli
\
runtime/value.ml
\
runtime/run_dispatch.mli
\
runtime/run_dispatch.ml
\
runtime/serial.mli
\
runtime/serial.ml
...
...
runtime/serial.ml
View file @
44bf9263
module
T
=
Custom
.
Array
(
Custom
.
Pair
(
Types
)(
Custom
.
List
(
Patterns
.
Node
)))
module
P
=
struct
let
()
=
Types
.
CompUnit
.
enter
(
Types
.
CompUnit
.
mk
(
Encodings
.
Utf8
.
mk
"OCAML"
))
let
pms
=
ref
[]
and
nb_pms
=
ref
(
-
1
)
let
init
()
=
pms
:=
[]
;
nb_pms
:=
0
let
init
()
=
pms
:=
[]
;
nb_pms
:=
(
-
1
)
let
mk
()
=
let
pms
=
Array
.
of_list
!
pms
in
Serialize
.
Put
.
run
T
.
serialize
pms
...
...
@@ -12,7 +14,40 @@ module P = struct
end
module
G
=
struct
type
chunk
=
T
.
t
let
mk
s
=
Serialize
.
Get
.
run
T
.
deserialize
s
let
pm
x
i
=
x
.
(
i
)
type
chunk
=
T
.
t
*
(
Patterns
.
Compile
.
dispatcher
*
int
Patterns
.
Compile
.
rhs
array
)
option
array
let
mk
s
=
try
let
a
=
Serialize
.
Get
.
run
T
.
deserialize
s
in
(
a
,
Array
.
create
(
Array
.
length
a
)
None
)
with
_
->
assert
false
let
disp
(
spec
,
d
)
i
=
match
d
.
(
i
)
with
|
Some
x
->
x
|
None
->
let
(
t
,
brs
)
=
spec
.
(
i
)
in
let
brs
=
Array
.
to_list
(
Array
.
mapi
(
fun
i
x
->
(
x
,
i
))
(
Array
.
of_list
brs
))
in
let
x
=
Patterns
.
Compile
.
make_branches
t
brs
in
d
.
(
i
)
<-
Some
x
;
x
let
run
(
chunk
:
chunk
)
i
v
=
let
(
d
,
rhs
)
=
disp
chunk
i
in
let
(
code
,
bindings
)
=
Run_dispatch
.
run_dispatcher
d
v
in
match
rhs
.
(
code
)
with
|
Patterns
.
Compile
.
Fail
->
assert
false
|
Patterns
.
Compile
.
Match
(
bind
,
i
)
->
i
,
Array
.
map
(
fun
(
_
,
i
)
->
if
(
i
==
-
1
)
then
v
else
bindings
.
(
i
))
(
Array
.
of_list
bind
)
end
runtime/serial.mli
View file @
44bf9263
...
...
@@ -9,5 +9,7 @@ module G : sig
type
chunk
val
mk
:
string
->
chunk
val
pm
:
chunk
->
int
->
Types
.
t
*
Patterns
.
Node
.
t
list
val
run
:
chunk
->
int
->
Value
.
t
->
int
*
Value
.
t
array
end
types_depend
View file @
44bf9263
...
...
@@ -99,8 +99,17 @@ runtime/value.cmo: types/atoms.cmi types/chars.cmi misc/encodings.cmi \
runtime/value.cmx: types/atoms.cmx types/chars.cmx misc/encodings.cmx \
types/ident.cmx types/intervals.cmx compile/lambda.cmx misc/ns.cmx \
types/sequence.cmx types/types.cmx runtime/value.cmi
runtime/serial.cmi: types/patterns.cmi types/types.cmi
runtime/serial.cmo: types/patterns.cmi misc/serialize.cmi types/types.cmi \
runtime/run_dispatch.cmi: types/patterns.cmi runtime/value.cmi
runtime/run_dispatch.cmo: types/atoms.cmi types/chars.cmi misc/encodings.cmi \
types/ident.cmo types/patterns.cmi types/types.cmi runtime/value.cmi \
runtime/run_dispatch.cmi
runtime/run_dispatch.cmx: types/atoms.cmx types/chars.cmx misc/encodings.cmx \
types/ident.cmx types/patterns.cmx types/types.cmx runtime/value.cmx \
runtime/run_dispatch.cmi
runtime/serial.cmi: types/patterns.cmi types/types.cmi runtime/value.cmi
runtime/serial.cmo: misc/custom.cmo types/patterns.cmi \
runtime/run_dispatch.cmi misc/serialize.cmi types/types.cmi \
runtime/serial.cmi
runtime/serial.cmx: types/patterns.cmx misc/serialize.cmx types/types.cmx \
runtime/serial.cmx: misc/custom.cmx types/patterns.cmx \
runtime/run_dispatch.cmx misc/serialize.cmx types/types.cmx \
runtime/serial.cmi
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