Module Printer_api

module Printer_api: sig .. end
Type of AST's extensible printers.
Since Fluorine-20130401


Class type for extensible printer


class type extensible_printer_type = object .. end
The class type that a printer must implement.

Types for customizing pretty printers


type line_directive_style = 
| Line_comment (*
Before every element, print the line number in comments. This is ignored by processing tools (thus errors are reported on the lines of the CIL output), but useful for visual inspection
*)
| Line_comment_sparse (*
Like LineComment but only print a line directive for a new source line
*)
| Line_preprocessor_input (*
Use #line directives
*)
| Line_preprocessor_output (*
Use # nnn directives (in gcc mode)
*)
Styles of printing line directives
type state = {
   mutable line_directive_style : line_directive_style option; (*
Whether we print something that will only be used as input to Cil's parser. In that case we are a bit more liberal in what we print.
*)
   mutable print_cil_input : bool; (*
Whether to print the CIL as they are, without trying to be smart and print nicer code. Normally this is false, in which case the pretty printer will turn the while(1) loops of CIL into nicer loops, will not print empty "else" blocks, etc. These is one case howewer in which if you turn this on you will get code that does not compile: if you use varargs the __builtin_va_arg function will be printed in its internal form.
*)
   mutable print_cil_as_is : bool; (*
The length used when wrapping output lines. Setting this variable to a large integer will prevent wrapping and make #line directives more accurate.
*)
   mutable line_length : int; (*
Emit warnings when truncating integer constants (default true)
*)
   mutable warn_truncate : bool;
}

Functions for pretty printing


module type S = sig .. end