(***********************************************************************)
(*
- Time-stamp: <Last modified on 2013-03-05 15:12:47 CET by Kim Nguyen>
+ Time-stamp: <Last modified on 2013-03-13 18:46:18 CET by Kim Nguyen>
*)
(** Implementation of documents as binary trees *)
+
module type S =
sig
type node
type t
(** The type of trees *)
+ val size : t -> int
+ (** Return the number of nodes *)
+
val nil : node
(** Nil node, denoting the first/second child of a leaf or the parent of
the root *)
val print_xml : out_channel -> t -> node -> unit
(** Outputs the tree as an XML document on the given output_channel *)
-
val root : t -> node
(** Returns the root of the tree *)
QName.text, QName.cdata_section or QName.comment
*)
+ val kind : t -> node -> Common.NodeKind.t
+ (** Returns the kind of the given node *)
+
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].