1997-03-24 12:11:22 -08:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* Objective Caml *)
|
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
|
|
|
(* 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. *)
|
1997-03-24 12:11:22 -08:00
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
|
|
|
(* $Id$ *)
|
|
|
|
|
|
|
|
(* Basic operations on core types *)
|
|
|
|
|
|
|
|
open Types
|
|
|
|
|
|
|
|
val generic_level: int
|
|
|
|
|
1998-07-03 10:40:39 -07:00
|
|
|
val newty2: int -> type_desc -> type_expr
|
|
|
|
(* Create a type *)
|
1997-03-24 12:11:22 -08:00
|
|
|
val newgenty: type_desc -> type_expr
|
|
|
|
(* Create a generic type *)
|
|
|
|
val newgenvar: unit -> type_expr
|
|
|
|
(* Return a fresh generic variable *)
|
1998-07-03 10:40:39 -07:00
|
|
|
val newmarkedvar: int -> type_expr
|
|
|
|
(* Return a fresh marked variable *)
|
1997-03-24 12:11:22 -08:00
|
|
|
val newmarkedgenvar: unit -> type_expr
|
|
|
|
(* Return a fresh marked generic variable *)
|
|
|
|
|
|
|
|
val repr: type_expr -> type_expr
|
|
|
|
(* Return the canonical representative of a type. *)
|
|
|
|
|
1997-05-11 14:48:21 -07:00
|
|
|
val field_kind_repr: field_kind -> field_kind
|
|
|
|
(* Return the canonical representative of an object field
|
|
|
|
kind. *)
|
|
|
|
|
1997-03-24 12:11:22 -08:00
|
|
|
(**** Utilities for type traversal ****)
|
|
|
|
|
|
|
|
val iter_type_expr: (type_expr -> unit) -> type_expr -> unit
|
|
|
|
(* Iteration on types *)
|
|
|
|
|
|
|
|
val save_desc: type_expr -> type_desc -> unit
|
|
|
|
(* Save a type description *)
|
|
|
|
val cleanup_types: unit -> unit
|
|
|
|
(* Restore type descriptions *)
|
|
|
|
|
|
|
|
val lowest_level: int
|
|
|
|
(* Marked type: ty.level < lowest_level *)
|
|
|
|
val pivot_level: int
|
|
|
|
(* Type marking: ty.level <- pivot_level - ty.level *)
|
1998-06-24 12:22:26 -07:00
|
|
|
val mark_type: type_expr -> unit
|
|
|
|
(* Mark a type *)
|
1998-10-16 04:51:18 -07:00
|
|
|
val mark_type_node: type_expr -> unit
|
|
|
|
(* Mark a type node (but not its sons) *)
|
|
|
|
val mark_type_params: type_expr -> unit
|
|
|
|
(* Mark the sons of a type node *)
|
1997-03-24 12:11:22 -08:00
|
|
|
val unmark_type: type_expr -> unit
|
1998-06-24 12:22:26 -07:00
|
|
|
val unmark_type_decl: type_declaration -> unit
|
|
|
|
val unmark_class_type: class_type -> unit
|
|
|
|
val unmark_class_signature: class_signature -> unit
|
1997-03-24 12:11:22 -08:00
|
|
|
(* Remove marks from a type *)
|
|
|
|
|
|
|
|
(**** Memorization of abbreviation expansion ****)
|
|
|
|
|
|
|
|
val cleanup_abbrev: unit -> unit
|
|
|
|
(* Flush the cache of abbreviation expansions.
|
|
|
|
When some types are saved (using [output_value]), this
|
|
|
|
function MUST be called just before. *)
|
|
|
|
val memorize_abbrev:
|
1998-06-24 12:22:26 -07:00
|
|
|
abbrev_memo ref -> Path.t -> type_expr -> type_expr -> unit
|
1997-03-24 12:11:22 -08:00
|
|
|
(* Add an expansion in the cache *)
|
1998-06-24 12:22:26 -07:00
|
|
|
val forget_abbrev:
|
|
|
|
abbrev_memo ref -> Path.t -> unit
|
|
|
|
(* Remove an abbreviation from the cache *)
|