class type cilPrinter = object
.. end
A printer interface for CIL trees. Create instantiations of
this type by specializing the class Cil.defaultCilPrinter
.
val mutable logic_printer_enabled : bool
Local logical annotation (function specifications and code annotations
are printed only if logic_printer_enabled
is set to true
val mutable verbose : bool
more info is displayed when on verbose mode.
method current_function : Cil_types.varinfo option
Returns the varinfo
corresponding to the function being printed
method has_annot : bool
true if current_stmt
has some annotations attached to it.
method current_stmt : Cil_types.stmt option
Returns the stmt being printed
method may_be_skipped : Cil_types.stmt -> bool
This 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 setPrintInstrTerminator : string -> unit
method getPrintInstrTerminator : unit -> string
method pVarName : Format.formatter -> string -> unit
Invoked each time an identifier name is to be printed. Allows for
various manipulation of the name, such as unmangling.
method pVDecl : Format.formatter -> Cil_types.varinfo -> unit
Invoked for each variable declaration. Note that variable
declarations are all the GVar
, GVarDecl
, GFun
, all the varinfo
in formals of function types, and the formals and locals for function
definitions.
method pVar : Format.formatter -> Cil_types.varinfo -> unit
Invoked on each variable use.
method pLval : Format.formatter -> Cil_types.lval -> unit
Invoked on each lvalue occurence
method pOffset : Format.formatter -> Cil_types.offset -> unit
Invoked on each offset occurence. The second argument is the base.
method pInstr : Format.formatter -> Cil_types.instr -> unit
Invoked on each instruction occurrence.
method pStmt : Format.formatter -> Cil_types.stmt -> unit
Control-flow statement.
method pStmtNext : Cil_types.stmt -> Format.formatter -> Cil_types.stmt -> unit
method requireBraces : Cil_types.block -> bool
method pBlock : ?toplevel:bool -> Format.formatter -> Cil_types.block -> unit
Print a block.
method pGlobal : Format.formatter -> Cil_types.global -> unit
Global (vars, types, etc.). This can be slow.
method pFieldDecl : Format.formatter -> Cil_types.fieldinfo -> unit
A field declaration
method pType : ?fundecl:Cil_types.varinfo ->
(Format.formatter -> unit) option ->
Format.formatter -> Cil_types.typ -> unit
Use 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 pAttr : Format.formatter -> Cil_types.attribute -> bool
Attribute. Also return an indication whether this attribute must be
printed inside the __attribute__ list or not.
method pAttrParam : Format.formatter -> Cil_types.attrparam -> unit
Attribute paramter
method pAttrs : Format.formatter -> Cil_types.attributes -> unit
Attribute lists
method pLabel : Format.formatter -> Cil_types.label -> unit
Label
method pLineDirective : ?forcefile:bool -> Format.formatter -> Cil_types.location -> unit
Print 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 time this function is called. The last
file name is stored in a private field inside the cilPrinter object.
method pStmtLabels : Format.formatter -> Cil_types.stmt -> unit
Print only the labels of the statement. Used by pAnnotatedStmt
.
method pAnnotatedStmt : Cil_types.stmt -> Format.formatter -> Cil_types.stmt -> unit
Print 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;
Cil.defaultCilPrinterClass
uses this information to prettify
statement printing in certain special cases.
method pStmtKind : Cil_types.stmt -> Format.formatter -> Cil_types.stmtkind -> unit
Print 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;
Cil.defaultCilPrinterClass
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 pExp : Format.formatter -> Cil_types.exp -> unit
Print expressions
method pInit : Format.formatter -> Cil_types.init -> unit
Print initializers. This can be slow.
Pretty-printing of annotations.
method pLogic_type : (Format.formatter -> unit) option ->
Format.formatter -> Cil_types.logic_type -> unit
method pLogic_type_def : Format.formatter -> Cil_types.logic_type_def -> unit
method pTerm : Format.formatter -> Cil_types.term -> unit
method pTerm_node : Format.formatter -> Cil_types.term -> unit
method pTerm_lval : Format.formatter -> Cil_types.term_lval -> unit
method pTerm_offset : Format.formatter -> Cil_types.term_offset -> unit
method pLogic_info_use : Format.formatter -> Cil_types.logic_info -> unit
method pLogic_var : Format.formatter -> Cil_types.logic_var -> unit
method pQuantifiers : Format.formatter -> Cil_types.quantifiers -> unit
method pPredicate : Format.formatter -> Cil_types.predicate -> unit
method pPredicate_named : Format.formatter -> Cil_types.predicate Cil_types.named -> unit
method pIdentified_predicate : Format.formatter -> Cil_types.identified_predicate -> unit
method pBehavior : Format.formatter -> Cil_types.funbehavior -> unit
method pRequires : Format.formatter -> Cil_types.identified_predicate -> unit
method pComplete_behaviors : Format.formatter -> string list -> unit
method pDisjoint_behaviors : Format.formatter -> string list -> unit
method pTerminates : Format.formatter -> Cil_types.identified_predicate -> unit
method pPost_cond : Format.formatter ->
Cil_types.termination_kind * Cil_types.identified_predicate -> unit
pretty prints a post condition according to the exit kind it represents
Change in Boron-20100401: replaces pEnsures
method pAssumes : Format.formatter -> Cil_types.identified_predicate -> unit
method pSpec : Format.formatter -> Cil_types.funspec -> unit
method pZone : Format.formatter -> Cil_types.identified_term Cil_types.zone -> unit
method pAssigns : string ->
Format.formatter -> Cil_types.identified_term Cil_types.assigns list -> unit
pAssigns is parameterized by its introducing keyword
(i.e. loop_assigns or assigns)
method pFrom : string ->
Format.formatter -> Cil_types.identified_term Cil_types.assigns -> unit
prints an assignment with its dependencies.
method pStatus : Format.formatter -> Cil_types.annot_status -> unit
method pCode_annot : Format.formatter -> Cil_types.code_annotation -> unit
method pAnnotation : Format.formatter -> Cil_types.global_annotation -> unit
method pDecreases : Format.formatter -> Cil_types.term Cil_types.variant -> unit
method pLoop_variant : Format.formatter -> Cil_types.term Cil_types.variant -> unit