polyglot.ext.jl.types
Class TypeSystem_c

java.lang.Object
  extended by polyglot.ext.jl.types.TypeSystem_c
All Implemented Interfaces:
TypeSystem
Direct Known Subclasses:
PaoTypeSystem_c, ParamTypeSystem_c

public class TypeSystem_c
extends java.lang.Object
implements TypeSystem

TypeSystem_c Overview: A TypeSystem_c is a universe of types, including all Java types.


Nested Class Summary
protected  class TypeSystem_c.MostSpecificComparator
          Class to handle the comparisons; dispatches to moreSpecific method.
 
Field Summary
protected  Flags ACCESS_FLAGS
          All possible access flags.
protected  PrimitiveType BOOLEAN_
           
protected  PrimitiveType BYTE_
           
protected  PrimitiveType CHAR_
           
protected  ClassType CLASS_
           
protected  Flags CONSTRUCTOR_FLAGS
          All flags allowed for a constructor.
protected  LazyClassInitializer defaultClassInit
           
protected  PrimitiveType DOUBLE_
           
protected  Flags FIELD_FLAGS
          All flags allowed for a field.
protected  java.util.Map flagsForName
           
protected  PrimitiveType FLOAT_
           
protected  Flags INITIALIZER_FLAGS
          All flags allowed for an initializer block.
protected  PrimitiveType INT_
           
protected  LoadedClassResolver loadedResolver
           
protected  Flags LOCAL_CLASS_FLAGS
          All flags allowed for a local class.
protected  Flags LOCAL_FLAGS
          All flags allowed for a local variable.
protected  PrimitiveType LONG_
           
protected  Flags MEMBER_CLASS_FLAGS
          All flags allowed for a member class.
protected  Flags METHOD_FLAGS
          All flags allowed for a method.
protected  NullType NULL_
           
protected  ClassType OBJECT_
           
protected  TableResolver parsedResolver
           
protected  PrimitiveType SHORT_
           
protected  ClassType STRING_
           
protected  TopLevelResolver systemResolver
           
protected  ClassType THROWABLE_
           
protected  Flags TOP_LEVEL_CLASS_FLAGS
          All flags allowed for a top-level class.
protected  UnknownPackage unknownPackage
           
protected  UnknownQualifier unknownQualifier
           
protected  UnknownType unknownType
           
protected  PrimitiveType VOID_
           
 
Constructor Summary
TypeSystem_c()
           
 
Method Summary
 Flags Abstract()
           
protected  java.util.List abstractSuperInterfaces(ReferenceType rt)
          Utility method to gather all the superclasses and interfaces of ct that may contain abstract methods that must be implemented by ct.
protected  boolean accessibleFromPackage(Flags flags, Package pkg1, Package pkg2)
          Return true if a member (in an accessible container) or a top-level class with access flags flags in package pkg1 is accessible from package pkg2.
 ClassType ArithmeticException()
          java.lang.ArithmeticException
 ArrayType arrayOf(Position pos, Type type)
          Return an array of type
 ArrayType arrayOf(Position pos, Type type, int dims)
          Return a dims-array of type
 ArrayType arrayOf(Type type)
          Returns a type identical to , but with more array dimensions.
 ArrayType arrayOf(Type type, int dims)
          Return a dims-array of type
 ClassType ArrayStoreException()
          java.lang.ArrayStoreException
protected  ArrayType arrayType(Position pos, Type type)
          Factory method for ArrayTypes.
protected  void assert_(java.util.Collection l)
           
protected  void assert_(TypeObject o)
           
 PrimitiveType Boolean()
          boolean
 PrimitiveType Byte()
          byte
 boolean callValid(ProcedureInstance prototype, java.util.List argTypes)
          Return true if pi can be called with actual parameters of types actualTypes.
 boolean canCoerceToString(Type t, Context c)
          Returns true iff the type t can be coerced to a String in the given Context.
 boolean canOverride(MethodInstance mi, MethodInstance mj)
          Return true if mi can override mj.
 PrimitiveType Char()
          char
 void checkAccessFlags(Flags f)
          Assert if the flags f are legal access flags.
 void checkClassConformance(ClassType ct)
          Assert that ct implements all abstract methods required; that is, if it is a concrete class, then it must implement all interfaces and abstract methods that it or it's superclasses declare, and if it is an abstract class then any methods that it overrides are overridden correctly.
 void checkConstructorFlags(Flags f)
          Assert if the flags f are legal constructor flags.
 void checkCycles(ReferenceType goal)
          Assert that t has no cycles in the super type+nested class graph starting at t.
protected  void checkCycles(ReferenceType curr, ReferenceType goal)
           
 void checkFieldFlags(Flags f)
          Assert if the flags f are legal field flags.
 void checkInitializerFlags(Flags f)
          Assert if the flags f are legal initializer flags.
 void checkLocalClassFlags(Flags f)
          Assert if the flags f are legal local class flags.
 void checkLocalFlags(Flags f)
          Assert if the flags f are legal local variable flags.
 void checkMemberClassFlags(Flags f)
          Assert if the flags f are legal member class flags.
 void checkMethodFlags(Flags f)
          Assert if the flags f are legal method flags.
 void checkOverride(MethodInstance mi, MethodInstance mj)
          Throw a SemanticException if mi cannot override mj.
 void checkTopLevelClassFlags(Flags f)
          Assert if the flags f are legal top-level class flags.
 ClassType Class()
          java.lang.Class
protected  boolean classAccessible(ClassType targetClass, ClassType contextClass)
          True if the class targetClass accessible from the body of class contextClass.
 boolean classAccessible(ClassType targetClass, Context context)
          True if the class targetClass accessible from the context.
 boolean classAccessibleFromPackage(ClassType targetClass, Package pkg)
          True if the class targetClass accessible from the package pkg.
 ClassType ClassCastException()
          java.lang.ClassCastException
 Resolver classContextResolver(ClassType type)
          Get a resolver for looking up a type in a class context.
 ClassType Cloneable()
          java.lang.Cloneable
 ConstructorInstance constructorInstance(Position pos, ClassType container, Flags flags, java.util.List argTypes, java.util.List excTypes)
          Create a constructor instance.
 ParsedClassType createClassType()
          Create a new empty class.
 ParsedClassType createClassType(LazyClassInitializer init)
          Create a new empty class.
 ParsedClassType createClassType(LazyClassInitializer init, Source fromSource)
          Create a new empty class.
 ParsedClassType createClassType(Source fromSource)
          Create a new empty class.
 Context createContext()
          Create a new context object for looking up variables, types, etc.
 Flags createNewFlag(java.lang.String name, Flags after)
          Create a new unique Flags object.
