File: visitor_ast0_types.ml

package info (click to toggle)
coccinelle 1.0.8.deb-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 26,148 kB
  • sloc: ml: 136,392; ansic: 23,594; sh: 2,189; makefile: 2,157; perl: 1,576; lisp: 840; python: 823; awk: 70; csh: 12
file content (245 lines) | stat: -rw-r--r-- 12,184 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
(*
 * This file is part of Coccinelle, licensed under the terms of the GPL v2.
 * See copyright.txt in the Coccinelle source code for more information.
 * The Coccinelle source code can be obtained at http://coccinelle.lip6.fr
 *)

module Ast0 = Ast0_cocci
module Ast = Ast_cocci

type ('a,'n) inout = 'a -> ('n * 'a)

type 'n all_functions =
    {meta_mcode : (Ast.meta_name Ast0.mcode,'n) inout;
      ident : (Ast0.ident,'n) inout;
      expression : (Ast0.expression,'n) inout;
      assignOp : (Ast0.assignOp,'n) inout;
      binaryOp : (Ast0.binaryOp,'n) inout;
      typeC : (Ast0.typeC,'n) inout;
      declaration : (Ast0.declaration,'n) inout;
      field : (Ast0.field,'n) inout;
      initialiser : (Ast0.initialiser,'n) inout;
      initialiser_list : (Ast0.initialiser_list,'n) inout;
      parameter : (Ast0.parameterTypeDef,'n) inout;
      parameter_list : (Ast0.parameter_list,'n) inout;
      statement : (Ast0.statement,'n) inout;
      forinfo : (Ast0.forinfo,'n) inout;
      case_line : (Ast0.case_line,'n) inout;
      define_param : (Ast0.define_param,'n) inout;
      string_fragment : (Ast0.string_fragment,'n) inout;
      top_level : (Ast0.top_level,'n) inout;
      expression_dots : (Ast0.expression Ast0.dots,'n) inout;
      statement_dots : (Ast0.statement Ast0.dots,'n) inout;
      declaration_dots : (Ast0.declaration Ast0.dots,'n) inout;
      field_dots : (Ast0.field Ast0.dots,'n) inout;
      case_line_dots : (Ast0.case_line Ast0.dots,'n) inout;
      define_param_dots : (Ast0.define_param Ast0.dots,'n) inout;
      anything : (Ast0.anything,'n) inout}

(* ----------------------------------------------------------------------- *)
(* combiner *)

type ('a,'n) combiner_inout = 'a -> 'n

type 'n combiner_rec_functions =
    {combiner_rec_meta_mcode : (Ast.meta_name Ast0.mcode,'n) combiner_inout;
      combiner_rec_ident : (Ast0.ident,'n) combiner_inout;
      combiner_rec_expression : (Ast0.expression,'n) combiner_inout;
      combiner_rec_assignOp : (Ast0.assignOp,'n) combiner_inout;
      combiner_rec_binaryOp : (Ast0.binaryOp,'n) combiner_inout;
      combiner_rec_typeC : (Ast0.typeC,'n) combiner_inout;
      combiner_rec_declaration : (Ast0.declaration,'n) combiner_inout;
      combiner_rec_field : (Ast0.field,'n) combiner_inout;
      combiner_rec_initialiser : (Ast0.initialiser,'n) combiner_inout;
      combiner_rec_initialiser_list :
	(Ast0.initialiser_list,'n) combiner_inout;
      combiner_rec_parameter : (Ast0.parameterTypeDef,'n) combiner_inout;
      combiner_rec_parameter_list : (Ast0.parameter_list,'n) combiner_inout;
      combiner_rec_statement : (Ast0.statement,'n) combiner_inout;
      combiner_rec_forinfo   : (Ast0.forinfo,'n) combiner_inout;
      combiner_rec_case_line : (Ast0.case_line,'n) combiner_inout;
      combiner_rec_define_param : (Ast0.define_param,'n) combiner_inout;
      combiner_rec_string_fragment : (Ast0.string_fragment,'n) combiner_inout;
      combiner_rec_top_level : (Ast0.top_level,'n) combiner_inout;
      combiner_rec_expression_dots :
	(Ast0.expression Ast0.dots,'n) combiner_inout;
      combiner_rec_statement_dots :
	(Ast0.statement Ast0.dots,'n) combiner_inout;
      combiner_rec_declaration_dots :
	(Ast0.declaration Ast0.dots,'n) combiner_inout;
      combiner_rec_field_dots :
	(Ast0.field Ast0.dots,'n) combiner_inout;
      combiner_rec_case_line_dots :
	(Ast0.case_line Ast0.dots,'n) combiner_inout;
      combiner_rec_define_param_dots :
	(Ast0.define_param Ast0.dots,'n) combiner_inout;
      combiner_rec_anything : (Ast0.anything,'n) combiner_inout}

type ('mc,'n) cmcode = 'n -> 'mc Ast0.mcode -> 'n
type ('mc,'n) flat_cmcode = 'mc Ast0.mcode -> 'n
type ('cd,'n) ccode = 'n combiner_rec_functions -> ('cd -> 'n) -> 'cd -> 'n

type 'n combiner_functions =
  {combiner_meta_mcode : (Ast.meta_name,'n) cmcode;
   combiner_string_mcode : (string,'n) cmcode;
   combiner_const_mcode : (Ast.constant,'n) cmcode;
   combiner_simpleAssign_mcode : (Ast0.simpleAssignOp,'n) cmcode;
   combiner_opAssign_mcode : (Ast.arithOp,'n) cmcode;
   combiner_fix_mcode : (Ast.fixOp,'n) cmcode;
   combiner_unary_mcode : (Ast.unaryOp,'n) cmcode;
   combiner_arithOp_mcode : (Ast.arithOp,'n) cmcode;
   combiner_logicalOp_mcode : (Ast.logicalOp,'n) cmcode;
   combiner_cv_mcode : (Ast.const_vol,'n) cmcode;
   combiner_sign_mcode : (Ast.sign,'n) cmcode;
   combiner_struct_mcode : (Ast.structUnion,'n) cmcode;
   combiner_storage_mcode : (Ast.storage,'n) cmcode;
   combiner_inc_mcode : (Ast.inc_file,'n) cmcode;
   combiner_dotsexprfn : (Ast0.expression Ast0.dots,'n) ccode;
   combiner_dotsinitfn : (Ast0.initialiser Ast0.dots,'n) ccode;
   combiner_dotsparamfn : (Ast0.parameterTypeDef Ast0.dots,'n) ccode;
   combiner_dotsstmtfn : (Ast0.statement Ast0.dots,'n) ccode;
   combiner_dotsdeclfn : (Ast0.declaration Ast0.dots,'n) ccode;
   combiner_dotsfieldfn : (Ast0.field Ast0.dots,'n) ccode;
   combiner_dotscasefn : (Ast0.case_line Ast0.dots,'n) ccode;
   combiner_dotsdefparfn : (Ast0.define_param Ast0.dots,'n) ccode;
   combiner_identfn : (Ast0.ident,'n) ccode;
   combiner_exprfn : (Ast0.expression,'n) ccode;
   combiner_assignOpfn : (Ast0.assignOp,'n) ccode;
   combiner_binaryOpfn : (Ast0.binaryOp,'n) ccode;
   combiner_tyfn : (Ast0.typeC,'n) ccode;
   combiner_initfn : (Ast0.initialiser,'n) ccode;
   combiner_paramfn : (Ast0.parameterTypeDef,'n) ccode;
   combiner_declfn : (Ast0.declaration,'n) ccode;
   combiner_fieldfn : (Ast0.field,'n) ccode;
   combiner_stmtfn : (Ast0.statement,'n) ccode;
   combiner_forinfofn : (Ast0.forinfo,'n) ccode;
   combiner_casefn : (Ast0.case_line,'n) ccode;
   combiner_string_fragmentfn : (Ast0.string_fragment,'n) ccode;
   combiner_topfn : (Ast0.top_level,'n) ccode}

(* ----------------------------------------------------------------------- *)
(* rebuilder *)

type 'a rebuilder_inout = 'a -> 'a

type rebuilder_rec_functions =
    {rebuilder_rec_meta_mcode : Ast.meta_name Ast0.mcode rebuilder_inout;
      rebuilder_rec_ident : Ast0.ident rebuilder_inout;
      rebuilder_rec_expression : Ast0.expression rebuilder_inout;
      rebuilder_rec_assignOp : Ast0.assignOp rebuilder_inout;
      rebuilder_rec_binaryOp : Ast0.binaryOp rebuilder_inout;
      rebuilder_rec_typeC : Ast0.typeC rebuilder_inout;
      rebuilder_rec_declaration : Ast0.declaration rebuilder_inout;
      rebuilder_rec_field : Ast0.field rebuilder_inout;
      rebuilder_rec_initialiser : Ast0.initialiser rebuilder_inout;
      rebuilder_rec_initialiser_list :
	Ast0.initialiser_list rebuilder_inout;
      rebuilder_rec_parameter : Ast0.parameterTypeDef rebuilder_inout;
      rebuilder_rec_parameter_list : Ast0.parameter_list rebuilder_inout;
      rebuilder_rec_statement : Ast0.statement rebuilder_inout;
      rebuilder_rec_forinfo : Ast0.forinfo rebuilder_inout;
      rebuilder_rec_case_line : Ast0.case_line rebuilder_inout;
      rebuilder_rec_string_fragment : Ast0.string_fragment rebuilder_inout;
      rebuilder_rec_top_level : Ast0.top_level rebuilder_inout;
      rebuilder_rec_expression_dots :
	Ast0.expression Ast0.dots rebuilder_inout;
      rebuilder_rec_statement_dots :
	Ast0.statement Ast0.dots rebuilder_inout;
      rebuilder_rec_declaration_dots :
	Ast0.declaration Ast0.dots rebuilder_inout;
      rebuilder_rec_field_dots :
	Ast0.field Ast0.dots rebuilder_inout;
      rebuilder_rec_case_line_dots :
	Ast0.case_line Ast0.dots rebuilder_inout;
      rebuilder_rec_define_param_dots :
	Ast0.define_param Ast0.dots rebuilder_inout;
      rebuilder_rec_anything : Ast0.anything rebuilder_inout}

type 'mc rmcode = 'mc Ast0.mcode rebuilder_inout
type 'cd rcode =
    rebuilder_rec_functions -> ('cd rebuilder_inout) -> 'cd rebuilder_inout

type rebuilder_functions =
  {rebuilder_meta_mcode : Ast_cocci.meta_name rmcode;
   rebuilder_string_mcode : string rmcode;
   rebuilder_const_mcode : Ast.constant rmcode;
   rebuilder_simpleAssign_mcode : Ast0.simpleAssignOp rmcode;
   rebuilder_opAssign_mcode : Ast.arithOp rmcode;
   rebuilder_fix_mcode : Ast.fixOp rmcode;
   rebuilder_unary_mcode : Ast.unaryOp rmcode;
   rebuilder_arithOp_mcode : Ast.arithOp rmcode;
   rebuilder_logicalOp_mcode : Ast.logicalOp rmcode;
   rebuilder_cv_mcode : Ast.const_vol rmcode;
   rebuilder_sign_mcode : Ast.sign rmcode;
   rebuilder_struct_mcode : Ast.structUnion rmcode;
   rebuilder_storage_mcode : Ast.storage rmcode;
   rebuilder_inc_mcode : Ast.inc_file rmcode;
   rebuilder_dotsexprfn : Ast0.expression Ast0.dots rcode;
   rebuilder_dotsinitfn : Ast0.initialiser Ast0.dots rcode;
   rebuilder_dotsparamfn : Ast0.parameterTypeDef Ast0.dots rcode;
   rebuilder_dotsstmtfn : Ast0.statement Ast0.dots rcode;
   rebuilder_dotsdeclfn : Ast0.declaration Ast0.dots rcode;
   rebuilder_dotsfieldfn : Ast0.field Ast0.dots rcode;
   rebuilder_dotscasefn : Ast0.case_line Ast0.dots rcode;
   rebuilder_dotsdefparfn : Ast0.define_param Ast0.dots rcode;
   rebuilder_identfn : Ast0.ident rcode;
   rebuilder_exprfn : Ast0.expression rcode;
   rebuilder_assignOpfn : Ast0.assignOp rcode;
   rebuilder_binaryOpfn : Ast0.binaryOp rcode;

   rebuilder_tyfn : Ast0.typeC rcode;
   rebuilder_initfn : Ast0.initialiser rcode;
   rebuilder_paramfn : Ast0.parameterTypeDef rcode;
   rebuilder_declfn : Ast0.declaration rcode;
   rebuilder_fieldfn : Ast0.field rcode;
   rebuilder_stmtfn : Ast0.statement rcode;
   rebuilder_forinfofn : Ast0.forinfo rcode;
   rebuilder_casefn : Ast0.case_line rcode;
   rebuilder_string_fragmentfn : Ast0.string_fragment rcode;
   rebuilder_topfn : Ast0.top_level rcode}

(* ----------------------------------------------------------------------- *)
(* combiner_rebuilder *)

type ('mc,'a) rcmcode = 'a -> 'mc Ast0.mcode -> ('a * 'mc Ast0.mcode)
type ('cd,'a) rccode =
    'a all_functions -> ('cd -> ('a * 'cd)) -> 'cd -> ('a * 'cd)

type 'n combiner_rebuilder_functions =
  {combiner_rebuilder_meta_mcode : (Ast_cocci.meta_name,'n) rcmcode;
   combiner_rebuilder_string_mcode : (string,'n) rcmcode;
   combiner_rebuilder_const_mcode : (Ast.constant,'n) rcmcode;
   combiner_rebuilder_simpleAssign_mcode : (Ast0.simpleAssignOp,'n) rcmcode;
   combiner_rebuilder_opAssign_mcode : (Ast.arithOp,'n) rcmcode;
   combiner_rebuilder_fix_mcode : (Ast.fixOp,'n) rcmcode;
   combiner_rebuilder_unary_mcode : (Ast.unaryOp,'n) rcmcode;
   combiner_rebuilder_arithOp_mcode : (Ast.arithOp,'n) rcmcode;
   combiner_rebuilder_logicalOp_mcode : (Ast.logicalOp,'n) rcmcode;
   combiner_rebuilder_cv_mcode : (Ast.const_vol,'n) rcmcode;
   combiner_rebuilder_sign_mcode : (Ast.sign,'n) rcmcode;
   combiner_rebuilder_struct_mcode : (Ast.structUnion,'n) rcmcode;
   combiner_rebuilder_storage_mcode : (Ast.storage,'n) rcmcode;
   combiner_rebuilder_inc_mcode : (Ast.inc_file,'n) rcmcode;
   combiner_rebuilder_dotsexprfn : (Ast0.expression Ast0.dots,'n) rccode;
   combiner_rebuilder_dotsinitfn : (Ast0.initialiser Ast0.dots,'n) rccode;
   combiner_rebuilder_dotsparamfn :
      (Ast0.parameterTypeDef Ast0.dots,'n) rccode;
   combiner_rebuilder_dotsstmtfn : (Ast0.statement Ast0.dots,'n) rccode;
   combiner_rebuilder_dotsdeclfn : (Ast0.declaration Ast0.dots,'n) rccode;
   combiner_rebuilder_dotsfieldfn : (Ast0.field Ast0.dots,'n) rccode;
   combiner_rebuilder_dotscasefn : (Ast0.case_line Ast0.dots,'n) rccode;
   combiner_rebuilder_dotsdefparfn : (Ast0.define_param Ast0.dots,'n) rccode;
   combiner_rebuilder_identfn : (Ast0.ident,'n) rccode;
   combiner_rebuilder_exprfn : (Ast0.expression,'n) rccode;
   combiner_rebuilder_assignOpfn : (Ast0.assignOp,'n) rccode;
   combiner_rebuilder_binaryOpfn : (Ast0.binaryOp,'n) rccode;
   combiner_rebuilder_tyfn : (Ast0.typeC,'n) rccode;
   combiner_rebuilder_initfn : (Ast0.initialiser,'n) rccode;
   combiner_rebuilder_paramfn : (Ast0.parameterTypeDef,'n) rccode;
   combiner_rebuilder_declfn : (Ast0.declaration,'n) rccode;
   combiner_rebuilder_fieldfn : (Ast0.field,'n) rccode;
   combiner_rebuilder_stmtfn : (Ast0.statement,'n) rccode;
   combiner_rebuilder_forinfofn : (Ast0.forinfo,'n) rccode;
   combiner_rebuilder_casefn : (Ast0.case_line,'n) rccode;
   combiner_rebuilder_string_fragmentfn : (Ast0.string_fragment,'n) rccode;
   combiner_rebuilder_topfn : (Ast0.top_level,'n) rccode}