+(*
+ * Copyright 2005-2010, Ecole des Mines de Nantes, University of Copenhagen
+ * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
+ * This file is part of Coccinelle.
+ *
+ * Coccinelle is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, according to version 2 of the License.
+ *
+ * Coccinelle is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Coccinelle. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * The authors reserve the right to distribute this or future versions of
+ * Coccinelle under other licenses.
+ *)
+
+
open Common
(* When in a semantic patch there is f(X) ... f(X) we want to force
open Ast_c
-let rec (iso_e_e: expression -> expression -> bool) = fun a b ->
+let rec (iso_e_e: expression -> expression -> bool) = fun a b ->
raise Todo
(*
- let rec (=~=) a b =
+ let rec (=~=) a b =
match (a, b) with
| (Ident a, typa, iia), (Ident b, typb, iib) -> a = b
| (Constant a, typa, iia), (Constant b, typb, iib) -> a = b
- | (FunCall (ea, eas), typa, iia), (FunCall (eb, ebs), typb, iib) ->
+ | (FunCall (ea, eas), typa, iia), (FunCall (eb, ebs), typb, iib) ->
ea =~= eb &&
- List.length eas = List.length ebs &&
- List.for_all (fun (a, b) ->
+ List.length eas = List.length ebs &&
+ List.for_all (fun (a, b) ->
match (a, b) with
| (Left ea, iia), (Left eb, iib) -> ea =~= eb
| _ -> raise Todo
)
(zip eas ebs)
- | (Binary (ea1,Logical AndLog,ea2),typa, iia), (Binary (eb1,Logical AndLog, eb2), typb, iib) ->
- (ea1 =~= eb1 && ea2 =~= eb2)
+ | (Binary (ea1,Logical AndLog,ea2),typa, iia), (Binary (eb1,Logical AndLog, eb2), typb, iib) ->
+ (ea1 =~= eb1 && ea2 =~= eb2)
||
(ea1 =~= eb2 && ea2 =~= eb1)
a =~= b
*)
-and (iso_st_st: statement -> statement -> bool) = fun a b ->
+and (iso_st_st: statement -> statement -> bool) = fun a b ->
raise Todo
-and (iso_t_t: fullType -> fullType -> bool) = fun a b ->
+and (iso_t_t: fullType -> fullType -> bool) = fun a b ->
raise Todo
-
+
(*
-let _ = assert (iso_e_e
+let _ = assert (iso_e_e
(cexpression_of_string "a&&b")
(cexpression_of_string "b&&a")
*)