KitBa.ml 433 Bytes
Newer Older
POTTIER Francois's avatar
POTTIER Francois committed
1
(* This kit serves to compute the set of ``bound atoms'' of a term, that is,
2
   the set of all binding name occurrences. *)
POTTIER Francois's avatar
POTTIER Francois committed
3

4 5 6 7 8 9 10 11 12 13 14 15 16 17
class ['self] iter = object (_ : 'self)

  val mutable accu = Atom.Set.empty

  method accu = accu (* must be public *)

  (* A bound atom is added to the accumulator when its scope is entered. *)
  method private extend x () =
    accu <- Atom.Set.add x accu

  method private visit_'fn () _x =
    ()

end