package mopsa

  1. Overview
  2. Docs
On This Page
  1. Graph conversion
Legend:
Library
Module
Module type
Parameter
Class
Class type

Converts a Universal program AST into a CFG.

val name : string
val debug : ('a, Stdlib.Format.formatter, unit, unit) Stdlib.format4 -> 'a
val dump_dot : bool

dump CFG in dot file (for debugging)

Graph conversion

val extract_calls_expr : Mopsa.expr -> (Mopsa.var * Mopsa.range) list * Mopsa.stmt list * Mopsa.expr
val extract_calls_stmt : Mopsa.stmt -> (Mopsa.var * Mopsa.range) list * Mopsa.stmt list * Mopsa.stmt
val mk_add_tmps : (Mopsa.var * Mopsa.range) list -> Mopsa.stmt list
val mk_remove_tmps : (Mopsa.var * Mopsa.range) list -> Mopsa.stmt list
type ctx = {
  1. ctx_cfg : Ast.graph;
  2. ctx_return : Ast.node;
  3. ctx_break : Ast.node list;
  4. ctx_continue : Ast.node list;
  5. ctx_return_var : Mopsa.var option;
}
val add_node : ctx -> Ast.node_id -> Ast.node
val add_edge : ctx -> Mopsa_utils.Location.range -> (Ast.port * Ast.node) list -> (Ast.port * Ast.node) list -> Mopsa.stmt list -> unit
val add_block_after : ctx -> Mopsa_utils.Location.range -> Ast.node -> Mopsa.stmt list -> Ast.node
val add_block_before : ctx -> Mopsa_utils.Location.range -> Ast.node -> Mopsa.stmt list -> Ast.node
val add_stmt : ctx -> Ast.node -> Ast.node -> Mopsa.stmt -> unit
val convert_stmt : ?name:string -> ?ret:Mopsa.var -> Mopsa.stmt -> Mopsa.stmt

Creates a new graph and fill-in with the given statement.

val convert_fundec : Universal.Ast.fundec -> unit

Converts a function AST to a CFG.

val convert_program : Mopsa.program -> Mopsa.program

Converts a full universal program.

val parse_program : string list -> Mopsa.program

From source to CFG.

OCaml

Innovation. Community. Security.