separated decompile packaged

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@142 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 241e7f4850
commit 5ae3e9508e
  1. 1
      jode/jode/bytecode/ClassInfo.java
  2. 8
      jode/jode/bytecode/Opcodes.java
  3. 2
      jode/jode/bytecode/SearchPath.java
  4. 1
      jode/jode/decompiler/ClassAnalyzer.java
  5. 1
      jode/jode/decompiler/CodeAnalyzer.java
  6. 2
      jode/jode/decompiler/FieldAnalyzer.java
  7. 1
      jode/jode/decompiler/ImportHandler.java
  8. 7
      jode/jode/decompiler/LocalInfo.java
  9. 3
      jode/jode/expr/ArrayLengthOperator.java
  10. 6
      jode/jode/expr/ArrayLoadOperator.java
  11. 4
      jode/jode/expr/ArrayStoreOperator.java
  12. 3
      jode/jode/expr/BinaryOperator.java
  13. 3
      jode/jode/expr/CheckCastOperator.java
  14. 3
      jode/jode/expr/CompareBinaryOperator.java
  15. 3
      jode/jode/expr/CompareToIntOperator.java
  16. 3
      jode/jode/expr/CompareUnaryOperator.java
  17. 6
      jode/jode/expr/ComplexExpression.java
  18. 3
      jode/jode/expr/ConstOperator.java
  19. 4
      jode/jode/expr/ConstantArrayOperator.java
  20. 4
      jode/jode/expr/ConstructorOperator.java
  21. 3
      jode/jode/expr/ConvertOperator.java
  22. 3
      jode/jode/expr/Expression.java
  23. 4
      jode/jode/expr/GetFieldOperator.java
  24. 6
      jode/jode/expr/IIncOperator.java
  25. 5
      jode/jode/expr/IfThenElseOperator.java
  26. 3
      jode/jode/expr/InstanceOfOperator.java
  27. 7
      jode/jode/expr/InvokeOperator.java
  28. 11
      jode/jode/expr/LocalLoadOperator.java
  29. 3
      jode/jode/expr/LocalPrePostFixOperator.java
  30. 4
      jode/jode/expr/LocalStoreOperator.java
  31. 4
      jode/jode/expr/LocalVarOperator.java
  32. 3
      jode/jode/expr/MonitorEnterOperator.java
  33. 3
      jode/jode/expr/MonitorExitOperator.java
  34. 4
      jode/jode/expr/NewArrayOperator.java
  35. 3
      jode/jode/expr/NewOperator.java
  36. 4
      jode/jode/expr/NoArgOperator.java
  37. 3
      jode/jode/expr/NopOperator.java
  38. 5
      jode/jode/expr/Operator.java
  39. 3
      jode/jode/expr/PopOperator.java
  40. 3
      jode/jode/expr/PrePostFixOperator.java
  41. 4
      jode/jode/expr/PutFieldOperator.java
  42. 3
      jode/jode/expr/ShiftOperator.java
  43. 3
      jode/jode/expr/SimpleOperator.java
  44. 5
      jode/jode/expr/StoreInstruction.java
  45. 3
      jode/jode/expr/StringAddOperator.java
  46. 3
      jode/jode/expr/UnaryOperator.java
  47. 2
      jode/jode/flow/CaseBlock.java
  48. 4
      jode/jode/flow/CombineIfGotoExpressions.java
  49. 6
      jode/jode/flow/CompleteSynchronized.java
  50. 4
      jode/jode/flow/ConditionalBlock.java
  51. 2
      jode/jode/flow/CreateAssignExpression.java
  52. 7
      jode/jode/flow/CreateConstantArray.java
  53. 5
      jode/jode/flow/CreateExpression.java
  54. 3
      jode/jode/flow/CreateForInitializer.java
  55. 7
      jode/jode/flow/CreateIfThenElseOperator.java
  56. 6
      jode/jode/flow/CreateNewConstructor.java
  57. 3
      jode/jode/flow/CreatePrePostIncExpression.java
  58. 1
      jode/jode/flow/FlowBlock.java
  59. 2
      jode/jode/flow/IfThenElseBlock.java
  60. 6
      jode/jode/flow/InstructionBlock.java
  61. 4
      jode/jode/flow/InstructionContainer.java
  62. 6
      jode/jode/flow/LoopBlock.java
  63. 3
      jode/jode/flow/RemoveEmpty.java
  64. 2
      jode/jode/flow/ReturnBlock.java
  65. 3
      jode/jode/flow/SwitchBlock.java
  66. 2
      jode/jode/flow/SynchronizedBlock.java
  67. 2
      jode/jode/flow/ThrowBlock.java
  68. 5
      jode/jode/flow/TransformConstructors.java
  69. 14
      jode/jode/flow/TransformExceptionHandlers.java
  70. 2
      jode/jode/type/MethodType.java

