Index: ChangeLog =================================================================== RCS file: /cvs/kawa/kawa/gnu/bytecode/ChangeLog,v retrieving revision 1.118 diff -u -r1.118 ChangeLog --- ChangeLog 2001/09/15 19:15:30 1.118 +++ ChangeLog 2001/09/17 03:35:14 @@ -1,3 +1,15 @@ +2001-08-07 Brian Jones + + * InnerClassesAttr.java (getClassNames): new method allows other + programs to get inner class names and their proper access string. + + * Variable.java (getOffset): new method allows program to determine + slot in LocalVariableTable. + * Variable.java (getStartPC): new method allows program to determine + the pc value for a variable. + * Variable.java (getEndPC): new method allows program to determine + the length of a variable + 2001-09-14 Per Bothner * ObjectType.java (promote): Convert nullType to pointer_type; Index: InnerClassesAttr.java =================================================================== RCS file: /cvs/kawa/kawa/gnu/bytecode/InnerClassesAttr.java,v retrieving revision 1.4 diff -u -r1.4 InnerClassesAttr.java --- InnerClassesAttr.java 1999/12/03 02:02:15 1.4 +++ InnerClassesAttr.java 2001/09/17 03:35:14 @@ -82,4 +82,21 @@ dst.println(); } } + + public String[][] getClassNames () + { + ClassType ctype = (ClassType) container; + ConstantPool constants = ctype.getConstants(); + String[][] val = new String[count][2]; + for (int i = 0; i < count; i++) + { + int index; + index = data[4*i] & 0xFFFF; // inner_class_info_index + CpoolClass centry = (CpoolClass)constants.getForced(index, ConstantPool.CLASS); + val[i][0] = centry.getStringName (); + + val[i][1] = Access.toString(data[4*i+3] & 0xFFFF); + } + return val; + } } Index: Variable.java =================================================================== RCS file: /cvs/kawa/kawa/gnu/bytecode/Variable.java,v retrieving revision 1.16 diff -u -r1.16 Variable.java --- Variable.java 2000/01/22 21:10:50 1.16 +++ Variable.java 2001/09/17 03:35:14 @@ -45,12 +45,19 @@ /** The local variable slot number used by this variable. * Not used (by the codegen layer) if !isSimple(). */ int offset = UNASSIGNED; + + public int getOffset () { return offset; } + /** Returns true iff assigned to a local variable slot. * Only relevant if isSimple (). */ public final boolean isAssigned () { return offset != UNASSIGNED; } int start_pc; int end_pc; + + public int getStartPC () { return start_pc; } + + public int getEndPC () { return end_pc; } final boolean dead () { return end_pc > 0; }