package coccinelle

  1. Overview
  2. Docs
type posl = int * int
type virtual_position = Common.parse_info * int
type parse_info = Ast_c.parse_info =
  1. | OriginTok of Common.parse_info
  2. | FakeTok of string * virtual_position
  3. | ExpandedTok of Common.parse_info * virtual_position
  4. | AbstractLineTok of Common.parse_info
type danger = Ast_c.danger =
  1. | DangerStart
  2. | DangerEnd
  3. | Danger
  4. | NoDanger
type info = Ast_c.info = {
  1. pinfo : parse_info;
  2. cocci_tag : (Ast_cocci.mcodekind * metavars_binding list) option ref;
  3. comments_tag : comments_around ref;
  4. mutable annots_tag : Token_annot.annots;
  5. danger : danger ref;
}
and il = info list
and !'a wrap = 'a * il
and !'a wrap2 = 'a * il
and !'a wrap3 = 'a * il
and name = Ast_c.name =
  1. | RegularName of string wrap
  2. | CppConcatenatedName of string wrap wrap2 list
  3. | CppVariadicName of string wrap
  4. | CppIdentBuilder of string wrap * string wrap wrap2 list
and fullType = typeQualifier * typeC
and typeC = typeCbis wrap
and typeCbis = Ast_c.typeCbis =
  1. | NoType
  2. | BaseType of baseType
  3. | Pointer of fullType
  4. | Array of constExpression option * fullType
  5. | Decimal of constExpression * constExpression option
  6. | FunctionType of functionType
  7. | Enum of string option * enumType
  8. | StructUnion of structUnion * string option * structType
  9. | EnumName of string
  10. | StructUnionName of structUnion * string
  11. | TypeName of name * fullType option
  12. | FieldType of fullType * name * constExpression option
  13. | ParenType of fullType
  14. | TypeOfExpr of expression
  15. | TypeOfType of fullType
  16. | AutoType
and baseType = Ast_c.baseType =
  1. | Void
  2. | IntType of intType
  3. | FloatType of floatType
  4. | SizeType
  5. | SSizeType
  6. | PtrDiffType
and intType = Ast_c.intType =
  1. | CChar
  2. | Si of signed
and signed = sign * base
and base = Ast_c.base =
  1. | CChar2
  2. | CShort
  3. | CInt
  4. | CLong
  5. | CLongLong
and sign = Ast_c.sign =
  1. | Signed
  2. | UnSigned
and floatType = Ast_c.floatType =
  1. | CFloat
  2. | CDouble
  3. | CLongDouble
  4. | CFloatComplex
  5. | CDoubleComplex
  6. | CLongDoubleComplex
and structUnion = Ast_c.structUnion =
  1. | Struct
  2. | Union
and structType = field list
and field = Ast_c.field =
  1. | DeclarationField of field_declaration
  2. | EmptyField of info
  3. | MacroDeclField of (string * argument wrap2 list) wrap
  4. | CppDirectiveStruct of cpp_directive
  5. | IfdefStruct of ifdef_directive
and field_declaration = Ast_c.field_declaration =
  1. | FieldDeclList of fieldkind wrap2 list wrap
and fieldkind = Ast_c.fieldkind =
  1. | Simple of name option * fullType
  2. | BitField of name option * fullType * info * constExpression
and enumType = oneEnumType wrap2 list
and oneEnumType = name * (info * constExpression) option
and functionType = fullType * (parameterType wrap2 list * bool wrap)
and parameterType = Ast_c.parameterType = {
  1. p_namei : name option;
  2. p_register : bool wrap;
  3. p_type : fullType;
  4. p_attr : attribute list;
  5. p_midattr : attribute list;
  6. p_endattr : attribute list;
}
and typeQualifier = typeQualifierbis wrap
and typeQualifierbis = Ast_c.typeQualifierbis = {
  1. const : bool;
  2. volatile : bool;
}
and attribute = attributebis wrap
and attributebis = Ast_c.attributebis =
  1. | Attribute of attr_arg
  2. | GccAttribute of attr_arg
and attr_arg = attr_arg_bis wrap
and attr_arg_bis = Ast_c.attr_arg_bis =
  1. | MacroAttr of string
  2. | MacroAttrArgs of string * argument wrap2 list
and expression = (expressionbis * exp_info ref) wrap3
and exp_info = exp_type option * test
and exp_type = fullType * local
and local = Ast_c.local =
  1. | LocalVar of parse_info
  2. | StaticLocalVar of parse_info
  3. | NotLocalVar
