if !Options.count_only then
let module R = ResJIT.Count in
- let module M = Runtime.Make(R) in
(* mk_runtime run auto doc arg count print outfile *)
- mk_runtime M.top_down_run auto v Tree.root R.NS.length R.NS.serialize None
+ mk_runtime (Runtime.top_down_run {
+ Runtime.empty = R.NS.empty;
+ Runtime.subtree_tags = R.NS.subtree_tags;
+ Runtime.subtree_elements = R.NS.subtree_elements;
+ Runtime.exec = ResJIT.count_exec;
+ })
+ auto v Tree.root R.NS.length R.NS.serialize None
else
let module R = ResJIT.Mat in
- let module M = Runtime.Make(R) in
- mk_runtime M.top_down_run auto v Tree.root R.NS.length R.NS.serialize !Options.output_file
+ mk_runtime
+ (Runtime.top_down_run {
+ Runtime.empty = R.NS.empty;
+ Runtime.subtree_tags = R.NS.subtree_tags;
+ Runtime.subtree_elements = R.NS.subtree_elements;
+ Runtime.exec = ResJIT.mat_exec;
+ })
+ auto v Tree.root R.NS.length R.NS.serialize !Options.output_file
in
runtime ()
;;
Gc.compact();
Gc.set (tuned_gc);
let runtime =
- let module R = ResJIT.Count in
+ if !Options.count_only then
+ let module R = ResJIT.Make(NodeSet.Partial(NodeSet.Count)) in
let module M = Runtime.Make(R) in
(* mk_runtime run auto doc arg count print outfile *)
mk_runtime M.grammar_run auto (Obj.magic g) () R.NS.length (Obj.magic R.NS.serialize) None
+ else
+ let module R = ResJIT.Mat in
+ let module M = Runtime.Make(R) in
+ (* mk_runtime run auto doc arg count print outfile *)
+ mk_runtime M.grammar_run auto (Obj.magic g) () R.NS.length (Obj.magic R.NS.serialize) None
in
runtime ();
exit 0