Commit | Line | Data |
---|---|---|
34e49164 C |
1 | open Ograph_extended |
2 | ||
3 | (*****************************************************************************) | |
4 | (* the different ctl formula related types *) | |
5 | (*****************************************************************************) | |
6 | type mvar = Ast_cocci.meta_name | |
7 | ||
8 | type predicate = | |
9 | InLoop | TrueBranch | FalseBranch | |
10 | | After (* pointer to the code after an if or while *) | |
951c7801 | 11 | | FallThrough | LoopFallThrough |
34e49164 C |
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 | |
21 | | FakeBrace | |
22 | ||
485bce71 | 23 | (* coccionly: *) |
34e49164 C |
24 | type ctlcocci = (predicate, Ast_cocci.meta_name) Wrapper_ctl.wrapped_ctl |
25 | ||
26 | ||
27 | (*****************************************************************************) | |
28 | (* the different binding types *) | |
29 | (*****************************************************************************) | |
30 | type metavars_binding = Ast_c.metavars_binding | |
31 | ||
32 | (* used in ctlcocci_integration *) | |
ae4735db | 33 | type metavar_binding_kind2 = |
34e49164 C |
34 | | NormalMetaVal of Ast_c.metavar_binding_kind |
35 | | ParenVal of Ast_cocci.meta_name | |
7f004419 | 36 | | LabelVal of labelval |
34e49164 C |
37 | | GoodVal | BadVal (* used to implement \+ *) |
38 | ||
7f004419 C |
39 | and labelval = Absolute of int list | Prefix of int list |
40 | ||
34e49164 C |
41 | and metavars_binding2 = (mvar, metavar_binding_kind2) Common.assoc |
42 | ||
43 | ||
44 | ||
45 | (*****************************************************************************) | |
46 | (* the CTL model related types *) | |
47 | (*****************************************************************************) | |
485bce71 | 48 | (* coccionly: *) |
ae4735db C |
49 | type label_ctlcocci = |
50 | predicate -> | |
51 | (nodei * | |
52 | (predicate * (mvar, metavar_binding_kind2) Ast_ctl.generic_substitution)) | |
34e49164 | 53 | list |
ae4735db | 54 | |
34e49164 C |
55 | type model = Control_flow_c.cflow * label_ctlcocci * nodei list |
56 | ||
ae4735db | 57 | type transformation_info = |
34e49164 C |
58 | (nodei * metavars_binding * Ast_cocci.rule_elem) list |
59 | ||
ae4735db | 60 | type numbered_transformation_info = |
708f4980 C |
61 | (int list * (nodei * metavars_binding * Ast_cocci.rule_elem)) list |
62 | ||
34e49164 C |
63 | |
64 | (*****************************************************************************) | |
65 | (* comparing binding *) | |
66 | (*****************************************************************************) | |
67 | ||
ae4735db | 68 | let equal_binding xs ys = |
34e49164 | 69 | List.sort compare xs = List.sort compare ys |