2 (* Just to warn me when there is some news in the types in
3 * ast_cocci.ml or even ast_c.ml, so that I can then adjust my code in
4 * pattern.ml or transformation.ml.
6 * For the moment I do it only for myself (pad), that is I check only
7 * for news in ast_cocci.ml, because I already know when I add stuff in
8 * my code in ast_c.ml or control_flow_c.ml. *)
12 module F
= Control_flow_c
14 (* dependencies_to_adjust: pattern.ml, transformaton.ml *)
16 let dumb_astcocci_rule_elem = function
17 | A.MetaRuleElem _
-> ()
18 | A.MetaStmt
(ida
,_
,_
,_
) -> ()
19 | A.MetaStmtList _
-> ()
23 | A.TopInit init
-> ()
24 | A.FunHeader
(bef
,allminus
, fninfo
, ida
, _
, paramsa
, _
) -> ()
25 | A.Decl
(bef
,allminus
,decla
) -> ()
28 | A.ExprStatement
(ea
, _
) -> ()
29 | A.IfHeader
(_
,_
, ea
, _
) -> ()
31 | A.WhileHeader
(_
, _
, ea
, _
) -> ()
33 | A.WhileTail
(_
,_
,ea
,_
,_
) -> ()
34 | A.ForHeader
(_
, _
, ea1opt
, _
, ea2opt
, _
, ea3opt
, _
) -> ()
35 | A.IteratorHeader
(ia1
, ia2
, ea
, ia3
) -> ()
36 | A.SwitchHeader _
-> ()
42 | A.ReturnExpr
(_
, ea
, _
) -> ()
43 | A.DefineHeader _
-> ()
47 | A.DisjRuleElem _
-> failwith
"not possible - compiled away in asttoctl"
49 let dumb_astcocci_decl = function
50 | A.UnInit
(stg
, typa
, sa
, _
) -> ()
51 | A.Init
(stg
, typa
, sa
, _
, expa
, _
) -> ()
52 | A.TyDecl
(typa
, _
) -> ()
53 | A.MacroDecl
(fn
, _
, eas
, _
, _
) -> ()
54 | A.Ddots
(dots
,whencode
) -> ()
56 | A.Typedef
(d
,ty1
,ty2
,pv
) -> ()
58 | A.OptDecl _
| A.UniqueDecl _
-> ()
60 let dumb_astcocci_initialiser = function
61 A.Init
(stg
,ty
,id
,eq
,ini
,sem
) -> ()
62 | A.UnInit
(stg
,ty
,id
,sem
) -> ()
63 | A.MacroDecl
(fn
, _
, eas
, _
, _
) -> ()
64 | A.TyDecl
(ty
,sem
) -> ()
65 | A.Typedef
(d
,ty1
,ty2
,pv
) -> ()
66 | A.DisjDecl
(decls
) -> ()
67 | A.Ddots
(dots
,whencode
) -> ()
68 | A.MetaDecl
(name
,_
,_
) -> ()
69 | A.OptDecl
(decl
) -> ()
70 | A.UniqueDecl
(decl
) -> ()
72 let dumb_astcocci_expr = function
73 | A.MetaExpr
(ida
,_
,_
, opttypa
, _
, _
) -> ()
77 | A.Constant
(A.String sa
,_
,_
,_
) -> ()
78 | A.Constant
(A.Char sa
,_
,_
,_
) -> ()
79 | A.Constant
(A.Int sa
,_
,_
,_
) -> ()
80 | A.Constant
(A.Float sa
,_
,_
,_
) -> ()
81 | A.FunCall
(ea1
, _
, eas
, _
) -> ()
82 | A.Assignment
(ea1
, opa
, ea2
, _
) -> ()
83 | A.CondExpr
(ea1
,_
,ea2opt
,_
,ea3
) -> ()
84 | A.Postfix
(ea
, opa
) -> ()
85 | A.Infix
(ea
, opa
) -> ()
86 | A.Unary
(ea
, opa
) -> ()
87 | A.Binary
(ea1
, opa
, ea2
) -> ()
88 | A.Nested
(ea1
, opa
, ea2
) -> ()
89 | A.ArrayAccess
(ea1
, _
, ea2
, _
) -> ()
90 | A.RecordAccess
(ea
, _
, ida
) -> ()
91 | A.RecordPtAccess
(ea
, _
, ida
) -> ()
92 | A.Cast
(_
, typa
, _
, ea
) -> ()
93 | A.SizeOfExpr
(_
, ea
) -> ()
94 | A.SizeOfType
(_
, _
, typa
, _
) -> ()
95 | A.TypeExp
(typa
) -> ()
96 | A.Paren
(_
, ea
, _
) -> ()
98 | A.MetaExprList _
-> ()
102 | A.DisjExpr eas
-> ()
103 | A.UniqueExp _
-> ()
106 let dumb_astcocci_fulltype = function
108 | A.DisjType
(types
) -> ()
109 | A.OptType
(ty
) -> ()
110 | A.UniqueType
(ty
) -> ()
112 let dumb_astcocci_type = function
113 | A.MetaType
(ida
,_
,_
) -> ()
114 | A.BaseType
(basea
,strings
) -> ()
115 | A.SignedT
(signa
,tya
) -> ()
116 | A.Pointer
(typa
, _
) -> ()
117 | A.FunctionPointer
(ty
,lp1
,star
,rp1
,lp2
,params
,rp2
) -> ()
118 | A.FunctionType _
-> ()
119 | A.Array
(typa
, _
, eaopt
, _
) -> ()
120 | A.EnumName
(en
, ena
) -> ()
121 | A.StructUnionName
(sa
, sua
) -> ()
122 | A.StructUnionDef
(ty
, lb
, decls
, rb
) -> ()
123 | A.TypeName sa
-> ()
126 (* ------------------------------------------------------------------------- *)
129 | (Ident (_) | Constant _ | FunCall (_,_) | CondExpr (_,_,_)
132 | Postfix (_,_) | Infix (_,_) | Unary (_,_) | Binary (_,_,_)
133 | ArrayAccess (_,_) | RecordAccess (_,_) | RecordPtAccess (_,_)
134 | SizeOfExpr (_) | SizeOfType (_) | Cast (_,_)
135 | StatementExpr (_) | Constructor
136 | ParenExpr (_) | MacroCall (_) | MacroCall2 (_)
139 | ( Labeled (Label (_,_)) | Labeled (Case (_,_))
140 | Labeled (CaseRange (_,_,_)) | Labeled (Default _)
141 | Compound _ | ExprStatement _
142 | Selection (If (_, _, _)) | Selection (Switch (_, _))
143 | Iteration (While (_, _)) | Iteration (DoWhile (_, _))
144 | Iteration (For ((_,_), (_,_), (_, _), _))
145 | Jump (Goto _) | Jump ((Continue|Break|Return)) | Jump (ReturnExpr _)
146 | Decl _ | Asm | Selection (IfCpp (_,_))
150 (* for control flow nodes
152 | ( F.ExprStatement (_, _)
153 | F.IfHeader (_, _) | F.SwitchHeader (_, _)
154 | F.WhileHeader (_, _) | (* F.DoHeader (_, _) | *) F.DoWhileTail
(_
, _
)
156 | F.Return
(_
, _
) | F.ReturnExpr
(_
, _
)
157 (* no counter part in cocci *)
159 | F.Case
(_
,_
) | (* F.CaseRange (_, _) | *) F.Default
(_
, _
)
160 | F.Goto
(_
, _
) | F.Continue
(_
, _
) | F.Break
(_
, _
)
161 ) -> raise Impossible