X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Fmain.ml;h=605c0e6e520f030c8fbdf034852d072774871539;hb=3791216bfb2b9d966718f83fd414e8bcd5f7a066;hp=fa16737c5a90c15dc167e1ca284ff62a9ab456b5;hpb=071e25c710e9a48116f66ddf51bfdca25e20502b;p=SXSI%2Fxpathcomp.git diff --git a/src/main.ml b/src/main.ml index fa16737..605c0e6 100644 --- a/src/main.ml +++ b/src/main.ml @@ -78,7 +78,10 @@ let main v query_string output = 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 + if !Options.twopass then + mk_runtime M.twopass_top_down_run auto v Tree.root R.NS.length R.NS.serialize None + else + mk_runtime M.top_down_run 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 @@ -126,10 +129,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