COCCILIB(3COCCI)

NAME
Coccilib - Library of functions for use with Coccinelle OCaml script code

MODULE
Module Coccilib

DOCUMENTATION

Module Coccilib
 : sig end === Positions ===

type pos = {
 current_element : string ;
 file : string ;
 line : int ;
 col : int ;
 line_end : int ;
 col_end : int ;
 }

A value of type pos describes a position in a source file. current_element is the name of the function containing the matched position; file is the name of the file containing the matched position; line is the number of the line containing the first character of the matched position; col is the (0-based) column containing the first character of the matched position; line_end is the number of the line containing the last character of the matched position; col_end is the (0-based) column containing the last character of the matched position.

=== Abstract Syntax Tree ===

type param_type
 =
 | Pos of pos list
 | 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
 | Stmt of Ast_c.statement

=== Match management functions === 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.

val exit : unit -> unit

If called, aborts the treatment of the current file. All previous changes take effect.

val dir : unit -> string

Returns the directory on which spatch was launched.

val print_main : ?color:string -> string -> pos list -> unit

Print information about a main position using org mode.

val print_sec : ?color:string -> string -> pos list -> unit

Print information about a single secondary position using org mode.

val print_secs : ?color:string -> string -> pos list -> unit

Print information about a list of secondary positions using org mode.

REFERENCES
Y. Padioleau, J.L. Lawall, R.R Hansen, G. Muller "Documenting and Automating Collateral Evolutions in Linux Device Driver" EuroSys 2008, Glasgow, Scotland (April 2008) pp. 247-260.

AUTHOR
This manual page was written by Julia Lawall <julia@diku.dk>.

REPORTING BUGS
Send a mail to <cocci@diku.dk>

COPYRIGHT
Copyright 2011, DIKU, University of Copenhagen and INRIA.