Merge branch 'lucca-tests-bench' into lucca-optim
[tatoo.git] / src / tree.mli
index 1d5d77b..b64b0ff 100644 (file)
@@ -49,6 +49,12 @@ val first_child : t -> node -> node
     Returns [nil] if [n] is a leaf. Returns [nil] if [n == nil].
 *)
 
+val first_child_x : t -> node -> node
+(** [first_child t n] returns the first child which is not an attribute
+    of node [n] in tree [t].
+    Returns [nil] if [n] is a leaf. Returns [nil] if [n == nil].
+*)
+
 val next_sibling : t -> node -> node
 (** [next_sibling t n] returns the next_sibling of node [n] in tree [t].
     Returns [nil] if [n] is the last child of a node.
@@ -61,6 +67,12 @@ val parent : t -> node -> node
     Returns [nil] if [n == nil].
 *)
 
+val is_leaf : t -> node -> bool
+(** Return true if the node is a leaf or an attribute *)
+
+val is_attribute : t -> node -> bool
+(** Return true if the node is an attribute *)
+
 val tag : t -> node -> QName.t
 (** Returns the label of a given node *)
 
@@ -74,3 +86,10 @@ val preorder : t -> node -> int
 (** Returns the position of a node in pre-order in the tree. The
     root has preorder 0. [nil] has pre-order [-1].
 *)
+
+val print_xml_preorder : out_channel -> t -> node -> unit
+(** Outputs the tree with IDs for nodes as an XML document on the
+    given output_channel *)
+
+val debug_node : Format.formatter -> t -> node -> unit
+(** DEBUG *)