Release coccinelle-0.2.0rc1
[bpt/coccinelle.git] / parsing_cocci / data.mli
1 (* types that clutter the .mly file *)
2 (* for iso metavariables, true if they can only match nonmodified, unitary
3 metavariables *)
4 type fresh = bool
5
6 type incl_iso =
7 Include of string | Iso of (string,string) Common.either
8 | Virt of string list (* virtual rules *)
9
10 type clt =
11 line_type * int * int * int * int (* starting spaces *) *
12 (string * Ast0_cocci.position_info) list (* code before *) *
13 (string * Ast0_cocci.position_info) list (* code after *) *
14 Ast0_cocci.meta_pos (* position variable, minus only *)
15
16 (* ---------------------------------------------------------------------- *)
17
18 and line_type =
19 MINUS | OPTMINUS | UNIQUEMINUS
20 | PLUS | PLUSPLUS
21 | CONTEXT | UNIQUE | OPT
22
23 type iconstraints = Ast_cocci.idconstraint
24 type econstraints = Ast0_cocci.constraints
25 type pconstraints = Ast_cocci.meta_name list
26
27 val in_rule_name : bool ref (* true if parsing the rule name *)
28 val in_meta : bool ref (* true if parsing the metavariable decls *)
29 val in_iso : bool ref (* true if parsing the isomorphisms *)
30 val in_generating : bool ref(* true if generating a rule *)
31 val ignore_patch_or_match : bool ref (* skip rules not satisfying virt *)
32 val in_prolog : bool ref (* true if parsing the beginning of an SP *)
33 val saw_struct : bool ref (* true if saw struct/union *)
34 val inheritable_positions : string list ref
35
36 val call_in_meta : (unit -> 'a) -> 'a
37
38 val all_metadecls : (string, Ast_cocci.metavar list) Hashtbl.t
39
40 val clear_meta: (unit -> unit) ref
41
42 val add_id_meta:
43 (Ast_cocci.meta_name -> iconstraints -> Ast0_cocci.pure -> unit) ref
44
45 val add_fresh_id_meta: (Ast_cocci.meta_name -> unit) ref
46
47 val add_type_meta: (Ast_cocci.meta_name -> Ast0_cocci.pure -> unit) ref
48
49 val add_init_meta: (Ast_cocci.meta_name -> Ast0_cocci.pure -> unit) ref
50
51 val add_param_meta: (Ast_cocci.meta_name -> Ast0_cocci.pure -> unit) ref
52
53 val add_paramlist_meta:
54 (Ast_cocci.meta_name -> Ast_cocci.meta_name option -> Ast0_cocci.pure ->
55 unit) ref
56
57 val add_const_meta:
58 (Type_cocci.typeC list option -> Ast_cocci.meta_name -> econstraints ->
59 Ast0_cocci.pure -> unit) ref
60
61 val add_err_meta:
62 (Ast_cocci.meta_name -> econstraints -> Ast0_cocci.pure -> unit) ref
63
64 val add_exp_meta:
65 (Type_cocci.typeC list option -> Ast_cocci.meta_name -> econstraints ->
66 Ast0_cocci.pure -> unit) ref
67
68 val add_idexp_meta:
69 (Type_cocci.typeC list option -> Ast_cocci.meta_name ->
70 econstraints -> Ast0_cocci.pure -> unit) ref
71
72 val add_local_idexp_meta:
73 (Type_cocci.typeC list option -> Ast_cocci.meta_name ->
74 econstraints -> Ast0_cocci.pure -> unit) ref
75
76 val add_explist_meta:
77 (Ast_cocci.meta_name -> Ast_cocci.meta_name option -> Ast0_cocci.pure ->
78 unit) ref
79
80 val add_stm_meta: (Ast_cocci.meta_name -> Ast0_cocci.pure -> unit) ref
81
82 val add_stmlist_meta: (Ast_cocci.meta_name -> Ast0_cocci.pure -> unit) ref
83
84 val add_func_meta:
85 (Ast_cocci.meta_name -> iconstraints -> Ast0_cocci.pure -> unit) ref
86
87 val add_local_func_meta:
88 (Ast_cocci.meta_name -> iconstraints -> Ast0_cocci.pure -> unit) ref
89
90 val add_declarer_meta:
91 (Ast_cocci.meta_name -> iconstraints -> Ast0_cocci.pure -> unit) ref
92
93 val add_iterator_meta:
94 (Ast_cocci.meta_name -> iconstraints -> Ast0_cocci.pure -> unit) ref
95
96 val add_pos_meta:
97 (Ast_cocci.meta_name -> pconstraints -> Ast_cocci.meta_collect -> unit) ref
98
99 val add_type_name: (string -> unit) ref
100
101 val add_declarer_name: (string -> unit) ref
102
103 val add_iterator_name: (string -> unit) ref
104
105 val init_rule: (unit -> unit) ref
106
107 val install_bindings: (string -> unit) ref