package mopsa

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Mopsa_c_parser.Clang_to_CSource

Clang_to_C - Translates Clang AST to C AST and link C AST

Sourcetype context

Abstract structure used internally during project parsing & linking.

Sourceval create_context : ?min_uid:int -> string -> Clang_AST.target_info -> context

create_context project_name target creates a new project (i.e., a program made of several translation units accumulated) with the given name and target. Returns a context to manipulate the project.

Sourceval add_translation_unit : context -> string -> Clang_AST.decl -> string list -> Clang_AST.comment list -> Clang_AST.macro list -> bool -> string list -> unit

add_translation_unit context name decl files coms macros keep_static forced_stub_list converts a Clang definition of a translation unit with the given name (generally, the source C file) into a cAST and accumulates the definition to the projet. Remove static functions unused in the translation unit, unless keep_static is true (useful for sutb files).

link_project context links all the translation units accumulated in the project and returns the consolidated definitions.

Sourceval dump_decls : bool ref

dump each C declarations found, for debugging

Sourceval log_rename : bool ref

log when renaming (or assign a name to an anonymous)

Sourceval log_merge : bool ref
Sourceval log_remove : bool ref
Sourceval dump_dir : string ref

Log destination directory.

Sourceval simplify : bool ref
Sourceval new_uid : context -> C_AST.uid
Sourceval find_function : string -> context -> C_AST.func

Find a function by its name. Not_found is raised when the function is missing.

Sourceval get_parsed_files : context -> string list

Get the list of parsed files

OCaml

Innovation. Community. Security.