|
|
@ -21,11 +21,9 @@ package jode.expr; |
|
|
|
import jode.Type; |
|
|
|
import jode.Type; |
|
|
|
|
|
|
|
|
|
|
|
public class BinaryOperator extends SimpleOperator { |
|
|
|
public class BinaryOperator extends SimpleOperator { |
|
|
|
protected Type operandType; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public BinaryOperator(Type type, int op) { |
|
|
|
public BinaryOperator(Type type, int op) { |
|
|
|
super(type, op, 2); |
|
|
|
super(type, op, 2); |
|
|
|
operandType = type; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public int getPriority() { |
|
|
|
public int getPriority() { |
|
|
@ -57,22 +55,13 @@ public class BinaryOperator extends SimpleOperator { |
|
|
|
return getPriority() + i; |
|
|
|
return getPriority() + i; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// public Type getOperandType(int i) {
|
|
|
|
public Type getOperandType(int i) { |
|
|
|
// return operandType;
|
|
|
|
return type; |
|
|
|
// }
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// public void setOperandType(Type[] inputTypes) {
|
|
|
|
|
|
|
|
// operandType = operandType
|
|
|
|
|
|
|
|
// .intersection(inputTypes[0]).intersection(inputTypes[1]);
|
|
|
|
|
|
|
|
// type = operandType;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// /**
|
|
|
|
public void setOperandType(Type[] inputTypes) { |
|
|
|
// * Sets the return type of this operator.
|
|
|
|
setType(inputTypes[0].intersection(inputTypes[1])); |
|
|
|
// */
|
|
|
|
} |
|
|
|
// public void setType(Type newType) {
|
|
|
|
|
|
|
|
// type = operandType = operandType.intersection(newType);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean equals(Object o) { |
|
|
|
public boolean equals(Object o) { |
|
|
|
return (o instanceof BinaryOperator) && |
|
|
|
return (o instanceof BinaryOperator) && |
|
|
|