protected  NullType createNull()
           
 Package createPackage(Package prefix, java.lang.String name)
          Return a package by name with the given outer package.
 Package createPackage(java.lang.String name)
          Return a package by name.
protected  PrimitiveType createPrimitive(PrimitiveType.Kind kind)
           
 LazyClassInitializer defaultClassInitializer()
          The default lazy class initializer.
 ConstructorInstance defaultConstructor(Position pos, ClassType container)
          Create a default constructor instance.
 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 and ancestor are distinct reference types, and child descends from ancestor.
 PrimitiveType Double()
          double
 boolean equals(TypeObject type1, TypeObject type2)
          Returns true iff type1 and type2 represent the same type object.
 ClassType Error()
          java.lang.Error
 ClassType Exception()
          java.lang.Exception
 FieldInstance fieldInstance(Position pos, ReferenceType container, Flags flags, Type type, java.lang.String name)
          Create a field instance.
 Flags Final()
           
protected  java.util.List findAcceptableConstructors(ClassType container, java.util.List argTypes, ClassType currClass)
          Populates the list acceptable with those MethodInstances which are Applicable and Accessible as defined by JLS 15.11.2.1
protected  java.util.List findAcceptableMethods(ReferenceType container, java.lang.String name, java.util.List argTypes, ClassType currClass)
          Populates the list acceptable with those MethodInstances which are Applicable and Accessible as defined by JLS 15.11.2.1
 ConstructorInstance findConstructor(ClassType container, java.util.List argTypes, ClassType currClass)
          Find a constructor.
 ConstructorInstance findConstructor(ClassType container, java.util.List argTypes, Context c)
          Deprecated.  
 FieldInstance findField(ReferenceType container, java.lang.String name)
          Returns the FieldInstance for the field name defined in type container or a supertype.
 FieldInstance findField(ReferenceType container, java.lang.String name, ClassType currClass)
          Returns the FieldInstance for the field name defined in type container or a supertype, and visible from currClass.
 FieldInstance findField(ReferenceType container, java.lang.String name, Context c)
          Deprecated.  
protected  java.util.Set findFields(ReferenceType container, java.lang.String name)
          Returns a set of fields named name defined in type container or a supertype.
 ClassType findMemberClass(ClassType container, java.lang.String name)
          Find a member class.
 ClassType findMemberClass(ClassType container, java.lang.String name, ClassType currClass)
          Find a member class.
 ClassType findMemberClass(ClassType container, java.lang.String name, Context c)
          Deprecated.  
 java.util.Set findMemberClasses(ClassType container, java.lang.String name)
           
 MethodInstance findMethod(ReferenceType container, java.lang.String name, java.util.List argTypes, ClassType currClass)
          Requires: all type arguments are canonical.
 MethodInstance findMethod(ReferenceType container, java.lang.String name, java.util.List argTypes, Context c)
          Deprecated.  
protected  java.util.Collection findMostSpecificProcedures(java.util.List acceptable, ReferenceType container, java.util.List argTypes, ClassType currClass)
           
protected  ProcedureInstance findProcedure(java.util.List acceptable, ReferenceType container, java.util.List argTypes, ClassType currClass)
           
 Flags flagsForBits(int bits)
          Given the JVM encoding of a set of flags, returns the Flags object for that encoding.
 Flags flagsForName(java.lang.String name)
           
 PrimitiveType Float()
          float
 Named forName(java.lang.String name)
          Get the named type object with the following name.
 java.lang.String getTransformedClassName(ClassType ct)
          Get the transformed class name of a class.
 java.util.Set getTypeEncoderRootSet(Type t)
          Return the set of objects that should be serialized into the type information for the given ClassType.
 boolean hasEnclosingInstance(ClassType inner, ClassType encl)
          Returns whether an object of the inner class inner has an enclosing instance of class encl.
 boolean hasFormals(ProcedureInstance pi, java.util.List formalTypes)
          Return true if t overrides mi
 boolean hasMethod(ReferenceType t, MethodInstance mi)
          Return true if t overrides mi
 boolean hasMethodNamed(ReferenceType container, java.lang.String name)
          Returns the list of methods with the given name defined or inherited into container, checking if the methods are accessible from the body of currClass
 java.util.List implemented(MethodInstance mi)
          Get the list of methods mi implements, in no specified order.
 ImportTable importTable(Package pkg)
          Create an import table for the source file.
 ImportTable importTable(java.lang.String sourceName, Package pkg)
          Create an import table for the source file.
protected  void initFlags()
           
 void initialize(LoadedClassResolver loadedResolver, ExtensionInfo extInfo)
          Initializes the type system and its internal constants (which depend on the resolver).
 InitializerInstance initializerInstance(Position pos, ClassType container, Flags flags)
          Create an initailizer instance.
protected  void initTypes()
           
 PrimitiveType Int()
          int
 Flags Interface()
           
 java.util.List interfaces(ReferenceType type)
          Returns an immutable list of all the interface types which type implements.
protected  boolean isAccessible(MemberInstance mi, ClassType contextClass)
          Checks whether the member mi can be accessed from code that is declared in the class contextClass.
 boolean isAccessible(MemberInstance mi, Context context)
          Checks whether the member mi can be accessed from Context "context".
 boolean isCanonical(Type type)
          Returns true iff is a canonical (fully qualified) type.
 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 isSameMethod(MethodInstance m1, MethodInstance m2)
          Returns true iff is the same method as
 boolean isSubtype(Type t1, Type t2)
          Returns true iff child descends from ancestor or child == ancestor.
 boolean isThrowable(Type type)
          Returns true iff an object of type may be thrown.
 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.
protected static java.lang.String listToString(java.util.List l)
           
protected  ClassType load(java.lang.String name)
           
 LoadedClassResolver loadedResolver()
          Return the type system's loaded resolver.
 LocalInstance localInstance(Position pos, Flags flags, Type type, java.lang.String name)
          Create a local variable instance.
 PrimitiveType Long()
          long
 boolean methodCallValid(MethodInstance prototype, java.lang.String name, java.util.List argTypes)
          Return true if mi can be called with name name and actual parameters of types actualTypes.
 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.
 boolean moreSpecific(ProcedureInstance p1, ProcedureInstance p2)
          Returns whether method 1 is more specific than method 2, where more specific is defined as JLS 15.11.2.2
 Flags Native()
           
 Flags NoFlags()
           
 NullType Null()
          The type of null.
 ClassType NullPointerException()
          java.lang.NullPointerException
 boolean numericConversionValid(Type t, long value)
          Returns true if value can be implicitly cast to Primitive type t.
 boolean numericConversionValid(Type t, java.lang.Object value)
          Returns true if value can be implicitly cast to Primitive type t.
 ClassType Object()
          java.lang.Object
 ClassType OutOfBoundsException()
          java.lang.ArrayIndexOutOfBoundsException
 java.util.List overrides(MethodInstance mi)
          Get the list of methods mi (potentially) overrides, in order from this class (that is, including this) to super classes.
 Resolver packageContextResolver(Resolver cr, Package p)
          Get a resolver for looking up a type in a package.
 boolean packageExists(java.lang.String name)
          Returns true if the package named name exists.
 Package packageForName(Package prefix, java.lang.String name)
          Return a package by name with the given outer package.
 Package packageForName(java.lang.String name)
          Return a package by name.
 TableResolver parsedResolver()
          Return the type system's table resolver.
 java.lang.Object placeHolder(TypeObject o)
          Get a place-holder for serializing a type object.
 java.lang.Object placeHolder(TypeObject o, java.util.Set roots)
          Get a place-holder for serializing a type object.
 PrimitiveType primitiveForName(java.lang.String name)
          Return the primitive with the given name.
 Flags Private()
           
 PrimitiveType promote(Type t)
          Unary promotion for numeric types.
 PrimitiveType promote(Type t1, Type t2)
          Binary promotion for numeric types.
