X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=src%2Ftree.ml;h=97711dd60f6e0662c306c1ecc306e8eb8e0c1831;hp=e06a11e5ff8d6c1a855e82d7f3eb262988515cec;hb=aade6d9ba2e2b65e021de8a1c3a2d3874aa5742e;hpb=5b5dcd45cf86701ccfe917c1d6ad73b83bb523c3 diff --git a/src/tree.ml b/src/tree.ml index e06a11e..97711dd 100644 --- a/src/tree.ml +++ b/src/tree.ml @@ -13,10 +13,6 @@ (* *) (***********************************************************************) -(* - Time-stamp: -*) - (** The different kind of XML nodes and utility functions *) module NodeKind = @@ -108,9 +104,12 @@ sig (** 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]. + (** [preorder t n] returns the pre-order position of [n] in [t]. + [preodrder t (root t) == 0] and [preorder t nil < 0]. *) + val by_preorder : t -> int -> node + (** [by_preorder t i] returns the node with preorder [i] + *) val print_node : Format.formatter -> node -> unit end