@ -17,7 +17,6 @@
* $Id$
*/
package jode.bytecode;
import jode.SearchPath;
import jode.MethodType;
import java.io.*;
import java.util.Hashtable;

@ -17,10 +17,14 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.CodeAnalyzer;
import jode.LocalInfo;
import jode.Type;
import jode.MethodType;
import jode.bytecode.ConstantPool;
import jode.flow.*;
import java.io.*;
import jode.bytecode.ConstantPool;
/**
* This is an abstract class which creates flow blocks for the

@ -16,7 +16,7 @@
*
* $Id$
*/
package jode;
package jode.bytecode;
import java.io.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

@ -23,6 +23,7 @@ import jode.bytecode.FieldInfo;
import jode.bytecode.MethodInfo;
import jode.bytecode.ConstantPool;
import jode.bytecode.ClassFormatException;
import jode.decompiler.Expression;
import jode.flow.TransformConstructors;
import java.lang.reflect.Modifier;

@ -22,6 +22,7 @@ import jode.bytecode.ClassInfo;
import jode.bytecode.ConstantPool;
import jode.bytecode.AttributeInfo;
import jode.bytecode.CodeInfo;
import jode.decompiler.Opcodes;
import jode.flow.FlowBlock;
import jode.flow.TransformExceptionHandlers;

