Commit | Line | Data |
---|---|---|
9f8e26f4 | 1 | (* |
90aeb998 C |
2 | * Copyright 2010, INRIA, University of Copenhagen |
3 | * Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix | |
4 | * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen | |
5636bb2c C |
5 | * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix |
6 | * This file is part of Coccinelle. | |
7 | * | |
8 | * Coccinelle is free software: you can redistribute it and/or modify | |
9 | * it under the terms of the GNU General Public License as published by | |
10 | * the Free Software Foundation, according to version 2 of the License. | |
11 | * | |
12 | * Coccinelle is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License | |
18 | * along with Coccinelle. If not, see <http://www.gnu.org/licenses/>. | |
19 | * | |
20 | * The authors reserve the right to distribute this or future versions of | |
21 | * Coccinelle under other licenses. | |
22 | *) | |
23 | ||
24 | ||
34e49164 C |
25 | (* --------------------------------------------------------------------- *) |
26 | (* Modified code *) | |
27 | ||
28 | type arity = OPT | UNIQUE | NONE | |
29 | ||
30 | type token_info = | |
31 | { tline_start : int; tline_end : int; | |
32 | left_offset : int; right_offset : int } | |
33 | val default_token_info : token_info | |
34 | ||
35 | type mcodekind = | |
36 | MINUS of (Ast_cocci.anything list list * token_info) ref | |
951c7801 | 37 | | PLUS of Ast_cocci.count |
34e49164 C |
38 | | CONTEXT of (Ast_cocci.anything Ast_cocci.befaft * |
39 | token_info * token_info) ref | |
40 | | MIXED of (Ast_cocci.anything Ast_cocci.befaft * | |
41 | token_info * token_info) ref | |
42 | ||
0708f913 C |
43 | type position_info = { line_start : int; line_end : int; |
44 | logical_start : int; logical_end : int; | |
45 | column : int; offset : int; } | |
46 | ||
47 | type info = { pos_info : position_info; | |
34e49164 C |
48 | attachable_start : bool; attachable_end : bool; |
49 | mcode_start : mcodekind list; mcode_end : mcodekind list; | |
34e49164 | 50 | (* the following are only for + code *) |
c3e37e97 C |
51 | strings_before : (Ast_cocci.added_string * position_info) list; |
52 | strings_after : (Ast_cocci.added_string * position_info) list } | |
34e49164 | 53 | |
708f4980 C |
54 | type 'a mcode = |
55 | 'a * arity * info * mcodekind * meta_pos ref (* pos, - only *) * | |
56 | int (* adjacency_index *) | |
57 | ||
34e49164 C |
58 | and 'a wrap = |
59 | { node : 'a; | |
60 | info : info; | |
61 | index : int ref; | |
62 | mcodekind : mcodekind ref; | |
63 | exp_ty : Type_cocci.typeC option ref; (* only for expressions *) | |
64 | bef_aft : dots_bef_aft; (* only for statements *) | |
65 | true_if_arg : bool; (* true if "arg_exp", only for exprs *) | |
66 | true_if_test : bool; (* true if "test position", only for exprs *) | |
67 | true_if_test_exp : bool;(* true if "test_exp from iso", only for exprs *) | |
68 | (*nonempty if this represents the use of an iso*) | |
69 | iso_info : (string*anything) list } | |
70 | ||
71 | and dots_bef_aft = | |
72 | NoDots | AddingBetweenDots of statement | DroppingBetweenDots of statement | |
73 | ||
74 | (* for iso metavariables, true if they can only match nonmodified, unitary | |
75 | metavariables | |
76 | for SP metavariables, true if the metavariable is unitary (valid up to | |
77 | isomorphism phase only) *) | |
78 | and pure = Impure | Pure | Context | PureContext (* pure and only context *) | |
79 | ||
80 | (* --------------------------------------------------------------------- *) | |
81 | (* --------------------------------------------------------------------- *) | |
82 | (* Dots *) | |
83 | ||
84 | and 'a base_dots = | |
85 | DOTS of 'a list | |
86 | | CIRCLES of 'a list | |
87 | | STARS of 'a list | |
88 | ||
89 | and 'a dots = 'a base_dots wrap | |
90 | ||
91 | (* --------------------------------------------------------------------- *) | |
92 | (* Identifier *) | |
93 | ||
94 | and base_ident = | |
951c7801 C |
95 | Id of string mcode |
96 | | MetaId of Ast_cocci.meta_name mcode * Ast_cocci.idconstraint * pure | |
97 | | MetaFunc of Ast_cocci.meta_name mcode * Ast_cocci.idconstraint * pure | |
98 | | MetaLocalFunc of Ast_cocci.meta_name mcode * Ast_cocci.idconstraint * pure | |
34e49164 C |
99 | | OptIdent of ident |
100 | | UniqueIdent of ident | |
101 | ||
102 | and ident = base_ident wrap | |
103 | ||
104 | (* --------------------------------------------------------------------- *) | |
105 | (* Expression *) | |
106 | ||
faf9a90c | 107 | and base_expression = |
34e49164 C |
108 | Ident of ident |
109 | | Constant of Ast_cocci.constant mcode | |
110 | | FunCall of expression * string mcode (* ( *) * | |
111 | expression dots * string mcode (* ) *) | |
112 | | Assignment of expression * Ast_cocci.assignOp mcode * expression * | |
113 | bool (* true if it can match an initialization *) | |
114 | | CondExpr of expression * string mcode (* ? *) * expression option * | |
115 | string mcode (* : *) * expression | |
116 | | Postfix of expression * Ast_cocci.fixOp mcode | |
117 | | Infix of expression * Ast_cocci.fixOp mcode | |
118 | | Unary of expression * Ast_cocci.unaryOp mcode | |
119 | | Binary of expression * Ast_cocci.binaryOp mcode * expression | |
120 | | Nested of expression * Ast_cocci.binaryOp mcode * expression | |
121 | | Paren of string mcode (* ( *) * expression * | |
122 | string mcode (* ) *) | |
123 | | ArrayAccess of expression * string mcode (* [ *) * expression * | |
124 | string mcode (* ] *) | |
125 | | RecordAccess of expression * string mcode (* . *) * ident | |
126 | | RecordPtAccess of expression * string mcode (* -> *) * ident | |
127 | | Cast of string mcode (* ( *) * typeC * string mcode (* ) *) * | |
128 | expression | |
129 | | SizeOfExpr of string mcode (* sizeof *) * expression | |
130 | | SizeOfType of string mcode (* sizeof *) * string mcode (* ( *) * | |
131 | typeC * string mcode (* ) *) | |
132 | | TypeExp of typeC | |
951c7801 C |
133 | | MetaErr of Ast_cocci.meta_name mcode * constraints * pure |
134 | | MetaExpr of Ast_cocci.meta_name mcode * constraints * | |
34e49164 C |
135 | Type_cocci.typeC list option * Ast_cocci.form * pure |
136 | | MetaExprList of Ast_cocci.meta_name mcode (* only in arglists *) * | |
137 | listlen * pure | |
138 | | EComma of string mcode (* only in arglists *) | |
139 | | DisjExpr of string mcode * expression list * string mcode list * | |
140 | string mcode | |
141 | | NestExpr of string mcode * expression dots * string mcode * | |
142 | expression option * Ast_cocci.multi | |
143 | | Edots of string mcode (* ... *) * expression option | |
144 | | Ecircles of string mcode (* ooo *) * expression option | |
145 | | Estars of string mcode (* *** *) * expression option | |
146 | | OptExp of expression | |
147 | | UniqueExp of expression | |
148 | ||
149 | and expression = base_expression wrap | |
150 | ||
951c7801 C |
151 | and constraints = |
152 | NoConstraint | |
5636bb2c | 153 | | NotIdCstrt of Ast_cocci.reconstraint |
951c7801 | 154 | | NotExpCstrt of expression list |
5636bb2c | 155 | | SubExpCstrt of Ast_cocci.meta_name list |
951c7801 | 156 | |
34e49164 C |
157 | and listlen = Ast_cocci.meta_name mcode option |
158 | ||
159 | (* --------------------------------------------------------------------- *) | |
160 | (* Types *) | |
161 | ||
faf9a90c | 162 | and base_typeC = |
34e49164 | 163 | ConstVol of Ast_cocci.const_vol mcode * typeC |
faf9a90c C |
164 | | BaseType of Ast_cocci.baseType * string mcode list |
165 | | Signed of Ast_cocci.sign mcode * typeC option | |
34e49164 C |
166 | | Pointer of typeC * string mcode (* * *) |
167 | | FunctionPointer of typeC * | |
168 | string mcode(* ( *)*string mcode(* * *)*string mcode(* ) *)* | |
169 | string mcode (* ( *)*parameter_list*string mcode(* ) *) | |
170 | | FunctionType of typeC option * | |
171 | string mcode (* ( *) * parameter_list * | |
172 | string mcode (* ) *) | |
173 | | Array of typeC * string mcode (* [ *) * | |
174 | expression option * string mcode (* ] *) | |
faf9a90c | 175 | | EnumName of string mcode (*enum*) * ident (* name *) |
34e49164 C |
176 | | StructUnionName of Ast_cocci.structUnion mcode * ident option (* name *) |
177 | | StructUnionDef of typeC (* either StructUnionName or metavar *) * | |
178 | string mcode (* { *) * declaration dots * string mcode (* } *) | |
179 | | TypeName of string mcode | |
180 | | MetaType of Ast_cocci.meta_name mcode * pure | |
181 | | DisjType of string mcode * typeC list * (* only after iso *) | |
182 | string mcode list (* the |s *) * string mcode | |
183 | | OptType of typeC | |
184 | | UniqueType of typeC | |
185 | ||
186 | and typeC = base_typeC wrap | |
187 | ||
188 | (* --------------------------------------------------------------------- *) | |
189 | (* Variable declaration *) | |
190 | (* Even if the Cocci program specifies a list of declarations, they are | |
191 | split out into multiple declarations of a single variable each. *) | |
192 | ||
193 | and base_declaration = | |
194 | Init of Ast_cocci.storage mcode option * typeC * ident * | |
195 | string mcode (*=*) * initialiser * string mcode (*;*) | |
196 | | UnInit of Ast_cocci.storage mcode option * typeC * ident * | |
197 | string mcode (* ; *) | |
198 | | TyDecl of typeC * string mcode (* ; *) | |
199 | | MacroDecl of ident (* name *) * string mcode (* ( *) * | |
200 | expression dots * string mcode (* ) *) * string mcode (* ; *) | |
201 | | Typedef of string mcode (* typedef *) * typeC * typeC * string mcode (*;*) | |
202 | | DisjDecl of string mcode * declaration list * string mcode list * | |
203 | string mcode | |
204 | | Ddots of string mcode (* ... *) * declaration option (* whencode *) | |
205 | | OptDecl of declaration | |
206 | | UniqueDecl of declaration | |
207 | ||
208 | and declaration = base_declaration wrap | |
209 | ||
210 | (* --------------------------------------------------------------------- *) | |
211 | (* Initializers *) | |
212 | ||
213 | and base_initialiser = | |
113803cf C |
214 | MetaInit of Ast_cocci.meta_name mcode * pure |
215 | | InitExpr of expression | |
34e49164 | 216 | | InitList of string mcode (*{*) * initialiser_list * string mcode (*}*) |
113803cf C |
217 | | InitGccExt of |
218 | designator list (* name *) * string mcode (*=*) * | |
34e49164 C |
219 | initialiser (* gccext: *) |
220 | | InitGccName of ident (* name *) * string mcode (*:*) * | |
221 | initialiser | |
34e49164 C |
222 | | IComma of string mcode |
223 | | Idots of string mcode (* ... *) * initialiser option (* whencode *) | |
224 | | OptIni of initialiser | |
225 | | UniqueIni of initialiser | |
226 | ||
113803cf C |
227 | and designator = |
228 | DesignatorField of string mcode (* . *) * ident | |
229 | | DesignatorIndex of string mcode (* [ *) * expression * string mcode (* ] *) | |
230 | | DesignatorRange of | |
231 | string mcode (* [ *) * expression * string mcode (* ... *) * | |
232 | expression * string mcode (* ] *) | |
233 | ||
34e49164 C |
234 | and initialiser = base_initialiser wrap |
235 | ||
236 | and initialiser_list = initialiser dots | |
237 | ||
238 | (* --------------------------------------------------------------------- *) | |
239 | (* Parameter *) | |
240 | ||
241 | and base_parameterTypeDef = | |
242 | VoidParam of typeC | |
243 | | Param of typeC * ident option | |
244 | | MetaParam of Ast_cocci.meta_name mcode * pure | |
245 | | MetaParamList of Ast_cocci.meta_name mcode * listlen * pure | |
246 | | PComma of string mcode | |
247 | | Pdots of string mcode (* ... *) | |
248 | | Pcircles of string mcode (* ooo *) | |
249 | | OptParam of parameterTypeDef | |
250 | | UniqueParam of parameterTypeDef | |
251 | ||
252 | and parameterTypeDef = base_parameterTypeDef wrap | |
253 | ||
254 | and parameter_list = parameterTypeDef dots | |
255 | ||
256 | (* --------------------------------------------------------------------- *) | |
257 | (* #define Parameters *) | |
258 | ||
259 | and base_define_param = | |
260 | DParam of ident | |
261 | | DPComma of string mcode | |
262 | | DPdots of string mcode (* ... *) | |
263 | | DPcircles of string mcode (* ooo *) | |
264 | | OptDParam of define_param | |
265 | | UniqueDParam of define_param | |
266 | ||
267 | and define_param = base_define_param wrap | |
268 | ||
269 | and base_define_parameters = | |
270 | NoParams | |
271 | | DParams of string mcode(*( *) * define_param dots * string mcode(* )*) | |
272 | ||
273 | and define_parameters = base_define_parameters wrap | |
274 | ||
275 | (* --------------------------------------------------------------------- *) | |
276 | (* Statement*) | |
277 | ||
278 | and base_statement = | |
279 | Decl of (info * mcodekind) (* before the decl *) * declaration | |
280 | | Seq of string mcode (* { *) * statement dots * | |
281 | string mcode (* } *) | |
282 | | ExprStatement of expression * string mcode (*;*) | |
283 | | IfThen of string mcode (* if *) * string mcode (* ( *) * | |
284 | expression * string mcode (* ) *) * | |
285 | statement * (info * mcodekind) | |
286 | | IfThenElse of string mcode (* if *) * string mcode (* ( *) * | |
287 | expression * string mcode (* ) *) * | |
288 | statement * string mcode (* else *) * statement * | |
289 | (info * mcodekind) | |
290 | | While of string mcode (* while *) * string mcode (* ( *) * | |
291 | expression * string mcode (* ) *) * | |
292 | statement * (info * mcodekind) (* after info *) | |
293 | | Do of string mcode (* do *) * statement * | |
294 | string mcode (* while *) * string mcode (* ( *) * | |
295 | expression * string mcode (* ) *) * | |
296 | string mcode (* ; *) | |
297 | | For of string mcode (* for *) * string mcode (* ( *) * | |
298 | expression option * string mcode (*;*) * | |
299 | expression option * string mcode (*;*) * | |
300 | expression option * string mcode (* ) *) * statement * | |
301 | (info * mcodekind) (* after info *) | |
302 | | Iterator of ident (* name *) * string mcode (* ( *) * | |
303 | expression dots * string mcode (* ) *) * | |
304 | statement * (info * mcodekind) (* after info *) | |
305 | | Switch of string mcode (* switch *) * string mcode (* ( *) * | |
306 | expression * string mcode (* ) *) * string mcode (* { *) * | |
fc1ad971 | 307 | statement (*decl*) dots * |
34e49164 C |
308 | case_line dots * string mcode (* } *) |
309 | | Break of string mcode (* break *) * string mcode (* ; *) | |
310 | | Continue of string mcode (* continue *) * string mcode (* ; *) | |
311 | | Label of ident * string mcode (* : *) | |
312 | | Goto of string mcode (* goto *) * ident * string mcode (* ; *) | |
313 | | Return of string mcode (* return *) * string mcode (* ; *) | |
314 | | ReturnExpr of string mcode (* return *) * expression * | |
315 | string mcode (* ; *) | |
316 | | MetaStmt of Ast_cocci.meta_name mcode * pure | |
317 | | MetaStmtList of Ast_cocci.meta_name mcode (*only in statement lists*) * | |
318 | pure | |
319 | | Exp of expression (* only in dotted statement lists *) | |
320 | | TopExp of expression (* for macros body *) | |
321 | | Ty of typeC (* only at top level *) | |
1be43e12 | 322 | | TopInit of initialiser (* only at top level *) |
34e49164 C |
323 | | Disj of string mcode * statement dots list * string mcode list * |
324 | string mcode | |
325 | | Nest of string mcode * statement dots * string mcode * | |
326 | (statement dots,statement) whencode list * Ast_cocci.multi | |
327 | | Dots of string mcode (* ... *) * | |
328 | (statement dots,statement) whencode list | |
329 | | Circles of string mcode (* ooo *) * | |
330 | (statement dots,statement) whencode list | |
331 | | Stars of string mcode (* *** *) * | |
332 | (statement dots,statement) whencode list | |
333 | | FunDecl of (info * mcodekind) (* before the function decl *) * | |
334 | fninfo list * ident (* name *) * | |
335 | string mcode (* ( *) * parameter_list * string mcode (* ) *) * | |
336 | string mcode (* { *) * statement dots * | |
337 | string mcode (* } *) | |
338 | | Include of string mcode (* #include *) * Ast_cocci.inc_file mcode(* file *) | |
339 | | Define of string mcode (* #define *) * ident (* name *) * | |
340 | define_parameters (*params*) * statement dots | |
341 | | OptStm of statement | |
342 | | UniqueStm of statement | |
343 | ||
344 | and fninfo = | |
345 | FStorage of Ast_cocci.storage mcode | |
346 | | FType of typeC | |
347 | | FInline of string mcode | |
348 | | FAttr of string mcode | |
349 | ||
350 | and ('a,'b) whencode = | |
351 | WhenNot of 'a | |
352 | | WhenAlways of 'b | |
353 | | WhenModifier of Ast_cocci.when_modifier | |
1be43e12 C |
354 | | WhenNotTrue of expression |
355 | | WhenNotFalse of expression | |
34e49164 C |
356 | |
357 | and statement = base_statement wrap | |
358 | ||
359 | and base_case_line = | |
360 | Default of string mcode (* default *) * string mcode (*:*) * statement dots | |
361 | | Case of string mcode (* case *) * expression * string mcode (*:*) * | |
362 | statement dots | |
fc1ad971 C |
363 | | DisjCase of string mcode * case_line list * |
364 | string mcode list (* the |s *) * string mcode | |
34e49164 C |
365 | | OptCase of case_line |
366 | ||
367 | and case_line = base_case_line wrap | |
368 | ||
369 | (* --------------------------------------------------------------------- *) | |
370 | (* Positions *) | |
371 | ||
372 | and meta_pos = | |
373 | MetaPos of Ast_cocci.meta_name mcode * Ast_cocci.meta_name list * | |
374 | Ast_cocci.meta_collect | |
375 | | NoMetaPos | |
376 | ||
377 | (* --------------------------------------------------------------------- *) | |
378 | (* Top-level code *) | |
379 | ||
380 | and base_top_level = | |
381 | DECL of statement | |
382 | | CODE of statement dots | |
383 | | FILEINFO of string mcode (* old file *) * string mcode (* new file *) | |
384 | | ERRORWORDS of expression list | |
385 | | OTHER of statement (* temporary, disappears after top_level.ml *) | |
386 | ||
387 | and top_level = base_top_level wrap | |
388 | and rule = top_level list | |
389 | ||
390 | and parsed_rule = | |
391 | CocciRule of | |
392 | (rule * Ast_cocci.metavar list * | |
393 | (string list * string list * Ast_cocci.dependency * string * | |
394 | Ast_cocci.exists)) * | |
faf9a90c | 395 | (rule * Ast_cocci.metavar list) * Ast_cocci.ruletype |
174d1640 C |
396 | | ScriptRule of string (* name *) * |
397 | string * Ast_cocci.dependency * | |
aba5c457 C |
398 | (Ast_cocci.script_meta_name * |
399 | Ast_cocci.meta_name * Ast_cocci.metavar) list * | |
34e49164 | 400 | string |
174d1640 | 401 | | InitialScriptRule of string (* name *) * |
c3e37e97 | 402 | string (*language*) * Ast_cocci.dependency * string (*code*) |
174d1640 | 403 | | FinalScriptRule of string (* name *) * |
c3e37e97 | 404 | string (*language*) * Ast_cocci.dependency * string (*code*) |
34e49164 C |
405 | |
406 | (* --------------------------------------------------------------------- *) | |
407 | ||
408 | and anything = | |
409 | DotsExprTag of expression dots | |
410 | | DotsInitTag of initialiser dots | |
411 | | DotsParamTag of parameterTypeDef dots | |
412 | | DotsStmtTag of statement dots | |
413 | | DotsDeclTag of declaration dots | |
414 | | DotsCaseTag of case_line dots | |
415 | | IdentTag of ident | |
416 | | ExprTag of expression | |
417 | | ArgExprTag of expression (* for isos *) | |
418 | | TestExprTag of expression (* for isos *) | |
419 | | TypeCTag of typeC | |
420 | | ParamTag of parameterTypeDef | |
421 | | InitTag of initialiser | |
422 | | DeclTag of declaration | |
423 | | StmtTag of statement | |
424 | | CaseLineTag of case_line | |
425 | | TopTag of top_level | |
426 | | IsoWhenTag of Ast_cocci.when_modifier (*only for when code, in iso phase*) | |
1be43e12 C |
427 | | IsoWhenTTag of expression(*only for when code, in iso phase*) |
428 | | IsoWhenFTag of expression(*only for when code, in iso phase*) | |
34e49164 C |
429 | | MetaPosTag of meta_pos (* only in iso phase *) |
430 | ||
431 | val dotsExpr : expression dots -> anything | |
432 | val dotsInit : initialiser dots -> anything | |
433 | val dotsParam : parameterTypeDef dots -> anything | |
434 | val dotsStmt : statement dots -> anything | |
435 | val dotsDecl : declaration dots -> anything | |
436 | val dotsCase : case_line dots -> anything | |
437 | val ident : ident -> anything | |
438 | val expr : expression -> anything | |
439 | val typeC : typeC -> anything | |
440 | val param : parameterTypeDef -> anything | |
441 | val ini : initialiser -> anything | |
442 | val decl : declaration -> anything | |
443 | val stmt : statement -> anything | |
444 | val case_line : case_line -> anything | |
445 | val top : top_level -> anything | |
446 | ||
447 | (* --------------------------------------------------------------------- *) | |
448 | ||
449 | val undots : 'a dots -> 'a list | |
450 | ||
451 | (* --------------------------------------------------------------------- *) | |
452 | (* Avoid cluttering the parser. Calculated in compute_lines.ml. *) | |
453 | ||
454 | val default_info : unit -> info | |
455 | val default_befaft : unit -> mcodekind | |
456 | val context_befaft : unit -> mcodekind | |
457 | val wrap : 'a -> 'a wrap | |
458 | val context_wrap : 'a -> 'a wrap | |
459 | val unwrap : 'a wrap -> 'a | |
460 | val unwrap_mcode : 'a mcode -> 'a | |
461 | val rewrap : 'a wrap -> 'b -> 'b wrap | |
462 | val rewrap_mcode : 'a mcode -> 'b -> 'b mcode | |
463 | val copywrap : 'a wrap -> 'b -> 'b wrap | |
464 | val get_pos : 'a mcode -> meta_pos | |
465 | val get_pos_ref : 'a mcode -> meta_pos ref | |
466 | val set_pos : meta_pos -> 'a mcode -> 'a mcode | |
467 | val get_info : 'a wrap -> info | |
468 | val set_info : 'a wrap -> info -> 'a wrap | |
469 | val get_index : 'a wrap -> int | |
470 | val set_index : 'a wrap -> int -> unit | |
471 | val get_line : 'a wrap -> int | |
472 | val get_line_end : 'a wrap -> int | |
473 | val get_mcodekind : 'a wrap -> mcodekind | |
474 | val get_mcode_mcodekind : 'a mcode -> mcodekind | |
475 | val get_mcodekind_ref : 'a wrap -> mcodekind ref | |
476 | val set_mcodekind : 'a wrap -> mcodekind -> unit | |
477 | val set_type : 'a wrap -> Type_cocci.typeC option -> unit | |
478 | val get_type : 'a wrap -> Type_cocci.typeC option | |
479 | val set_dots_bef_aft : statement -> dots_bef_aft -> statement | |
480 | val get_dots_bef_aft : 'a wrap -> dots_bef_aft | |
481 | val set_arg_exp : expression -> expression | |
482 | val get_arg_exp : expression -> bool | |
483 | val set_test_pos : expression -> expression | |
484 | val get_test_pos : 'a wrap -> bool | |
485 | val set_test_exp : expression -> expression | |
486 | val get_test_exp : 'a wrap -> bool | |
487 | val set_iso : 'a wrap -> (string*anything) list -> 'a wrap | |
488 | val get_iso : 'a wrap -> (string*anything) list | |
489 | val fresh_index : unit -> int | |
490 | val set_mcode_data : 'a -> 'a mcode -> 'a mcode | |
491 | val make_mcode : 'a -> 'a mcode | |
492 | val make_mcode_info : 'a -> info -> 'a mcode | |
493 | ||
494 | val ast0_type_to_type : typeC -> Type_cocci.typeC | |
495 | val reverse_type : Type_cocci.typeC -> base_typeC | |
496 | exception TyConv | |
497 | ||
498 | val lub_pure : pure -> pure -> pure | |
499 | ||
500 | (* --------------------------------------------------------------------- *) | |
501 | ||
502 | val rule_name : string ref (* for the convenience of the parser *) |