protected  PrimitiveType promoteNumeric(PrimitiveType t)
           
protected  PrimitiveType promoteNumeric(PrimitiveType t1, PrimitiveType t2)
           
 Flags Protected()
           
 Flags Public()
           
 ClassType RuntimeException()
          java.lang.RuntimeException
 ClassType Serializable()
          java.io.Serializable
 PrimitiveType Short()
          short
 Flags Static()
           
 Type staticTarget(Type t)
          Returns t, modified as necessary to make it a legal static target.
 Flags StrictFP()
           
 ClassType String()
          java.lang.String
 Type superType(ReferenceType type)
          Returns the supertype of type, or null if type has no supertype.
 Flags Synchronized()
           
 TopLevelResolver systemResolver()
          Returns the system resolver.
 ClassType Throwable()
          java.lang.Throwable
 boolean throwsSubset(ProcedureInstance p1, ProcedureInstance p2)
          Returns true iff throws fewer exceptions than .
 java.lang.String toString()
           
 Flags Transient()
           
 java.lang.String translateArray(Resolver c, ArrayType t)
          Translate an array type.
 java.lang.String translateClass(Resolver c, ClassType t)
          Translate a top-level class type.
 java.lang.String translatePackage(Resolver c, Package p)
          Translate a package.
 java.lang.String translatePrimitive(Resolver c, PrimitiveType t)
          Translate a primitive type.
 Type typeForClass(java.lang.Class clazz)
          Returns a canonical type corresponding to the Java Class object theClass.
 Type typeForName(java.lang.String name)
          Get the type with the following name.
 java.util.Collection uncheckedExceptions()
          Returns a list of the Throwable types that need not be declared in method and constructor signatures.
 UnknownPackage unknownPackage(Position pos)
          Get an unknown package.
 UnknownQualifier unknownQualifier(Position pos)
          Get an unknown type qualifier.
 UnknownType unknownType(Position pos)
          Get an unknown type.
 PrimitiveType Void()
          void
 Flags Volatile()
           
 java.lang.String wrapperTypeString(PrimitiveType t)
          Return the boxed version of t.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

systemResolver

protected TopLevelResolver systemResolver

parsedResolver

protected TableResolver parsedResolver

loadedResolver

protected LoadedClassResolver loadedResolver

flagsForName

protected java.util.Map flagsForName

OBJECT_

protected ClassType OBJECT_

CLASS_

protected ClassType CLASS_

STRING_

protected ClassType STRING_

THROWABLE_

protected ClassType THROWABLE_

NULL_

protected final NullType NULL_

VOID_

protected final PrimitiveType VOID_

BOOLEAN_

protected final PrimitiveType BOOLEAN_

CHAR_

protected final PrimitiveType CHAR_

BYTE_

protected final PrimitiveType BYTE_

SHORT_

protected final PrimitiveType SHORT_

INT_

protected final PrimitiveType INT_

LONG_

protected final PrimitiveType LONG_

FLOAT_

protected final PrimitiveType FLOAT_

DOUBLE_

protected final PrimitiveType DOUBLE_

unknownType

protected UnknownType unknownType

unknownPackage

protected UnknownPackage unknownPackage

unknownQualifier

protected UnknownQualifier unknownQualifier

defaultClassInit

protected LazyClassInitializer defaultClassInit

ACCESS_FLAGS

protected final Flags ACCESS_FLAGS
All possible access flags.


LOCAL_FLAGS

protected final Flags LOCAL_FLAGS
All flags allowed for a local variable.


FIELD_FLAGS

protected final Flags FIELD_FLAGS
All flags allowed for a field.


CONSTRUCTOR_FLAGS

protected final Flags CONSTRUCTOR_FLAGS
All flags allowed for a constructor.


INITIALIZER_FLAGS

protected final Flags INITIALIZER_FLAGS
All flags allowed for an initializer block.


METHOD_FLAGS

protected final Flags METHOD_FLAGS
All flags allowed for a method.


TOP_LEVEL_CLASS_FLAGS

protected final Flags TOP_LEVEL_CLASS_FLAGS
All flags allowed for a top-level class.


MEMBER_CLASS_FLAGS

protected final Flags MEMBER_CLASS_FLAGS
All flags allowed for a member class.


LOCAL_CLASS_FLAGS

protected final Flags LOCAL_CLASS_FLAGS
All flags allowed for a local class.

Constructor Detail

TypeSystem_c

public TypeSystem_c()
Method Detail

initialize

public void initialize(LoadedClassResolver loadedResolver,
                       ExtensionInfo extInfo)
                throws SemanticException
Initializes the type system and its internal constants (which depend on the resolver).

Specified by:
initialize in interface TypeSystem
Parameters:
loadedResolver - The resolver to use for loading types from class files or other source files.
extInfo - The ExtensionInfo the TypeSystem is being created for.
Throws:
SemanticException

initTypes

protected void initTypes()
                  throws SemanticException
Throws:
SemanticException

systemResolver

public TopLevelResolver systemResolver()
Description copied from interface: TypeSystem
Returns the system resolver. This resolver can load top-level classes with fully qualified names from the class path and the source path.

Specified by:
systemResolver in interface TypeSystem

parsedResolver

public TableResolver parsedResolver()
Description copied from interface: TypeSystem
Return the type system's table resolver. This resolver contains types parsed from source files.

Specified by:
parsedResolver in interface TypeSystem

loadedResolver

public LoadedClassResolver loadedResolver()
Description copied from interface: TypeSystem
Return the type system's loaded resolver. This resolver contains types loaded from class files.

Specified by:
loadedResolver in interface TypeSystem

importTable

