package coccinelle

  1. Overview
  2. Docs
type arity = Ast0_cocci.arity =
  1. | OPT
  2. | NONE
type token_info = Ast0_cocci.token_info = {
  1. tline_start : int;
  2. tline_end : int;
  3. left_offset : int;
  4. right_offset : int;
}
val default_token_info : token_info
type position_info = Ast0_cocci.position_info = {
  1. line_start : int;
  2. line_end : int;
  3. logical_start : int;
  4. logical_end : int;
  5. column : int;
  6. offset : int;
}
type info = Ast0_cocci.info = {
  1. pos_info : position_info;
  2. whitespace : string;
  3. attachable_start : bool;
  4. attachable_end : bool;
  5. mcode_start : mcodekind list;
  6. mcode_end : mcodekind list;
  7. strings_before : (Ast_cocci.added_string * position_info) list;
  8. strings_after : (Ast_cocci.added_string * position_info) list;
  9. isSymbolIdent : bool;
}
type adjacency = int
type fake_mcode = info * mcodekind * adjacency
type !'a mcode = 'a * arity * info * mcodekind * anything list ref * adjacency
and !'a wrap = 'a Ast0_cocci.wrap = {
  1. node : 'a;
  2. info : info;
  3. index : int ref;
  4. mcodekind : mcodekind ref;
  5. exp_ty : typeC option ref;
  6. bef_aft : dots_bef_aft;
  7. true_if_arg : bool;
  8. true_if_test : bool;
  9. true_if_test_exp : bool;
  10. iso_info : (string * anything) list;
}
and dots_bef_aft = Ast0_cocci.dots_bef_aft =
  1. | NoDots
  2. | AddingBetweenDots of statement
  3. | DroppingBetweenDots of statement
and pure = Ast0_cocci.pure =
  1. | Impure
  2. | Pure
  3. | Context
  4. | PureContext
and !'a dots = 'a list wrap
and base_ident = Ast0_cocci.base_ident =
  1. | Id of string mcode
  2. | MetaId of Ast_cocci.meta_name mcode * constraints * Ast_cocci.seed * pure
  3. | MetaFunc of Ast_cocci.meta_name mcode * constraints * pure
  4. | MetaLocalFunc of Ast_cocci.meta_name mcode * constraints * pure
  5. | AsIdent of ident * ident
  6. | DisjId of string mcode * ident list * string mcode list * string mcode
  7. | ConjId of string mcode * ident list * string mcode list * string mcode
  8. | OptIdent of ident
and ident = base_ident wrap
and base_expression = Ast0_cocci.base_expression =
  1. | Ident of ident
  2. | Constant of Ast_cocci.constant mcode
  3. | StringConstant of string mcode * string_fragment dots * string mcode * Ast_cocci.isWchar
  4. | FunCall of expression * string mcode * expression dots * string mcode
  5. | Assignment of expression * assignOp * expression * bool
  6. | Sequence of expression * string mcode * expression
  7. | CondExpr of expression * string mcode * expression option * string mcode * expression
  8. | Postfix of expression * Ast_cocci.fixOp mcode
  9. | Infix of expression * Ast_cocci.fixOp mcode
  10. | Unary of expression * Ast_cocci.unaryOp mcode
  11. | Binary of expression * binaryOp * expression
  12. | Nested of expression * binaryOp * expression
  13. | Paren of string mcode * expression * string mcode
  14. | ArrayAccess of expression * string mcode * expression * string mcode
  15. | RecordAccess of expression * string mcode * ident
  16. | RecordPtAccess of expression * string mcode * ident
  17. | Cast of string mcode * typeC * attr list * string mcode * expression
  18. | SizeOfExpr of string mcode * expression
  19. | SizeOfType of string mcode * string mcode * typeC * string mcode
  20. | TypeExp of typeC
  21. | Constructor of string mcode * typeC * string mcode * initialiser
  22. | MetaErr of Ast_cocci.meta_name mcode * constraints * pure
  23. | MetaExpr of Ast_cocci.meta_name mcode * constraints * typeC list option * Ast_cocci.form * pure * listlen option
  24. | MetaExprList of Ast_cocci.meta_name mcode * listlen * constraints * pure
  25. | AsExpr of expression * expression
  26. | AsSExpr of expression * statement
  27. | EComma of string mcode
  28. | DisjExpr of string mcode * expression list * string mcode list * string mcode
  29. | ConjExpr of string mcode * expression list * string mcode list * string mcode
  30. | NestExpr of string mcode * expression dots * string mcode * (string mcode * string mcode * expression) option * Ast_cocci.multi
  31. | Edots of string mcode * (string mcode * string mcode * expression) option
  32. | OptExp of expression
