1995-08-09 08:06:35 -07:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
2011-07-27 07:17:02 -07:00
|
|
|
(* OCaml *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
1999-11-17 10:59:06 -08:00
|
|
|
(* en Automatique. All rights reserved. This file is distributed *)
|
|
|
|
(* under the terms of the Q Public License version 1.0. *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
(* Identifiers (unique names) *)
|
|
|
|
|
2012-05-30 07:52:37 -07:00
|
|
|
type t = { stamp: int; name: string; mutable flags: int }
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1996-04-22 04:15:41 -07:00
|
|
|
val create: string -> t
|
|
|
|
val create_persistent: string -> t
|
2004-01-04 06:32:34 -08:00
|
|
|
val create_predef_exn: string -> t
|
2000-05-15 23:27:44 -07:00
|
|
|
val rename: t -> t
|
1995-05-04 03:15:53 -07:00
|
|
|
val name: t -> string
|
1995-07-02 09:50:08 -07:00
|
|
|
val unique_name: t -> string
|
2003-05-12 02:09:16 -07:00
|
|
|
val unique_toplevel_name: t -> string
|
1995-05-04 03:15:53 -07:00
|
|
|
val persistent: t -> bool
|
|
|
|
val equal: t -> t -> bool
|
2010-01-22 04:48:24 -08:00
|
|
|
(* Compare identifiers by name. *)
|
1995-05-04 03:15:53 -07:00
|
|
|
val same: t -> t -> bool
|
|
|
|
(* Compare identifiers by binding location.
|
|
|
|
Two identifiers are the same either if they are both
|
|
|
|
non-persistent and have been created by the same call to
|
|
|
|
[new], or if they are both persistent and have the same
|
|
|
|
name. *)
|
|
|
|
val hide: t -> t
|
|
|
|
(* Return an identifier with same name as the given identifier,
|
2003-05-12 02:34:05 -07:00
|
|
|
but stamp different from any stamp returned by new.
|
1995-05-04 03:15:53 -07:00
|
|
|
When put in a 'a tbl, this identifier can only be looked
|
|
|
|
up by name. *)
|
|
|
|
|
|
|
|
val make_global: t -> unit
|
|
|
|
val global: t -> bool
|
2004-01-04 06:32:34 -08:00
|
|
|
val is_predef_exn: t -> bool
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1996-07-15 09:35:35 -07:00
|
|
|
val binding_time: t -> int
|
|
|
|
val current_time: unit -> int
|
1998-11-11 08:58:05 -08:00
|
|
|
val set_current_time: int -> unit
|
2003-05-12 02:34:05 -07:00
|
|
|
val reinit: unit -> unit
|
1996-07-15 09:35:35 -07:00
|
|
|
|
2000-03-13 08:49:01 -08:00
|
|
|
val print: Format.formatter -> t -> unit
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
type 'a tbl
|
|
|
|
(* Association tables from identifiers to type 'a. *)
|
|
|
|
|
|
|
|
val empty: 'a tbl
|
|
|
|
val add: t -> 'a -> 'a tbl -> 'a tbl
|
|
|
|
val find_same: t -> 'a tbl -> 'a
|
|
|
|
val find_name: string -> 'a tbl -> 'a
|
2012-10-29 00:54:06 -07:00
|
|
|
val find_all: string -> 'a tbl -> 'a list
|
|
|
|
val fold_name: (t -> 'a -> 'b -> 'b) -> 'a tbl -> 'b -> 'b
|
|
|
|
val fold_all: (t -> 'a -> 'b -> 'b) -> 'a tbl -> 'b -> 'b
|
2012-04-10 22:50:08 -07:00
|
|
|
val iter: (t -> 'a -> unit) -> 'a tbl -> unit
|
2013-01-29 06:21:12 -08:00
|
|
|
|