pp.mli 5.85 KB
Newer Older
Andrei Paskevich's avatar
Andrei Paskevich committed
1 2 3
(********************************************************************)
(*                                                                  *)
(*  The Why3 Verification Platform   /   The Why3 Development Team  *)
4
(*  Copyright 2010-2015   --   INRIA - CNRS - Paris-Sud University  *)
Andrei Paskevich's avatar
Andrei Paskevich committed
5 6 7 8
(*                                                                  *)
(*  This software is distributed under the terms of the GNU Lesser  *)
(*  General Public License version 2.1, with the special exception  *)
(*  on linking described in file LICENSE.                           *)
9
(*                                                                  *)
Andrei Paskevich's avatar
Andrei Paskevich committed
10
(********************************************************************)
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
11 12 13 14 15 16 17 18

(*i $Id: pp.mli,v 1.22 2009-10-19 11:55:33 bobot Exp $ i*)

open Format

val print_option : (formatter -> 'a -> unit) -> formatter -> 'a option -> unit
val print_option_or_default :
  string -> (formatter -> 'a -> unit) -> formatter -> 'a option -> unit
19 20 21
val print_list_pre :
  (formatter -> unit -> unit) ->
  (formatter -> 'a -> unit) -> formatter -> 'a list -> unit
22 23 24
val print_list_suf :
  (formatter -> unit -> unit) ->
  (formatter -> 'a -> unit) -> formatter -> 'a list -> unit
25 26
val print_list :
  (formatter -> unit -> unit) ->
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
27 28
  (formatter -> 'a -> unit) -> formatter -> 'a list -> unit
val print_list_or_default :
29
  string -> (formatter -> unit -> unit) ->
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
30 31 32 33 34
  (formatter -> 'a -> unit) -> formatter -> 'a list -> unit
val print_list_par :
  (Format.formatter -> unit -> 'a) ->
  (Format.formatter -> 'b -> unit) -> Format.formatter -> 'b list -> unit
val print_list_delim :
35 36 37
  start:(Format.formatter -> unit -> unit) ->
  stop:(Format.formatter -> unit -> unit) ->
  sep:(Format.formatter -> unit -> unit) ->
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
38
  (Format.formatter -> 'b -> unit) -> Format.formatter -> 'b list -> unit
Francois Bobot's avatar
Francois Bobot committed
39

Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
40 41 42 43
val print_pair_delim :
  (Format.formatter -> unit -> unit) ->
  (Format.formatter -> unit -> unit) ->
  (Format.formatter -> unit -> unit) ->
44
  (Format.formatter -> 'a -> unit) ->
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
45
  (Format.formatter -> 'b -> unit) -> Format.formatter -> 'a * 'b -> unit
Francois Bobot's avatar
Francois Bobot committed
46
val print_pair :
47
  (Format.formatter -> 'a -> unit) ->
Francois Bobot's avatar
Francois Bobot committed
48
  (Format.formatter -> 'b -> unit) -> Format.formatter -> 'a * 'b -> unit
49

50
val print_iter1 :
51
  (('a -> unit) -> 'b -> unit) ->
52 53
  (Format.formatter -> unit -> unit) ->
  (Format.formatter -> 'a -> unit) ->
54 55
  Format.formatter -> 'b -> unit

56
val print_iter2:
57 58 59
  (('a -> 'b -> unit) -> 'c -> unit) ->
  (Format.formatter -> unit -> unit) ->
  (Format.formatter -> unit -> unit) ->
60 61 62 63 64 65 66 67 68 69 70 71
  (Format.formatter -> 'a -> unit) ->
  (Format.formatter -> 'b -> unit) ->
  Format.formatter -> 'c -> unit
(**  [print_iter2 iter sep1 sep2 print1 print2 fmt t]
     iter iterator on [t : 'c]
     print1 k sep2 () print2 v sep1 () print1  sep2 () ...
*)

val print_iter22:
  (('a -> 'b -> unit) -> 'c -> unit) ->
  (Format.formatter -> unit -> unit) ->
  (Format.formatter -> 'a -> 'b -> unit) ->
72
  Format.formatter -> 'c -> unit
73 74 75 76 77
(**  [print_iter22 iter sep print fmt t]
     iter iterator on [t : 'c]
     print k v sep () print k v sep () ...
*)

78 79 80 81
(** formatted: string which is formatted "@ " allow to cut the line if
    too long *)
type formatted = (unit, unit, unit, unit, unit, unit) format6
val empty_formatted : formatted
82

Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
83 84
val space : formatter -> unit -> unit
val alt : formatter -> unit -> unit
85
val alt2 : formatter -> unit -> unit
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
86
val newline : formatter -> unit -> unit
87
val newline2 : formatter -> unit -> unit
88
val dot : formatter -> unit -> unit
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
89
val comma : formatter -> unit -> unit
MARCHE Claude's avatar
MARCHE Claude committed
90
val star : formatter -> unit -> unit
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
91 92
val simple_comma : formatter -> unit -> unit
val semi : formatter -> unit -> unit
93
val colon : formatter -> unit -> unit
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
94
val underscore : formatter -> unit -> unit
Francois Bobot's avatar
Francois Bobot committed
95
val equal : formatter -> unit -> unit
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
96 97 98 99 100 101 102 103 104 105 106
val arrow : formatter -> unit -> unit
val lbrace : formatter -> unit -> unit
val rbrace : formatter -> unit -> unit
val lsquare : formatter -> unit -> unit
val rsquare : formatter -> unit -> unit
val lparen : formatter -> unit -> unit
val rparen : formatter -> unit -> unit
val lchevron : formatter -> unit -> unit
val rchevron : formatter -> unit -> unit
val nothing : formatter -> 'a -> unit
val string : formatter -> string -> unit
107 108
val float : formatter -> float -> unit
val int : formatter -> int -> unit
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
109
val constant_string : string -> formatter -> unit -> unit
110 111
val formatted : formatter -> formatted -> unit
val constant_formatted : formatted -> formatter -> unit -> unit
112
val print0 : formatter -> unit -> unit
François Bobot's avatar
François Bobot committed
113 114 115
val hov : int -> (formatter -> 'a -> unit) -> formatter -> 'a -> unit
val indent : int -> (formatter -> 'a -> unit) -> formatter -> 'a -> unit
(** add the indentation at the first line *)
116

François Bobot's avatar
François Bobot committed
117
val add_flush : (formatter -> 'a -> unit) -> formatter -> 'a -> unit
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
118

119 120 121
val asd : (formatter -> 'a -> unit) -> (formatter -> 'a -> unit)
(** add string delimiter  " " *)

Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
122 123 124 125
val open_formatter : ?margin:int -> out_channel -> formatter
val close_formatter : formatter -> unit
val open_file_and_formatter : ?margin:int -> string -> out_channel * formatter
val close_file_and_formatter : out_channel * formatter -> unit
126
val print_in_file_no_close :
127
  ?margin:int -> (Format.formatter -> unit) -> string -> out_channel
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
128
val print_in_file : ?margin:int -> (Format.formatter -> unit) -> string -> unit
129 130


131 132
val print_list_opt :
  (formatter -> unit -> unit) ->
133
  (formatter -> 'a -> bool) -> formatter -> 'a list -> bool
MARCHE Claude's avatar
MARCHE Claude committed
134 135


136 137 138
val string_of : ?max_boxes:int ->
  (Format.formatter -> 'a -> unit) -> 'a -> string

139 140
val string_of_wnl : (Format.formatter -> 'a -> unit) -> 'a -> string
  (** same as {!string_of} but without newline *)
François Bobot's avatar
François Bobot committed
141 142

val wnl : Format.formatter -> unit
143

144 145 146
val sprintf :
  ('b,  formatter, unit, string) Pervasives.format4 -> 'b

147 148 149
val sprintf_wnl :
  ('b,  formatter, unit, string) Pervasives.format4 -> 'b

150 151 152 153 154
val html_string : Format.formatter -> string -> unit
  (** formats the string by escaping special HTML characters
      quote, double quote, <, > and & *)


155 156 157 158
module Ansi :
sig
  val set_column : Format.formatter -> int -> unit
end
159 160

type formatter = Format.formatter