package mopsa
Install
Dune Dependency
Authors
Maintainers
Sources
md5=9f673f79708b44a7effb3b6bb3618d2c
sha512=cb91cb428e43a22f1abbcb8219710d0c10a5b3756d0da392d4084b3b3a6157350776c596983e63def344f617d39964e91f244f60c07958695ee5c8c809a9f0f4
doc/c_lang/C_lang/Lang/Frontend/index.html
Module Lang.Frontend
Source
C front-end to translate parser AST into MOPSA AST
Command-line options
========================
Extra options to pass to clang when parsing
List of include directories
Name of the target binary to analyze
Disable stubs of the standard library
Enable the parser cache.
Display all compiler warnings
Lists of functions that the body will be replaced by a stub
Allow library-only targets in the .db files (used for multilanguage analysis)
Target architecture triple to analyze for (host if left empty)
Additional stub files to parse
List of translation units to ignore during linking
Contexts
============
type ctx = {
ctx_prj : Mopsa_c_parser.C_AST.project;
ctx_fun : C_lang__.Ast.c_fundec Mopsa_c_parser.C_AST.StringMap.t;
ctx_type : (type_space * string, Mopsa.typ) Stdlib.Hashtbl.t;
ctx_vars : (int * string, Mopsa.var * Mopsa_c_parser.C_AST.variable) Stdlib.Hashtbl.t;
ctx_macros : Mopsa_c_parser.C_AST.macro Mopsa_c_parser.C_AST.StringMap.t;
ctx_predicates : Mopsa_c_stubs_parser.Passes.Preprocessor.predicate Mopsa_c_parser.C_AST.StringMap.t;
ctx_stubs : (string, Mopsa_c_stubs_parser.Cst.stub) Stdlib.Hashtbl.t;
ctx_enums : Z.t Mopsa_c_parser.C_AST.StringMap.t;
}
List of input files
Target information used for parsing
val find_function_in_context :
ctx ->
Utils_core.Location.range ->
Mopsa_c_parser.C_AST.func ->
C_lang__.Ast.c_fundec
Entry point
===============
val parse_file :
string ->
?nb:(int * int) ->
?stub:bool ->
string list ->
string ->
bool ->
bool ->
Mopsa_c_parser.Clang_to_C.context ->
unit
functions
=============
Scope update
****************
val from_scope_update :
ctx ->
Mopsa_c_parser.C_AST.scope_update ->
C_lang__.Ast.c_scope_update
Statements
==============
val from_body_option :
ctx ->
Mopsa.range ->
Mopsa_c_parser.C_AST.block option ->
Mopsa.stmt option
Expressions
===============
val from_unary_operator :
Mopsa_c_parser.C_AST.unary_operator ->
Mopsa.typ ->
Ast.Operator.operator
val from_binary_operator :
Mopsa_c_parser.C_AST.binary_operator ->
Mopsa.typ ->
Ast.Operator.operator
val from_character_kind :
Mopsa_c_parser.C_AST.character_kind ->
C_lang__.Ast.c_character_kind
Variables
=============
val from_init_option :
ctx ->
Mopsa_c_parser.C_AST.init option ->
C_lang__.Ast.c_var_init option
Types
=========
val from_array_length :
ctx ->
Mopsa_c_parser.C_AST.array_length ->
C_lang__.Ast.c_array_length
val from_function_type :
ctx ->
Mopsa_c_parser.C_AST.function_type ->
C_lang__.Ast.c_function_type
Ranges and locations
========================
Stubs annotations
=====================
val from_stub_func :
ctx ->
Mopsa_c_parser.C_AST.func ->
Parsing.Ast.stub ->
Stubs.Ast.stub_func
val from_stub_requires :
ctx ->
Parsing.Ast.requires Mopsa_utils.Location.with_range ->
Stubs.Ast.requires Mopsa.with_range
val from_stub_free :
ctx ->
Parsing.Ast.free Mopsa_utils.Location.with_range ->
Stubs.Ast.free Mopsa.with_range
val from_stub_message :
ctx ->
Parsing.Ast.message Mopsa_utils.Location.with_range ->
Stubs.Ast.message Mopsa.with_range
val from_stub_assigns :
ctx ->
Parsing.Ast.assigns Mopsa_utils.Location.with_range ->
Stubs.Ast.assigns Mopsa.with_range
val from_stub_local :
ctx ->
Parsing.Ast.local Mopsa_utils.Location.with_range ->
Stubs.Ast.local Mopsa.with_range
val from_stub_ensures :
ctx ->
Parsing.Ast.ensures Mopsa_utils.Location.with_range ->
Stubs.Ast.ensures Mopsa.with_range
val from_stub_assumes :
ctx ->
Parsing.Ast.assumes Mopsa_utils.Location.with_range ->
Stubs.Ast.assumes Mopsa.with_range
val from_stub_directives :
ctx ->
(Mopsa_c_parser.Clang_AST.comment
* Mopsa_c_parser.C_AST.macro Mopsa_c_parser.C_AST.StringMap.t)
list
Mopsa_c_parser.C_AST.RangeMap.t ->
Stubs.Ast.stub_directive list