Update to new caching infrastructure.
[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   end
37
38 module Count :
39   sig
40     module NS : NodeSet.S with type t = int
41     type t = NS.t array
42     val exec : t -> t -> t -> Tree.node -> code -> unit
43   end
44
45 module Mat :
46   sig
47     module NS : NodeSet.S with type t = Tree.node NodeSet.mat
48     type t = NS.t array
49     val exec : t -> t -> t -> Tree.node -> code -> unit
50   end