Replace the Hashtbl.t used for mapping nodes to state-sets by an
[tatoo.git] / src / tree / naive.ml
index 0885bad..fa14d93 100644 (file)
@@ -14,7 +14,7 @@
 (***********************************************************************)
 
 (*
-  Time-stamp: <Last modified on 2013-03-13 10:33:17 CET by Kim Nguyen>
+  Time-stamp: <Last modified on 2013-03-13 18:47:18 CET by Kim Nguyen>
 *)
 open Utils
 
@@ -54,6 +54,7 @@ let rec dummy = {
 
 type t = {
   root : node;
+  size : int;
   (* TODO add other intersting stuff *)
 }
 
@@ -211,7 +212,9 @@ struct
        match ctx.stack with
          [ root ] ->
            root.next_sibling <- nil;
-           { root = root }
+           { root = root;
+             size = ctx.current_preorder
+           }
        | _ -> raise (Expat.Expat_error Expat.UNCLOSED_TOKEN)
     )
 
@@ -299,6 +302,7 @@ let print_xml out tree_ node =
   let nnode =  { node with next_sibling = nil } in print_xml out tree_ nnode
 
 let root t = t.root
+let size t = t.size
 let first_child _ n = n.first_child
 let next_sibling _ n = n.next_sibling
 let parent _ n = n.parent