Package com.ibm.wala.classLoader
Interface Language
-
- All Known Subinterfaces:
BytecodeLanguage
- All Known Implementing Classes:
JavaLanguage
,LanguageImpl
public interface Language
Main interface for language-specific information. This interface helps build analyses which can operate over multiple languages.
-
-
Field Summary
Fields Modifier and Type Field Description static JavaLanguage
JAVA
The canonicalLanguage
implementation for Java
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TypeReference[]
getArrayInterfaces()
get the interfaces implemented by all arrays in the languageLanguage
getBaseLanguage()
If this language is "derived" from some other langauge, which one?TypeReference
getConstantType(Object o)
Given a Java constant o, return the appropriate language type to associate with the constant.Set<Language>
getDerivedLanguages()
Object
getMetadataToken(Object value)
Get the representation of the meta-data corresponding to value.Atom
getName()
What is the name of the language?TypeReference
getPointerType(TypeReference pointee)
PrimitiveType
getPrimitive(TypeReference reference)
get the abstraction of a primitive type to be used for type inferenceTypeReference
getRootType()
What is the root type in a type hierarchy for this language? e.g.TypeReference
getStringType()
TypeReference
getThrowableType()
What is the root type of exceptions in this language? e.g.Collection<TypeReference>
inferInvokeExceptions(MethodReference target, IClassHierarchy cha)
determine the set of possible exception types a call to target may throwSSAInstructionFactory
instructionFactory()
boolean
isBooleanType(TypeReference t)
boolean
isCharType(TypeReference t)
boolean
isDoubleType(TypeReference t)
boolean
isFloatType(TypeReference t)
boolean
isIntType(TypeReference t)
boolean
isLongType(TypeReference t)
boolean
isMetadataType(TypeReference t)
Is t a "metadata" type for the language, i.e., a type describing some other type (e.g., java.lang.Class for Java)?boolean
isNullType(TypeReference t)
Is t the type of the language's null value? Should return true ift == null
(?).boolean
isStringType(TypeReference t)
boolean
isVoidType(TypeReference t)
TypeName
lookupPrimitiveType(String name)
Given a source-level primitive type name, get the corresponding "low-level" type name, e.g., the corresponding character to use in a Java method descriptorvoid
registerDerivedLanguage(Language l)
Yuck? Languages are mutable?
-
-
-
Field Detail
-
JAVA
static final JavaLanguage JAVA
The canonicalLanguage
implementation for Java
-
-
Method Detail
-
getName
Atom getName()
What is the name of the language?
-
getBaseLanguage
Language getBaseLanguage()
If this language is "derived" from some other langauge, which one?
-
registerDerivedLanguage
void registerDerivedLanguage(Language l)
Yuck? Languages are mutable?
-
getRootType
TypeReference getRootType()
What is the root type in a type hierarchy for this language? e.g. java.lang.Object in Java.
-
getThrowableType
TypeReference getThrowableType()
What is the root type of exceptions in this language? e.g. java.lang.Throwable in Java
-
getConstantType
TypeReference getConstantType(Object o)
Given a Java constant o, return the appropriate language type to associate with the constant. Possible types for o can be language dependent, but typically include Boolean, String, Integer, Float, etc.
-
isNullType
boolean isNullType(TypeReference t)
Is t the type of the language's null value? Should return true ift == null
(?).
-
isIntType
boolean isIntType(TypeReference t)
-
isLongType
boolean isLongType(TypeReference t)
-
isVoidType
boolean isVoidType(TypeReference t)
-
isFloatType
boolean isFloatType(TypeReference t)
-
isDoubleType
boolean isDoubleType(TypeReference t)
-
isStringType
boolean isStringType(TypeReference t)
-
isMetadataType
boolean isMetadataType(TypeReference t)
Is t a "metadata" type for the language, i.e., a type describing some other type (e.g., java.lang.Class for Java)?
-
isCharType
boolean isCharType(TypeReference t)
-
isBooleanType
boolean isBooleanType(TypeReference t)
-
getMetadataToken
Object getMetadataToken(Object value)
Get the representation of the meta-data corresponding to value. For example, in Java, if value represents some type, the returned object should be the correspondingTypeReference
. The returned object should be appropriate for use as the token in anSSALoadMetadataInstruction
for the language
-
getArrayInterfaces
TypeReference[] getArrayInterfaces()
get the interfaces implemented by all arrays in the language
-
lookupPrimitiveType
TypeName lookupPrimitiveType(String name)
Given a source-level primitive type name, get the corresponding "low-level" type name, e.g., the corresponding character to use in a Java method descriptor
-
instructionFactory
SSAInstructionFactory instructionFactory()
-
inferInvokeExceptions
Collection<TypeReference> inferInvokeExceptions(MethodReference target, IClassHierarchy cha) throws InvalidClassFileException
determine the set of possible exception types a call to target may throw- Throws:
InvalidClassFileException
-
getStringType
TypeReference getStringType()
-
getPointerType
TypeReference getPointerType(TypeReference pointee)
-
getPrimitive
PrimitiveType getPrimitive(TypeReference reference)
get the abstraction of a primitive type to be used for type inference- See Also:
TypeInference
-
-