public ImportTable importTable(java.lang.String sourceName,
                               Package pkg)
Description copied from interface: TypeSystem
Create an import table for the source file.

Specified by:
importTable in interface TypeSystem
Parameters:
sourceName - Name of the source file to import into. This is used mainly for error messages and for debugging.
pkg - The package of the source file in which to import.

importTable

public ImportTable importTable(Package pkg)
Description copied from interface: TypeSystem
Create an import table for the source file.

Specified by:
importTable in interface TypeSystem
Parameters:
pkg - The package of the source file in which to import.

packageExists

public boolean packageExists(java.lang.String name)
Returns true if the package named name exists.

Specified by:
packageExists in interface TypeSystem

assert_

protected void assert_(java.util.Collection l)

assert_

protected void assert_(TypeObject o)

wrapperTypeString

public java.lang.String wrapperTypeString(PrimitiveType t)
Description copied from interface: TypeSystem
Return the boxed version of t.

Specified by:
wrapperTypeString in interface TypeSystem

createContext

public Context createContext()
Description copied from interface: TypeSystem
Create a new context object for looking up variables, types, etc.

Specified by:
createContext in interface TypeSystem

packageContextResolver

public Resolver packageContextResolver(Resolver cr,
                                       Package p)
Description copied from interface: TypeSystem
Get a resolver for looking up a type in a package.

Specified by:
packageContextResolver in interface TypeSystem

classContextResolver

public Resolver classContextResolver(ClassType type)
Description copied from interface: TypeSystem
Get a resolver for looking up a type in a class context.

Specified by:
classContextResolver in interface TypeSystem

fieldInstance

public FieldInstance fieldInstance(Position pos,
                                   ReferenceType container,
                                   Flags flags,
                                   Type type,
                                   java.lang.String name)
Description copied from interface: TypeSystem
Create a field instance.

Specified by:
fieldInstance in interface TypeSystem
Parameters:
pos - Position of the field.
container - Containing type of the field.
flags - The field's flags.
type - The field's type.
name - The field's name.

localInstance

public LocalInstance localInstance(Position pos,
                                   Flags flags,
                                   Type type,
                                   java.lang.String name)
Description copied from interface: TypeSystem
Create a local variable instance.

Specified by:
localInstance in interface TypeSystem
Parameters:
pos - Position of the local variable.
flags - The local variable's flags.
type - The local variable's type.
name - The local variable's name.

defaultConstructor

public ConstructorInstance defaultConstructor(Position pos,
                                              ClassType container)
Description copied from interface: TypeSystem
Create a default constructor instance.

Specified by:
defaultConstructor in interface TypeSystem
Parameters:
pos - Position of the constructor.
container - Containing class of the constructor.

constructorInstance

public ConstructorInstance constructorInstance(Position pos,
                                               ClassType container,
                                               Flags flags,
                                               java.util.List argTypes,
                                               java.util.List excTypes)
Description copied from interface: TypeSystem
Create a constructor instance.

Specified by:
constructorInstance in interface TypeSystem
Parameters:
pos - Position of the constructor.
container - Containing class of the constructor.
flags - The constructor's flags.
argTypes - The constructor's formal parameter types.
excTypes - The constructor's exception throw types.

initializerInstance

public InitializerInstance initializerInstance(Position pos,
                                               ClassType container,
                                               Flags flags)
Description copied from interface: TypeSystem
Create an initailizer instance.

Specified by:
initializerInstance in interface TypeSystem
Parameters:
pos - Position of the initializer.
container - Containing class of the initializer.
flags - The initializer's flags.

methodInstance

public MethodInstance methodInstance(Position pos,
                                     ReferenceType container,
                                     Flags flags,
                                     Type returnType,
                                     java.lang.String name,
                                     java.util.List argTypes,
                                     java.util.List excTypes)
Description copied from interface: TypeSystem
Create a method instance.

Specified by:
methodInstance in interface TypeSystem
Parameters:
pos - Position of the method.
container - Containing type of the method.
flags - The method's flags.
returnType - The method's return type.
name - The method's name.
argTypes - The method's formal parameter types.
excTypes - The method's exception throw types.

descendsFrom

public boolean descendsFrom(Type child,
                            Type ancestor)
Returns true iff child and ancestor are distinct reference types, and child descends from ancestor.

Specified by:
descendsFrom in interface TypeSystem

isCastValid

public boolean isCastValid(Type fromType,
                           Type toType)
Requires: all type arguments are canonical. ToType is not a NullType. Returns true iff a cast from fromType to toType is valid; in other words, some non-null members of fromType are also members of toType.

Specified by:
isCastValid in interface TypeSystem

isImplicitCastValid

public boolean isImplicitCastValid(Type fromType,
                                   Type toType)
Requires: all type arguments are canonical. Returns true iff an implicit cast from fromType to toType is valid; in other words, every member of fromType is member of toType. 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.

Specified by:
isImplicitCastValid in interface TypeSystem

equals

public boolean equals(TypeObject type1,
                      TypeObject type2)
Returns true iff type1 and type2 represent the same type object.

Specified by:
equals in interface TypeSystem

numericConversionValid

public boolean numericConversionValid(Type t,
                                      java.lang.Object value)
Returns true if value can be implicitly cast to Primitive type t.

Specified by:
numericConversionValid in interface TypeSystem

numericConversionValid

public boolean numericConversionValid(Type t,
                                      long value)
Returns true if value can be implicitly cast to Primitive type t. This method should be removed. It is kept for backward compatibility.

Specified by:
numericConversionValid in interface TypeSystem

isCanonical

public boolean isCanonical(Type type)
Returns true iff is a canonical (fully qualified) type.

Specified by:
isCanonical in interface TypeSystem

isAccessible

public boolean isAccessible(MemberInstance mi,
                            Context context)
Checks whether the member mi can be accessed from Context "context".

Specified by:
isAccessible in interface TypeSystem

isAccessible

protected boolean isAccessible(MemberInstance mi,
                               ClassType contextClass)
Checks whether the member mi can be accessed from code that is declared in the class contextClass.


classAccessible

public boolean classAccessible(ClassType targetClass,
                               Context context)
True if the class targetClass accessible from the context.

Specified by:
classAccessible in interface TypeSystem

classAccessible

protected boolean classAccessible(ClassType targetClass,
                                  ClassType contextClass)
True if the class targetClass accessible from the body of class contextClass.


classAccessibleFromPackage

public boolean classAccessibleFromPackage(ClassType targetClass,
                                          Package pkg)
True if the class targetClass accessible from the package pkg.

Specified by:
classAccessibleFromPackage in interface TypeSystem

accessibleFromPackage

protected boolean accessibleFromPackage(Flags flags,
                                        Package pkg1,
                                        Package pkg2)
