X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Fmain.ml;h=128ac53f01c2d2e980d30520cf7ebc9bb1c04409;hb=ff99aa3de1810d5607f31f1f7597da78af72b6bf;hp=fa16737c5a90c15dc167e1ca284ff62a9ab456b5;hpb=071e25c710e9a48116f66ddf51bfdca25e20502b;p=SXSI%2Fxpathcomp.git diff --git a/src/main.ml b/src/main.ml index fa16737..128ac53 100644 --- a/src/main.ml +++ b/src/main.ml @@ -76,13 +76,24 @@ let main v query_string output = 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 () ;; @@ -126,10 +137,16 @@ let _ = 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