4 static public final int EXPR=0;
5 static public final int POSITION=1;
6 static public final int ABSTRACT=2;
14 public Updates(Expr lexpr, Expr rexpr, Opcode op) {
18 /* Get rid of everything but NE */
20 rightexpr=new OpExpr(Opcode.ADD,rexpr,new IntegerLiteralExpr(1));
21 } else if (op==Opcode.GE) {
23 } else if (op==Opcode.LT) {
24 rightexpr=new OpExpr(Opcode.SUB,rexpr,new IntegerLiteralExpr(1));
25 } else if (op==Opcode.LE) {
27 } else if (op==Opcode.EQ) {
29 } else if (op==Opcode.NE) {
35 if (leftexpr instanceof VarExpr)
40 Descriptor getDescriptor() {
42 return ((VarExpr)leftexpr).getVar();
43 } else if (isField()) {
44 return ((DotExpr)leftexpr).getField();
45 } else throw new Error("Unrecognized Update");
49 if (leftexpr instanceof DotExpr) {
50 assert ((DotExpr)leftexpr).getIndex()==null;
61 public Updates(Expr lexpr, Expr rexpr) {
68 public Updates(Expr lexpr, int rpos) {
71 type=Updates.POSITION;
74 public Updates(Expr lexpr,boolean negates) {
76 type=Updates.ABSTRACT;
81 public int getType() {
84 public Expr getLeftExpr() {
87 public int getRightPos() {
88 assert type==Updates.POSITION;
91 public Expr getRightExpr() {
92 assert type==Updates.EXPR;