Module Coccilib

module Coccilib: sig .. end
A library of functions for use with Coccinelle OCaml script code.

type pos = {
   current_element : string; (*
current_element is the name of the function containing the matched position
*)
   file : string; (*
file is the name of the file containing the matched position
*)
   line : int; (*
line is the number of the line containing the first character of the matched position
*)
   col : int; (*
col is the column containing the first character of the matched position
*)
   line_end : int; (*
line_end is the number of the line containing the last character of the matched position
*)
   col_end : int; (*
col_end is the column containing the last character of the matched position.
*)
}
A value of type pos describes a position in a source file.
type param_type = 
| Pos of pos list
| AssignOp of Ast_c.assignOp
| BinaryOp of Ast_c.binaryOp
| Str of string
| Type of Ast_c.fullType
| Init of Ast_c.initialiser
| InitList of Ast_c.initialiser Ast_c.wrap2 list
| Int of int
| Param of Ast_c.parameterType
| ParamList of Ast_c.parameterType Ast_c.wrap2 list
| Expr of Ast_c.expression
| ExprList of Ast_c.argument Ast_c.wrap2 list
| Decl of Ast_c.declaration
| Field of Ast_c.field
| FieldList of Ast_c.field list
| FragList of Ast_c.string_fragment list
| Fmt of Ast_c.string_format
| Stmt of Ast_c.statement
| StmtList of Ast_c.statement_sequencable list
Types describing the metavariables.
val no_format : string -> bool
Parameters:
s : string
val make_ident : string -> Ast_c.metavar_binding_kind
Parameters:
s : string
val make_expr : string -> Ast_c.metavar_binding_kind
Parameters:
s : string
val make_expr_with_env : string -> string -> Ast_c.metavar_binding_kind
Parameters:
env : string
s : string
val make_stmt : string -> Ast_c.metavar_binding_kind
Parameters:
s : string
val make_stmt_with_env : string -> string -> Ast_c.metavar_binding_kind
Parameters:
env : string
s : string
val make_type : string -> Ast_c.metavar_binding_kind
Parameters:
s : string
val make_listlen : int -> Ast_c.metavar_binding_kind
Parameters:
i : int
val make_position : Common.filename ->
string -> int -> int -> int -> int -> Ast_c.metavar_binding_kind
Parameters:
fl : Common.filename
fn : string
startl : int
startc : int
endl : int
endc : int
val inc_match : bool ref
See include_match.
val include_match : bool -> unit
If the argument is true, retain the environment with respect to which the ocaml script code is being executed for use in subsequent rules. If the argument is false, discard this environment. By default, the environment is retained.
Parameters:
x : bool
val exited : bool ref
See exit
val exit : unit -> unit
If called, aborts the treatment of the current file. All previous changes take effect.
Parameters:
() : unit
val dir : unit -> string
Parameters:
() : unit
val file : unit -> string
Parameters:
() : unit
val build_link : pos -> string -> string -> string
Parameters:
p : pos
msg : string
color : string
val print_todo : ?color:string -> ?msg:string -> pos -> unit
Parameters:
color : string
msg : string
p : pos
val print_link : ?color:string -> ?msg:string -> pos -> unit
Parameters:
color : string
msg : string
p : pos
val print_safe_todo : ?color:string -> ?msg:string -> pos -> unit
Parameters:
color : string
msg : string
p : pos
val print_safe_link : ?color:string -> ?msg:string -> pos -> unit
Parameters:
color : string
msg : string
p : pos
val print_main : ?color:string -> string -> pos list -> unit
Parameters:
color : string
msg : string
ps : pos list
val print_sec : ?color:string -> string -> pos list -> unit
Parameters:
color : string
msg : string
ps : pos list
val print_secs : ?color:string -> string -> pos list -> unit
Parameters:
color : string
msg : string
ps : pos list
val basename_pos : pos -> pos
convert the filename of a pos to its basename
Parameters:
pos : pos
module Ana: sig .. end
external analysis integration.