Release coccinelle-0.1.2
[bpt/coccinelle.git] / engine / transformation_c.ml
similarity index 94%
rename from engine/transformation3.ml
rename to engine/transformation_c.ml
index 84a3d33..ec3a2b0 100644 (file)
@@ -1,29 +1,21 @@
-(*
-* Copyright 2005-2008, Ecole des Mines de Nantes, University of Copenhagen
-* Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller
-* 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.
-*)
-
-
+(* Copyright (C) 2006, 2007 Yoann Padioleau
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License (GPL)
+ * version 2 as published by the Free Software Foundation.
+ * 
+ * This program 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
+ * file license.txt for more details.
+ * 
+ * This file was part of Coccinelle.
+ *)
 open Common
 
 module F = Control_flow_c
 
+module Flag = Flag_matcher
 (*****************************************************************************)
 (* The functor argument  *) 
 (*****************************************************************************)
@@ -100,7 +92,7 @@ module XTRANS = struct
   let value_format_flag f = fun tin -> 
     f (tin.extra.value_format_iso) tin
 
-  let mode = Cocci_vs_c_3.TransformMode
+  let mode = Cocci_vs_c.TransformMode
 
   (* ------------------------------------------------------------------------*)
   (* Exp  *) 
@@ -187,9 +179,12 @@ module XTRANS = struct
     let (oldmcode, oldenv) = !cocciinforef in
 
     let mck =
+      (* coccionly: 
       if !Flag_parsing_cocci.sgrep_mode
       then Sgrep.process_sgrep ib mck
-      else mck 
+      else 
+      *)
+        mck 
     in
     (match mck, Ast_c.pinfo_of_info ib with
     | _,                  Ast_c.AbstractLineTok _ -> raise Impossible
@@ -213,10 +208,13 @@ module XTRANS = struct
           ib
         end
         else 
+          (* coccionly: 
           if !Flag.sgrep_mode2
           then ib (* safe *)
           else 
-            begin
+          *)
+             begin
+            (* coccionly:
              Format.set_formatter_out_channel stderr;
               Common.pr2 "SP mcode ";
               Pretty_print_cocci.print_mcodekind oldmcode;
@@ -225,6 +223,7 @@ module XTRANS = struct
               Pretty_print_cocci.print_mcodekind mck;
               Format.print_newline();
               Format.print_flush();
+            *)
               failwith
                (Common.sprintf "%s: already tagged token:\n%s"
                   tin.extra.current_rule_name
@@ -460,7 +459,7 @@ module XTRANS = struct
          *)
 
         (*f () tin*)
-        if Cocci_vs_c_3.equal_metavarval value value' 
+        if Cocci_vs_c.equal_metavarval value value' 
         then f () tin
         else fail tin
 
@@ -478,7 +477,7 @@ end
 (*****************************************************************************)
 (* Entry point  *) 
 (*****************************************************************************)
-module TRANS  = Cocci_vs_c_3.COCCI_VS_C (XTRANS)
+module TRANS  = Cocci_vs_c.COCCI_VS_C (XTRANS)
 
 
 let transform_re_node a b tin =