1997-03-22 12:16:52 -08:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
2011-07-27 07:17:02 -07:00
|
|
|
(* OCaml *)
|
1997-03-22 12:16:52 -08:00
|
|
|
(* *)
|
|
|
|
(* Jerome Vouillon, 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-22 12:16:52 -08:00
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
|
|
|
(* Printing of values *)
|
|
|
|
|
|
|
|
open Types
|
2000-03-06 14:12:09 -08:00
|
|
|
open Format
|
1997-03-22 12:16:52 -08:00
|
|
|
|
1998-10-01 05:34:32 -07:00
|
|
|
module type OBJ =
|
1997-03-22 12:16:52 -08:00
|
|
|
sig
|
|
|
|
type t
|
|
|
|
val obj : t -> 'a
|
|
|
|
val is_block : t -> bool
|
|
|
|
val tag : t -> int
|
|
|
|
val size : t -> int
|
|
|
|
val field : t -> int -> t
|
|
|
|
end
|
|
|
|
|
2000-03-25 10:55:45 -08:00
|
|
|
module type EVALPATH =
|
|
|
|
sig
|
2012-07-10 08:03:11 -07:00
|
|
|
type valu
|
2013-10-03 19:06:40 -07:00
|
|
|
val eval_path: Env.t -> Path.t -> valu
|
2000-03-25 10:55:45 -08:00
|
|
|
exception Error
|
2012-07-10 08:03:11 -07:00
|
|
|
val same_value: valu -> valu -> bool
|
2000-03-25 10:55:45 -08:00
|
|
|
end
|
|
|
|
|
2014-12-06 09:11:04 -08:00
|
|
|
type ('a, 'b) gen_printer =
|
|
|
|
| Zero of 'b
|
|
|
|
| Succ of ('a -> ('a, 'b) gen_printer)
|
|
|
|
|
1997-03-22 12:16:52 -08:00
|
|
|
module type S =
|
|
|
|
sig
|
|
|
|
type t
|
2001-07-03 04:04:10 -07:00
|
|
|
val install_printer :
|
|
|
|
Path.t -> Types.type_expr -> (formatter -> t -> unit) -> unit
|
2014-12-06 09:11:04 -08:00
|
|
|
val install_generic_printer :
|
|
|
|
Path.t -> Path.t ->
|
|
|
|
(int -> (int -> t -> Outcometree.out_value,
|
|
|
|
t -> Outcometree.out_value) gen_printer) ->
|
|
|
|
unit
|
|
|
|
val install_generic_printer' :
|
|
|
|
Path.t -> Path.t ->
|
|
|
|
(formatter -> t -> unit,
|
|
|
|
formatter -> t -> unit) gen_printer ->
|
|
|
|
unit
|
2014-12-06 09:11:11 -08:00
|
|
|
(** [install_generic_printer' function_path constructor_path printer]
|
|
|
|
function_path is used to remove the printer. *)
|
1997-03-22 12:16:52 -08:00
|
|
|
val remove_printer : Path.t -> unit
|
2001-08-02 01:51:55 -07:00
|
|
|
val outval_of_untyped_exception : t -> Outcometree.out_value
|
|
|
|
val outval_of_value :
|
|
|
|
int -> int ->
|
|
|
|
(int -> t -> Types.type_expr -> Outcometree.out_value option) ->
|
|
|
|
Env.t -> t -> type_expr -> Outcometree.out_value
|
1997-03-22 12:16:52 -08:00
|
|
|
end
|
|
|
|
|
2012-07-10 08:03:11 -07:00
|
|
|
module Make(O : OBJ)(EVP : EVALPATH with type valu = O.t) :
|
2000-03-25 10:55:45 -08:00
|
|
|
(S with type t = O.t)
|