aboutsummaryrefslogtreecommitdiffhomepage
path: root/checker/analyze.mli
blob: 42efcf01df31c604bb7ab33d9aea856cb6bd4a70 (plain)
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
type data =
| Int of int
| Ptr of int
| Atm of int (* tag *)
| Fun of int (* address *)

type obj =
| Struct of int * data array (* tag × data *)
| String of string

val parse_channel : in_channel -> (data * obj array)
val parse_string : string -> (data * obj array)

(** {6 Functorized version} *)

module type Input =
sig
  type t
  val input_byte : t -> int
  (** Input a single byte *)
  val input_binary_int : t -> int
  (** Input a big-endian 31-bits signed integer *)
end
(** Type of inputs *)

module type S =
sig
  type input
  val parse : input -> (data * obj array)
  (** Return the entry point and the reification of the memory out of a
      marshalled structure. *)
end

module Make (M : Input) : S with type input = M.t
(** Functorized version of the previous code. *)