package frama-c

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

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

val pp_call_var : f:string -> 'a printer -> 'a list printer
val pp_call_void : f:string -> 'a printer -> 'a list printer
val pp_call_apply : f:string -> 'a printer -> 'a list printer

Operators

val pp_assoc : ?e:string -> op:string -> 'a printer -> 'a list printer
val pp_binop : op:string -> 'a printer -> 'a printer2
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 =
  1. | Isingle
  2. | Ifirst
  3. | Ilast
  4. | 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 pp_listcompact : sep:string -> 'a printer -> 'a list printer
val pp_listsep : sep:string -> 'a printer -> 'a list printer
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

val substitute_list : 'a printer -> string -> 'a list printer

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.

OCaml

Innovation. Community. Security.