Merge branch 'handle-stdout'
[SXSI/xpathcomp.git] / src / resJIT.mli
1 type instr =
2   | SELF of unit
3   | LEFT of State.t
4   | RIGHT of State.t
5
6 type opcode =
7   | OP_NOP of unit
8   | OP_LEFT1 of State.t
9   | OP_LEFT2 of State.t * State.t
10   | OP_RIGHT1 of State.t
11   | OP_RIGHT2 of State.t * State.t
12   | OP_LEFT1_RIGHT1 of State.t * State.t
13   | OP_LEFT2_RIGHT1 of State.t * State.t * State.t
14   | OP_LEFT1_RIGHT2 of State.t * State.t * State.t
15   | OP_LEFT2_RIGHT2 of State.t * State.t * State.t * State.t
16   | OP_SELF of unit
17   | OP_SELF_LEFT1 of State.t
18   | OP_SELF_LEFT2 of State.t * State.t
19   | OP_SELF_RIGHT1 of State.t
20   | OP_SELF_RIGHT2 of State.t * State.t
21   | OP_SELF_LEFT1_RIGHT1 of State.t * State.t
22   | OP_SELF_LEFT2_RIGHT1 of State.t * State.t * State.t
23   | OP_SELF_LEFT1_RIGHT2 of State.t * State.t * State.t
24   | OP_SELF_LEFT2_RIGHT2 of State.t * State.t * State.t * State.t
25   | OP_OTHER of instr array
26
27 type code = Nil | Cons of State.t * opcode * code
28
29 val compile : (State.t * instr list) list -> code * bool
30
31 module type S =
32   sig
33     module NS : NodeSet.S
34     type t = NS.t array
35     val exec : t -> t -> t -> Tree.node -> code -> unit
36     val print : Format.formatter -> t -> unit
37     val var : int -> t -> t
38     val close : ((int*State.t, NS.t) Hashtbl.t) -> t -> t
39     val is_open : t -> bool
40   end
41
42 module Count : S with type NS.t = int
43 module Mat : S with type NS.t = Tree.node NodeSet.mat
44 module Make(U : NodeSet.S) : S with type NS.t = U.t