Return true if a member (in an accessible container) or a top-level class with access flags flags in package pkg1 is accessible from package pkg2.


isEnclosed

public boolean isEnclosed(ClassType inner,
                          ClassType outer)
Description copied from interface: TypeSystem
Returns whether inner is enclosed within outer

Specified by:
isEnclosed in interface TypeSystem

hasEnclosingInstance

public boolean hasEnclosingInstance(ClassType inner,
                                    ClassType encl)
Description copied from interface: TypeSystem
Returns whether an object of the inner class inner has an enclosing instance of class encl.

Specified by:
hasEnclosingInstance in interface TypeSystem

checkCycles

public void checkCycles(ReferenceType goal)
                 throws SemanticException
Description copied from interface: TypeSystem
Assert that t has no cycles in the super type+nested class graph starting at t.

Specified by:
checkCycles in interface TypeSystem
Throws:
SemanticException

checkCycles

protected void checkCycles(ReferenceType curr,
                           ReferenceType goal)
                    throws SemanticException
Throws:
SemanticException

canCoerceToString

public boolean canCoerceToString(Type t,
                                 Context c)
Returns true iff the type t can be coerced to a String in the given Context. If a type can be coerced to a String then it can be concatenated with Strings, e.g. if o is of type T, then the code snippet "" + o would be allowed.

Specified by:
canCoerceToString in interface TypeSystem

isThrowable

public boolean isThrowable(Type type)
Returns true iff an object of type may be thrown.

Specified by:
isThrowable in interface TypeSystem

isUncheckedException

public boolean isUncheckedException(Type type)
Returns a true iff the type or a supertype is in the list returned by uncheckedExceptions().

Specified by:
isUncheckedException in interface TypeSystem

uncheckedExceptions

public java.util.Collection uncheckedExceptions()
Returns a list of the Throwable types that need not be declared in method and constructor signatures.

Specified by:
uncheckedExceptions in interface TypeSystem

isSubtype

public boolean isSubtype(Type t1,
                         Type t2)
Description copied from interface: TypeSystem
Returns true iff child descends from ancestor or child == ancestor. This is equivalent to:
    descendsFrom(child, ancestor) || equals(child, ancestor)
 

Specified by:
isSubtype in interface TypeSystem

findField

public FieldInstance findField(ReferenceType container,
                               java.lang.String name,
                               Context c)
                        throws SemanticException
Deprecated. 

Description copied from interface: TypeSystem
Deprecated version of the findField method.

Specified by:
findField in interface TypeSystem
Throws:
SemanticException

findField

public FieldInstance findField(ReferenceType container,
                               java.lang.String name,
                               ClassType currClass)
                        throws SemanticException
Returns the FieldInstance for the field name defined in type container or a supertype, and visible from currClass. If no such field is found, a SemanticException is thrown. currClass may be null.

Specified by:
findField in interface TypeSystem
Throws:
SemanticException - if the field cannot be found or is inaccessible.

findField

public FieldInstance findField(ReferenceType container,
                               java.lang.String name)
                        throws SemanticException
Returns the FieldInstance for the field name defined in type container or a supertype. If no such field is found, a SemanticException is thrown.

Specified by:
findField in interface TypeSystem
Throws:
SemanticException - if the field cannot be found or is inaccessible.

findFields

protected java.util.Set findFields(ReferenceType container,
                                   java.lang.String name)
Returns a set of fields named name defined in type container or a supertype. The list returned may be empty.


findMemberClass

public ClassType findMemberClass(ClassType container,
                                 java.lang.String name,
                                 Context c)
                          throws SemanticException
Deprecated. 

Description copied from interface: TypeSystem
Deprecated version of the findMemberClass method.

Specified by:
findMemberClass in interface TypeSystem
Throws:
SemanticException

findMemberClass

public ClassType findMemberClass(ClassType container,
                                 java.lang.String name,
                                 ClassType currClass)
                          throws SemanticException
Description copied from interface: TypeSystem
Find a member class. We check if the field is accessible from the class currClass.

Specified by:
findMemberClass in interface TypeSystem
Throws:
SemanticException - if the class cannot be found or is inaccessible.

findMemberClasses

public java.util.Set findMemberClasses(ClassType container,
                                       java.lang.String name)
                                throws SemanticException
Throws:
SemanticException

findMemberClass

public ClassType findMemberClass(ClassType container,
                                 java.lang.String name)
                          throws SemanticException
Description copied from interface: TypeSystem
Find a member class.

Specified by:
findMemberClass in interface TypeSystem
Throws:
SemanticException - if the class cannot be found or is inaccessible.

listToString

protected static java.lang.String listToString(java.util.List l)

findMethod

public MethodInstance findMethod(ReferenceType container,
                                 java.lang.String name,
                                 java.util.List argTypes,
                                 Context c)
                          throws SemanticException
Deprecated. 

Description copied from interface: TypeSystem
Deprecated version of the findMethod method.

Specified by:
findMethod in interface TypeSystem
Throws:
SemanticException

hasMethodNamed

public boolean hasMethodNamed(ReferenceType container,
                              java.lang.String name)
Returns the list of methods with the given name defined or inherited into container, checking if the methods are accessible from the body of currClass

Specified by:
hasMethodNamed in interface TypeSystem

findMethod

public MethodInstance findMethod(ReferenceType container,
                                 java.lang.String name,
                                 java.util.List argTypes,
                                 ClassType currClass)
                          throws SemanticException
Requires: all type arguments are canonical. Returns the MethodInstance named 'name' defined on 'type' visible in context. If no such field may be found, returns a fieldmatch with an error explaining why. Access flags are considered.

Specified by:
findMethod in interface TypeSystem
Throws:
SemanticException - if the method cannot be found or is inaccessible.

findConstructor

public ConstructorInstance findConstructor(ClassType container,
                                           java.util.List argTypes,
                                           Context c)
                                    throws SemanticException
Deprecated. 

Description copied from interface: TypeSystem
Deprecated version of the findConstructor method.

Specified by:
findConstructor in interface TypeSystem
Throws:
SemanticException

findConstructor

public ConstructorInstance findConstructor(ClassType container,
                                           java.util.List argTypes,
                                           ClassType currClass)
                                    throws SemanticException
Description copied from interface: TypeSystem
Find a constructor. We need to pass the class from which the constructor is being found because the constructor we find depends on whether the constructor is accessible from that class.

Specified by:
findConstructor in interface TypeSystem
Throws:
SemanticException - if the constructor cannot be found or is inaccessible.

findProcedure

protected ProcedureInstance findProcedure(java.util.List acceptable,
                                          ReferenceType container,
                                          java.util.List argTypes,
                                          ClassType currClass)
                                   throws SemanticException
