Fixed lots of bugs with increment operations and +=/etc...
[IRC.git] / Robust / src / IR / Operation.java
index 3a4aebc6d92bed5840374c07d78d1c9ec0e064be..274c0414730d9d330a8a6ed73f231627880d47a9 100644 (file)
@@ -23,8 +23,11 @@ public class Operation {
     public static final int UNARYMINUS=20;
     public static final int POSTINC=21;
     public static final int POSTDEC=22;
-    public static final int PREINC=21;
-    public static final int PREDEC=22;
+    public static final int PREINC=23;
+    public static final int PREDEC=24;
+    public static final int LOGIC_NOT=25;
+    /* Flat Operations */
+    public static final int ASSIGN=100;
 
     private int operation;
     public Operation(int op) {
@@ -35,6 +38,10 @@ public class Operation {
        this.operation=parseOp(op);
     }
 
+    public int getOp() {
+       return operation;
+    }
+    
     public static int parseOp(String st) {
        if (st.equals("logical_or"))
            return LOGIC_OR;
@@ -84,6 +91,8 @@ public class Operation {
            return PREINC;
        else if (st.equals("predec"))
            return PREDEC;
+       else if (st.equals("not"))
+           return LOGIC_NOT;
        else
            throw new Error();
     }
@@ -93,6 +102,8 @@ public class Operation {
            return "||";
        else if (operation==LOGIC_AND)
            return "&&";
+       else if (operation==LOGIC_NOT)
+           return "not";
        else if (operation==BIT_OR)
            return "|";
        else if (operation==BIT_XOR)
@@ -137,6 +148,8 @@ public class Operation {
            return "preinc";
        else if (operation==PREDEC)
            return "predec";
+       else if (operation==ASSIGN)
+           return "assign";
        else throw new Error();
     }