1995-08-09 08:06:35 -07:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Objective Caml *)
|
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 *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* Automatique. Distributed only by permission. *)
|
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
|
|
|
(* $Id$ *)
|
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
(* Environment handling *)
|
|
|
|
|
1996-09-23 04:33:27 -07:00
|
|
|
open Types
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
type t
|
|
|
|
|
|
|
|
val empty: t
|
|
|
|
val initial: t
|
|
|
|
|
|
|
|
(* Lookup by paths *)
|
|
|
|
|
|
|
|
val find_value: Path.t -> t -> value_description
|
|
|
|
val find_type: Path.t -> t -> type_declaration
|
1996-11-29 10:36:42 -08:00
|
|
|
val find_module: Path.t -> t -> module_type
|
1995-05-04 03:15:53 -07:00
|
|
|
val find_modtype: Path.t -> t -> modtype_declaration
|
1998-06-24 12:22:26 -07:00
|
|
|
val find_class: Path.t -> t -> class_declaration
|
|
|
|
val find_cltype: Path.t -> t -> cltype_declaration
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1997-04-01 12:53:02 -08:00
|
|
|
val find_type_expansion: Path.t -> t -> type_expr list * type_expr
|
|
|
|
val find_modtype_expansion: Path.t -> t -> Types.module_type
|
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
(* Lookup by long identifiers *)
|
|
|
|
|
|
|
|
val lookup_value: Longident.t -> t -> Path.t * value_description
|
|
|
|
val lookup_constructor: Longident.t -> t -> constructor_description
|
|
|
|
val lookup_label: Longident.t -> t -> label_description
|
|
|
|
val lookup_type: Longident.t -> t -> Path.t * type_declaration
|
|
|
|
val lookup_module: Longident.t -> t -> Path.t * module_type
|
|
|
|
val lookup_modtype: Longident.t -> t -> Path.t * modtype_declaration
|
1998-06-24 12:22:26 -07:00
|
|
|
val lookup_class: Longident.t -> t -> Path.t * class_declaration
|
|
|
|
val lookup_cltype: Longident.t -> t -> Path.t * cltype_declaration
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
(* Insertion by identifier *)
|
|
|
|
|
|
|
|
val add_value: Ident.t -> value_description -> t -> t
|
|
|
|
val add_type: Ident.t -> type_declaration -> t -> t
|
|
|
|
val add_exception: Ident.t -> exception_declaration -> t -> t
|
|
|
|
val add_module: Ident.t -> module_type -> t -> t
|
|
|
|
val add_modtype: Ident.t -> modtype_declaration -> t -> t
|
1998-06-24 12:22:26 -07:00
|
|
|
val add_class: Ident.t -> class_declaration -> t -> t
|
|
|
|
val add_cltype: Ident.t -> cltype_declaration -> t -> t
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
(* Insertion of all fields of a signature. *)
|
|
|
|
|
1996-07-25 06:18:53 -07:00
|
|
|
val add_item: signature_item -> t -> t
|
1995-05-04 03:15:53 -07:00
|
|
|
val add_signature: signature -> t -> t
|
|
|
|
|
|
|
|
(* Insertion of all fields of a signature, relative to the given path.
|
|
|
|
Used to implement open. *)
|
|
|
|
|
|
|
|
val open_signature: Path.t -> signature -> t -> t
|
|
|
|
val open_pers_signature: string -> t -> t
|
|
|
|
|
|
|
|
(* Insertion by name *)
|
|
|
|
|
|
|
|
val enter_value: string -> value_description -> t -> Ident.t * t
|
|
|
|
val enter_type: string -> type_declaration -> t -> Ident.t * t
|
|
|
|
val enter_exception: string -> exception_declaration -> t -> Ident.t * t
|
|
|
|
val enter_module: string -> module_type -> t -> Ident.t * t
|
|
|
|
val enter_modtype: string -> modtype_declaration -> t -> Ident.t * t
|
1998-06-24 12:22:26 -07:00
|
|
|
val enter_class: string -> class_declaration -> t -> Ident.t * t
|
|
|
|
val enter_cltype: string -> cltype_declaration -> t -> Ident.t * t
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
(* Reset the cache of in-core module interfaces.
|
|
|
|
To be called in particular when load_path changes. *)
|
|
|
|
|
|
|
|
val reset_cache: unit -> unit
|
|
|
|
|
|
|
|
(* Read, save a signature to/from a file *)
|
|
|
|
|
1997-05-15 06:30:02 -07:00
|
|
|
val read_signature: string -> string -> signature
|
|
|
|
(* Arguments: module name, file name. Results: signature. *)
|
|
|
|
val save_signature: signature -> string -> string -> unit
|
|
|
|
(* Arguments: signature, module name, file name. *)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
(* Return the set of compilation units imported, with their CRC *)
|
|
|
|
|
1995-10-09 06:37:11 -07:00
|
|
|
val imported_units: unit -> (string * Digest.t) list
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1996-11-29 10:36:42 -08:00
|
|
|
(* Summaries -- compact representation of an environment, to be
|
|
|
|
exported in debugging information. *)
|
|
|
|
|
|
|
|
type summary =
|
|
|
|
Env_empty
|
|
|
|
| Env_value of summary * Ident.t * value_description
|
|
|
|
| Env_type of summary * Ident.t * type_declaration
|
|
|
|
| Env_exception of summary * Ident.t * exception_declaration
|
|
|
|
| Env_module of summary * Ident.t * module_type
|
|
|
|
| Env_modtype of summary * Ident.t * modtype_declaration
|
1998-06-24 12:22:26 -07:00
|
|
|
| Env_class of summary * Ident.t * class_declaration
|
|
|
|
| Env_cltype of summary * Ident.t * cltype_declaration
|
1996-11-29 10:36:42 -08:00
|
|
|
| Env_open of summary * Path.t
|
|
|
|
|
|
|
|
val summary: t -> summary
|
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
(* Error report *)
|
|
|
|
|
|
|
|
type error =
|
1995-11-03 05:23:03 -08:00
|
|
|
Not_an_interface of string
|
1995-05-04 03:15:53 -07:00
|
|
|
| Corrupted_interface of string
|
|
|
|
| Illegal_renaming of string * string
|
1997-05-15 06:30:02 -07:00
|
|
|
| Inconsistent_import of string * string * string
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
exception Error of error
|
|
|
|
|
|
|
|
val report_error: error -> unit
|
|
|
|
|
1995-08-24 06:25:04 -07:00
|
|
|
(* Forward declaration to break mutual recursion with includemod. *)
|
1995-08-23 04:55:54 -07:00
|
|
|
|
|
|
|
val check_modtype_inclusion: (t -> module_type -> module_type -> unit) ref
|