projects
/
tatoo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace the Hashtbl.t used for mapping nodes to state-sets by an
[tatoo.git]
/
src
/
tree
/
naive.ml
diff --git
a/src/tree/naive.ml
b/src/tree/naive.ml
index
0885bad
..
fa14d93
100644
(file)
--- a/
src/tree/naive.ml
+++ b/
src/tree/naive.ml
@@
-14,7
+14,7
@@
(***********************************************************************)
(*
(***********************************************************************)
(*
- Time-stamp: <Last modified on 2013-03-13 1
0:33:17
CET by Kim Nguyen>
+ Time-stamp: <Last modified on 2013-03-13 1
8:47:18
CET by Kim Nguyen>
*)
open Utils
*)
open Utils
@@
-54,6
+54,7
@@
let rec dummy = {
type t = {
root : node;
type t = {
root : node;
+ size : int;
(* TODO add other intersting stuff *)
}
(* TODO add other intersting stuff *)
}
@@
-211,7
+212,9
@@
struct
match ctx.stack with
[ root ] ->
root.next_sibling <- nil;
match ctx.stack with
[ root ] ->
root.next_sibling <- nil;
- { root = root }
+ { root = root;
+ size = ctx.current_preorder
+ }
| _ -> raise (Expat.Expat_error Expat.UNCLOSED_TOKEN)
)
| _ -> 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 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
let first_child _ n = n.first_child
let next_sibling _ n = n.next_sibling
let parent _ n = n.parent