Throws:
SemanticException

findMostSpecificProcedures

protected java.util.Collection findMostSpecificProcedures(java.util.List acceptable,
                                                          ReferenceType container,
                                                          java.util.List argTypes,
                                                          ClassType currClass)
                                                   throws SemanticException
Throws:
SemanticException

findAcceptableMethods

protected java.util.List findAcceptableMethods(ReferenceType container,
                                               java.lang.String name,
                                               java.util.List argTypes,
                                               ClassType currClass)
                                        throws SemanticException
Populates the list acceptable with those MethodInstances which are Applicable and Accessible as defined by JLS 15.11.2.1

Throws:
SemanticException

findAcceptableConstructors

protected java.util.List findAcceptableConstructors(ClassType container,
                                                    java.util.List argTypes,
                                                    ClassType currClass)
                                             throws SemanticException
Populates the list acceptable with those MethodInstances which are Applicable and Accessible as defined by JLS 15.11.2.1

Throws:
SemanticException

moreSpecific

public boolean moreSpecific(ProcedureInstance p1,
                            ProcedureInstance p2)
Returns whether method 1 is more specific than method 2, where more specific is defined as JLS 15.11.2.2

Specified by:
moreSpecific in interface TypeSystem

superType

public Type superType(ReferenceType type)
Returns the supertype of type, or null if type has no supertype.

Specified by:
superType in interface TypeSystem

interfaces

public java.util.List interfaces(ReferenceType type)
Returns an immutable list of all the interface types which type implements.

Specified by:
interfaces in interface TypeSystem

leastCommonAncestor

public Type leastCommonAncestor(Type type1,
                                Type type2)
                         throws SemanticException
Requires: all type arguments are canonical. Returns the least common ancestor of Type1 and Type2

Specified by:
leastCommonAncestor in interface TypeSystem
Throws:
SemanticException - if the LCA does not exist

throwsSubset

public boolean throwsSubset(ProcedureInstance p1,
                            ProcedureInstance p2)
Returns true iff throws fewer exceptions than .

Specified by:
throwsSubset in interface TypeSystem

hasFormals

public boolean hasFormals(ProcedureInstance pi,
                          java.util.List formalTypes)
Return true if t overrides mi

Specified by:
hasFormals in interface TypeSystem

hasMethod

public boolean hasMethod(ReferenceType t,
                         MethodInstance mi)
Return true if t overrides mi

Specified by:
hasMethod in interface TypeSystem

overrides

public java.util.List overrides(MethodInstance mi)
Description copied from interface: TypeSystem
Get the list of methods mi (potentially) overrides, in order from this class (that is, including this) to super classes.

Specified by:
overrides in interface TypeSystem

implemented

public java.util.List implemented(MethodInstance mi)
Description copied from interface: TypeSystem
Get the list of methods mi implements, in no specified order.

Specified by:
implemented in interface TypeSystem

canOverride

public boolean canOverride(MethodInstance mi,
                           MethodInstance mj)
Description copied from interface: TypeSystem
Return true if mi can override mj.

Specified by:
canOverride in interface TypeSystem

checkOverride

public void checkOverride(MethodInstance mi,
                          MethodInstance mj)
                   throws SemanticException
Description copied from interface: TypeSystem
Throw a SemanticException if mi cannot override mj.

Specified by:
checkOverride in interface TypeSystem
Throws:
SemanticException

isSameMethod

public boolean isSameMethod(MethodInstance m1,
                            MethodInstance m2)
Returns true iff is the same method as

Specified by:
isSameMethod in interface TypeSystem

methodCallValid

public boolean methodCallValid(MethodInstance prototype,
                               java.lang.String name,
                               java.util.List argTypes)
Description copied from interface: TypeSystem
Return true if mi can be called with name name and actual parameters of types actualTypes.

Specified by:
methodCallValid in interface TypeSystem

callValid

public boolean callValid(ProcedureInstance prototype,
                         java.util.List argTypes)
Description copied from interface: TypeSystem
Return true if pi can be called with actual parameters of types actualTypes.

Specified by:
callValid in interface TypeSystem

Null

public NullType Null()
Description copied from interface: TypeSystem
The type of null.

Specified by:
Null in interface TypeSystem

Void

public PrimitiveType Void()
Description copied from interface: TypeSystem
void

Specified by:
Void in interface TypeSystem

Boolean

public PrimitiveType Boolean()
Description copied from interface: TypeSystem
boolean

Specified by:
Boolean in interface TypeSystem

Char

public PrimitiveType Char()
Description copied from interface: TypeSystem
char

Specified by:
Char in interface TypeSystem

Byte

public PrimitiveType Byte()
Description copied from interface: TypeSystem
byte

Specified by:
Byte in interface TypeSystem

Short

public PrimitiveType Short()
Description copied from interface: TypeSystem
short

Specified by:
Short in interface TypeSystem

Int

public PrimitiveType Int()
Description copied from interface: TypeSystem
int

Specified by:
Int in interface TypeSystem

Long

public PrimitiveType Long()
Description copied from interface: TypeSystem
long

Specified by:
Long in interface TypeSystem

Float

public PrimitiveType Float()
Description copied from interface: TypeSystem
float

Specified by:
Float in interface TypeSystem

Double

public PrimitiveType Double()
Description copied from interface: TypeSystem
double

Specified by:
Double in interface TypeSystem

load

protected ClassType load(java.lang.String name)

forName

public Named forName(java.lang.String name)
              throws SemanticException
Description copied from interface: TypeSystem
Get the named type object with the following name.

Specified by:
forName in interface TypeSystem
Parameters:
name - The name of the type object to look for.
Throws:
SemanticException - when object is not found.

typeForName

public Type typeForName(java.lang.String name)
                 throws SemanticException
Description copied from interface: TypeSystem
Get the type with the following name.

Specified by:
typeForName in interface TypeSystem
Parameters:
name - The name to create the type for.
Throws:
SemanticException - when type is not found.

Object

public ClassType Object()
Description copied from interface: TypeSystem
java.lang.Object

Specified by:
Object in interface TypeSystem

Class

public ClassType Class()
Description copied from interface: TypeSystem
java.lang.Class

Specified by:
Class in interface TypeSystem

String

public ClassType String()
Description copied from interface: TypeSystem
java.lang.String

Specified by:
String in interface TypeSystem

Throwable

public ClassType Throwable()
Description copied from interface: TypeSystem
java.lang.Throwable

Specified by:
Throwable in interface TypeSystem

Error

public ClassType Error()
Description copied from interface: TypeSystem
java.lang.Error

Specified by:
Error in interface TypeSystem

Exception

public ClassType Exception()
Description copied from interface: TypeSystem
java.lang.Exception

Specified by:
Exception in interface TypeSystem

