X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftree%2Fsig.ml;h=e2db1d11983935c09e229f1458c9826254620ed3;hb=03b6a364e7240ca827585e7baff225a0aaa33bc6;hp=f9bd0b75caea9544e86b24472623edbdb79b0839;hpb=74e8f4bcdd9e19a2ec434d82c1a6eb897b826632;p=tatoo.git diff --git a/src/tree/sig.ml b/src/tree/sig.ml index f9bd0b7..e2db1d1 100644 --- a/src/tree/sig.ml +++ b/src/tree/sig.ml @@ -14,10 +14,11 @@ (***********************************************************************) (* - Time-stamp: + Time-stamp: *) (** Implementation of documents as binary trees *) + module type S = sig type node @@ -26,6 +27,9 @@ sig 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 *) @@ -45,7 +49,6 @@ sig 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 *) @@ -75,6 +78,9 @@ sig 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].