module File:Frama-c preprocessing and Cil AST initialization.sig
..end
type
file =
| |
NeedCPP of |
(* | The first string is the filename of the .c to preprocess.
The second one is the preprocessor command (filename.c -o
tempfilname.i will be appended at the end). | *) |
| |
NoCPP of |
(* | Already pre-processed file .i | *) |
| |
External of |
(* | file that can be translated into a Cil AST through an external function, together with the recognized suffix. | *) |
include Datatype.S
val new_file_type : string -> (string -> Cil_types.file * Cabs.file) -> unit
new_file_type suffix func funcname
registers a new type of files (with
corresponding suffix) as recognized by Frama-C through func
.val new_machdep : string -> bool -> (unit -> unit) -> unit
new_machdep name public func
registers a new machdep name as recognized by
Frama-C through func
. public
must be set to true
to display it in the
help displayed by frama-c -machdep help
. The usual uses is
Cmdline.run_after_loading_stage
(fun () -> File.new_machdep
"my_machdep"
true
(fun () -> let module M = Machdep.DEFINE(My_machdep_implem) in ()))
Invalid_argument
if the given name already existsval get_suffixes : unit -> string list
val get_name : t -> string
val get_preprocessor_command : unit -> string
val pre_register : t -> unit
val get_all : unit -> t list
val from_filename : ?cpp:string -> string -> t
!get_preprocessor_command ()
.class check_file :string ->
Visitor.frama_c_visitor
val prepare_from_c_files : unit -> unit
File_types.Bad_Initialization
if called more than once.val init_from_c_files : t list -> unit
File_types.Bad_Initialization
if called more than once.val init_project_from_cil_file : Project.t -> Cil_types.file -> unit
File_types.Bad_Initialization
if called more than once.val create_project_from_visitor : string -> (Project.t -> Visitor.frama_c_visitor) -> Project.t
Cil.copy_visit
at some point).File_types.Bad_Initialization
if called more than once.val create_rebuilt_project_from_visitor : ?preprocess:bool ->
string -> (Project.t -> Visitor.frama_c_visitor) -> Project.t
File.create_project_from_visitor
, but the new generated cil file is
generated into a temp .i or .c file according to preprocess
, then re-built
by Frama-C in the returned project. For instance, use this function if the
new cil file contains a constructor GText
as global.
Not that the generation of a preprocessed C file may fail in some cases
(e.g. if it includes headers already included). Thus the generated file is
NOT preprocessed by default.
Since Nitrogen-20111001
Raises File_types.Bad_Initialization
if called more than once.
val init_from_cmdline : unit -> unit
File_types.Bad_Initialization
if called more than once.val pretty_ast : ?prj:Project.t -> ?fmt:Format.formatter -> unit -> unit
Kernel.CodeOutput.get_fmt ()
.File_types.Bad_Initialization
if the file is no initialized.