BinaryType doesn't correlate the type anymore

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@303 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent ceda801601
commit b3e4eebdc1
  1. 36
      jode/jode/expr/BinaryOperator.java

@ -20,18 +20,14 @@
package jode.expr;
import jode.Type;
public class BinaryOperator extends Operator {
public class BinaryOperator extends SimpleOperator {
protected Type operandType;
public BinaryOperator(Type type, int op) {
super(type, op);
super(type, op, 2);
operandType = type;
}
public int getOperandCount() {
return 2;
}
public int getPriority() {
switch (operator) {
case 1: case 2:
@ -61,22 +57,22 @@ public class BinaryOperator extends Operator {
return getPriority() + i;
}
public Type getOperandType(int i) {
return operandType;
}
// public Type getOperandType(int i) {
// return operandType;
// }
public void setOperandType(Type[] inputTypes) {
operandType = operandType
.intersection(inputTypes[0]).intersection(inputTypes[1]);
type = operandType;
}
// public void setOperandType(Type[] inputTypes) {
// operandType = operandType
// .intersection(inputTypes[0]).intersection(inputTypes[1]);
// type = operandType;
// }
/**
* Sets the return type of this operator.
*/
public void setType(Type newType) {
type = operandType = operandType.intersection(newType);
}
// /**
// * Sets the return type of this operator.
// */
// public void setType(Type newType) {
// type = operandType = operandType.intersection(newType);
// }
public boolean equals(Object o) {
return (o instanceof BinaryOperator) &&

Loading…
Cancel
Save