and expression = base_expression wrap
and listlen = Ast0_cocci.listlen =
  1. | MetaListLen of Ast_cocci.meta_name mcode * constraints
  2. | CstListLen of int
  3. | AnyListLen
and base_string_fragment = Ast0_cocci.base_string_fragment =
  1. | ConstantFragment of string mcode
  2. | FormatFragment of string mcode * string_format
  3. | Strdots of string mcode
  4. | MetaFormatList of string mcode * Ast_cocci.meta_name mcode * constraints * listlen
and string_fragment = base_string_fragment wrap
and base_string_format = Ast0_cocci.base_string_format =
  1. | ConstantFormat of string mcode
  2. | MetaFormat of Ast_cocci.meta_name mcode * constraints
and string_format = base_string_format wrap
and base_assignOp = Ast0_cocci.base_assignOp =
  1. | SimpleAssign of simpleAssignOp mcode
  2. | OpAssign of Ast_cocci.arithOp mcode
  3. | MetaAssign of Ast_cocci.meta_name mcode * constraints * pure
and simpleAssignOp = string
and assignOp = base_assignOp wrap
and binaryOp = base_binaryOp wrap
and base_typeC = Ast0_cocci.base_typeC =
  1. | ConstVol of Ast_cocci.const_vol mcode list * typeC
  2. | BaseType of Ast_cocci.baseType * string mcode list
  3. | Signed of Ast_cocci.sign mcode * typeC option
  4. | Pointer of typeC * string mcode
  5. | ParenType of string mcode * typeC * string mcode
  6. | FunctionType of typeC * string mcode * parameter_list * string mcode
  7. | Array of typeC * string mcode * expression option * string mcode
  8. | Decimal of string mcode * string mcode * expression * string mcode option * expression option * string mcode
  9. | EnumName of string mcode * ident option
  10. | EnumDef of typeC * string mcode * enum_decl dots * string mcode
  11. | StructUnionName of Ast_cocci.structUnion mcode * ident option
  12. | StructUnionDef of typeC * string mcode * field dots * string mcode
  13. | TypeOfExpr of string mcode * string mcode * expression * string mcode
  14. | TypeOfType of string mcode * string mcode * typeC * string mcode
  15. | TypeName of string mcode
  16. | AutoType of string mcode
  17. | MetaType of Ast_cocci.meta_name mcode * constraints * pure
  18. | AsType of typeC * typeC
  19. | DisjType of string mcode * typeC list * string mcode list * string mcode
  20. | ConjType of string mcode * typeC list * string mcode list * string mcode
  21. | OptType of typeC
and typeC = base_typeC wrap
and base_declaration = Ast0_cocci.base_declaration =
  1. | MetaDecl of Ast_cocci.meta_name mcode * constraints * pure
  2. | AsDecl of declaration * declaration
  3. | Init of Ast_cocci.storage mcode option * typeC * attr list * ident * attr list * string mcode * initialiser * string mcode
  4. | UnInit of Ast_cocci.storage mcode option * typeC * attr list * ident * attr list * string mcode
  5. | FunProto of fninfo list * attr list * ident * string mcode * parameter_list * (string mcode * string mcode) option * string mcode * string mcode
  6. | TyDecl of typeC * attr list * string mcode
  7. | MacroDecl of Ast_cocci.storage mcode option * ident * string mcode * expression dots * string mcode * attr list * string mcode
  8. | MacroDeclInit of Ast_cocci.storage mcode option * ident * string mcode * expression dots * string mcode * string mcode * initialiser * string mcode
  9. | Typedef of string mcode * typeC * typeC * string mcode
  10. | DisjDecl of string mcode * declaration list * string mcode list * string mcode
  11. | ConjDecl of string mcode * declaration list * string mcode list * string mcode
  12. | OptDecl of declaration
and declaration = base_declaration wrap
and base_field = Ast0_cocci.base_field =
  1. | MetaField of Ast_cocci.meta_name mcode * constraints * pure
  2. | MetaFieldList of Ast_cocci.meta_name mcode * listlen * constraints * pure
  3. | Field of typeC * ident option * bitfield option * string mcode
  4. | DisjField of string mcode * field list * string mcode list * string mcode
  5. | ConjField of string mcode * field list * string mcode list * string mcode
  6. | Fdots of string mcode * (string mcode * string mcode * field) option
  7. | OptField of field
and bitfield = string mcode * expression
and field = base_field wrap
and base_enum_decl = Ast0_cocci.base_enum_decl =
  1. | Enum of ident * (string mcode * expression) option
  2. | EnumComma of string mcode
  3. | EnumDots of string mcode * (string mcode * string mcode * enum_decl) option
and enum_decl = base_enum_decl wrap
and base_initialiser = Ast0_cocci.base_initialiser =
  1. | MetaInit of Ast_cocci.meta_name mcode * constraints * pure
  2. | MetaInitList of Ast_cocci.meta_name mcode * listlen * constraints * pure
  3. | AsInit of initialiser * initialiser
  4. | InitExpr of expression
  5. | InitList of string mcode * initialiser_list * string mcode * bool
  6. | InitGccExt of designator list * string mcode * initialiser
  7. | InitGccName of ident * string mcode * initialiser
  8. | IComma of string mcode
  9. | Idots of string mcode * (string mcode * string mcode * initialiser) option
  10. | OptIni of initialiser
and designator = Ast0_cocci.designator =
  1. | DesignatorField of string mcode * ident
  2. | DesignatorIndex of string mcode * expression * string mcode
  3. | DesignatorRange of string mcode * expression * string mcode * expression * string mcode
and initialiser = base_initialiser wrap
and initialiser_list = initialiser dots
and base_parameterTypeDef = Ast0_cocci.base_parameterTypeDef =
  1. | VoidParam of typeC * attr list
  2. | Param of typeC * attr list * ident option * attr list
  3. | MetaParam of Ast_cocci.meta_name mcode * constraints * pure
  4. | MetaParamList of Ast_cocci.meta_name mcode * listlen * constraints * pure
  5. | AsParam of parameterTypeDef * expression
  6. | PComma of string mcode
  7. | Pdots of string mcode
  8. | OptParam of parameterTypeDef
and parameterTypeDef = base_parameterTypeDef wrap
and parameter_list = parameterTypeDef dots
and base_define_param = Ast0_cocci.base_define_param =
  1. | DParam of ident
  2. | MetaDParamList of Ast_cocci.meta_name mcode * listlen * constraints * pure
  3. | DPComma of string mcode
  4. | DPdots of string mcode
  5. | OptDParam of define_param
and define_param = base_define_param wrap
and base_define_parameters = Ast0_cocci.base_define_parameters =
  1. | NoParams
  2. | DParams of string mcode * define_param dots * string mcode
and define_parameters = base_define_parameters wrap
and base_statement = Ast0_cocci.base_statement =
  1. | Decl of info * mcodekind * declaration
  2. | Seq of string mcode * statement dots * string mcode
  3. | ExprStatement of expression option * string mcode
  4. | IfThen of string mcode * string mcode * expression * string mcode * statement * fake_mcode
  5. | IfThenElse of string mcode * string mcode * expression * string mcode * statement * string mcode * statement * fake_mcode
  6. | While of string mcode * string mcode * expression * string mcode * statement * fake_mcode
  7. | Do of string mcode * statement * string mcode * string mcode * expression * string mcode * string mcode
  8. | For of string mcode * string mcode * forinfo * expression option * string mcode * expression option * string mcode * statement * fake_mcode
  9. | Iterator of ident * string mcode * expression dots * string mcode * statement * fake_mcode
  10. | Switch of string mcode * string mcode * expression * string mcode * string mcode * statement dots * case_line dots * string mcode
  11. | Break of string mcode * string mcode
  12. | Continue of string mcode * string mcode
  13. | Label of ident * string mcode
  14. | Goto of string mcode * ident * string mcode
  15. | Return of string mcode * string mcode
  16. | ReturnExpr of string mcode * expression * string mcode
  17. | Exec of string mcode * string mcode * exec_code dots * string mcode
  18. | MetaStmt of Ast_cocci.meta_name mcode * constraints * pure
  19. | MetaStmtList of Ast_cocci.meta_name mcode * listlen * constraints * pure
  20. | AsStmt of statement * statement
  21. | Exp of expression
  22. | TopExp of expression
  23. | Ty of typeC
  24. | TopId of ident
  25. | TopInit of initialiser
  26. | Disj of string mcode * statement dots list * string mcode list * string mcode
  27. | Conj of string mcode * statement dots list * string mcode list * string mcode
  28. | Nest of string mcode * statement dots * string mcode * (statement dots, statement) whencode list * Ast_cocci.multi
  29. | Dots of string mcode * (statement dots, statement) whencode list
  30. | FunDecl of info * mcodekind * fninfo list * ident * string mcode * parameter_list * (string mcode * string mcode) option * string mcode * attr list * string mcode * statement dots * string mcode * info * mcodekind
  31. | Include of string mcode * Ast_cocci.inc_file mcode
  32. | MetaInclude of string mcode * expression
  33. | Undef of string mcode * ident
  34. | Define of string mcode * ident * define_parameters * statement dots
  35. | Pragma of string mcode * ident * pragmainfo
  36. | OptStm of statement
