Changes to allow unique names
[repair.git] / Repair / RepairCompiler / MCC / CLI.java
index afd51e6a386a02c05789ef14052ef7330fe05699..b8cce23e2c2b62857c1e25ab22ac50ac2be1c935 100755 (executable)
@@ -2,6 +2,7 @@ package MCC;
 
 import java.util.*;
 import MCC.IR.DebugItem;
+import MCC.IR.RepairGenerator;
 
 /**
  * A generic command-line interface for 6.035 compilers.  This class
@@ -11,7 +12,7 @@ import MCC.IR.DebugItem;
  * files.
  *
  * @author  le01, 6.035 Staff (<tt>6.035-staff@mit.edu</tt>)
- * @version <tt>$Id: CLI.java,v 1.15 2005/09/30 06:18:11 bdemsky Exp $</tt>
+ * @version <tt>$Id: CLI.java,v 1.20 2005/11/09 16:47:42 bdemsky Exp $</tt>
  */
 public class CLI {
     /**
@@ -103,13 +104,18 @@ public class CLI {
            System.out.println("-depth depthnum constraintnum -- generate dependency graph from constraintnum with depth of depthnum");
            System.out.println("-depthconj depthnum constraintnum conjunctionnum -- generate dependency graph from constraintnum with depth of depthnum");
            System.out.println("-instrument -- generate instrumentation code");
-           System.out.println("-aggressivesearch");
-           System.out.println("-prunequantifiernodes");
-           System.out.println("-cplusplus");
-           System.out.println("-time");
-           System.out.println("-omitcomp");
-           System.out.println("-mergenodes");
-           System.out.println("-debuggraph");
+           System.out.println("-aggressivesearch -- search for one repair per constraint");
+           System.out.println("-prunequantifiernodes -- prune nodes that satisfy constraint by decreasing scope");
+           System.out.println("-cplusplus -- properly set up c++ classes");
+           System.out.println("-time -- generate timing code");
+           System.out.println("-omitcomp -- omit compensation updates");
+           System.out.println("-mergenodes -- omit nodes for simpler role dependence graphs");
+           System.out.println("-debuggraph -- add edge labels and support to debug graph");
+           System.out.println("-rejectlengthchanges -- reject all updates which change the length of an array");
+           System.out.println("-printrepairs -- print log of repair actions");
+           System.out.println("-exactallocation -- application calls malloc for each struct and");
+           System.out.println("                    allocates exactly the right amount of space.");
+           System.out.println("-name -- set name");
            System.exit(-1);
        }
 
@@ -119,18 +125,24 @@ public class CLI {
                 debug = true;
            } else if (args[i].equals("-checkonly")) {
                 Compiler.REPAIR=false;
+           } else if (args[i].equals("-exactallocation")) {
+                Compiler.EXACTALLOCATION=true;
            } else if (args[i].equals("-omitcomp")) {
                 Compiler.OMITCOMP=true;
            } else if (args[i].equals("-debuggraph")) {
                 Compiler.DEBUGGRAPH=true;
            } else if (args[i].equals("-mergenodes")) {
                 Compiler.MERGENODES=true;
+           } else if (args[i].equals("-printrepairs")) {
+                Compiler.PRINTREPAIRS=true;
            } else if (args[i].equals("-depth")) {
                Compiler.debuggraphs.add(new DebugItem(Integer.parseInt(args[i+1]),Integer.parseInt(args[i+2])));
                i+=2;
            } else if (args[i].equals("-depthconj")) {
                Compiler.debuggraphs.add(new DebugItem(Integer.parseInt(args[i+1]),Integer.parseInt(args[i+2]),Integer.parseInt(args[i+3])));
                i+=3;
+            } else if (args[i].equals("-rejectlengthchanges")) {
+                Compiler.REJECTLENGTH=true;
            } else if (args[i].equals("-debug")) {
                 Compiler.GENERATEDEBUGHOOKS=true;
            } else if (args[i].equals("-time")) {
@@ -143,6 +155,10 @@ public class CLI {
                 Compiler.PRUNEQUANTIFIERS=true;
            } else if (args[i].equals("-cplusplus")) {
                 Compiler.ALLOCATECPLUSPLUS=true;
+           } else if (args[i].equals("-name")) {
+               i++;
+                RepairGenerator.name=args[i];
+               RepairGenerator.postfix=args[i];
             } else if (args[i].equals("-verbose") || args[i].equals("-v")) {
                 context = 0;
                 verbose++;