RuntimeException

public ClassType RuntimeException()
Description copied from interface: TypeSystem
java.lang.RuntimeException

Specified by:
RuntimeException in interface TypeSystem

Cloneable

public ClassType Cloneable()
Description copied from interface: TypeSystem
java.lang.Cloneable

Specified by:
Cloneable in interface TypeSystem

Serializable

public ClassType Serializable()
Description copied from interface: TypeSystem
java.io.Serializable

Specified by:
Serializable in interface TypeSystem

NullPointerException

public ClassType NullPointerException()
Description copied from interface: TypeSystem
java.lang.NullPointerException

Specified by:
NullPointerException in interface TypeSystem

ClassCastException

public ClassType ClassCastException()
Description copied from interface: TypeSystem
java.lang.ClassCastException

Specified by:
ClassCastException in interface TypeSystem

OutOfBoundsException

public ClassType OutOfBoundsException()
Description copied from interface: TypeSystem
java.lang.ArrayIndexOutOfBoundsException

Specified by:
OutOfBoundsException in interface TypeSystem

ArrayStoreException

public ClassType ArrayStoreException()
Description copied from interface: TypeSystem
java.lang.ArrayStoreException

Specified by:
ArrayStoreException in interface TypeSystem

ArithmeticException

public ClassType ArithmeticException()
Description copied from interface: TypeSystem
java.lang.ArithmeticException

Specified by:
ArithmeticException in interface TypeSystem

createNull

protected NullType createNull()

createPrimitive

protected PrimitiveType createPrimitive(PrimitiveType.Kind kind)

placeHolder

public java.lang.Object placeHolder(TypeObject o)
Description copied from interface: TypeSystem
Get a place-holder for serializing a type object.

Specified by:
placeHolder in interface TypeSystem
Parameters:
o - The object to get the place-holder for.

placeHolder

public java.lang.Object placeHolder(TypeObject o,
                                    java.util.Set roots)
Description copied from interface: TypeSystem
Get a place-holder for serializing a type object.

Specified by:
placeHolder in interface TypeSystem
Parameters:
o - The object to get the place-holder for.
roots - The root objects for the serialization. Place holders are not created for these.

unknownType

public UnknownType unknownType(Position pos)
Description copied from interface: TypeSystem
Get an unknown type.

Specified by:
unknownType in interface TypeSystem

unknownPackage

public UnknownPackage unknownPackage(Position pos)
Description copied from interface: TypeSystem
Get an unknown package.

Specified by:
unknownPackage in interface TypeSystem

unknownQualifier

public UnknownQualifier unknownQualifier(Position pos)
Description copied from interface: TypeSystem
Get an unknown type qualifier.

Specified by:
unknownQualifier in interface TypeSystem

packageForName

public Package packageForName(Package prefix,
                              java.lang.String name)
                       throws SemanticException
Description copied from interface: TypeSystem
Return a package by name with the given outer package. Fail if the package does not exists.

Specified by:
packageForName in interface TypeSystem
Throws:
SemanticException

packageForName

public Package packageForName(java.lang.String name)
                       throws SemanticException
Description copied from interface: TypeSystem
Return a package by name. Fail if the package does not exists.

Specified by:
packageForName in interface TypeSystem
Throws:
SemanticException

createPackage

public Package createPackage(Package prefix,
                             java.lang.String name)
Description copied from interface: TypeSystem
Return a package by name with the given outer package.

Specified by:
createPackage in interface TypeSystem

createPackage

public Package createPackage(java.lang.String name)
Description copied from interface: TypeSystem
Return a package by name.

Specified by:
createPackage in interface TypeSystem

arrayOf

public ArrayType arrayOf(Type type)
Returns a type identical to , but with more array dimensions.

Specified by:
arrayOf in interface TypeSystem

arrayOf

public ArrayType arrayOf(Position pos,
                         Type type)
Description copied from interface: TypeSystem
Return an array of type

Specified by:
arrayOf in interface TypeSystem

arrayType

protected ArrayType arrayType(Position pos,
                              Type type)
Factory method for ArrayTypes.


arrayOf

public ArrayType arrayOf(Type type,
                         int dims)
Description copied from interface: TypeSystem
Return a dims-array of type

Specified by:
arrayOf in interface TypeSystem

arrayOf

public ArrayType arrayOf(Position pos,
                         Type type,
                         int dims)
Description copied from interface: TypeSystem
Return a dims-array of type

Specified by:
arrayOf in interface TypeSystem

typeForClass

public Type typeForClass(java.lang.Class clazz)
                  throws SemanticException
Returns a canonical type corresponding to the Java Class object theClass. Does not require that have a JavaClass registered in this typeSystem. Does not register the type in this TypeSystem. For use only by JavaClass implementations.

Throws:
SemanticException

getTypeEncoderRootSet

public java.util.Set getTypeEncoderRootSet(Type t)
Description copied from interface: TypeSystem
Return the set of objects that should be serialized into the type information for the given ClassType. Usually only the clazz itself should get encoded, and references to other classes should just have their name written out. If it makes sense for additional types to be fully encoded, (ie, they're necessary to correctly reconstruct the given clazz, and the usual class resolvers can't otherwise find them) they should be returned in the set in addition to clazz.

Specified by:
getTypeEncoderRootSet in interface TypeSystem

getTransformedClassName

public java.lang.String getTransformedClassName(ClassType ct)
Get the transformed class name of a class. This utility method returns the "mangled" name of the given class, whereby all periods ('.') following the toplevel class name are replaced with dollar signs ('$'). If any of the containing classes is not a member class or a top level class, then null is returned.

Specified by:
getTransformedClassName in interface TypeSystem

translatePackage

public java.lang.String translatePackage(Resolver c,
                                         Package p)
Description copied from interface: TypeSystem
Translate a package.

Specified by:
translatePackage in interface TypeSystem

translateArray

public java.lang.String translateArray(Resolver c,
                                       ArrayType t)
Description copied from interface: TypeSystem
Translate an array type.

Specified by:
translateArray in interface TypeSystem

translateClass

public java.lang.String translateClass(Resolver c,
                                       ClassType t)
Description copied from interface: TypeSystem
Translate a top-level class type.

Specified by:
translateClass in interface TypeSystem

translatePrimitive

public java.lang.String translatePrimitive(Resolver c,
                                           PrimitiveType t)
Description copied from interface: TypeSystem
Translate a primitive type.

Specified by:
translatePrimitive in interface TypeSystem

primitiveForName

public PrimitiveType primitiveForName(java.lang.String name)
                               throws SemanticException
Description copied from interface: TypeSystem
Return the primitive with the given name.

Specified by:
primitiveForName in interface TypeSystem
Throws:
SemanticException

defaultClassInitializer