and base_pragmainfo = Ast0_cocci.base_pragmainfo =
  1. | PragmaString of string mcode
  2. | PragmaDots of string mcode
and pragmainfo = base_pragmainfo wrap
and base_forinfo = Ast0_cocci.base_forinfo =
  1. | ForExp of expression option * string mcode
  2. | ForDecl of info * mcodekind * declaration
and forinfo = base_forinfo wrap
and fninfo = Ast0_cocci.fninfo =
  1. | FStorage of Ast_cocci.storage mcode
  2. | FType of typeC
  3. | FInline of string mcode
  4. | FAttr of attr
and base_attr = Ast0_cocci.base_attr =
  1. | Attribute of attr_arg
  2. | GccAttribute of string mcode * string mcode * string mcode * attr_arg * string mcode * string mcode
and attr = base_attr wrap
and base_attr_arg = Ast0_cocci.base_attr_arg =
  1. | MacroAttr of string mcode
  2. | MacroAttrArgs of string mcode * string mcode * expression dots * string mcode
  3. | MetaAttr of Ast_cocci.meta_name mcode * constraints * pure
and attr_arg = base_attr_arg wrap
and (!'a, !'b) whencode = ('a, 'b) Ast0_cocci.whencode =
  1. | WhenNot of string mcode * string mcode * 'a
  2. | WhenAlways of string mcode * string mcode * 'b
  3. | WhenModifier of string mcode * Ast_cocci.when_modifier
  4. | WhenNotTrue of string mcode * string mcode * expression
  5. | WhenNotFalse of string mcode * string mcode * expression
and statement = base_statement wrap
and base_case_line = Ast0_cocci.base_case_line =
  1. | Default of string mcode * string mcode * statement dots
  2. | Case of string mcode * expression * string mcode * statement dots
  3. | DisjCase of string mcode * case_line list * string mcode list * string mcode
  4. | OptCase of case_line
and case_line = base_case_line wrap
and base_exec_code = Ast0_cocci.base_exec_code =
  1. | ExecEval of string mcode * expression
  2. | ExecToken of string mcode
  3. | ExecDots of string mcode
and exec_code = base_exec_code wrap
and base_top_level = Ast0_cocci.base_top_level =
  1. | NONDECL of statement
  2. | TOPCODE of statement dots
  3. | CODE of statement dots
  4. | FILEINFO of string mcode * string mcode
  5. | ERRORWORDS of expression list
  6. | OTHER of statement
and top_level = base_top_level wrap
and rule = top_level list
and dep = Ast0_cocci.dep =
  1. | Dep of string
  2. | AntiDep of dep
  3. | EverDep of string
  4. | NeverDep of string
  5. | AndDep of dep * dep
  6. | OrDep of dep * dep
  7. | FileIn of string
and dependency = Ast0_cocci.dependency =
  1. | NoDep
  2. | FailDep
  3. | ExistsDep of dep
  4. | ForallDep of dep
and anything = Ast0_cocci.anything =
  1. | DotsExprTag of expression dots
  2. | DotsInitTag of initialiser dots
  3. | DotsParamTag of parameterTypeDef dots
  4. | DotsStmtTag of statement dots
  5. | DotsDeclTag of declaration dots
  6. | DotsFieldTag of field dots
  7. | DotsEnumDeclTag of enum_decl dots
  8. | DotsCaseTag of case_line dots
  9. | DotsDefParamTag of define_param dots
  10. | IdentTag of ident
  11. | ExprTag of expression
  12. | AssignOpTag of assignOp
  13. | BinaryOpTag of binaryOp
  14. | ArgExprTag of expression
  15. | TestExprTag of expression
  16. | TypeCTag of typeC
  17. | ParamTag of parameterTypeDef
  18. | InitTag of initialiser
  19. | DeclTag of declaration
  20. | FieldTag of field
  21. | EnumDeclTag of enum_decl
  22. | StmtTag of statement
  23. | ForInfoTag of forinfo
  24. | CaseLineTag of case_line
  25. | StringFragmentTag of string_fragment
  26. | AttributeTag of attr
  27. | AttrArgTag of attr_arg
  28. | TopTag of top_level
  29. | IsoWhenTag of Ast_cocci.when_modifier
  30. | IsoWhenTTag of expression
  31. | IsoWhenFTag of expression
  32. | MetaPosTag of meta_pos
  33. | HiddenVarTag of anything list
  34. | WhenTag of string mcode * string mcode option * anything
