val inject: tree -> position -> position
val eject: position -> tree
+
+ val dump: position -> Format.formatter -> unit
end
aux acc (eject p)
;;
+let dump pos fmt =
+ let module Pp = GraphvizPp.Dot in
+ let tree = root pos in
+ let where = eject pos in
+ let c = ref 0 in
+ let rec aux (Node l as orig) =
+ let j = !c in
+ Pp.node ("node"^string_of_int j) ~attrs:(["shape","record";
+ "label",String.concat "|"
+ (HExtlib.list_mapi
+ (fun (x,_) i -> "<f"^string_of_int i^">" ^ T.pp x)
+ l)] @ if orig == where then ["style","rounded"] else []) fmt;
+ ignore(HExtlib.list_mapi
+ (fun (_,t) i ->
+ incr c;
+ let k = !c in
+ Pp.edge
+ ("node"^string_of_int j^":f"^string_of_int i)
+ ("node"^string_of_int k) fmt;
+ aux t)
+ l)
+ in
+ aux tree
+;;
end