Commit 8437f850 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2005-03-21 17:14:45 by afrisch] Empty log message

Original author: afrisch
Date: 2005-03-21 17:14:45+00:00
parent 2c1fdf63
module T = Custom.Pair(Custom.Array(Types))(Custom.Array(Patterns.Node))
module T = Custom.Array(Custom.Pair(Types)(Custom.List(Patterns.Node)))
module P = struct
let typs = ref [] and nb_typs = ref (-1)
let pats = ref [] and nb_pats = ref (-1)
let pms = ref [] and nb_pms = ref (-1)
let init () = typs:=[]; pats:=[]; nb_typs:=0; nb_pats:=0
let init () = pms:=[]; nb_pms:=0
let mk () =
let typs = Array.of_list !typs in
let pats = Array.of_list !pats in
Serialize.Put.run T.serialize (typs,pats)
let pms = Array.of_list !pms in
Serialize.Put.run T.serialize pms
let typ t = typs:=t::!typs; incr nb_typs; !nb_typs
let pat t = pats:=t::!pats; incr nb_pats; !nb_pats
let pm t = pms:=t::!pms; incr nb_pms; !nb_pms
end
module G = struct
type chunk = Types.t array * Patterns.Node.t array
type chunk = T.t
let mk s = Serialize.Get.run T.deserialize s
let typ (x,_) i = x.(i)
let pat (_,x) i = x.(i)
let pm x i = x.(i)
end
......@@ -2,14 +2,12 @@ module P : sig
val init: unit -> unit
val mk: unit -> string
val typ: Types.t -> int
val pat: Patterns.Node.t -> int
val pm: Types.t * Patterns.Node.t list -> int
end
module G : sig
type chunk
val mk: string -> chunk
val typ: chunk -> int -> Types.t
val pat: chunk -> int -> Patterns.Node.t
val pm: chunk -> int -> Types.t * Patterns.Node.t list
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment