aboutsummaryrefslogtreecommitdiff
path: root/toplevel/ide_intf.mli
blob: 2550a30cd326bc7d90ab93c12ff837c793936804 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
(************************************************************************)
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
(* <O___,, *   INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2010     *)
(*   \VV/  **************************************************************)
(*    //   *      This file is distributed under the terms of the       *)
(*         *       GNU Lesser General Public License Version 2.1        *)
(************************************************************************)

(** * Interface of calls to Coq by CoqIde *)

type 'a menu = 'a * (string * string) list

type goals =
  | Message of string
  | Goals of ((string menu) list * string menu) list

type 'a call

val raw_interp : string -> unit call
val interp : bool -> string -> int call
val rewind : int -> int call
val is_in_loadpath : string -> bool call
val make_cases : string -> string list list call
val current_status : string call
val current_goals : goals call
val read_stdout : string call

(** * Coq answers to CoqIde *)

type 'a value =
  | Good of 'a
  | Fail of (Util.loc option * string)

type handler = {
  is_in_loadpath : string -> bool;
  raw_interp : string -> unit;
  interp : bool -> string -> int;
  rewind : int -> int;
  read_stdout : unit -> string;
  current_goals : unit -> goals;
  current_status : unit -> string;
  make_cases : string -> string list list;
}

val abstract_eval_call :
  handler -> (exn -> Util.loc option * string) ->
  'a call -> 'a value