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