Package | Description |
---|---|
gov.nasa.jpf.jvm |
Modifier and Type | Class and Description |
---|---|
class |
ClassFileParser
a class parser that reads Java class file formats
This is actually more of an adapter between the Java specific ClassFile (which does the real parsing),
and the Java agnostic ClassInfo, which is only accessed through its initialization API since it resides
in another package
|
class |
ClassFilePrinter
simple tool to print contents of a classfile
<2do> use indentation level variable and formated output
|
class |
ClassFileReaderAdapter
adapter class implementing the ClassFileReader interface
|
class |
JVMAnnotationParser
parser that reads annotation classfiles and extracts default value entries
Java annotations form a different type system.
|
Modifier and Type | Method and Description |
---|---|
void |
ClassFile.parse(ClassFileReader reader)
this is the main parsing routine that uses the ClassFileReader interface
to tell clients about the classfile contents
ClassFile structure: http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#74353
u4 magic; // 0xcafebabe
u2 minor_version;
u2 major_version;
u2 constant_pool_count;
cp_entry constant_pool[constant_pool_count-1];
u2 access_flags;
u2 this_class;
u2 super_class;
u2 interfaces_count;
u2 interfaces[interfaces_count];
u2 fields_count;
field_info fields[fields_count];
u2 methods_count;
method_info methods[methods_count];
u2 attributes_count;
attribute_info attributes[attributes_count];
|
void |
ClassFile.parseAnnotationDefaultAttr(ClassFileReader reader,
Object tag)
AnnotationDefault_attribute {
u2 attribute_name_index;
u4 attribute_length;
element_value default_value; << pos
}
|
void |
ClassFile.parseAnnotationsAttr(ClassFileReader reader,
Object tag) |
protected void |
ClassFile.parseClassAttributes(ClassFileReader reader,
int attrCount) |
void |
ClassFile.parseCodeAttr(ClassFileReader reader,
Object tag)
(optionally) called by reader from within the setMethodAttribute() notification
This means we have recursive notification since this is a variable length
attribute that has variable length attributes
Code_attribute { u2 attr_name_index
|
protected void |
ClassFile.parseCodeAttrAttributes(ClassFileReader reader,
Object tag,
int attrCount) |
void |
ClassFile.parseConstValueAttr(ClassFileReader reader,
Object tag)
optionally called by reader to obtain a ConstantValue field attribute
ConstantValue {u2 attrName
|
void |
ClassFile.parseEnclosingMethodAttr(ClassFileReader reader,
Object tag)
EnclosingMethod_attribute {
u2 attribute_name_index;
u4 attribute_length;
u2 class_index -> Class_info { u1 tag; u2 name_index->utf8 }
u2 method_index -> NameAndType_info { u1 tag; u2 name_index->utf8; u2 descriptor_index->utf8 }
}
|
void |
ClassFile.parseExceptionAttr(ClassFileReader reader,
Object tag) |
protected void |
ClassFile.parseFieldAttributes(ClassFileReader reader,
int fieldIdx,
int attrCount) |
protected void |
ClassFile.parseFields(ClassFileReader reader,
int fieldCount) |
void |
ClassFile.parseInnerClassesAttr(ClassFileReader reader,
Object tag)
(optionally) called by ClassFileReader from within setClassAttribute() notification
InnerClass { u2 nameIdx
|
protected void |
ClassFile.parseInterfaces(ClassFileReader reader,
int ifcCount) |
void |
ClassFile.parseLineNumberTableAttr(ClassFileReader reader,
Object tag)
optionally called from ClassFileReader.setCodeAttribute() to parse LineNumberTables
LineNumberTable { u2 attrName; u4 attrLength;
u2 lineCount;
{ u2 startPc; u2 lineNumber; } [lineCount] };
pos is at lineCount
|
void |
ClassFile.parseLocalVarTableAttr(ClassFileReader reader,
Object tag)
optionally called from ClassFileReader.setCodeAttribute() to parse LocalVarTables
LocalVarTableTable { u2 attrName; u4 attrLength;
u2 localVarCount;
{ u2 startPc; u2 lineNumber; } [lineCount] };
pos is at localVarCount
|
protected void |
ClassFile.parseMethodAttributes(ClassFileReader reader,
int methodIdx,
int attrCount) |
protected void |
ClassFile.parseMethods(ClassFileReader reader,
int methodCount) |
void |
ClassFile.parseParameterAnnotationsAttr(ClassFileReader reader,
Object tag) |
void |
ClassFile.parseSignatureAttr(ClassFileReader reader,
Object tag)
Signature_attribute {
u2 attribute_name_index;
u4 attr-length;
u2 signature-index << pos
}
|
void |
ClassFile.parseSourceFileAttr(ClassFileReader reader,
Object tag)
(optionally) called by ClassFileReader from within setClassAttribute() notification
InnerClass { u2 nameIdx
|
void |
ClassFile.setAnnotationValuesDone(ClassFileReader reader,
Object tag,
int annotationIndex) |
void |
ClassFile.setSignature(ClassFileReader reader,
Object tag,
String signature) |