Debian Codegraph @

parsing_cocci/visitor_ast.mli

raw symbols SCIP
1 (*
2 * This file is part of Coccinelle, licensed under the terms of the GPL v2.
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
7 type 'a combiner =
8 {combiner_ident : Ast_cocci.ident -> 'a;
9 combiner_expression : Ast_cocci.expression -> 'a;
10 combiner_fragment : Ast_cocci.string_fragment -> 'a;
11 combiner_format : Ast_cocci.string_format -> 'a;
12 combiner_assignOp : Ast_cocci.assignOp -> 'a;
13 combiner_binaryOp : Ast_cocci.binaryOp -> 'a;
14 combiner_fullType : Ast_cocci.fullType -> 'a;
15 combiner_typeC : Ast_cocci.typeC -> 'a;
16 combiner_declaration : Ast_cocci.declaration -> 'a;
17 combiner_field : Ast_cocci.field -> 'a;
18 combiner_ann_field : Ast_cocci.annotated_field -> 'a;
19 combiner_enumdecl : Ast_cocci.enum_decl -> 'a;
20 combiner_initialiser : Ast_cocci.initialiser -> 'a;
21 combiner_parameter : Ast_cocci.parameterTypeDef -> 'a;
22 combiner_template_parameter : Ast_cocci.templateParameterTypeDef -> 'a;
23 combiner_parameter_list : Ast_cocci.parameter_list -> 'a;
24 combiner_rule_elem : Ast_cocci.rule_elem -> 'a;
25 combiner_statement : Ast_cocci.statement -> 'a;
26 combiner_case_line : Ast_cocci.case_line -> 'a;
27 combiner_attribute : Ast_cocci.attr -> 'a;
28 combiner_attr_arg : Ast_cocci.attr_arg -> 'a;
29 combiner_top_level : Ast_cocci.top_level -> 'a;
30 combiner_anything : Ast_cocci.anything -> 'a;
31 combiner_expression_dots : Ast_cocci.expression Ast_cocci.dots -> 'a;
32 combiner_statement_dots : Ast_cocci.statement Ast_cocci.dots -> 'a;
33 combiner_anndecl_dots : Ast_cocci.annotated_decl Ast_cocci.dots -> 'a;
34 combiner_annfield_dots : Ast_cocci.annotated_field Ast_cocci.dots -> 'a;
35 combiner_enumdecl_dots : Ast_cocci.enum_decl Ast_cocci.dots -> 'a;
36 combiner_initialiser_dots : Ast_cocci.initialiser Ast_cocci.dots -> 'a}
37
38 type ('mc,'a) cmcode = 'a combiner -> 'mc Ast_cocci.mcode -> 'a
39 type ('cd,'a) ccode = 'a combiner -> ('cd -> 'a) -> 'cd -> 'a
40
41 type 'b cmcodefn = { cmcode: 'a. 'b combiner -> 'a Ast_cocci.mcode -> 'b }
42 type 'b cdonothingfn =
43 { cdonothing: 'a. 'b combiner -> ('a Ast_cocci.wrap -> 'b) -> 'a Ast_cocci.wrap -> 'b }
44
45 val combiner :
46 ('a -> 'a -> 'a) -> 'a -> 'a cmcodefn -> 'a cdonothingfn ->
47 ?meta_mcode:((Ast_cocci.meta_name,'a) cmcode) ->
48 ?string_mcode:((string,'a) cmcode) ->
49 ?const_mcode:((Ast_cocci.constant,'a) cmcode) ->
50 ?simpleAssign_mcode:((Ast_cocci.simpleAssignOp,'a) cmcode) ->
51 ?opAssign_mcode:((Ast_cocci.arithOp,'a) cmcode) ->
52 ?fixOp_mcode:((Ast_cocci.fixOp,'a) cmcode) ->
53 ?unaryOp_mcode:((Ast_cocci.unaryOp,'a) cmcode) ->
54 ?arithOp_mcode:((Ast_cocci.arithOp,'a) cmcode) ->
55 ?logicalOp_mcode:((Ast_cocci.logicalOp,'a) cmcode) ->
56 ?cv_mcode:((Ast_cocci.const_vol,'a) cmcode) ->
57 ?sign_mcode:((Ast_cocci.sign,'a) cmcode) ->
58 ?struct_mcode:((Ast_cocci.structUnion,'a) cmcode) ->
59 ?storage_mcode:((Ast_cocci.storage,'a) cmcode) ->
60 ?inc_mcode:((Ast_cocci.inc_file,'a) cmcode) ->
61 ?dotsexpr:((Ast_cocci.expression Ast_cocci.dots,'a) ccode) ->
62 ?dotsinit:((Ast_cocci.initialiser Ast_cocci.dots,'a) ccode) ->
63 ?dotsparam:((Ast_cocci.parameterTypeDef Ast_cocci.dots,'a) ccode) ->
64 ?dotstemplateparam:((Ast_cocci.templateParameterTypeDef Ast_cocci.dots,'a) ccode) ->
65 ?dotsstmt:((Ast_cocci.statement Ast_cocci.dots,'a) ccode) ->
66 ?dotsanndecl:((Ast_cocci.annotated_decl Ast_cocci.dots,'a) ccode) ->
67 ?dotsannfield:((Ast_cocci.annotated_field Ast_cocci.dots,'a) ccode) ->
68 ?dotsenumdecl:((Ast_cocci.enum_decl Ast_cocci.dots,'a) ccode) ->
69 ?dotsdefpar:((Ast_cocci.define_param Ast_cocci.dots,'a) ccode) ->
70 ?ident:((Ast_cocci.ident,'a) ccode) ->
71 ?expr:((Ast_cocci.expression,'a) ccode) ->
72 ?assignOp:((Ast_cocci.assignOp,'a) ccode) ->
73 ?binaryOp:((Ast_cocci.binaryOp,'a) ccode) ->
74 ?ty:((Ast_cocci.typeC,'a) ccode) ->
75 ?ft:((Ast_cocci.fullType,'a) ccode) ->
76 ?init:((Ast_cocci.initialiser,'a) ccode) ->
77 ?param:((Ast_cocci.parameterTypeDef,'a) ccode) ->
78 ?template_param:((Ast_cocci.templateParameterTypeDef,'a) ccode) ->
79 ?define_param:((Ast_cocci.define_param,'a) ccode) ->
80 ?decl:((Ast_cocci.declaration,'a) ccode) ->
81 ?annotated_decl:((Ast_cocci.annotated_decl,'a) ccode) ->
82 ?field:((Ast_cocci.field,'a) ccode) ->
83 ?annotated_field:((Ast_cocci.annotated_field,'a) ccode) ->
84 ?enumdecl:((Ast_cocci.enum_decl,'a) ccode) ->
85 ?stmt:((Ast_cocci.statement,'a) ccode) ->
86 ?rule:((Ast_cocci.rule_elem,'a) ccode) ->
87 ?case:((Ast_cocci.case_line,'a) ccode) ->
88 ?string_fragment:((Ast_cocci.string_fragment,'a) ccode) ->
89 ?fmt:((Ast_cocci.string_format,'a) ccode) ->
90 ?attribute:((Ast_cocci.attr,'a) ccode) ->
91 ?attr_arg:((Ast_cocci.attr_arg,'a) ccode) ->
92 ?pragma_info:((Ast_cocci.pragmainfo,'a) ccode) ->
93 ?directive:((Ast_cocci.directive,'a) ccode) ->
94 ?top:((Ast_cocci.top_level,'a) ccode) ->
95 ((Ast_cocci.anything,'a) ccode) ->
96 'a combiner
97
98 type 'a inout = 'a -> 'a (* for specifying the type of rebuilder *)
99
100 type rebuilder =
101 {rebuilder_ident : Ast_cocci.ident inout;
102 rebuilder_expression : Ast_cocci.expression inout;
103 rebuilder_fragment : Ast_cocci.string_fragment inout;
104 rebuilder_format : Ast_cocci.string_format inout;
105 rebuilder_assignOp : Ast_cocci.assignOp inout;
106 rebuilder_binaryOp : Ast_cocci.binaryOp inout;
107 rebuilder_fullType : Ast_cocci.fullType inout;
108 rebuilder_typeC : Ast_cocci.typeC inout;
109 rebuilder_declaration : Ast_cocci.declaration inout;
110 rebuilder_field : Ast_cocci.field inout;
111 rebuilder_ann_field : Ast_cocci.annotated_field inout;
112 rebuilder_enumdecl : Ast_cocci.enum_decl inout;
113 rebuilder_initialiser : Ast_cocci.initialiser inout;
114 rebuilder_parameter : Ast_cocci.parameterTypeDef inout;
115 rebuilder_template_parameter : Ast_cocci.templateParameterTypeDef inout;
116 rebuilder_parameter_list : Ast_cocci.parameter_list inout;
117 rebuilder_statement : Ast_cocci.statement inout;
118 rebuilder_case_line : Ast_cocci.case_line inout;
119 rebuilder_attribute : Ast_cocci.attr inout;
120 rebuilder_attr_arg : Ast_cocci.attr_arg inout;
121 rebuilder_rule_elem : Ast_cocci.rule_elem inout;
122 rebuilder_top_level : Ast_cocci.top_level inout;
123 rebuilder_expression_dots : Ast_cocci.expression Ast_cocci.dots inout;
124 rebuilder_statement_dots : Ast_cocci.statement Ast_cocci.dots inout;
125 rebuilder_anndecl_dots : Ast_cocci.annotated_decl Ast_cocci.dots inout;
126 rebuilder_annfield_dots : Ast_cocci.annotated_field Ast_cocci.dots inout;
127 rebuilder_enumdecl_dots : Ast_cocci.enum_decl Ast_cocci.dots inout;
128 rebuilder_initialiser_dots : Ast_cocci.initialiser Ast_cocci.dots inout;
129 rebuilder_define_param_dots: Ast_cocci.define_param Ast_cocci.dots inout;
130 rebuilder_define_param : Ast_cocci.define_param inout;
131 rebuilder_define_parameters : Ast_cocci.define_parameters inout;
132 rebuilder_anything : Ast_cocci.anything inout}
133
134 type 'mc rmcode = 'mc Ast_cocci.mcode inout
135 type 'cd rcode = rebuilder -> ('cd inout) -> 'cd inout
136
137 type rmcodefn = { rmcode: 'a. 'a Ast_cocci.mcode -> 'a Ast_cocci.mcode }
138 type rdonothingfn =
139 { rdonothing: 'a. rebuilder -> ('a Ast_cocci.wrap -> 'a Ast_cocci.wrap) ->
140 'a Ast_cocci.wrap -> 'a Ast_cocci.wrap }
141
142 val rebuilder :
143 rmcodefn -> rdonothingfn ->
144 ?meta_mcode:(Ast_cocci.meta_name rmcode) ->
145 ?string_mcode:(string rmcode) ->
146 ?const_mcode:(Ast_cocci.constant rmcode) ->
147 ?simpleAssign_mcode:(Ast_cocci.simpleAssignOp rmcode) ->
148 ?opAssign_mcode:(Ast_cocci.arithOp rmcode) ->
149 ?fixOp_mcode:(Ast_cocci.fixOp rmcode) ->
150 ?unaryOp_mcode:(Ast_cocci.unaryOp rmcode) ->
151 ?arithOp_mcode:(Ast_cocci.arithOp rmcode) ->
152 ?logicalOp_mcode:(Ast_cocci.logicalOp rmcode) ->
153 ?cv_mcode:(Ast_cocci.const_vol rmcode) ->
154 ?sign_mcode:(Ast_cocci.sign rmcode) ->
155 ?struct_mcode:(Ast_cocci.structUnion rmcode) ->
156 ?storage_mcode:(Ast_cocci.storage rmcode) ->
157 ?inc_mcode:(Ast_cocci.inc_file rmcode) ->
158 ?dotsexpr:(Ast_cocci.expression Ast_cocci.dots rcode) ->
159 ?dotsinit:(Ast_cocci.initialiser Ast_cocci.dots rcode) ->
160 ?dotsparam:(Ast_cocci.parameterTypeDef Ast_cocci.dots rcode) ->
161 ?dotstemplateparam:(Ast_cocci.templateParameterTypeDef Ast_cocci.dots rcode) ->
162 ?dotsstmt:(Ast_cocci.statement Ast_cocci.dots rcode) ->
163 ?dotsanndecl:(Ast_cocci.annotated_decl Ast_cocci.dots rcode) ->
164 ?dotsannfield:(Ast_cocci.annotated_field Ast_cocci.dots rcode) ->
165 ?dotsenumdecl:(Ast_cocci.enum_decl Ast_cocci.dots rcode) ->
166 ?dotsdefpar:(Ast_cocci.define_param Ast_cocci.dots rcode) ->
167 ?ident:(Ast_cocci.ident rcode) ->
168 ?expr:(Ast_cocci.expression rcode) ->
169 ?assignOp:(Ast_cocci.assignOp rcode) ->
170 ?binaryOp:(Ast_cocci.binaryOp rcode) ->
171 ?ty:(Ast_cocci.typeC rcode) ->
172 ?ft:(Ast_cocci.fullType rcode) ->
173 ?init:(Ast_cocci.initialiser rcode) ->
174 ?param:(Ast_cocci.parameterTypeDef rcode) ->
175 ?template_param:(Ast_cocci.templateParameterTypeDef rcode) ->
176 ?define_param:(Ast_cocci.define_param rcode) ->
177 ?decl:(Ast_cocci.declaration rcode) ->
178 ?annotated_decl:(Ast_cocci.annotated_decl rcode) ->
179 ?field:(Ast_cocci.field rcode) ->
180 ?annotated_field:(Ast_cocci.annotated_field rcode) ->
181 ?enumdecl:(Ast_cocci.enum_decl rcode) ->
182 ?stmt:(Ast_cocci.statement rcode) ->
183 ?rule:(Ast_cocci.rule_elem rcode) ->
184 ?case:(Ast_cocci.case_line rcode) ->
185 ?string_fragment:(Ast_cocci.string_fragment rcode) ->
186 ?fmt:(Ast_cocci.string_format rcode) ->
187 ?attribute:(Ast_cocci.attr rcode) ->
188 ?attr_arg:(Ast_cocci.attr_arg rcode) ->
189 ?pragma_info:(Ast_cocci.pragmainfo rcode) ->
190 ?directive:(Ast_cocci.directive rcode) ->
191 ?top:(Ast_cocci.top_level rcode) ->
192 (Ast_cocci.anything rcode) ->
193 rebuilder