(***********************************************************************) (* *) (* Objective Caml *) (* *) (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) (* *) (* Copyright 1996 Institut National de Recherche en Informatique et *) (* en Automatique. All rights reserved. This file is distributed *) (* under the terms of the Q Public License version 1.0. *) (* *) (***********************************************************************) (* $Id: toploop.mli,v 1.2 2002/04/02 06:33:08 cookcu Exp $ *) open Format (* Accessors for the table of toplevel value bindings. These functions must appear as first and second exported functions in this module. (See module Translmod.) *) val getvalue : string -> Obj.t val setvalue : string -> Obj.t -> unit (* Interface with toplevel directives *) type directive_fun = | Directive_none of (unit -> unit) | Directive_string of (string -> unit) | Directive_int of (int -> unit) | Directive_ident of (Longident.t -> unit) | Directive_bool of (bool -> unit) val directive_table : (string, directive_fun) Hashtbl.t (* Table of known directives, with their execution function *) val toplevel_env : Env.t ref (* Typing environment for the toplevel *) val print_exception_outcome : formatter -> exn -> unit (* Print an exception resulting from the evaluation of user code. *) val print_exception_outcome_nty : formatter -> exn -> 'a Nty.nty -> unit (* Print an exception resulting from the evaluation of user code. *) val eval_path: Path.t -> Obj.t (* Return the toplevel object referred to by the given path *) (* Printing of values *) val print_value_nty: Env.t -> Obj.t -> formatter -> Types.type_expr -> 'a Nty.nty -> unit val print_value: Env.t -> Obj.t -> formatter -> Types.type_expr -> unit val print_untyped_exception: formatter -> Obj.t -> unit val install_printer : Path.t -> Types.type_expr -> (formatter -> Obj.t -> unit) -> unit val remove_printer : Path.t -> unit val max_printer_depth: int ref val max_printer_steps: int ref (* Used by Trace module *) val may_trace : bool ref (* COOKCU *) type evaluation_outcome = Result of Obj.t | Exception of exn val load_lambda : Format.formatter -> Lambda.lambda -> evaluation_outcome val use_print_results : bool ref val refill_lexbuf : string -> int -> int val first_line : bool ref val empty_lexbuf : Lexing.lexbuf -> unit