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) {
this.operation=parseOp(op);
}
+ public int getOp() {
+ return operation;
+ }
+
public static int parseOp(String st) {
if (st.equals("logical_or"))
return LOGIC_OR;
return PREINC;
else if (st.equals("predec"))
return PREDEC;
+ else if (st.equals("not"))
+ return LOGIC_NOT;
else
throw new Error();
}
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)
return "preinc";
else if (operation==PREDEC)
return "predec";
+ else if (operation==ASSIGN)
+ return "assign";
else throw new Error();
}