You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
611 B
23 lines
611 B
package jode;
|
|
import sun.tools.java.Type;
|
|
|
|
/**
|
|
* ShiftOpcodes are special, because their second operand is an UIndex
|
|
*/
|
|
public class ShiftOperator extends BinaryOperator {
|
|
protected Type shiftType;
|
|
|
|
public ShiftOperator(Type type, int op) {
|
|
super(type, op);
|
|
shiftType = MyType.tUIndex;
|
|
}
|
|
|
|
public Type getOperandType(int i) {
|
|
return (i==0)?operandType:shiftType;
|
|
}
|
|
|
|
public void setOperandType(Type[] inputTypes) {
|
|
operandType = MyType.intersection(operandType, inputTypes[0]);
|
|
shiftType = MyType.intersection(shiftType, inputTypes[1]);
|
|
}
|
|
}
|
|
|