package frama-c
Install
dune-project
Dependency
Authors
-
MMichele Alberti
-
TThibaud Antignac
-
GGergö Barany
-
PPatrick Baudin
-
TThibaut Benjamin
-
AAllan Blanchard
-
LLionel Blatter
-
FFrançois Bobot
-
RRichard Bonichon
-
QQuentin Bouillaguet
-
DDavid Bühler
-
ZZakaria Chihani
-
LLoïc Correnson
-
JJulien Crétin
-
PPascal Cuoq
-
ZZaynah Dargaye
-
BBasile Desloges
-
JJean-Christophe Filliâtre
-
PPhilippe Herrmann
-
MMaxime Jacquemin
-
FFlorent Kirchner
-
AAlexander Kogtenkov
-
TTristan Le Gall
-
JJean-Christophe Léchenet
-
MMatthieu Lemerre
-
DDara Ly
-
DDavid Maison
-
CClaude Marché
-
AAndré Maroneze
-
TThibault Martin
-
FFonenantsoa Maurica
-
MMelody Méaulle
-
BBenjamin Monate
-
YYannick Moy
-
PPierre Nigron
-
AAnne Pacalet
-
VValentin Perrelle
-
GGuillaume Petiot
-
DDario Pinto
-
VVirgile Prevosto
-
AArmand Puccetti
-
FFélix Ridoux
-
VVirgile Robles
-
JJan Rochel
-
MMuriel Roger
-
JJulien Signoles
-
NNicolas Stouls
-
KKostyantyn Vorobyov
-
BBoris Yakobowski
Maintainers
Sources
sha256=29612882330ecb6eddd0b4ca3afc0492b70d0feb3379a1b8e893194c6e173983
doc/frama-c.gui/Frama_c_gui/Gui_printers/LinkPrinter/class-printer/index.html
Class LinkPrinter.printerSource
Useful functions for building pretty-printers
Local logical annotation (function specifications and code annotations are printed only if logic_printer_enabled is set to true.
more info is displayed when on verbose mode. This flag is synchronized with Frama-C's kernel being on debug mode.
method private current_function : Frama_c_kernel.Cil_types.varinfo optionmethod private current_behavior : Frama_c_kernel.Cil_types.funbehavior optionmethod private stmt_has_annot : Frama_c_kernel.Cil_types.stmt -> booltrue if the given statement has some annotations attached to it.
method private in_ghost_if_needed : Format.formatter ->
bool ->
?break_ghost:bool ->
post_fmt:((Format.formatter -> unit) -> unit, Format.formatter, unit) format ->
?block:bool ->
(unit -> unit) ->
unitOpen a ghost context if the the first bool is true and we are not already in a ghost context. break_ghost indicates whether we should break after the ghost keyword, defaults to true. post_fmt is a format like "%t" and is used to define the format at the end of the ghost context. block indicates whether we should open a C block or not (defaults to true). The last parameter is the function to be applied in the ghost context (generally some AST element).
method private current_stmt : Frama_c_kernel.Cil_types.stmt optionmethod private may_be_skipped : Frama_c_kernel.Cil_types.stmt -> boolThis is called to check that a given statement may be compacted with another one. For example this is called whenever a while(1) followed by a conditional if (cond) break; may be compacted into while (cond).
method private require_braces : Frama_c_kernel.Printer_api.block_ctxt ->
Frama_c_kernel.Cil_types.block ->
boolmethod private inline_block : Frama_c_kernel.Printer_api.block_ctxt ->
Frama_c_kernel.Cil_types.block ->
boolWhat terminator to print after an instruction. sometimes we want to print sequences of instructions separated by comma
method private opt_funspec : Format.formatter ->
Frama_c_kernel.Cil_types.funspec ->
unitPretty-printing of C code
method location : Format.formatter -> Frama_c_kernel.Cil_types.location -> unitmethod constant : Format.formatter -> Frama_c_kernel.Cil_types.constant -> unitmethod varname : Format.formatter -> string -> unitInvoked each time an identifier name is to be printed. Allows for various manipulation of the name, such as unmangling.
method vdecl : Format.formatter -> Frama_c_kernel.Cil_types.varinfo -> unitInvoked for each variable declaration. Note that variable declarations are all the GVar, GVarDecl, GFun, GFunDecl, all the varinfo in formals of function types, and the formals and locals for function definitions.
method varinfo : Format.formatter -> Frama_c_kernel.Cil_types.varinfo -> unitInvoked on each variable use.
method lval : Format.formatter -> Frama_c_kernel.Cil_types.lval -> unitInvoked on each lvalue occurrence
method field : Format.formatter -> Frama_c_kernel.Cil_types.fieldinfo -> unitmethod offset : Format.formatter -> Frama_c_kernel.Cil_types.offset -> unitInvoked on each offset occurrence. The second argument is the base.
method global : Format.formatter -> Frama_c_kernel.Cil_types.global -> unitGlobal (vars, types, etc.). This can be slow.
method fieldinfo : Format.formatter ->
Frama_c_kernel.Cil_types.fieldinfo ->
unitA field declaration
method storage : Format.formatter -> Frama_c_kernel.Cil_types.storage -> unitmethod ikind : Format.formatter -> Frama_c_kernel.Cil_types.ikind -> unitmethod fkind : Format.formatter -> Frama_c_kernel.Cil_types.fkind -> unitmethod compkind : Format.formatter -> Frama_c_kernel.Cil_types.compinfo -> unitmethod compname : Format.formatter -> Frama_c_kernel.Cil_types.compinfo -> unitmethod compinfo : Format.formatter -> Frama_c_kernel.Cil_types.compinfo -> unitmethod enuminfo : Format.formatter -> Frama_c_kernel.Cil_types.enuminfo -> unitmethod typeinfo : Format.formatter -> Frama_c_kernel.Cil_types.typeinfo -> unitmethod typ : ?fundecl:Frama_c_kernel.Cil_types.varinfo ->
(Format.formatter -> unit) option ->
Format.formatter ->
Frama_c_kernel.Cil_types.typ ->
unitUse of some type in some declaration. fundecl is the name of the function which is declared with the corresponding type. The second argument is used to print the declared element, or is None if we are just printing a type with no name being declared. If fundecl is not None, second argument must also have a value.
method attrparam : Format.formatter ->
Frama_c_kernel.Cil_types.attrparam ->
unitAttribute parameter
method attribute : Format.formatter ->
Frama_c_kernel.Cil_types.attribute ->
boolAttribute. Also return an indication whether this attribute must be printed inside the __attribute__ list or not.
method attributes : Format.formatter ->
Frama_c_kernel.Cil_types.attributes ->
unitAttribute lists
method label : Format.formatter -> Frama_c_kernel.Cil_types.label -> unitmethod compinfo : Format.formatter -> Frama_c_kernel.Cil_types.compinfo -> unitmethod initinfo : Format.formatter -> Frama_c_kernel.Cil_types.initinfo -> unitmethod fundec : Format.formatter -> Frama_c_kernel.Cil_types.fundec -> unitmethod line_directive : ?forcefile:bool ->
Format.formatter ->
Frama_c_kernel.Cil_types.location ->
unitPrint a line-number. This is assumed to come always on an empty line. If the forcefile argument is present and is true then the file name will be printed always. Otherwise the file name is printed only if it is different from the last time this function is called. The last file name is stored in a private field inside the cilPrinter object.
method stmt_labels : Format.formatter -> Frama_c_kernel.Cil_types.stmt -> unitPrint only the labels of the statement. Used by annotated_stmt.
method annotated_stmt : Frama_c_kernel.Cil_types.stmt ->
Format.formatter ->
Frama_c_kernel.Cil_types.stmt ->
unitPrint an annotated statement. The code to be printed is given in the last Cil_types.stmt argument. The initial Cil_types.stmt argument records the statement which follows the one being printed.
method stmtkind : Frama_c_kernel.Cil_types.attributes ->
Frama_c_kernel.Cil_types.stmt ->
Format.formatter ->
Frama_c_kernel.Cil_types.stmtkind ->
unitPrint a statement kind. The code to be printed is given in the Cil_types.stmtkind argument. The initial Cil_types.stmt argument records the statement which follows the one being printed; Printer.extensible_printer uses this information to prettify statement printing in certain special cases. The boolean flag indicated whether the statement has labels (which have already been printed)
method instr : Format.formatter -> Frama_c_kernel.Cil_types.instr -> unitInvoked on each instruction occurrence.
method stmt : Format.formatter -> Frama_c_kernel.Cil_types.stmt -> unitControl-flow statement. annot is true iff the printer prints the annotations of the stmt.
method next_stmt : Frama_c_kernel.Cil_types.stmt ->
Format.formatter ->
Frama_c_kernel.Cil_types.stmt ->
unitmethod block : Format.formatter -> Frama_c_kernel.Cil_types.block -> unitPrints a block.
method exp : Format.formatter -> Frama_c_kernel.Cil_types.exp -> unitPrint expressions
method unop : Format.formatter -> Frama_c_kernel.Cil_types.unop -> unitmethod binop : Format.formatter -> Frama_c_kernel.Cil_types.binop -> unitmethod init : Format.formatter -> Frama_c_kernel.Cil_types.init -> unitmethod file : Format.formatter -> Frama_c_kernel.Cil_types.file -> unitPrint initializers. This can be slow.
Pretty-printing of annotations
method logic_constant : Format.formatter ->
Frama_c_kernel.Cil_types.logic_constant ->
unitmethod logic_type : (Format.formatter -> unit) option ->
Format.formatter ->
Frama_c_kernel.Cil_types.logic_type ->
unitmethod logic_type_def : Format.formatter ->
Frama_c_kernel.Cil_types.logic_type_def ->
unitmethod model_info : Format.formatter ->
Frama_c_kernel.Cil_types.model_info ->
unitmethod term_binop : Format.formatter -> Frama_c_kernel.Cil_types.binop -> unitmethod relation : Format.formatter -> Frama_c_kernel.Cil_types.relation -> unitmethod identified_term : Format.formatter ->
Frama_c_kernel.Cil_types.identified_term ->
unitmethod term : Format.formatter -> Frama_c_kernel.Cil_types.term -> unitmethod term_node : Format.formatter -> Frama_c_kernel.Cil_types.term -> unitmethod term_lval : Format.formatter ->
Frama_c_kernel.Cil_types.term_lval ->
unitmethod term_lhost : Format.formatter ->
Frama_c_kernel.Cil_types.term_lhost ->
unitmethod model_field : Format.formatter ->
Frama_c_kernel.Cil_types.model_info ->
unitmethod term_offset : Format.formatter ->
Frama_c_kernel.Cil_types.term_offset ->
unitmethod logic_builtin_label : Format.formatter ->
Frama_c_kernel.Cil_types.logic_builtin_label ->
unitmethod logic_label : Format.formatter ->
Frama_c_kernel.Cil_types.logic_label ->
unitmethod logic_info : Format.formatter ->
Frama_c_kernel.Cil_types.logic_info ->
unitmethod builtin_logic_info : Format.formatter ->
Frama_c_kernel.Cil_types.builtin_logic_info ->
unitmethod logic_type_info : Format.formatter ->
Frama_c_kernel.Cil_types.logic_type_info ->
unitmethod logic_ctor_info : Format.formatter ->
Frama_c_kernel.Cil_types.logic_ctor_info ->
unitmethod logic_var : Format.formatter ->
Frama_c_kernel.Cil_types.logic_var ->
unitmethod quantifiers : Format.formatter ->
Frama_c_kernel.Cil_types.quantifiers ->
unitmethod predicate_node : Format.formatter ->
Frama_c_kernel.Cil_types.predicate_node ->
unitmethod predicate : Format.formatter ->
Frama_c_kernel.Cil_types.predicate ->
unitmethod identified_predicate : Format.formatter ->
Frama_c_kernel.Cil_types.identified_predicate ->
unitmethod behavior : Format.formatter ->
Frama_c_kernel.Cil_types.funbehavior ->
unitmethod requires : Format.formatter ->
Frama_c_kernel.Cil_types.identified_predicate ->
unitmethod complete_behaviors : Format.formatter -> string list -> unitmethod disjoint_behaviors : Format.formatter -> string list -> unitmethod terminates : Format.formatter ->
Frama_c_kernel.Cil_types.identified_predicate ->
unitmethod post_cond : Format.formatter ->
(Frama_c_kernel.Cil_types.termination_kind
* Frama_c_kernel.Cil_types.identified_predicate) ->
unitpretty prints a post condition according to the exit kind it represents
method assumes : Format.formatter ->
Frama_c_kernel.Cil_types.identified_predicate ->
unitmethod extended : Format.formatter ->
Frama_c_kernel.Cil_types.acsl_extension ->
unitmethod short_extended : Format.formatter ->
Frama_c_kernel.Cil_types.acsl_extension ->
unitmethod funspec : Format.formatter -> Frama_c_kernel.Cil_types.funspec -> unitmethod assigns : string ->
Format.formatter ->
Frama_c_kernel.Cil_types.assigns ->
unitfirst parameter is the introducing keyword (e.g. loop_assigns or assigns).
method allocation : isloop:bool ->
Format.formatter ->
Frama_c_kernel.Cil_types.allocation ->
unitfirst parameter is the introducing keyword (e.g. loop_allocates, loop_frees, allocates or free)
method from : string ->
Format.formatter ->
Frama_c_kernel.Cil_types.from ->
unitprints an assignment with its dependencies.
method code_annotation : Format.formatter ->
Frama_c_kernel.Cil_types.code_annotation ->
unitmethod global_annotation : Format.formatter ->
Frama_c_kernel.Cil_types.global_annotation ->
unitmethod decreases : Format.formatter -> Frama_c_kernel.Cil_types.variant -> unitmethod variant : Format.formatter -> Frama_c_kernel.Cil_types.variant -> unitModifying pretty-printer behavior
method pp_while_head : Format.formatter -> Frama_c_kernel.Cil_types.exp -> unitPrints the recovered while (cond) exit condition of a loop. Note: this method will be called in a context where 'current_stmt' is tied to the original AST conditional statement that exits the loop, as expected.
method pp_keyword : Format.formatter -> string -> unitAll C99 keywords except types "char", "int", "long", "signed", "short", "unsigned", "void" and "_XXX" (like "_Bool") *
method pp_acsl_keyword : Format.formatter -> string -> unitAll ACSL keywords except logic types
method pp_open_annotation : ?block:bool ->
?pre:Frama_c_kernel.Pretty_utils.sformat ->
Format.formatter ->
unitmethod pp_close_annotation : ?block:bool ->
?suf:Frama_c_kernel.Pretty_utils.sformat ->
Format.formatter ->
unitCalled before/after printing an annotation comment. Put the annotation in a block according to the optional argument. If it is not set, the annotation is put in a block. *
method without_annot : 'a. (Format.formatter -> 'a -> unit) ->
Format.formatter ->
'a ->
unitself#without_annot printer fmt x pretty prints x by using printer, without pretty-printing its function contracts and code annotations.
method force_brace : 'a. (Format.formatter -> 'a -> unit) ->
Format.formatter ->
'a ->
unitself#force_brace printer fmt x pretty prints x by using printer, but add some extra braces '{' and '}' which are hidden by default.