3 (*****************************************************************************)
4 (* the different ctl formula related types *)
5 (*****************************************************************************)
6 type mvar
= Ast_cocci.meta_name
9 InLoop
| TrueBranch
| FalseBranch
10 | After
(* pointer to the code after an if or while *)
11 | FallThrough
| LoopFallThrough
12 | Return
(* any exit from the current function *)
13 | FunHeader
| Top
| Exit
| ErrorExit
| Goto
14 | Paren
of Ast_cocci.meta_name
15 | Match
of Ast_cocci.rule_elem
16 | Label
of Ast_cocci.meta_name
17 | BCLabel
of Ast_cocci.meta_name
(* parent of break or continue *)
18 | PrefixLabel
of Ast_cocci.meta_name
19 | BindGood
of Ast_cocci.meta_name
(* used to implement \+ *)
20 | BindBad
of Ast_cocci.meta_name
24 type ctlcocci
= (predicate
, Ast_cocci.meta_name
) Wrapper_ctl.wrapped_ctl
27 (*****************************************************************************)
28 (* the different binding types *)
29 (*****************************************************************************)
30 type metavars_binding
= Ast_c.metavars_binding
32 (* used in ctlcocci_integration *)
33 type metavar_binding_kind2
=
34 | NormalMetaVal
of Ast_c.metavar_binding_kind
35 | ParenVal
of Ast_cocci.meta_name
36 | LabelVal
of labelval
37 | GoodVal
| BadVal
(* used to implement \+ *)
39 and labelval
= Absolute
of int list
| Prefix
of int list
41 and metavars_binding2
= (mvar
, metavar_binding_kind2
) Common.assoc
45 (*****************************************************************************)
46 (* the CTL model related types *)
47 (*****************************************************************************)
52 (predicate
* (mvar
, metavar_binding_kind2
) Ast_ctl.generic_substitution
))
55 type model
= Control_flow_c.cflow
* label_ctlcocci
* nodei list
57 type transformation_info
=
58 (nodei
* metavars_binding
* Ast_cocci.rule_elem
) list
60 type numbered_transformation_info
=
61 (int list
* (nodei
* metavars_binding
* Ast_cocci.rule_elem
)) list
64 (*****************************************************************************)
65 (* comparing binding *)
66 (*****************************************************************************)
68 let equal_binding xs ys
=
69 List.sort compare xs
= List.sort compare ys