and test = Ast_c.test =
  1. | Test
  2. | NotTest
and expressionbis = Ast_c.expressionbis =
  1. | Ident of name
  2. | Constant of constant
  3. | StringConstant of string_fragment list * string * isWchar
  4. | FunCall of expression * argument wrap2 list
  5. | CondExpr of expression * expression option * expression
  6. | Sequence of expression * expression
  7. | Assignment of expression * assignOp * expression
  8. | Postfix of expression * fixOp
  9. | Infix of expression * fixOp
  10. | Unary of expression * unaryOp
  11. | Binary of expression * binaryOp * expression
  12. | ArrayAccess of expression * expression
  13. | RecordAccess of expression * name
  14. | RecordPtAccess of expression * name
  15. | SizeOfExpr of expression
  16. | SizeOfType of fullType
  17. | Cast of fullType * attribute list * expression
  18. | StatementExpr of compound wrap
  19. | Constructor of fullType * initialiser
  20. | ParenExpr of expression
  21. | New of argument wrap2 list option * argument
  22. | Delete of bool * expression
  23. | Defined of name
and weird_argument = Ast_c.weird_argument =
  1. | ArgType of parameterType
  2. | ArgAction of action_macro
and action_macro = Ast_c.action_macro =
  1. | ActMisc of il
and constant = Ast_c.constant =
  1. | String of string * isWchar
  2. | MultiString of string list
  3. | Char of string * isWchar
  4. | Int of string * intType
  5. | Float of string * floatType
  6. | DecimalConst of string * string * string
and isWchar = Ast_c.isWchar =
  1. | IsWchar
  2. | IsUchar
  3. | Isuchar
  4. | Isu8char
  5. | IsChar
and unaryOp = Ast_c.unaryOp =
  1. | GetRef
  2. | DeRef
  3. | UnPlus
  4. | UnMinus
  5. | Tilde
  6. | Not
  7. | GetRefLabel
and assignOpbis = Ast_c.assignOpbis =
  1. | SimpleAssign
  2. | OpAssign of arithOp
and assignOp = assignOpbis wrap
and fixOp = Ast_c.fixOp =
  1. | Dec
  2. | Inc
and binaryOpbis = Ast_c.binaryOpbis =
  1. | Arith of arithOp
  2. | Logical of logicalOp
and binaryOp = binaryOpbis wrap
and arithOp = Ast_c.arithOp =
  1. | Plus
  2. | Minus
  3. | Mul
  4. | Div
  5. | Mod
  6. | DecLeft
  7. | DecRight
  8. | And
  9. | Or
  10. | Xor
  11. | Max
  12. | Min
and logicalOp = Ast_c.logicalOp =
  1. | Inf
  2. | Sup
  3. | InfEq
  4. | SupEq
  5. | Eq
  6. | NotEq
  7. | AndLog
  8. | OrLog
and constExpression = expression
and string_fragment = string_fragment_bis wrap
and string_fragment_bis = Ast_c.string_fragment_bis =
  1. | ConstantFragment of string
  2. | FormatFragment of string_format
and string_format = string_format_bis wrap
and string_format_bis = Ast_c.string_format_bis =
  1. | ConstantFormat of string
and statement = statementbis wrap3
and statementbis = Ast_c.statementbis =
  1. | Labeled of labeled
  2. | Compound of compound
  3. | ExprStatement of exprStatement
  4. | Selection of selection
  5. | Iteration of iteration
  6. | Jump of jump
  7. | Decl of declaration
  8. | Asm of asmbody
  9. | NestedFunc of definition
  10. | MacroStmt
  11. | Exec of exec_code list
  12. | IfdefStmt1 of ifdef_directive list * statement list
and labeled = Ast_c.labeled =
  1. | Label of name * statement
  2. | Case of expression * statement
  3. | CaseRange of expression * expression * statement
  4. | Default of statement
and compound = statement_sequencable list
and statement_sequencable = Ast_c.statement_sequencable =
  1. | StmtElem of statement
  2. | CppDirectiveStmt of cpp_directive
  3. | IfdefStmt of ifdef_directive
  4. | IfdefStmt2 of ifdef_directive list * statement_sequencable list list
and exprStatement = expression option
and declOrExpr = Ast_c.declOrExpr =
  1. | ForDecl of declaration
  2. | ForExp of expression option wrap
and selection = Ast_c.selection =
  1. | If of expression * statement * statement
  2. | Switch of expression * statement
  3. | Ifdef_Ite of expression * statement * statement
  4. | Ifdef_Ite2 of expression * statement * statement * statement
