optimiser la fonction eval_query_tree par l'ajoutation d'un hashtbl 'table_query_tree'
[tatoo.git] / src / table_driver.ml
index 1f04028..371dbdf 100644 (file)
@@ -9,15 +9,16 @@ let main () =
   let () = Table_options.parse () in
   let doc =
     let fd, close_fd = match !Table_options.input_file with
-       None | Some "-" | Some "/dev/stdin" ->stdin,ignore (*qu'est-ce que c'est ignore?????*)
+       None | Some "-" | Some "/dev/stdin" ->stdin,ignore 
       | Some input ->
        let fd = open_in input in fd, fun() -> close_in fd
     in
     (*let inc = open_in Sys.argv.(1) in*)
     let doc = Naive_tree.load_xml_file fd in
-    close_fd();  (*ca sert a fermer fd????*)
+    close_fd(); 
     doc
   in
+  (*Hashtbl.clear Query_tree.table_query_tree;  il faut vider le hashtbl?????????????????*)
   let queries =
     List.map ( fun q ->
       parse_xpath q) 
@@ -32,7 +33,11 @@ let main () =
       print_node_list doc res;
       print_string "</xml_result>\n"
     ) query_tree_list ;
-
+  
+  let _ = if !Table_options.count then 
+       Format.fprintf Format.std_formatter "there are %i nodes\n" !Query_tree.compteur;
+  in
+  
  (* let output =
     match !Options.output_file with
       | None | Some "-" | Some "/dev/stdout" -> stdout