~npalix/coccinelle/upstream

4161.1.5 by Sébastien Hinderer
Add GPL header to all the files in Coccinelle.
1
(*
4424.1.12 by Julia Lawall
fixed som spelling errors
2
 * This file is part of Coccinelle, licensed under the terms of the GPL v2.
4161.1.5 by Sébastien Hinderer
Add GPL header to all the files in Coccinelle.
3
 * See copyright.txt in the Coccinelle source code for more information.
4
 * The Coccinelle source code can be obtained at http://coccinelle.lip6.fr
5
 *)
6
949 by Yoann Padioleau
try use ref, but pbs, so put in comment
7
open Common
8
1444 by Yoann Padioleau
improve parser
9
(*****************************************************************************)
1347 by Yoann Padioleau
reorganization and handling of depends on
10
(* work with tests/ *)
1444 by Yoann Padioleau
improve parser
11
(*****************************************************************************)
4725 by Julia Lawall
add --expected-extension option for more testing flexibility
12
val testone : string (*prefix*) -> string (*test*) ->
13
  string option (*compare_expected*) -> unit
5434 by Julia Lawall
when using testall or test-spacing, the cocci file specific arugments should be installed per cocci file
14
val testall : (string -> unit) -> string -> bool -> unit
15
val test_spacing : (string -> unit) -> string -> bool -> unit
1080 by Yoann Padioleau
next gen parsing started, must use -ng
16
1444 by Yoann Padioleau
improve parser
17
(*****************************************************************************)
1473 by Yoann Padioleau
clean memoisation and cocci.ml
18
(* works with tests-big/. The .res, .ok, .spatch_ok, .failed, .var *)
1444 by Yoann Padioleau
improve parser
19
(*****************************************************************************)
1463 by Yoann Padioleau
added config.ml
20
val test_okfailed : filename (*cocci*) -> filename (*c*) list -> unit
21
val test_regression_okfailed : unit -> unit
1444 by Yoann Padioleau
improve parser
22
23
24
25
(*****************************************************************************)
1392 by Yoann Padioleau
handling multi files
26
(* the parameter is the result of Cocci.full_engine *)
1444 by Yoann Padioleau
improve parser
27
(*****************************************************************************)
4725 by Julia Lawall
add --expected-extension option for more testing flexibility
28
val compare_with_expected : (filename * filename option) list -> string -> unit
1392 by Yoann Padioleau
handling multi files
29
30
1444 by Yoann Padioleau
improve parser
31
(*****************************************************************************)
1347 by Yoann Padioleau
reorganization and handling of depends on
32
(* to test/debug the coccinelle subsystems *)
1444 by Yoann Padioleau
improve parser
33
(*****************************************************************************)
1347 by Yoann Padioleau
reorganization and handling of depends on
34
2874 by Nicolas Palix
Remove trailing whitespace/tab
35
(* pad:
1931 by Yoann Padioleau
factorized parsing_c testing, stuff now in parsing_c/test_parsing_c.ml
36
 * I moved the parsing_c/ subsystem testing in parsing_c/test_parsing_c.ml
37
 * as I need it for other projects too.
38
 *)
1347 by Yoann Padioleau
reorganization and handling of depends on
39
1463 by Yoann Padioleau
added config.ml
40
val test_parse_cocci : filename -> unit
4020.10.9 by Julia Lawall
more changes for get_dependencies option
41
val test_rule_dependencies : filename -> unit
1347 by Yoann Padioleau
reorganization and handling of depends on
42
1473 by Yoann Padioleau
clean memoisation and cocci.ml
43
(*****************************************************************************)
44
(* to be called by ocaml toplevel, to test. *)
45
(*****************************************************************************)
46
47
val sp_of_file :
48
  filename (* coccifile *)  -> filename option (* isofile *) ->
4635 by Julia Lawall
compile scripts, even if currently under a false dependency
49
  Ast_cocci.metavar list list * Ast_cocci.rule list * Ast_cocci.rule list *
2199 by Julia Lawall
*** empty log message ***
50
      Ast_cocci.meta_name list list list *
4291.1.40 by julia
Adjust categorization of free position variables.
51
      (Ast_cocci.meta_name list * Ast_cocci.meta_name list) list list *
2601 by Julia Lawall
better treatment of fresh metavariables
52
      (Ast_cocci.meta_name list list list (*used after list*) *
53
	 (*fresh used after list*)
54
	 Ast_cocci.meta_name list list list *
55
	 (*fresh used after list seeds*)
56
	 Ast_cocci.meta_name list list list) *
57
      Ast_cocci.meta_name list list list *
3223 by Julia Lawall
improve indentation
58
      (string list option *
59
	 string list option *
4111 by julia
add --use-gitgrep option, some related cleanups
60
	 (Str.regexp * Str.regexp list * string list) option *
3754 by julia
better pretty printing and matching of format strings. TODO: don't parse format strings if no needed by the SP, format string metavariables with lengths, some pretty printing errors
61
	 Get_constants2.combine option) *
4454 by julia
return information about whether a rule contains any modifications, ie is caching of header files allowed
62
      bool (* format info needed for strings *) *
63
      bool (* contains modif in any rule *)
1849 by Henrik Stuart
Imported pycaml and py-cocci from Bazaar repository.
64
65
(* TODO: Remove
1473 by Yoann Padioleau
clean memoisation and cocci.ml
66
val rule_elem_of_string : string -> filename option -> Ast_cocci.rule_elem
1849 by Henrik Stuart
Imported pycaml and py-cocci from Bazaar repository.
67
*)
1473 by Yoann Padioleau
clean memoisation and cocci.ml
68
69
(*
70
val flows_of_ast : Ast_c.program -> Control_flow_c.cflow list
71
val print_flow : Control_flow_c.cflow -> unit
72
73
val ctls_of_ast :
74
    Ast_cocci.rule list ->
75
      Ast_cocci.meta_name list list list ->
76
	(Lib_engine.ctlcocci *
77
	   ((Lib_engine.predicate * Ast_cocci.meta_name Ast_ctl.modif)
78
	      list list))
79
	  list list
80
81
82
val one_flow  : Control_flow_c.cflow list -> Control_flow_c.cflow
83
val one_ctl : Lib_engine.ctlcocci list list -> Lib_engine.ctlcocci
84
*)