and iteration = Ast_c.iteration =
  1. | While of expression * statement
  2. | DoWhile of statement * expression
  3. | For of declOrExpr * exprStatement wrap * exprStatement wrap * statement
  4. | MacroIteration of string * argument wrap2 list * statement
and jump = Ast_c.jump =
  1. | Goto of name
  2. | Continue
  3. | Break
  4. | Return
  5. | ReturnExpr of expression
  6. | GotoComputed of expression
and asmbody = il * colon wrap list
and colon = Ast_c.colon =
  1. | Colon of colon_option wrap2 list
and colon_option = colon_option_bis wrap
and colon_option_bis = Ast_c.colon_option_bis =
  1. | ColonMisc
  2. | ColonExpr of expression
and exec_code_bis = Ast_c.exec_code_bis =
  1. | ExecEval of expression
  2. | ExecToken
and exec_code = exec_code_bis wrap
and declaration = Ast_c.declaration =
  1. | DeclList of onedecl wrap2 list wrap
  2. | MacroDecl of (storagebis * string * argument wrap2 list * attribute list * bool) wrap
  3. | MacroDeclInit of (storagebis * string * argument wrap2 list * initialiser) wrap
and onedecl = Ast_c.onedecl = {
  1. v_namei : (name * v_init) option;
  2. v_type : fullType;
  3. v_type_bis : fullType option ref;
  4. v_storage : storage;
  5. v_local : local_decl;
  6. v_attr : attribute list;
  7. v_midattr : attribute list;
  8. v_endattr : attribute list;
}
and v_init = Ast_c.v_init =
  1. | NoInit
  2. | ValInit of info * initialiser
  3. | ConstrInit of argument wrap2 list wrap
and storage = storagebis * bool
and storagebis = Ast_c.storagebis =
  1. | NoSto
  2. | StoTypedef
  3. | Sto of storageClass
and storageClass = Ast_c.storageClass =
  1. | Auto
  2. | Static
  3. | Register
  4. | Extern
and local_decl = Ast_c.local_decl =
  1. | LocalDecl
  2. | NotLocalDecl
and initialiser = initialiserbis wrap
and initialiserbis = Ast_c.initialiserbis =
  1. | InitExpr of expression
  2. | InitList of initialiser wrap2 list
  3. | InitDesignators of designator list * initialiser
  4. | InitFieldOld of string * initialiser
  5. | InitIndexOld of expression * initialiser
and designator = designatorbis wrap
and designatorbis = Ast_c.designatorbis =
  1. | DesignatorField of string
  2. | DesignatorIndex of expression
  3. | DesignatorRange of expression * expression
and definition = definitionbis wrap
and definitionbis = Ast_c.definitionbis = {
  1. f_name : name;
  2. f_type : functionType;
  3. f_storage : storage;
  4. f_body : compound;
  5. f_attr : attribute list;
  6. f_endattr : attribute list;
  7. f_old_c_style : declaration list option;
}
and cpp_directive = Ast_c.cpp_directive =
  1. | Define of define
  2. | Include of includ
  3. | Pragma of (name * string wrap list) wrap
  4. | OtherDirective of il
and define = string wrap * (define_kind * define_val)
and define_kind = Ast_c.define_kind =
  1. | DefineVar
  2. | DefineFunc of string wrap wrap2 list wrap
  3. | Undef
and define_val = Ast_c.define_val =
  1. | DefineExpr of expression
  2. | DefineStmt of statement
  3. | DefineType of fullType
  4. | DefineDoWhileZero of (statement * expression) wrap
  5. | DefineFunction of definition
  6. | DefineInit of initialiser
  7. | DefineMulti of statement list
  8. | DefineText of string wrap
  9. | DefineEmpty
  10. | DefineTodo
and includ = Ast_c.includ = {
  1. i_include : inc_file wrap;
  2. i_rel_pos : include_rel_pos option ref;
  3. i_overall_rel_pos : include_rel_pos option ref;
  4. i_is_in_ifdef : bool;
  5. i_content : (Common.filename * program) option;
}
and inc_file = Ast_c.inc_file =
  1. | Local of inc_elem list
  2. | NonLocal of inc_elem list
  3. | Weird of string
and inc_elem = string
and include_rel_pos = Ast_c.include_rel_pos = {
  1. first_of : string list list;
  2. last_of : string list list;
}
and ifdef_directive = Ast_c.ifdef_directive =
  1. | IfdefDirective of (ifdefkind * matching_tag) wrap
