Source

(***********************************************************************)(* *)(* OCamlSpotter *)(* *)(* Jun FURUSE *)(* *)(* Copyright 2008-2012 Jun Furuse. All rights reserved. *)(* This file is distributed under the terms of the GNU Library *)(* General Public License, with the special exception on linking *)(* described in file LICENSE. *)(* *)(***********************************************************************)moduletypeOrderedType=sigtypetvalcompare:t->t->[`Included|`Includes|`Left|`Overwrap|`Right|`Same]valsplit:t->by:t->(t*t)optionendmoduleMake(Ord:OrderedType):sigtypeelem=Ord.ttype'anode=Nodeofelem*'amodulerecNode:sigtypet=NodeSet.tnodevalcompare:t->t->intendandNodeSet:Xset.Swithtypeelt=Node.tincludeXset.Swithtypeelt=Node.tandtypet=NodeSet.tvaladd_elem:elem->t->tvalfind_path_contains:elem->t->(elem*t)list(** Returns the path which contains [elem]. The result is the elems which contains [elem]. Deeper (smaller) elem comes first. *)valiter_elem:(parent:elemoption->elem->'a)->t->unitend