|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The TypeSystem
defines the types of the language and
how they are related.
Method Summary | |
ParsedAnonClassType |
anonClassType(Job job)
|
ClassType |
ArithmeticException()
|
ArrayType |
arrayOf(Position pos,
Type type)
|
ArrayType |
arrayOf(Position pos,
Type type,
int dims)
|
ArrayType |
arrayOf(Type type)
Returns a type identical to |
ArrayType |
arrayOf(Type type,
int dims)
|
ClassType |
ArrayStoreException()
|
PrimitiveType |
Boolean()
|
PrimitiveType |
Byte()
|
PrimitiveType |
Char()
|
void |
checkAccessFlags(Flags f)
|
void |
checkConstructorFlags(Flags f)
|
void |
checkCycles(ReferenceType t)
|
void |
checkFieldFlags(Flags f)
|
void |
checkInitializerFlags(Flags f)
|
void |
checkLocalClassFlags(Flags f)
|
void |
checkLocalFlags(Flags f)
|
void |
checkMemberClassFlags(Flags f)
|
void |
checkMethodFlags(Flags f)
|
void |
checkTopLevelClassFlags(Flags f)
|
ClassType |
Class()
|
ClassType |
ClassCastException()
|
Resolver |
classContextResolver(ClassType ct)
Get a resolver for looking up a type in a class context. |
ClassType |
Cloneable()
|
Compiler |
compiler()
Return the compiler associated with this type system. |
ConstructorInstance |
constructorInstance(Position pos,
ClassType container,
Flags flags,
java.util.List argTypes,
java.util.List excTypes)
Create a constructor instance. |
Context |
createContext(ImportTable it)
|
java.util.List |
defaultPackageImports()
Return a list of the packages names that will be imported by default. |
boolean |
descendsFrom(Type child,
Type ancestor)
Returns true iff child is not ancestor, but child descends from ancestor. |
PrimitiveType |
Double()
|
ClassType |
Error()
|
ClassType |
Exception()
|
FieldInstance |
fieldInstance(Position pos,
ReferenceType container,
Flags flags,
Type type,
java.lang.String name)
Create a field instance. |
ConstructorInstance |
findConstructor(ClassType container,
java.util.List argTypes,
Context c)
Find a constructor. |
FieldInstance |
findField(ReferenceType container,
java.lang.String name,
Context c)
Returns the field named 'name' defined on 'type'. |
MemberClassType |
findMemberClass(ClassType container,
java.lang.String name,
Context c)
Find a member class. |
MethodInstance |
findMethod(ReferenceType container,
java.lang.String name,
java.util.List argTypes,
Context c)
Find a method. |
PrimitiveType |
Float()
|
ClassType |
forClass(java.lang.Class clazz)
Return a class type for the Class object. |
java.util.Set |
getTypeEncoderRootSet(Type clazz)
return the set of objects that should be serialized into the type information for the given ClassType. |
boolean |
hasSameArguments(ProcedureInstance m1,
ProcedureInstance m2)
Returns true iff |
void |
initialize(Compiler compiler)
Initialize the type system with the compiler. |
InitializerInstance |
initializerInstance(Position pos,
ClassType container,
Flags flags)
Create an initailizer instance. |
PrimitiveType |
Int()
|
java.util.List |
interfaces(ReferenceType type)
Returns an immutable list of all the interface types which type implements. |
boolean |
isAccessible(MemberInstance mi,
Context context)
Checks whether a method or field within target with access flags 'flags' can be accessed from Context context. |
boolean |
isAssignableSubtype(Type child,
Type ancestor)
Returns true iff child and ancestor are non-primitive types, and a variable of type child may be legally assigned to a variable of type ancestor. |
boolean |
isCanonical(Type type)
Returns true iff |
boolean |
isCastValid(Type fromType,
Type toType)
Requires: all type arguments are canonical. |
boolean |
isEnclosed(ClassType inner,
ClassType outer)
Returns whether inner is enclosed within outer |
boolean |
isImplicitCastValid(Type fromType,
Type toType)
Requires: all type arguments are canonical. |
boolean |
isSame(Type type1,
Type type2)
Requires: all type arguments are canonical. |
boolean |
isSubtype(Type child,
Type ancestor)
Returns true iff child descends from ancestor or child == ancestor. |
boolean |
isThrowable(Type type)
Requires: all type arguments are canonical. |
boolean |
isUncheckedException(Type type)
Returns a true iff the type or a supertype is in the list returned by uncheckedExceptions(). |
Type |
leastCommonAncestor(Type type1,
Type type2)
Requires: all type arguments are canonical. |
ParsedLocalClassType |
localClassType(Job job)
|
LocalInstance |
localInstance(Position pos,
Flags flags,
Type type,
java.lang.String name)
Create a local variable instance. |
PrimitiveType |
Long()
|
ParsedMemberClassType |
memberClassType(Job job)
|
MethodInstance |
methodInstance(Position pos,
ReferenceType container,
Flags flags,
Type returnType,
java.lang.String name,
java.util.List argTypes,
java.util.List excTypes)
Create a method instance. |
NullType |
Null()
|
ClassType |
NullPointerException()
|
boolean |
numericConversionValid(Type t,
long value)
Returns true if value can be implicitly cast to
Primitive type t . |
ClassType |
Object()
|
ClassType |
OutOfBoundsException()
|
Resolver |
packageContextResolver(Resolver resolver,
Package pkg)
Get a resolver for looking up a type in a package. |
Package |
packageForName(Package prefix,
java.lang.String name)
|
Package |
packageForName(java.lang.String name)
|
TypeObject |
placeHolder(TypeObject o)
|
TypeObject |
placeHolder(TypeObject o,
java.util.Set roots)
Get a place-holder for serializing a type object. |
PrimitiveType |
primitiveForName(java.lang.String name)
|
PrimitiveType |
promote(Type t)
Unary promotion for numeric types. |
PrimitiveType |
promote(Type t1,
Type t2)
Binary promotion for numeric types. |
ClassType |
RuntimeException()
|
ClassType |
Serializable()
|
PrimitiveType |
Short()
|
ClassType |
String()
|
Type |
superType(ReferenceType type)
Returns the immediate supertype of type, or null if type has no supertype. |
Resolver |
systemResolver()
Returns the system resolver. |
ClassType |
Throwable()
|
ParsedTopLevelClassType |
topLevelClassType(Job job)
|
java.lang.String |
translateArray(Context c,
ArrayType t)
|
java.lang.String |
translateLocalClass(Context c,
LocalClassType t)
|
java.lang.String |
translateMemberClass(Context c,
MemberClassType t)
|
java.lang.String |
translatePackage(Context c,
Package p)
|
java.lang.String |
translatePrimitive(Context c,
PrimitiveType t)
|
java.lang.String |
translateTopLevelClass(Context c,
TopLevelClassType t)
|
Type |
typeForClass(java.lang.Class clazz)
Returns a canonical type corresponding to the Java Class object class. |
java.util.Collection |
uncheckedExceptions()
Returns a collection of the Throwable types that need not be declared in method and constructor signatures. |
UnknownQualifier |
unknownQualifier(Position pos)
Get an unknown type qualifier. |
UnknownType |
unknownType(Position pos)
Get an unknown type. |
PrimitiveType |
Void()
|
java.lang.String |
wrapperTypeString(PrimitiveType t)
|
Method Detail |
public void initialize(Compiler compiler) throws SemanticException
public Compiler compiler()
public Resolver systemResolver()
public java.util.List defaultPackageImports()
public InitializerInstance initializerInstance(Position pos, ClassType container, Flags flags)
public ConstructorInstance constructorInstance(Position pos, ClassType container, Flags flags, java.util.List argTypes, java.util.List excTypes)
public MethodInstance methodInstance(Position pos, ReferenceType container, Flags flags, Type returnType, java.lang.String name, java.util.List argTypes, java.util.List excTypes)
public FieldInstance fieldInstance(Position pos, ReferenceType container, Flags flags, Type type, java.lang.String name)
public LocalInstance localInstance(Position pos, Flags flags, Type type, java.lang.String name)
public ClassType forClass(java.lang.Class clazz) throws SemanticException
public TypeObject placeHolder(TypeObject o, java.util.Set roots)
public TypeObject placeHolder(TypeObject o)
public UnknownType unknownType(Position pos)
public UnknownQualifier unknownQualifier(Position pos)
public boolean isSubtype(Type child, Type ancestor)
public boolean descendsFrom(Type child, Type ancestor)
public boolean isAssignableSubtype(Type child, Type ancestor)
public boolean isCastValid(Type fromType, Type toType)
public boolean isImplicitCastValid(Type fromType, Type toType)
public boolean isSame(Type type1, Type type2)
public boolean numericConversionValid(Type t, long value)
value
can be implicitly cast to
Primitive type t
.public Type leastCommonAncestor(Type type1, Type type2) throws SemanticException
public boolean isCanonical(Type type)
public boolean isAccessible(MemberInstance mi, Context context)
public boolean isEnclosed(ClassType inner, ClassType outer)
public boolean isThrowable(Type type)
public boolean isUncheckedException(Type type)
public java.util.Collection uncheckedExceptions()
public PrimitiveType promote(Type t) throws SemanticException
public PrimitiveType promote(Type t1, Type t2) throws SemanticException
public FieldInstance findField(ReferenceType container, java.lang.String name, Context c) throws SemanticException
public MethodInstance findMethod(ReferenceType container, java.lang.String name, java.util.List argTypes, Context c) throws SemanticException
public ConstructorInstance findConstructor(ClassType container, java.util.List argTypes, Context c) throws SemanticException
public MemberClassType findMemberClass(ClassType container, java.lang.String name, Context c) throws SemanticException
public Type superType(ReferenceType type)
public java.util.List interfaces(ReferenceType type)
public boolean hasSameArguments(ProcedureInstance m1, ProcedureInstance m2)
public NullType Null()
public PrimitiveType Void()
public PrimitiveType Boolean()
public PrimitiveType Char()
public PrimitiveType Byte()
public PrimitiveType Short()
public PrimitiveType Int()
public PrimitiveType Long()
public PrimitiveType Float()
public PrimitiveType Double()
public ClassType Object()
public ClassType String()
public ClassType Class()
public ClassType Throwable()
public ClassType Error()
public ClassType Exception()
public ClassType RuntimeException()
public ClassType Cloneable()
public ClassType Serializable()
public ClassType NullPointerException()
public ClassType ClassCastException()
public ClassType OutOfBoundsException()
public ClassType ArrayStoreException()
public ClassType ArithmeticException()
public ArrayType arrayOf(Type type)
public ArrayType arrayOf(Position pos, Type type)
public ArrayType arrayOf(Type type, int dims)
public ArrayType arrayOf(Position pos, Type type, int dims)
public Type typeForClass(java.lang.Class clazz) throws SemanticException
public Package packageForName(java.lang.String name)
public Package packageForName(Package prefix, java.lang.String name)
public Context createContext(ImportTable it)
public Resolver packageContextResolver(Resolver resolver, Package pkg)
public Resolver classContextResolver(ClassType ct)
public ParsedAnonClassType anonClassType(Job job)
public ParsedTopLevelClassType topLevelClassType(Job job)
public ParsedMemberClassType memberClassType(Job job)
public ParsedLocalClassType localClassType(Job job)
public java.util.Set getTypeEncoderRootSet(Type clazz)
public java.lang.String translatePackage(Context c, Package p)
public java.lang.String translatePrimitive(Context c, PrimitiveType t)
public java.lang.String translateArray(Context c, ArrayType t)
public java.lang.String translateTopLevelClass(Context c, TopLevelClassType t)
public java.lang.String translateMemberClass(Context c, MemberClassType t)
public java.lang.String translateLocalClass(Context c, LocalClassType t)
public java.lang.String wrapperTypeString(PrimitiveType t)
public PrimitiveType primitiveForName(java.lang.String name) throws SemanticException
public void checkMethodFlags(Flags f) throws SemanticException
public void checkLocalFlags(Flags f) throws SemanticException
public void checkFieldFlags(Flags f) throws SemanticException
public void checkConstructorFlags(Flags f) throws SemanticException
public void checkInitializerFlags(Flags f) throws SemanticException
public void checkTopLevelClassFlags(Flags f) throws SemanticException
public void checkMemberClassFlags(Flags f) throws SemanticException
public void checkLocalClassFlags(Flags f) throws SemanticException
public void checkAccessFlags(Flags f) throws SemanticException
public void checkCycles(ReferenceType t) throws SemanticException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |