start of new file
[IRC.git] / Robust / src / IR / AssignOperation.java
index 2abd7c8e216d4c4e1fb0f449f438e164d5e8d89e..121c4d41c0c900ccfc7ffdb86fd066576b6ed12b 100644 (file)
@@ -13,6 +13,8 @@ public class AssignOperation {
     public static final int ANDEQ=10;
     public static final int XOREQ=11;
     public static final int OREQ=12;
+    public static final int POSTINC=13;
+    public static final int POSTDEC=14;
 
     private int operation;
     public AssignOperation(int op) {
@@ -23,6 +25,10 @@ public class AssignOperation {
        this.operation=parseOp(op);
     }
 
+    public int getOp() {
+       return operation;
+    }
+
     public Operation getBaseOp() {
        switch(operation) {
        case EQ:
@@ -41,12 +47,18 @@ public class AssignOperation {
            return new Operation(Operation.LEFTSHIFT);
        case RSHIFTEQ:
            return new Operation(Operation.RIGHTSHIFT);
+       case URSHIFTEQ:
+           return new Operation(Operation.URIGHTSHIFT);
        case ANDEQ:
            return new Operation(Operation.BIT_AND);
        case XOREQ:
            return new Operation(Operation.BIT_XOR);
        case OREQ:
            return new Operation(Operation.BIT_OR);
+       case POSTINC:
+           return new Operation(Operation.POSTINC);
+       case POSTDEC:
+           return new Operation(Operation.POSTDEC);
        }
        throw new Error();
     }
@@ -66,6 +78,8 @@ public class AssignOperation {
            return MINUSEQ;
        else if (st.equals("lshifteq"))
            return LSHIFTEQ;
+       else if (st.equals("urshifteq"))
+           return URSHIFTEQ;
        else if (st.equals("rshifteq"))
            return RSHIFTEQ;
        else if (st.equals("andeq"))
@@ -74,6 +88,10 @@ public class AssignOperation {
            return XOREQ;
        else if (st.equals("oreq"))
            return OREQ;
+       else if (st.equals("postinc"))
+           return POSTINC;
+       else if (st.equals("postdec"))
+           return POSTDEC;
        else throw new Error();
     }
 
@@ -94,12 +112,18 @@ public class AssignOperation {
            return "<=";
        else if (operation==RSHIFTEQ)
            return ">=";
+       else if (operation==RSHIFTEQ)
+           return ">>=";
        else if (operation==ANDEQ)
            return "&=";
        else if (operation==XOREQ)
            return "^=";
        else if (operation==OREQ)
            return "|=";
+       else if (operation==POSTINC)
+           return "postinc";
+       else if (operation==POSTDEC)
+           return "postdec";
        else throw new Error();
     }