public LazyClassInitializer defaultClassInitializer()
Description copied from interface: TypeSystem
The default lazy class initializer.

Specified by:
defaultClassInitializer in interface TypeSystem

createClassType

public final ParsedClassType createClassType()
Description copied from interface: TypeSystem
Create a new empty class.

Specified by:
createClassType in interface TypeSystem

createClassType

public final ParsedClassType createClassType(Source fromSource)
Description copied from interface: TypeSystem
Create a new empty class.

Specified by:
createClassType in interface TypeSystem

createClassType

public final ParsedClassType createClassType(LazyClassInitializer init)
Description copied from interface: TypeSystem
Create a new empty class.

Specified by:
createClassType in interface TypeSystem

createClassType

public ParsedClassType createClassType(LazyClassInitializer init,
                                       Source fromSource)
Description copied from interface: TypeSystem
Create a new empty class.

Specified by:
createClassType in interface TypeSystem

defaultPackageImports

public java.util.List defaultPackageImports()
Description copied from interface: TypeSystem
Return a list of the packages names that will be imported by default. A list of Strings is returned, not a list of Packages.

Specified by:
defaultPackageImports in interface TypeSystem

promote

public PrimitiveType promote(Type t1,
                             Type t2)
                      throws SemanticException
Description copied from interface: TypeSystem
Binary promotion for numeric types.

Specified by:
promote in interface TypeSystem
Throws:
SemanticException - if the types cannot be promoted.

promoteNumeric

protected PrimitiveType promoteNumeric(PrimitiveType t1,
                                       PrimitiveType t2)

promote

public PrimitiveType promote(Type t)
                      throws SemanticException
Description copied from interface: TypeSystem
Unary promotion for numeric types.

Specified by:
promote in interface TypeSystem
Throws:
SemanticException - if the type cannot be promoted.

promoteNumeric

protected PrimitiveType promoteNumeric(PrimitiveType t)

checkMethodFlags

public void checkMethodFlags(Flags f)
                      throws SemanticException
Description copied from interface: TypeSystem
Assert if the flags f are legal method flags.

Specified by:
checkMethodFlags in interface TypeSystem
Throws:
SemanticException

checkLocalFlags

public void checkLocalFlags(Flags f)
                     throws SemanticException
Description copied from interface: TypeSystem
Assert if the flags f are legal local variable flags.

Specified by:
checkLocalFlags in interface TypeSystem
Throws:
SemanticException

checkFieldFlags

public void checkFieldFlags(Flags f)
                     throws SemanticException
Description copied from interface: TypeSystem
Assert if the flags f are legal field flags.

Specified by:
checkFieldFlags in interface TypeSystem
Throws:
SemanticException

checkConstructorFlags

public void checkConstructorFlags(Flags f)
                           throws SemanticException
Description copied from interface: TypeSystem
Assert if the flags f are legal constructor flags.

Specified by:
checkConstructorFlags in interface TypeSystem
Throws:
SemanticException

checkInitializerFlags

public void checkInitializerFlags(Flags f)
                           throws SemanticException
Description copied from interface: TypeSystem
Assert if the flags f are legal initializer flags.

Specified by:
checkInitializerFlags in interface TypeSystem
Throws:
SemanticException

checkTopLevelClassFlags

public void checkTopLevelClassFlags(Flags f)
                             throws SemanticException
Description copied from interface: TypeSystem
Assert if the flags f are legal top-level class flags.

Specified by:
checkTopLevelClassFlags in interface TypeSystem
Throws:
SemanticException

checkMemberClassFlags

public void checkMemberClassFlags(Flags f)
                           throws SemanticException
Description copied from interface: TypeSystem
Assert if the flags f are legal member class flags.

Specified by:
checkMemberClassFlags in interface TypeSystem
Throws:
SemanticException

checkLocalClassFlags

public void checkLocalClassFlags(Flags f)
                          throws SemanticException
Description copied from interface: TypeSystem
Assert if the flags f are legal local class flags.

Specified by:
checkLocalClassFlags in interface TypeSystem
Throws:
SemanticException

checkAccessFlags

public void checkAccessFlags(Flags f)
                      throws SemanticException
Description copied from interface: TypeSystem
Assert if the flags f are legal access flags.

Specified by:
checkAccessFlags in interface TypeSystem
Throws:
SemanticException

abstractSuperInterfaces

protected java.util.List abstractSuperInterfaces(ReferenceType rt)
Utility method to gather all the superclasses and interfaces of ct that may contain abstract methods that must be implemented by ct. The list returned also contains ct.


checkClassConformance

public void checkClassConformance(ClassType ct)
                           throws SemanticException
Assert that ct implements all abstract methods required; that is, if it is a concrete class, then it must implement all interfaces and abstract methods that it or it's superclasses declare, and if it is an abstract class then any methods that it overrides are overridden correctly.

Specified by:
checkClassConformance in interface TypeSystem
Throws:
SemanticException

staticTarget

public Type staticTarget(Type t)
Returns t, modified as necessary to make it a legal static target.

Specified by:
staticTarget in interface TypeSystem

initFlags

protected void initFlags()

createNewFlag

public Flags createNewFlag(java.lang.String name,
                           Flags after)
Description copied from interface: TypeSystem
Create a new unique Flags object.

Specified by:
createNewFlag in interface TypeSystem
Parameters:
name - the name of the flag
after - print the new flag after these flags

NoFlags

public Flags NoFlags()
Specified by:
NoFlags in interface TypeSystem

Public

public Flags Public()
Specified by:
Public in interface TypeSystem

Private

public Flags Private()
Specified by:
Private in interface TypeSystem

Protected

public Flags Protected()
Specified by:
Protected in interface TypeSystem

Static

public Flags Static()
Specified by:
Static in interface TypeSystem

Final

public Flags Final()
Specified by:
Final in interface TypeSystem

Synchronized

public Flags Synchronized()
Specified by:
Synchronized in interface TypeSystem

Transient

public Flags Transient()
Specified by:
Transient in interface TypeSystem

Native

public Flags Native()
Specified by:
Native in interface TypeSystem

Interface

public Flags Interface()
Specified by:
Interface in interface TypeSystem

Abstract

public Flags Abstract()
Specified by:
Abstract in interface TypeSystem

Volatile

public Flags Volatile()
Specified by:
Volatile in interface TypeSystem

StrictFP

public Flags StrictFP()
Specified by:
StrictFP in interface TypeSystem

flagsForBits

public Flags flagsForBits(int bits)
Description copied from interface: TypeSystem
Given the JVM encoding of a set of flags, returns the Flags object for that encoding.

Specified by:
flagsForBits in interface TypeSystem

flagsForName

public Flags flagsForName(java.lang.String name)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object