GoblintCil.cilPrinterA printer interface for CIL trees. Create instantiations of this type by specializing the class defaultCilPrinterClass.
method setCurrentFormals : varinfo list -> unitmethod pVDecl : unit -> varinfo -> GoblintCil__.Pretty.docInvoked 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 : varinfo -> GoblintCil__.Pretty.docInvoked on each variable use.
method pLval : unit -> lval -> GoblintCil__.Pretty.docInvoked on each lvalue occurrence
method pOffset : GoblintCil__.Pretty.doc -> offset -> GoblintCil__.Pretty.docInvoked on each offset occurrence. The second argument is the base.
method pInstr : unit -> instr -> GoblintCil__.Pretty.docInvoked on each instruction occurrence.
method pLabel : unit -> label -> GoblintCil__.Pretty.docPrint a label.
method pStmt : unit -> stmt -> GoblintCil__.Pretty.docControl-flow statement. This is used by printGlobal and by dumpGlobal.
method dStmt : Stdlib.out_channel -> int -> stmt -> unitDump a control-flow statement to a file with a given indentation. This is used by dumpGlobal.
method dBlock : Stdlib.out_channel -> int -> block -> unitDump a control-flow block to a file with a given indentation. This is used by dumpGlobal.
method pBlock : unit -> block -> GoblintCil__.Pretty.docPrint a block.
method pGlobal : unit -> global -> GoblintCil__.Pretty.docGlobal (vars, types, etc.). This can be slow and is used only by printGlobal but not by dumpGlobal.
method dGlobal : Stdlib.out_channel -> global -> unitDump a global to a file with a given indentation. This is used by dumpGlobal
method pFieldDecl : unit -> fieldinfo -> GoblintCil__.Pretty.docA field declaration
method pType : GoblintCil__.Pretty.doc option ->
unit ->
typ ->
GoblintCil__.Pretty.docUse of some type in some declaration. The first argument is used to print the declared element, or is None if we are just printing a type with no name being declared. Note that for structure/union and enumeration types the definition of the composite type is not visited. Use vglob to visit it.
method pAttr : attribute -> GoblintCil__.Pretty.doc * boolAttribute. Also return an indication whether this attribute must be printed inside the __attribute__ list or not.
method pAttrParam : unit -> attrparam -> GoblintCil__.Pretty.docAttribute parameter
method pAttrs : unit -> attributes -> GoblintCil__.Pretty.docAttribute lists
method pLineDirective : ?forcefile:bool -> location -> GoblintCil__.Pretty.docPrint 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.
Print a statement kind. The code to be printed is given in the stmtkind argument. The initial stmt argument records the statement which follows the one being printed; defaultCilPrinterClass uses this information to prettify statement printing in certain special cases.
method pExp : unit -> exp -> GoblintCil__.Pretty.docPrint expressions
method pInit : unit -> init -> GoblintCil__.Pretty.docPrint initializers. This can be slow and is used by printGlobal but not by dumpGlobal.
method dInit : Stdlib.out_channel -> int -> init -> unitDump a global to a file with a given indentation. This is used by dumpGlobal