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.
36 lines
762 B
36 lines
762 B
package jode;
|
|
import sun.tools.java.Type;
|
|
|
|
public class ConvertOperator extends Operator {
|
|
Type from;
|
|
|
|
public ConvertOperator(int addr, int length, Type from, Type to) {
|
|
super(addr,length, to, 0);
|
|
this.from = from;
|
|
}
|
|
|
|
public int getPriority() {
|
|
return 700;
|
|
}
|
|
|
|
public int getOperandPriority(int i) {
|
|
return 700;
|
|
}
|
|
|
|
public int getOperandCount() {
|
|
return 1;
|
|
}
|
|
|
|
public Type getOperandType(int i) {
|
|
return from;
|
|
}
|
|
|
|
public void setOperandType(Type[] inputTypes) {
|
|
from = UnknownType.commonType(from, inputTypes[0]);
|
|
}
|
|
|
|
public String toString(CodeAnalyzer ca, String[] operands)
|
|
{
|
|
return "("+ca.getTypeString(type)+") "+operands[0];
|
|
}
|
|
}
|
|
|