let size t = t.size
let first_child _ n = n.first_child
let next_sibling _ n = n.next_sibling
+
+let is_first_child _ n = n.parent.first_child == n
+let is_next_sibling _ n = n.parent.next_sibling == n
+
+let prev_sibling t n = if is_next_sibling t n then n.parent else nil
+let parent_of_first t n = if is_first_child t n then n.parent else nil
+
let parent _ n = n.parent
let tag _ n = n.tag
let data _ n = n.data
(** [by_preorder t i] returns the node with preorder [i]
*)
val print_node : Format.formatter -> node -> unit
+
+ val is_first_child : t -> node -> bool
+ val is_next_sibling : t -> node -> bool
+ val prev_sibling : t -> node -> node
+ (** [prev_sibling t n] returns the previous_sibling of node [n] in tree [t].
+ Returns [nil] if [n] is the first child of a node.
+ *)
+ val parent_of_first : t -> node -> node
+ (** [parent_of_first t n] returns the parent of node [n] in tree [t] .
+ Returns [nil] if [n] isn't the first child of a node.
+ *)
end