@ -22,6 +22,8 @@ import java.lang.reflect.Modifier;
import jode.bytecode.FieldInfo;
import jode.bytecode.AttributeInfo;
import jode.bytecode.ClassFormatException;
import jode.decompiler.Expression;
import jode.decompiler.ConstOperator;
public class FieldAnalyzer implements Analyzer {
ClassAnalyzer clazz;

@ -20,6 +20,7 @@
package jode;
import java.util.*;
import jode.bytecode.ClassInfo;
import jode.bytecode.SearchPath;
public class JodeEnvironment {
Hashtable imports;

@ -20,6 +20,7 @@
package jode;
import java.util.Enumeration;
import java.util.Vector;
import jode.decompiler.LocalVarOperator;
/**
* The LocalInfo represents a local variable of a method.
@ -87,8 +88,7 @@ public class LocalInfo {
(LocalVarOperator) enum.nextElement();
if (needTypeUpdate) {
if (Decompiler.isTypeDebugging)
System.err.println("updating " + lvo + " in "
+ ((Expression)lvo).parent);
System.err.println("updating " + lvo);
lvo.updateType();
}
shadow.operators.addElement(lvo);
@ -191,8 +191,7 @@ public class LocalInfo {
while (enum.hasMoreElements()) {
LocalVarOperator lvo = (LocalVarOperator) enum.nextElement();
if (Decompiler.isTypeDebugging)
System.err.println("updating "+lvo+" in "
+ ((Expression)lvo).parent);
System.err.println("updating "+lvo);
lvo.updateType();
}
}

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class ArrayLengthOperator extends Operator {

@ -17,7 +17,9 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
import jode.ArrayType;
public class ArrayLoadOperator extends SimpleOperator {
String value;
@ -54,7 +56,7 @@ public class ArrayLoadOperator extends SimpleOperator {
type = type.intersection
(((ArrayType)operandTypes[0]).getElementType());
else
throw new AssertError("No Array type: "+operandTypes[0]);
throw new jode.AssertError("No Array type: "+operandTypes[0]);
}
public String toString(String[] operands) {

@ -17,7 +17,9 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
import jode.ArrayType;
public class ArrayStoreOperator extends StoreInstruction {
Type indexType;

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class BinaryOperator extends Operator {
protected Type operandType;

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class CheckCastOperator extends SimpleOperator {
Type castType;

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class CompareBinaryOperator extends SimpleOperator {
public CompareBinaryOperator(Type type, int op) {

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class CompareToIntOperator extends SimpleOperator {
public CompareToIntOperator(Type type, int lessGreater) {

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class CompareUnaryOperator extends SimpleOperator {
boolean objectType;

@ -17,7 +17,9 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Decompiler;
import jode.Type;
public class ComplexExpression extends Expression {
Operator operator;
@ -26,7 +28,7 @@ public class ComplexExpression extends Expression {
public ComplexExpression(Operator op, Expression[] sub) {
super(Type.tUnknown);
if (sub.length != op.getOperandCount())
throw new AssertError ("Operand count mismatch: "+
throw new jode.AssertError ("Operand count mismatch: "+
sub.length + " != " +
op.getOperandCount());
operator = op;

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class ConstOperator extends NoArgOperator {
String value;

@ -17,7 +17,9 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
import jode.ArrayType;
public class ConstantArrayOperator extends NoArgOperator {

@ -17,7 +17,9 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
import jode.MethodType;
public class ConstructorOperator extends Operator {
MethodType methodType;

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class ConvertOperator extends Operator {
Type from;

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public abstract class Expression {
protected Type type;

@ -17,7 +17,9 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
import jode.CodeAnalyzer;
public class GetFieldOperator extends Operator {
boolean staticFlag;

@ -17,7 +17,9 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
import jode.LocalInfo;
public class IIncOperator extends NoArgOperator
implements LocalVarOperator {
@ -62,7 +64,7 @@ implements LocalVarOperator {
*/
public void makeNonVoid() {
if (type != Type.tVoid)
throw new AssertError("already non void");
throw new jode.AssertError("already non void");
type = local.getType();
}

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class IfThenElseOperator extends SimpleOperator {
public IfThenElseOperator(Type type) {
@ -42,7 +43,7 @@ public class IfThenElseOperator extends SimpleOperator {
case 2:
return 200;
default:
throw new AssertError("ifthenelse with operand "+i);
throw new jode.AssertError("ifthenelse with operand "+i);
}
}

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class InstanceOfOperator extends SimpleOperator {

@ -17,7 +17,10 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.CodeAnalyzer;
import jode.MethodType;
import jode.Type;
import jode.bytecode.ClassInfo;
public final class InvokeOperator extends Operator {
@ -103,7 +106,7 @@ public final class InvokeOperator extends Operator {
* @XXX check, if its the first super class that implements the method.
*/
public boolean isSuperOrThis() {
return ((ClassInterfacesType)classType).getClazz().superClassOf
return ((jode.ClassInterfacesType)classType).getClazz().superClassOf
(codeAnalyzer.getClazz());
}

@ -17,7 +17,9 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
import jode.LocalInfo;
public class LocalLoadOperator extends ConstOperator
implements LocalVarOperator {
@ -42,17 +44,12 @@ implements LocalVarOperator {
return false;
}
// public void setLocalInfo(LocalInfo local) {
// local.setType(type);
// this.local = local;
// }
public LocalInfo getLocalInfo() {
return local.getLocalInfo();
}
public void updateType() {
if (Decompiler.isTypeDebugging)
if (jode.Decompiler.isTypeDebugging)
System.err.println("local "+local.getName()+" changed: "
+type+" to "+local.getType()
+" in "+parent);

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class LocalPrePostFixOperator extends NoArgOperator {
IIncOperator iinc;

@ -17,7 +17,9 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
import jode.LocalInfo;
public class LocalStoreOperator extends StoreInstruction
implements LocalVarOperator {

@ -17,7 +17,9 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
import jode.LocalInfo;
public interface LocalVarOperator {
public boolean isRead();

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class MonitorEnterOperator extends SimpleOperator {
public MonitorEnterOperator() {

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class MonitorExitOperator extends SimpleOperator {
public MonitorExitOperator() {

@ -17,7 +17,9 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
import jode.ArrayType;
public class NewArrayOperator extends SimpleOperator {
String baseTypeString;

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class NewOperator extends NoArgOperator {
public NewOperator(Type type) {

@ -17,7 +17,9 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
import jode.AssertError;
public abstract class NoArgOperator extends Operator {

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
/**
* A NopOperator takes one or zero arguments and returns it again. It

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public abstract class Operator extends Expression {
public final static int ADD_OP = 1;
@ -50,7 +51,7 @@ public abstract class Operator extends Expression {
super(type);
this.operator = op;
if (type == null)
throw new AssertError("type == null");
throw new jode.AssertError("type == null");
}
public Operator getOperator() {

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class PopOperator extends SimpleOperator {
int count;

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class PrePostFixOperator extends Operator {
StoreInstruction store;

@ -17,7 +17,9 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
import jode.CodeAnalyzer;
public class PutFieldOperator extends StoreInstruction {
CodeAnalyzer codeAnalyzer;

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
/**
* ShiftOpcodes are special, because their second operand is an UIndex

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public abstract class SimpleOperator extends Operator {
protected Type[] operandTypes;

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public abstract class StoreInstruction extends Operator {
@ -43,7 +44,7 @@ public abstract class StoreInstruction extends Operator {
*/
public void makeNonVoid() {
if (type != Type.tVoid)
throw new AssertError("already non void");
throw new jode.AssertError("already non void");
type = lvalueType;
if (parent != null && parent.getOperator() == this)
parent.type = lvalueType;

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class StringAddOperator extends SimpleOperator {
protected Type operandType;

@ -17,7 +17,8 @@
* $Id$
*/
package jode;
package jode.decompiler;
import jode.Type;
public class UnaryOperator extends SimpleOperator {
public UnaryOperator(Type type, int op) {

@ -17,7 +17,7 @@
* $Id$
*/
package jode.flow;
import jode.ConstOperator;
import jode.decompiler.ConstOperator;
/**
* This block represents a case instruction. A case instruction is a

@ -19,10 +19,8 @@
package jode.flow;
import java.util.Vector;
import jode.Expression;
import jode.ComplexExpression;
import jode.decompiler.*;
import jode.Type;
import jode.BinaryOperator;
public class CombineIfGotoExpressions {

@ -18,11 +18,7 @@
*/
package jode.flow;
import jode.MonitorEnterOperator;
import jode.ComplexExpression;
import jode.LocalLoadOperator;
import jode.LocalStoreOperator;
import jode.Expression;
import jode.decompiler.*;
public class CompleteSynchronized {

@ -16,9 +16,9 @@
* $Id$
*/
package jode.flow;
import jode.Expression;
import jode.LocalVarOperator;
import jode.TabbedPrintWriter;
import jode.decompiler.Expression;
import jode.decompiler.LocalVarOperator;
/**
* An ConditionalBlock is the structured block representing an if

@ -18,7 +18,7 @@
*/
package jode.flow;
import jode.*;
import jode.decompiler.*;
public class CreateAssignExpression {

@ -18,12 +18,7 @@
*/
package jode.flow;
import jode.Expression;
import jode.ComplexExpression;
import jode.ArrayStoreOperator;
import jode.NewArrayOperator;
import jode.ConstantArrayOperator;
import jode.ConstOperator;
import jode.decompiler.*;
import jode.Type;
public class CreateConstantArray {

@ -18,10 +18,7 @@
*/
package jode.flow;
import jode.Operator;
import jode.NopOperator;
import jode.Expression;
import jode.ComplexExpression;
import jode.decompiler.*;
/**
* This transformation creates expressions. It transforms

@ -18,8 +18,7 @@
*/
package jode.flow;
import jode.Expression;
import jode.StoreInstruction;
import jode.decompiler.*;
public class CreateForInitializer {

@ -19,11 +19,8 @@
package jode.flow;
import jode.Type;
import jode.Expression;
import jode.ConstOperator;
import jode.ComplexExpression;
import jode.IfThenElseOperator;
import jode.CompareUnaryOperator;
import jode.decompiler.*;
import java.util.Enumeration;
import java.util.Vector;

@ -18,11 +18,7 @@
*/
package jode.flow;
import jode.InvokeOperator;
import jode.Expression;
import jode.ComplexExpression;
import jode.ConstructorOperator;
import jode.NewOperator;
import jode.decompiler.*;
public class CreateNewConstructor {

@ -18,7 +18,8 @@
*/
package jode.flow;
import jode.*;
import jode.decompiler.*;
import jode.Type;
public class CreatePrePostIncExpression {

@ -20,6 +20,7 @@
package jode.flow;
import java.util.*;
import jode.*;
import jode.decompiler.Expression;
/**
* A flow block is the structure of which the flow graph consists. A

@ -16,8 +16,8 @@
* $Id$
*/
package jode.flow;
import jode.Expression;
import jode.TabbedPrintWriter;
import jode.decompiler.Expression;
/**
* An IfThenElseBlock is the structured block representing an if

@ -16,11 +16,11 @@
* $Id$
*/
package jode.flow;
import jode.Expression;
import jode.TabbedPrintWriter;
import jode.LocalInfo;
import jode.LocalStoreOperator;
import jode.ComplexExpression;
import jode.decompiler.ComplexExpression;
import jode.decompiler.Expression;
import jode.decompiler.LocalStoreOperator;
/**
* This is the structured block for atomic instructions.

@ -16,8 +16,8 @@
* $Id$
*/
package jode.flow;
import jode.Expression;
import jode.LocalVarOperator;
import jode.decompiler.Expression;
import jode.decompiler.LocalVarOperator;
/**
* This is a method for block containing a single instruction.

@ -19,11 +19,11 @@
package jode.flow;
import jode.TabbedPrintWriter;
import jode.Expression;
import jode.ConstOperator;
import jode.Type;
import jode.LocalInfo;
import jode.LocalStoreOperator;
import jode.decompiler.Expression;
import jode.decompiler.ConstOperator;
import jode.decompiler.LocalStoreOperator;
/**
* This is the structured block for an Loop block.

@ -18,8 +18,7 @@
*/
package jode.flow;
import jode.Expression;
import jode.NopOperator;
import jode.decompiler.*;
public class RemoveEmpty {

@ -19,7 +19,7 @@
package jode.flow;
import jode.TabbedPrintWriter;
import jode.Expression;
import jode.decompiler.Expression;
/**
* This is the structured block for an Return block.

@ -19,6 +19,7 @@
package jode.flow;
import jode.TabbedPrintWriter;
import jode.decompiler.Expression;
/**
* This is the structured block for an empty block.
@ -27,7 +28,7 @@ public class SwitchBlock extends InstructionContainer
implements BreakableBlock {
CaseBlock[] caseBlocks;
public SwitchBlock(jode.Expression instr,
public SwitchBlock(Expression instr,
int[] cases, int[] dests) {
super(instr);
this.caseBlocks = new CaseBlock[dests.length];

@ -17,9 +17,9 @@
* $Id$
*/
package jode.flow;
import jode.Expression;
import jode.LocalInfo;
import jode.TabbedPrintWriter;
import jode.decompiler.Expression;
/**
* This class represents a synchronized structured block.

@ -19,7 +19,7 @@
package jode.flow;
import jode.TabbedPrintWriter;
import jode.Expression;
import jode.decompiler.Expression;
/**
* This is the structured block for an Throw block.

@ -18,10 +18,7 @@
*/
package jode.flow;
import jode.ClassAnalyzer;
import jode.Expression;
import jode.ComplexExpression;
import jode.InvokeOperator;
import jode.PutFieldOperator;
import jode.decompiler.*;
/**
*

@ -20,13 +20,8 @@ package jode.flow;
import jode.AssertError;
import jode.Type;
import jode.LocalInfo;
import jode.ComplexExpression;
import jode.LocalStoreOperator;
import jode.NopOperator;
import jode.MonitorExitOperator;
import jode.LocalLoadOperator;
import jode.Expression;
import jode.PopOperator;
import jode.decompiler.*;
import java.util.Enumeration;
/**
@ -180,10 +175,9 @@ public class TransformExceptionHandlers {
local.setName("exception");
firstInstr.removeBlock();
} else if (instr instanceof jode.LocalStoreOperator) {
} else if (instr instanceof LocalStoreOperator) {
/* The exception is stored in a local variable */
local =
((jode.LocalStoreOperator) instr).getLocalInfo();
local = ((LocalStoreOperator) instr).getLocalInfo();
firstInstr.removeBlock();
}
}

@ -76,7 +76,7 @@ public class MethodType {
public boolean equals(Object o) {
MethodType mt;
return ((o instanceof InvokeOperator)
return (o instanceof MethodType
&& signature.equals((mt = (MethodType)o).signature)
&& staticFlag == mt.staticFlag);
}

Loading…
Cancel
Save