Module type Printer_api.S

module type S = sig .. end

val pp_varname : Format.formatter -> string -> unit

Printer for C constructs


val pp_location : Format.formatter -> Cil_types.location -> unit
val pp_constant : Format.formatter -> Cil_types.constant -> unit
val pp_storage : Format.formatter -> Cil_types.storage -> unit
val pp_ikind : Format.formatter -> Cil_types.ikind -> unit
val pp_fkind : Format.formatter -> Cil_types.fkind -> unit
val pp_typ : Format.formatter -> Cil_types.typ -> unit
val pp_exp : Format.formatter -> Cil_types.exp -> unit
val pp_varinfo : Format.formatter -> Cil_types.varinfo -> unit
val pp_lval : Format.formatter -> Cil_types.lval -> unit
val pp_field : Format.formatter -> Cil_types.fieldinfo -> unit
val pp_offset : Format.formatter -> Cil_types.offset -> unit
val pp_init : Format.formatter -> Cil_types.init -> unit
val pp_binop : Format.formatter -> Cil_types.binop -> unit
val pp_unop : Format.formatter -> Cil_types.unop -> unit
val pp_attribute : Format.formatter -> Cil_types.attribute -> unit
val pp_attrparam : Format.formatter -> Cil_types.attrparam -> unit
val pp_attributes : Format.formatter -> Cil_types.attributes -> unit
val pp_instr : Format.formatter -> Cil_types.instr -> unit
val pp_label : Format.formatter -> Cil_types.label -> unit
val pp_stmt : Format.formatter -> Cil_types.stmt -> unit
val pp_block : Format.formatter -> Cil_types.block -> unit
val pp_global : Format.formatter -> Cil_types.global -> unit
val pp_file : Format.formatter -> Cil_types.file -> unit

Printer for ACSL constructs


val pp_relation : Format.formatter -> Cil_types.relation -> unit
val pp_model_info : Format.formatter -> Cil_types.model_info -> unit
Since Oxygen-20120901
val pp_term_lval : Format.formatter -> Cil_types.term_lval -> unit
val pp_logic_var : Format.formatter -> Cil_types.logic_var -> unit
val pp_logic_type : Format.formatter -> Cil_types.logic_type -> unit
val pp_identified_term : Format.formatter -> Cil_types.identified_term -> unit
val pp_term : Format.formatter -> Cil_types.term -> unit
val pp_model_field : Format.formatter -> Cil_types.model_info -> unit
val pp_term_offset : Format.formatter -> Cil_types.term_offset -> unit
val pp_logic_label : Format.formatter -> Cil_types.logic_label -> unit
val pp_predicate_node : Format.formatter -> Cil_types.predicate_node -> unit
val pp_predicate : Format.formatter -> Cil_types.predicate -> unit
val pp_identified_predicate : Format.formatter -> Cil_types.identified_predicate -> unit
val pp_code_annotation : Format.formatter -> Cil_types.code_annotation -> unit
val pp_funspec : Format.formatter -> Cil_types.funspec -> unit
val pp_behavior : Format.formatter -> Cil_types.funbehavior -> unit
val pp_global_annotation : Format.formatter -> Cil_types.global_annotation -> unit
val pp_decreases : Format.formatter -> Cil_types.term Cil_types.variant -> unit
val pp_variant : Format.formatter -> Cil_types.term Cil_types.variant -> unit
val pp_from : Format.formatter -> Cil_types.identified_term Cil_types.from -> unit
val pp_assigns : Format.formatter -> Cil_types.identified_term Cil_types.assigns -> unit
val pp_allocation : Format.formatter -> Cil_types.identified_term Cil_types.allocation -> unit
Since Oxygen-20120901
val pp_loop_from : Format.formatter -> Cil_types.identified_term Cil_types.from -> unit
val pp_loop_assigns : Format.formatter -> Cil_types.identified_term Cil_types.assigns -> unit
val pp_loop_allocation : Format.formatter -> Cil_types.identified_term Cil_types.allocation -> unit
Since Oxygen-20120901
val pp_post_cond : Format.formatter ->
Cil_types.termination_kind * Cil_types.identified_predicate -> unit

General form of printers


val pp_full_assigns : string ->
Format.formatter -> Cil_types.identified_term Cil_types.assigns -> unit
first parameter is the introducing keyword (e.g. loop_assigns or assigns).
val without_annot : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a -> unit
without_annot printer fmt x pretty prints x by using printer, without pretty-printing its function contracts and code annotations.
val force_brace : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a -> unit
self#force_brace printer fmt x pretty prints x by using printer, but add some extra braces '{' and '}' which are hidden by default.

Extensible printer


class extensible_printer : unit -> Printer_api.extensible_printer_type
Extend this class if you want to obtain a custom pretty-printer.
module type PrinterClass = sig .. end
Auxiliary module type for a pretty-printer
module type PrinterExtension = functor (X : PrinterClass-> PrinterClass
Signature for extending an existing pretty-printer.
val update_printer : (module Printer_api.S.PrinterExtension) -> unit
Register a pretty-printer extension. The pretty-printer passed as argument X in the functor Printer_api.S.PrinterExtension is the current pretty-printer, which you should inherit from.

This is how this function should be used:

module PrinterClassDeferred (X: Printer.PrinterClass) = struct
 class printer : Printer.extensible_printer = object(self)
   inherit X.printer as super
   (* Override the standard methods *)
 end
end
let () = Printer.update_printer
   (module PrinterClassDeferred: Printer.PrinterExtension)

val current_printer : unit -> (module Printer_api.S.PrinterClass)
Returns the current pretty-printer, with all the extensions added using Printer_api.S.update_printer.
val set_printer : (module Printer_api.S.PrinterClass) -> unit
Set the current pretty-printer, typically to a printer previously obtained through Printer_api.S.current_printer. This can be useful to cancel a modification performed through Printer_api.S.update_printer.