and ifdefkind = Ast_c.ifdefkind =
  1. | Ifdef of ifdef_guard
  2. | IfdefElseif of ifdef_guard
  3. | IfdefElse
  4. | IfdefEndif
and ifdef_guard = Ast_c.ifdef_guard =
  1. | Gifdef of macro_symbol
  2. | Gifndef of macro_symbol
  3. | Gif_str of Lexing.position * string
  4. | Gif of expression
  5. | Gnone
and macro_symbol = string
and matching_tag = Ast_c.matching_tag =
  1. | IfdefTag of int * int
and toplevel = Ast_c.toplevel =
  1. | Declaration of declaration
  2. | Definition of definition
  3. | CppTop of cpp_directive
  4. | IfdefTop of ifdef_directive
  5. | MacroTop of string * argument wrap2 list * il
  6. | EmptyDef of il
  7. | NotParsedCorrectly of il
  8. | FinalDef of info
  9. | Namespace of toplevel list * il
and program = toplevel list
and metavar_binding_kind = Ast_c.metavar_binding_kind =
  1. | MetaIdVal of string
  2. | MetaFuncVal of string
  3. | MetaLocalFuncVal of string
  4. | MetaExprVal of expression * Ast_cocci.meta_name list * stripped
  5. | MetaExprListVal of argument wrap2 list
  6. | MetaParamVal of parameterType
  7. | MetaParamListVal of parameterType wrap2 list
  8. | MetaTypeVal of fullType
  9. | MetaInitVal of initialiser
  10. | MetaInitListVal of initialiser wrap2 list
  11. | MetaDeclVal of declaration * declaration
  12. | MetaFieldVal of field
  13. | MetaFieldListVal of field list
  14. | MetaStmtVal of statement * statement * stripped
  15. | MetaStmtListVal of statement_sequencable list * stripped
  16. | MetaDParamListVal of string wrap wrap2 list
  17. | MetaFmtVal of string_format
  18. | MetaAttrArgVal of attr_arg
  19. | MetaFragListVal of string_fragment list
  20. | MetaAssignOpVal of assignOp
  21. | MetaBinaryOpVal of binaryOp
  22. | MetaPosVal of Ast_cocci.fixpos * Ast_cocci.fixpos
  23. | MetaPosValList of (Common.filename * string * (posl * posl) option * posl * posl) list
  24. | MetaComValList of (Token_c.comment_like_token list * Token_c.comment_like_token list * Token_c.comment_like_token list) list
  25. | MetaListlenVal of int
  26. | MetaNoVal
and stripped = Ast_c.stripped =
  1. | WITH_TYPES
  2. | WITHOUT_TYPES
