Added Strongly Connected Component support into GraphNodes.
[repair.git] / Repair / RepairCompiler / MCC / Compiler.java
index ad98137f3611e38fa7e0f4e8e4db01d4bac5f307..05c60339cc176a91cfa1cfc4eaa4ffb7d4983dbe 100755 (executable)
@@ -17,7 +17,7 @@ import MCC.IR.*;
  */
 
 public class Compiler {
-    public static boolean REPAIR=false;
+    public static boolean REPAIR=true;
     
     public static void main(String[] args) {
         State state = null;
@@ -54,11 +54,12 @@ public class Compiler {
            success = parse(state) || error(state, "Parsing failed, not attempting semantic analysis.");
            success = semantics(state) || error(state, "Semantic analysis failed, not attempting variable initialization.");
 
-           /* Check partition constraints */
-           (new ImplicitSchema(state)).update();
 
+           Termination termination=null;
            if (REPAIR) {
-               Termination t=new Termination(state);
+               /* Check partition constraints */
+               (new ImplicitSchema(state)).update();
+               termination=new Termination(state);
            }
             state.printall();
             (new DependencyBuilder(state)).calculate();
@@ -85,13 +86,24 @@ public class Compiler {
             try {
                 FileOutputStream gcode = new FileOutputStream(cli.infile + ".cc");
 
+
                 // do model optimizations
                 //(new Optimizer(state)).optimize();
 
-                NaiveGenerator ng = new NaiveGenerator(state);
-                ng.generate(gcode);
-                //WorklistGenerator wg = new WorklistGenerator(state);
-                //wg.generate(gcode);
+
+               if(REPAIR) {
+                   FileOutputStream gcode2 = new FileOutputStream(cli.infile + "_aux.cc");
+                   FileOutputStream gcode3 = new FileOutputStream(cli.infile + "_aux.h");
+                   RepairGenerator wg = new RepairGenerator(state,termination);
+                   wg.generate(gcode,gcode2,gcode3, cli.infile + "_aux.h");
+                   gcode2.close();
+                   gcode3.close();
+               } else {
+                   WorklistGenerator ng = new WorklistGenerator(state);
+                   SetInclusion.worklist=true;
+                   RelationInclusion.worklist=true;
+                   ng.generate(gcode);
+               }
                 gcode.close();
             } catch (Exception e) {
                 e.printStackTrace();