1 19 20 package jode.expr; 21 import jode.type.Type; 22 import jode.type.ArrayType; 23 import jode.decompiler.TabbedPrintWriter; 24 25 public class ArrayStoreOperator extends ArrayLoadOperator 26 implements LValueExpression { 27 28 public ArrayStoreOperator(Type type) { 29 super(type); 30 } 31 32 public boolean matches(Operator loadop) { 33 return loadop instanceof ArrayLoadOperator; 34 } 35 36 public void dumpExpression(TabbedPrintWriter writer) 37 throws java.io.IOException { 38 Type arrType = subExpressions[0].getType().getHint(); 39 if (arrType instanceof ArrayType) { 40 Type elemType = ((ArrayType) arrType).getElementType(); 41 if (!elemType.isOfType(getType())) { 42 43 writer.print("("); 44 writer.startOp(writer.EXPL_PAREN, 1); 45 writer.print("("); 46 writer.printType(Type.tArray(getType().getHint())); 47 writer.print(") "); 48 writer.breakOp(); 49 subExpressions[0].dumpExpression(writer, 700); 50 writer.print(")"); 51 writer.breakOp(); 52 writer.print("["); 53 subExpressions[1].dumpExpression(writer, 0); 54 writer.print("]"); 55 return; 56 } 57 } 58 super.dumpExpression(writer); 59 } 60 } 61 | Popular Tags |