package mopsa

  1. Overview
  2. Docs
MOPSA: A Modular and Open Platform for Static Analysis using Abstract Interpretation

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mopsa-analyzer-v1.2.tar.gz
md5=37966e98ffeebcedc09bd6e9b2b81f69
sha512=40d4d826c25f680766c07eccbabdf5e8a4fa023016e8a164e4e4f6b3781c8484dc4df437055721dfd19b9db8fb7fe3b61236c4833186d346fc7204a68d01eaaa

doc/mopsa.mopsa_c_parser/Mopsa_c_parser/Clang_parser/index.html

Module Mopsa_c_parser.Clang_parserSource

Clang_parser - Extracting Clang AST to OCaml

Interface to Clang AST: we call Clang to parse files and convert the AST into OCaml. This is a low-level interface: the returned AST stays close to Clang. Thus, the interface may evolve from Clang versions to versions.

See Clang_AST for the definition of the AST types, as well as the parts that we don't support yet.

Version

Sourceval version : string

Target information

Sourceval get_default_target_options : unit -> Clang_AST.target_options

Returns the default target, which corresponds to the host.

Gets the target informations (type width and alignment, ...) for the given target.

Parsing

Sourcetype parse_result = {
  1. parse_decl : Clang_AST.decl;
    (*

    AST.

    *)
  2. parse_diag : Clang_AST.diagnostic list;
    (*

    Warnings and errors.

    *)
  3. parse_comments : Clang_AST.comment list;
    (*

    C/C++ comments.

    *)
  4. parse_macros : Clang_AST.macro list;
    (*

    Macros.

    *)
  5. parse_files : string list;
    (*

    Files read during parsing.

    *)
}
Sourceval parse : command:string -> target:Clang_AST.target_options -> filename:string -> args:string array -> parse_result

Parse the source file with the specified command (e.g., "clang" or "clang++") for the specified target, given the the specified compile-time options.

OCaml

Innovation. Community. Security.