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

Loading…
Cancel
Save