Release coccinelle-0.1.1
[bpt/coccinelle.git] / engine / .#check_exhaustive_pattern.ml.1.39
CommitLineData
1be43e12
C
1(*
2* Copyright 2005-2008, Ecole des Mines de Nantes, University of Copenhagen
3* Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller
4* This file is part of Coccinelle.
5*
6* Coccinelle is free software: you can redistribute it and/or modify
7* it under the terms of the GNU General Public License as published by
8* the Free Software Foundation, according to version 2 of the License.
9*
10* Coccinelle is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with Coccinelle. If not, see <http://www.gnu.org/licenses/>.
17*
18* The authors reserve the right to distribute this or future versions of
19* Coccinelle under other licenses.
20*)
21
22
23
24(* Just to warn me when there is some news in the types in
25 * ast_cocci.ml or even ast_c.ml, so that I can then adjust my code in
26 * pattern.ml or transformation.ml.
27 *
28 * For the moment I do it only for myself (pad), that is I check only
29 * for news in ast_cocci.ml, because I already know when I add stuff in
30 * my code in ast_c.ml or control_flow_c.ml. *)
31
32module A = Ast_cocci
33module B = Ast_c
34module F = Control_flow_c
35
36(* dependencies_to_adjust: pattern.ml, transformaton.ml *)
37
38let dumb_astcocci_rule_elem = function
39 | A.MetaRuleElem _ -> ()
40 | A.MetaStmt (ida,_,_,_) -> ()
41 | A.MetaStmtList _ -> ()
42 | A.Exp expr -> ()
43 | A.TopExp expr -> ()
44 | A.Ty ty -> ()
45 | A.FunHeader (bef,allminus, fninfo, ida, _, paramsa, _) -> ()
46 | A.Decl (bef,allminus,decla) -> ()
47 | A.SeqStart _ -> ()
48 | A.SeqEnd _ -> ()
49 | A.ExprStatement (ea, _) -> ()
50 | A.IfHeader (_,_, ea, _) -> ()
51 | A.Else _ -> ()
52 | A.WhileHeader (_, _, ea, _) -> ()
53 | A.DoHeader _ -> ()
54 | A.WhileTail (_,_,ea,_,_) -> ()
55 | A.ForHeader (_, _, ea1opt, _, ea2opt, _, ea3opt, _) -> ()
56 | A.IteratorHeader (ia1, ia2, ea, ia3) -> ()
57 | A.SwitchHeader _ -> ()
58 | A.Break _ -> ()
59 | A.Continue _ -> ()
60 | A.Label _ -> ()
61 | A.Goto(_,_,_) -> ()
62 | A.Return _ -> ()
63 | A.ReturnExpr (_, ea, _) -> ()
64 | A.DefineHeader _ -> ()
65 | A.Include _ -> ()
66 | A.Default _ -> ()
67 | A.Case _ -> ()
68 | A.DisjRuleElem _ -> failwith "not possible - compiled away in asttoctl"
69
70let dumb_astcocci_decl = function
71 | A.UnInit (stg, typa, sa, _) -> ()
72 | A.Init (stg, typa, sa, _, expa, _) -> ()
73 | A.TyDecl (typa, _) -> ()
74 | A.MacroDecl(fn, _, eas, _, _) -> ()
75 | A.Ddots(dots,whencode) -> ()
76 | A.MetaDecl _ -> ()
77 | A.Typedef(d,ty1,ty2,pv) -> ()
78 | A.DisjDecl xs -> ()
79 | A.OptDecl _ | A.UniqueDecl _ -> ()
80
81let dumb_astcocci_initialiser = function
82 A.Init(stg,ty,id,eq,ini,sem) -> ()
83 | A.UnInit(stg,ty,id,sem) -> ()
84 | A.MacroDecl(fn, _, eas, _, _) -> ()
85 | A.TyDecl(ty,sem) -> ()
86 | A.Typedef(d,ty1,ty2,pv) -> ()
87 | A.DisjDecl(decls) -> ()
88 | A.Ddots(dots,whencode) -> ()
89 | A.MetaDecl(name,_,_) -> ()
90 | A.OptDecl(decl) -> ()
91 | A.UniqueDecl(decl) -> ()
92
93let dumb_astcocci_expr = function
94 | A.MetaExpr (ida,_,_, opttypa, _, _) -> ()
95 | A.Edots (_,_) -> ()
96 | A.MetaErr _ -> ()
97 | A.Ident ida -> ()
98 | A.Constant (A.String sa,_,_,_) -> ()
99 | A.Constant (A.Char sa,_,_,_) -> ()
100 | A.Constant (A.Int sa,_,_,_) -> ()
101 | A.Constant (A.Float sa,_,_,_) -> ()
102 | A.FunCall (ea1, _, eas, _) -> ()
103 | A.Assignment (ea1, opa, ea2, _) -> ()
104 | A.CondExpr (ea1,_,ea2opt,_,ea3) -> ()
105 | A.Postfix (ea, opa) -> ()
106 | A.Infix (ea, opa) -> ()
107 | A.Unary (ea, opa) -> ()
108 | A.Binary (ea1, opa, ea2) -> ()
109 | A.Nested (ea1, opa, ea2) -> ()
110 | A.ArrayAccess (ea1, _, ea2, _) -> ()
111 | A.RecordAccess (ea, _, ida) -> ()
112 | A.RecordPtAccess (ea, _, ida) -> ()
113 | A.Cast (_, typa, _, ea) -> ()
114 | A.SizeOfExpr (_, ea) -> ()
115 | A.SizeOfType (_, _, typa, _) -> ()
116 | A.TypeExp (typa) -> ()
117 | A.Paren (_, ea, _) -> ()
118 | A.NestExpr _ -> ()
119 | A.MetaExprList _ -> ()
120 | A.EComma _ -> ()
121 | A.Ecircles _ -> ()
122 | A.Estars _ -> ()
123 | A.DisjExpr eas -> ()
124 | A.UniqueExp _ -> ()
125 | A.OptExp _ -> ()
126
127let dumb_astcocci_fulltype = function
128 A.Type(cv,ty) -> ()
129 | A.DisjType(types) -> ()
130 | A.OptType(ty) -> ()
131 | A.UniqueType(ty) -> ()
132
133let dumb_astcocci_type = function
134 | A.MetaType(ida,_,_) -> ()
135 | A.BaseType (basea, signaopt) -> ()
136 | A.ImplicitInt (signa) -> ()
137 | A.Pointer (typa, _) -> ()
138 | A.FunctionPointer(ty,lp1,star,rp1,lp2,params,rp2) -> ()
139 | A.FunctionType _ -> ()
140 | A.Array (typa, _, eaopt, _) -> ()
141 | A.StructUnionName(sa, sua) -> ()
142 | A.StructUnionDef(ty, lb, decls, rb) -> ()
143 | A.TypeName sa -> ()
144
145
146(* ------------------------------------------------------------------------- *)
147(* for C *)
148(*
149 | (Ident (_) | Constant _ | FunCall (_,_) | CondExpr (_,_,_)
150 | Sequence (_,_)
151 | Assignment (_,_,_)
152 | Postfix (_,_) | Infix (_,_) | Unary (_,_) | Binary (_,_,_)
153 | ArrayAccess (_,_) | RecordAccess (_,_) | RecordPtAccess (_,_)
154 | SizeOfExpr (_) | SizeOfType (_) | Cast (_,_)
155 | StatementExpr (_) | Constructor
156 | ParenExpr (_) | MacroCall (_) | MacroCall2 (_)
157 ),_ ->
158
159 | ( Labeled (Label (_,_)) | Labeled (Case (_,_))
160 | Labeled (CaseRange (_,_,_)) | Labeled (Default _)
161 | Compound _ | ExprStatement _
162 | Selection (If (_, _, _)) | Selection (Switch (_, _))
163 | Iteration (While (_, _)) | Iteration (DoWhile (_, _))
164 | Iteration (For ((_,_), (_,_), (_, _), _))
165 | Jump (Goto _) | Jump ((Continue|Break|Return)) | Jump (ReturnExpr _)
166 | Decl _ | Asm | Selection (IfCpp (_,_))
167 ), _ ->
168*)
169
170(* for control flow nodes
171
172 | ( F.ExprStatement (_, _)
173 | F.IfHeader (_, _) | F.SwitchHeader (_, _)
174 | F.WhileHeader (_, _) | (* F.DoHeader (_, _) | *) F.DoWhileTail (_, _)
175 | F.ForHeader (_, _)
176 | F.Return (_, _) | F.ReturnExpr (_, _)
177 (* no counter part in cocci *)
178 | F.Label (_, _)
179 | F.Case (_,_) | (* F.CaseRange (_, _) | *) F.Default (_, _)
180 | F.Goto (_, _) | F.Continue (_, _) | F.Break (_, _)
181 ) -> raise Impossible
182
183*)