Types moved to jode.type

dumpExpression


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@597 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent a270483b87
commit 67f9091be8
  1. 21
      jode/jode/expr/ArrayStoreOperator.java
  2. 11
      jode/jode/expr/BinaryOperator.java

@ -18,8 +18,9 @@
*/
package jode.expr;
import jode.Type;
import jode.ArrayType;
import jode.type.Type;
import jode.type.ArrayType;
import jode.decompiler.TabbedPrintWriter;
public class ArrayStoreOperator extends StoreInstruction {
Type indexType;
@ -42,13 +43,6 @@ public class ArrayStoreOperator extends StoreInstruction {
return 2;
}
public int getLValueOperandPriority(int i) {
if (i == 0)
return 950;
else
return 0;
}
public Type getLValueOperandType(int i) {
if (i == 0)
return Type.tArray(lvalueType);
@ -65,7 +59,12 @@ public class ArrayStoreOperator extends StoreInstruction {
lvalueType = ((ArrayType)arrayType).getElementType();
}
public String getLValueString(String[] operands) {
return operands[0]+"["+operands[1]+"]";
public void dumpLValue(TabbedPrintWriter writer,
Expression[] operands)
throws java.io.IOException {
operands[0].dumpExpression(writer, 950);
writer.print("[");
operands[1].dumpExpression(writer, 0);
writer.print("]");
}
}

@ -18,7 +18,8 @@
*/
package jode.expr;
import jode.Type;
import jode.type.Type;
import jode.decompiler.TabbedPrintWriter;
public class BinaryOperator extends SimpleOperator {
@ -68,7 +69,11 @@ public class BinaryOperator extends SimpleOperator {
((BinaryOperator)o).operator == operator;
}
public String toString(String[] operands) {
return operands[0] + getOperatorString() + operands[1];
public void dumpExpression(TabbedPrintWriter writer,
Expression[] operands)
throws java.io.IOException {
operands[0].dumpExpression(writer, getPriority());
writer.print(getOperatorString());
operands[1].dumpExpression(writer, getPriority()+1);
}
}

Loading…
Cancel
Save