Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

TypeExtractor Class Reference

Inheritance diagram for TypeExtractor:
[legend]
Collaboration diagram for TypeExtractor:
[legend]
List of all members.

Public Methods

 TypeExtractor (TransSystem system, SootClassManager classManager)
String arrayName (ArrayType sootArrayType)
void caseArrayType (ArrayType type)
void caseBooleanType (BooleanType type)
void caseByteType (ByteType type)
void caseIntType (IntType type)
void caseLongType (LongType type)
void caseRefType (RefType type)
void caseShortType (ShortType type)
void defaultCase (Type type)
edu ksu cis bandera bir Record getRecordType (SootClass sootClass)

Private Methods

void addFields (edu.ksu.cis.bandera.bir.Record rec, SootClass sootClass)
void createArrayType (ArrayType sootArrayType, int arrayLen)
edu ksu cis bandera bir Collection createCollectionType (edu.ksu.cis.bandera.bir.Type type, int size)
void createRecordType (SootClass sootClass, boolean isLocked)
void createRefType (ArrayType sootArrayType)
void createRefType (SootClass sootClass)
edu ksu cis bandera bir Array getArrayType (ArrayType sootArrayType)
Vector getInterfaceClasses (SootClass sootClass)
edu ksu cis bandera bir Ref getRefType (ArrayType sootArrayType)
edu ksu cis bandera bir Ref getRefType (SootClass sootClass)
Vector getSuperClasses (SootClass sootClass)

Private Attributes

TransSystem system
SootClassManager classManager
Hashtable refTypeTable = new Hashtable()
Hashtable recordTypeTable = new Hashtable()
Hashtable arrayTypeTable = new Hashtable()

Detailed Description

A Jimple type switch for extracting BIR types from Jimple types.

The TransSystem class is a factory for the BIR type classes. For Jimple primitive types, the extractor simply calls the appropriate constructor method in the factory. For Jimple reference types, the extractor maintains a mapping from the Jimple type to the BIR record, array, or reference type.

Definition at line 59 of file TypeExtractor.java.


Member Function Documentation

void TypeExtractor::addFields edu.ksu.cis.bandera.bir.Record   rec,
SootClass   sootClass
[inline, private]
 

Add the fields of a class to a BIR record.

Definition at line 82 of file TypeExtractor.java.

String TypeExtractor::arrayName ArrayType   sootArrayType [inline]
 

Construct name for array type by appending "_arr" to the base type name for each dimension (e.g., int [][] would be int_arr_arr).

Definition at line 109 of file TypeExtractor.java.

Referenced by Builder::createCollections().

void TypeExtractor::createArrayType ArrayType   sootArrayType,
int   arrayLen
[inline, private]
 

Declare BIR array type for a Soot array type.

Definition at line 148 of file TypeExtractor.java.

Referenced by Builder::createRecordAndArrayTypes().

edu ksu cis bandera bir Collection TypeExtractor::createCollectionType edu.ksu.cis.bandera.bir.Type   type,
int   size
[inline, private]
 

Create a collection type for a given BIR type and collection size.

Definition at line 166 of file TypeExtractor.java.

Referenced by Builder::createCollections().

void TypeExtractor::createRecordType SootClass   sootClass,
boolean   isLocked
[inline, private]
 

Declare a record type for a class C (name it C_rec).

Note: we flatten the implementation inheritance here by adding all fields from superclasses of C into C_rec.

It is important that the inherited fields of a subclass appear first and in the same order as they do in the superclass.

Definition at line 182 of file TypeExtractor.java.

Referenced by Builder::createRecordAndArrayTypes().

void TypeExtractor::createRefType SootClass   sootClass [inline, private]
 

Declare reference type for a class C (name it C_ref).

Definition at line 217 of file TypeExtractor.java.

void TypeExtractor::createRefType ArrayType   sootArrayType [inline, private]
 

Declare a reference type for an array type A (name it A_ref).

Definition at line 206 of file TypeExtractor.java.

Referenced by Builder::createRefTypes().

edu ksu cis bandera bir Array TypeExtractor::getArrayType ArrayType   sootArrayType [inline, private]
 

Get BIR array type for Soot array type.

Definition at line 240 of file TypeExtractor.java.

Referenced by Builder::createCollections().

Vector TypeExtractor::getInterfaceClasses SootClass   sootClass [inline, private]
 

Return the set of interfaces implemented by a class.

Note: need to look at all superclasses.

Definition at line 250 of file TypeExtractor.java.

Referenced by Builder::createCollections().

edu ksu cis bandera bir Record TypeExtractor::getRecordType SootClass   sootClass [inline]
 

Get BIR record type of class.

Definition at line 272 of file TypeExtractor.java.

Referenced by Builder::createCollections().

edu ksu cis bandera bir Ref TypeExtractor::getRefType SootClass   sootClass [inline, private]
 

Get the reference type for a class or array.

Definition at line 282 of file TypeExtractor.java.

Referenced by Builder::createCollections().

Vector TypeExtractor::getSuperClasses SootClass   sootClass [inline, private]
 

Return the set of super classes of a class.

Definition at line 289 of file TypeExtractor.java.

Referenced by Builder::createCollections().


Member Data Documentation

Hashtable TypeExtractor::refTypeTable = new Hashtable() [private]
 

These tables map Jimple types to BIR types.

Note that a single Jimple type (e.g., a SootClass C) may have multiple BIR types (e.g., C_rec and C_ref).

Definition at line 70 of file TypeExtractor.java.


The documentation for this class was generated from the following file:
Generated at Thu Feb 7 07:22:41 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001