and comments_around = Ast_c.comments_around = {
  1. mbefore : Token_c.comment_like_token list;
  2. mafter : Token_c.comment_like_token list;
  3. mbefore2 : comment_and_relative_pos list;
  4. mafter2 : comment_and_relative_pos list;
}
and comment_and_relative_pos = Ast_c.comment_and_relative_pos = {
  1. minfo : Common.parse_info;
  2. mpos : int;
}
and comment = Common.parse_info
and com = comment list ref
val nullQualif : typeQualifierbis * 'a list
val nQ : typeQualifierbis * 'a list
val defaultInt : typeCbis
val noType : unit -> ('a option * test) ref
val noInstr : statementbis * 'a list
val noTypedefDef : unit -> 'a option
val emptyMetavarsBinding : metavars_binding
val emptyAnnotCocci : Ast_cocci.mcodekind * metavars_binding list
val emptyAnnot : (Ast_cocci.mcodekind * metavars_binding list) option
val mcode_and_env_of_cocciref : (Ast_cocci.mcodekind * metavars_binding list) option ref -> Ast_cocci.mcodekind * metavars_binding list
val emptyComments : comments_around
val noRelPos : unit -> include_rel_pos option ref
val noInIfdef : unit -> bool ref
val no_virt_pos : Common.parse_info * int
val fakeInfo : 'a -> info
val noii : 'a list
val noattr : 'a list
val noi_content : (Common.filename * program) option
val unwrap : ('a * 'b) -> 'a
val unwrap2 : ('a * 'b) -> 'a
val unwrap_expr : (('a * 'b) * 'c) -> 'a
val rewrap_expr : (('a * 'b) * 'c) -> 'd -> ('d * 'b) * 'c
val unwrap_typeC : ('a * ('b * 'c)) -> 'b
val rewrap_typeC : ('a * ('b * 'c)) -> 'd -> 'a * ('d * 'c)
val unwrap_typeCbis : ('a * 'b) -> 'a
val unwrap_st : ('a * 'b) -> 'a
val mk_e : 'a -> 'b -> ('a * ('c option * test) ref) * 'b
val mk_e_bis : 'a -> 'b -> 'c -> ('a * 'b) * 'c
val mk_ty : 'a -> 'b -> (typeQualifierbis * 'c list) * ('a * 'b)
val mk_tybis : 'a -> 'b -> 'a * 'b
val mk_st : 'a -> 'b -> 'a * 'b
val get_ii_typeC_take_care : ('a * 'b) -> 'b
val get_ii_st_take_care : ('a * 'b) -> 'b
val get_ii_expr_take_care : ('a * 'b) -> 'b
val get_st_and_ii : ('a * 'b) -> 'a * 'b
val get_ty_and_ii : ('a * ('b * 'c)) -> 'a * ('b * 'c)
val get_e_and_ii : ('a * 'b) -> 'a * 'b
val get_type_expr : (('a * 'b ref) * 'c) -> 'b
val set_type_expr : (('a * 'b ref) * 'c) -> 'b -> unit
val get_onlytype_expr : (('a * (('b * 'c) option * 'd) ref) * 'e) -> 'b option
val get_onlylocal_expr : (('a * (('b * 'c) option * 'd) ref) * 'e) -> 'c option
val rewrap_str : string -> info -> info
val rewrap_charpos : int -> info -> info
val rewrap_col : int -> info -> info
val rewrap_pinfo : parse_info -> info -> info
val get_opi : parse_info -> Common.parse_info
val str_of_info : info -> string
val get_info : (Common.parse_info -> 'a) -> info -> 'a
val get_orig_info : (Common.parse_info -> 'a) -> info -> 'a
val make_expanded : info -> info
val pos_of_info : info -> int
val opos_of_info : info -> int
val line_of_info : info -> int
val col_of_info : info -> int
val file_of_info : info -> Common.filename
val mcode_of_info : info -> Ast_cocci.mcodekind
val pinfo_of_info : info -> parse_info
val parse_info_of_info : info -> Common.parse_info
val strloc_of_info : info -> string
val is_fake : info -> bool
val is_origintok : info -> bool
type posrv = Ast_c.posrv =
  1. | Real of Common.parse_info
  2. | Virt of virtual_position
val compare_pos : info -> info -> int
val equal_posl : ('a * 'b) -> ('a * 'b) -> bool
val compare_posl : (int * int) -> (int * int) -> int
val info_to_fixpos : info -> Ast_cocci.fixpos
val is_test : expression -> bool
val al_info : int -> info -> info
val semi_al_info : info -> info
val magic_real_number : int
val real_al_info : info -> info
val al_comments : bool -> comments_around -> comments_around
val al_info_cpp : int -> info -> info
val semi_al_info_cpp : info -> info
val real_al_info_cpp : bool -> info -> info
val split_comma : 'a wrap2 list -> ('a, il) Common.either list
val unsplit_comma : ('a, il) Common.either list -> 'a wrap2 list
val split_nocomma : 'a list -> ('a, il) Common.either list
val unsplit_nocomma : ('a, il) Common.either list -> 'a list
val s_of_inc_file : inc_file -> string
val s_of_inc_file_bis : inc_file -> string
val fieldname_of_fieldkind : fieldkind -> name option
val s_of_attr : (attributebis * info list) list -> string
val str_of_name : name -> string
val get_s_and_ii_of_name : name -> string * il
val get_s_and_info_of_name : name -> string * info
val info_of_name : name -> info
val ii_of_name : name -> il
val get_local_ii_of_expr_inlining_ii_of_name : ((expressionbis * 'a) * il) -> il
val get_local_ii_of_tybis_inlining_ii_of_name : (typeCbis * il) -> il
val info_of_type : ('a * (typeCbis * il)) -> parse_info option
val get_local_ii_of_st_inlining_ii_of_name : (statementbis * info list) -> info list
val name_of_parameter : parameterType -> string option
val put_annot_info : info -> Token_annot.annot_key -> Token_annot.annot_val -> unit
val get_annot_info : info -> Token_annot.annot_key -> Token_annot.annot_val option
val get_comments_before : info -> Token_c.comment_like_token list
val get_comments_after : info -> Token_c.comment_like_token list
val string_of_toplevel : toplevel -> string
val string_of_inc_file : inc_file -> string
OCaml

Innovation. Community. Security.