Frama-C API - Plib
Pretty Printing Utilities.
Message Formatters
val kprintf : (string -> 'b) -> ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4 -> 'a
val sprintf : ('a, Stdlib.Format.formatter, unit, string) Stdlib.format4 -> 'a
val failure : ('a, Stdlib.Format.formatter, unit, 'b) Stdlib.format4 -> 'a
val to_string : (Stdlib.Format.formatter -> 'a -> unit) -> 'a -> string
Pretty printers
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
type 'a printer2 = Stdlib.Format.formatter -> 'a -> 'a -> unit
Function calls
Operators
val pp_assoc : ?e:string -> op:string -> 'a printer -> 'a list printer
val pp_fold_binop : ?e:string -> op:string -> 'a printer -> 'a list printer
val pp_fold_call : ?e:string -> f:string -> 'a printer -> 'a list printer
val pp_fold_apply : ?e:string -> f:string -> 'a printer -> 'a list printer
val pp_fold_call_rev : ?e:string -> f:string -> 'a printer -> 'a list printer
val pp_fold_apply_rev : ?e:string -> f:string -> 'a printer -> 'a list printer
Iterations
type index =
| Isingle
| Ifirst
| Ilast
| Imiddle
val iteri : (index -> 'a -> unit) -> 'a list -> unit
val iterk : (int -> 'a -> unit) -> 'a list -> unit
val mapk : (int -> 'a -> 'b) -> 'a list -> 'b list
val global_substitute_fmt : Str.regexp -> string printer -> Stdlib.Format.formatter -> string -> unit
string substitution
substitute the result of the given printer for each non-overlapping part of the given string that match the regexp
val iter_group : Str.regexp -> (string -> unit) -> string -> unit
call the given function for each non-overlapping part of the given string that match the regexp
substitute_list templ print_arg fmt l
prints in the formatter fmt
the list l
using the template templ
and the printer print_arg
. The template use %[0-9]+
hole.
val is_template : string -> bool
Check whether the string contains %[0-9]+
holes to be used with substitute_list
.