val dotsExpr : expression dots -> anything
val dotsInit : initialiser dots -> anything
val dotsParam : parameterTypeDef dots -> anything
val dotsStmt : statement dots -> anything
val dotsDecl : declaration dots -> anything
val dotsField : field dots -> anything
val dotsEnumDecl : enum_decl dots -> anything
val dotsCase : case_line dots -> anything
val dotsDefParam : define_param dots -> anything
val ident : ident -> anything
val expr : expression -> anything
val assignOp : assignOp -> anything
val binaryOp : binaryOp -> anything
val typeC : typeC -> anything
val param : parameterTypeDef -> anything
val ini : initialiser -> anything
val decl : declaration -> anything
val field : field -> anything
val enum_decl : enum_decl -> anything
val stmt : statement -> anything
val forinfo : forinfo -> anything
val case_line : case_line -> anything
val string_fragment : string_fragment -> anything
val attr : attr -> anything
val attr_arg : attr_arg -> anything
val top : top_level -> anything
val default_info : unit -> info
val default_befaft : unit -> mcodekind
val context_befaft : unit -> mcodekind
val wrap : 'a -> 'a wrap
val context_wrap : 'a -> 'a wrap
val unwrap : 'a wrap -> 'a
val unwrap_mcode : 'a mcode -> 'a
val rewrap : 'a wrap -> 'b -> 'b wrap
val rewrap_mcode : 'a mcode -> 'b -> 'b mcode
val copywrap : 'a wrap -> 'b -> 'b wrap
val get_pos : 'a mcode -> anything list
val get_pos_ref : 'a mcode -> anything list ref
val set_pos : anything list -> 'a mcode -> 'a mcode
val get_info : 'a wrap -> info
val set_info : 'a wrap -> info -> 'a wrap
val get_index : 'a wrap -> int
val set_index : 'a wrap -> int -> unit
val get_line : 'a wrap -> int
val get_mcode_line : 'a mcode -> int
val get_mcode_logline : 'a mcode -> int
val get_line_end : 'a wrap -> int
val get_mcodekind : 'a wrap -> mcodekind
val get_mcode_mcodekind : 'a mcode -> mcodekind
val get_mcodekind_ref : 'a wrap -> mcodekind ref
val set_mcodekind : 'a wrap -> mcodekind -> unit
val set_type : 'a wrap -> typeC option -> unit
val get_type : 'a wrap -> typeC option
val set_dots_bef_aft : statement -> dots_bef_aft -> statement
val get_dots_bef_aft : 'a wrap -> dots_bef_aft
val set_arg_exp : expression -> expression
val get_arg_exp : expression -> bool
val set_test_pos : expression -> expression
val get_test_pos : 'a wrap -> bool
val set_test_exp : expression -> expression
val clear_test_exp : expression -> expression
val get_test_exp : 'a wrap -> bool
val set_iso : 'a wrap -> (string * anything) list -> 'a wrap
val get_iso : 'a wrap -> (string * anything) list
val fresh_index : unit -> int
val set_mcode_data : 'a -> 'a mcode -> 'a mcode
val make_mcode : 'a -> 'a mcode
val make_mcode_info : 'a -> info -> 'a mcode
val make_minus_mcode : 'a -> 'a mcode
val get_rule_name : parsed_rule -> string
val meta_pos_name : anything -> Ast_cocci.meta_name mcode
val meta_names_of_typeC : typeC -> Ast_cocci.meta_name list
val meta_pos_constraint_names : anything -> Ast_cocci.meta_name list
val lub_pure : pure -> pure -> pure
val rule_name : string ref
val string_of_assignOp : assignOp -> string
val string_of_binaryOp : binaryOp -> string
val is_unknown_type : typeC -> bool
OCaml

Innovation. Community. Security.