polyglot.ext.coffer.types
Class CofferTypeSystem_c

java.lang.Object
  extended by polyglot.ext.jl.types.TypeSystem_c
      extended by polyglot.ext.param.types.ParamTypeSystem_c
          extended by polyglot.ext.coffer.types.CofferTypeSystem_c
All Implemented Interfaces:
CofferTypeSystem, ParamTypeSystem, TypeSystem

public class CofferTypeSystem_c
extends ParamTypeSystem_c
implements CofferTypeSystem


Nested Class Summary
 
Nested classes/interfaces inherited from class polyglot.ext.jl.types.TypeSystem_c
TypeSystem_c.MostSpecificComparator
 
Field Summary
 
Fields inherited from class polyglot.ext.jl.types.TypeSystem_c
ACCESS_FLAGS, BOOLEAN_, BYTE_, CHAR_, CLASS_, CONSTRUCTOR_FLAGS, defaultClassInit, DOUBLE_, FIELD_FLAGS, flagsForName, FLOAT_, INITIALIZER_FLAGS, INT_, loadedResolver, LOCAL_CLASS_FLAGS, LOCAL_FLAGS, LONG_, MEMBER_CLASS_FLAGS, METHOD_FLAGS, NULL_, OBJECT_, parsedResolver, SHORT_, STRING_, systemResolver, THROWABLE_, TOP_LEVEL_CLASS_FLAGS, unknownPackage, unknownQualifier, unknownType, VOID_
 
Constructor Summary
CofferTypeSystem_c()
           
 
Method Summary
 boolean canOverride(MethodInstance mi, MethodInstance mj)
          Return true if mi can override mj.
 CofferConstructorInstance cofferConstructorInstance(Position pos, ClassType container, Flags flags, java.util.List argTypes, KeySet entryKeys, KeySet returnKeys, java.util.List throwConstraints)
           
 CofferMethodInstance cofferMethodInstance(Position pos, ReferenceType container, Flags flags, Type returnType, java.lang.String name, java.util.List argTypes, KeySet entryKeys, KeySet returnKeys, java.util.List throwConstraints)
           
 ConstructorInstance constructorInstance(Position pos, ClassType container, Flags flags, java.util.List argTypes, java.util.List excTypes)
          Create a constructor instance.
 ParsedClassType createClassType(LazyClassInitializer init, Source fromSource)
          Create a new empty class.
 Context createContext()
          Create a new context object for looking up variables, types, etc.
 KeySet emptyKeySet(Position pos)
           
protected  void initTypes()
           
 InstKey instKey(Position pos, java.lang.String name)
           
 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.
 ParamKey paramKey(Position pos, java.lang.String name)
           
 Subst subst(java.util.Map substMap, java.util.Map cache)
          Create a substitutor.
 ThrowConstraint throwConstraint(Position pos, Type type, KeySet keys)
           
 java.util.Collection uncheckedExceptions()
          Returns a list of the Throwable types that need not be declared in method and constructor signatures.
 UnknownKey unknownKey(Position pos, java.lang.String name)
           
 
Methods inherited from class polyglot.ext.param.types.ParamTypeSystem_c
checkInstantiation, instantiate, mutablePClass, subst, subst, uncheckedInstantiate
 
Methods inherited from class polyglot.ext.jl.types.TypeSystem_c
Abstract, abstractSuperInterfaces, accessibleFromPackage, ArithmeticException, arrayOf, arrayOf, arrayOf, arrayOf, ArrayStoreException, arrayType, assert_, assert_, Boolean, Byte, callValid, canCoerceToString, Char, checkAccessFlags, checkClassConformance, checkConstructorFlags, checkCycles, checkCycles, checkFieldFlags, checkInitializerFlags, checkLocalClassFlags, checkLocalFlags, checkMemberClassFlags, checkMethodFlags, checkOverride, checkTopLevelClassFlags, Class, classAccessible, classAccessible, classAccessibleFromPackage, ClassCastException, classContextResolver, Cloneable, createClassType, createClassType, createClassType, createNewFlag, createNull, createPackage, createPackage, createPrimitive, defaultClassInitializer, defaultConstructor, defaultPackageImports, descendsFrom, Double, equals, Error, Exception, fieldInstance, Final, findAcceptableConstructors, findAcceptableMethods, findConstructor, findConstructor, findField, findField, findField, findFields, findMemberClass, findMemberClass, findMemberClass, findMemberClasses, findMethod, findMethod, findMostSpecificProcedures, findProcedure, flagsForBits, flagsForName, Float, forName, getTransformedClassName, getTypeEncoderRootSet, hasEnclosingInstance, hasFormals, hasMethod, hasMethodNamed, implemented, importTable, importTable, initFlags, initialize, initializerInstance, Int, Interface, interfaces, isAccessible, isAccessible, isCanonical, isCastValid, isEnclosed, isImplicitCastValid, isSameMethod, isSubtype, isThrowable, isUncheckedException, leastCommonAncestor, listToString, load, loadedResolver, localInstance, Long, methodCallValid, moreSpecific, Native, NoFlags, Null, NullPointerException, numericConversionValid, numericConversionValid, Object, OutOfBoundsException, overrides, packageContextResolver, packageExists, packageForName, packageForName, parsedResolver, placeHolder, placeHolder, primitiveForName, Private, promote, promote, promoteNumeric, promoteNumeric, Protected, Public, RuntimeException, Serializable, Short, Static, staticTarget, StrictFP, String, superType, Synchronized, systemResolver, Throwable, throwsSubset, toString, Transient, translateArray, translateClass, translatePackage, translatePrimitive, typeForClass, typeForName, unknownPackage, unknownQualifier, unknownType, Void, Volatile, wrapperTypeString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface polyglot.ext.param.types.ParamTypeSystem
instantiate, mutablePClass, subst, subst
 
Methods inherited from interface polyglot.types.TypeSystem
Abstract, ArithmeticException, arrayOf, arrayOf, arrayOf, arrayOf, ArrayStoreException, Boolean, Byte, callValid, canCoerceToString, Char, checkAccessFlags, checkClassConformance, checkConstructorFlags, checkCycles, checkFieldFlags, checkInitializerFlags, checkLocalClassFlags, checkLocalFlags, checkMemberClassFlags, checkMethodFlags, checkOverride, checkTopLevelClassFlags, Class, classAccessible, classAccessibleFromPackage, ClassCastException, classContextResolver, Cloneable, createClassType, createClassType, createClassType, createNewFlag, createPackage, createPackage, defaultClassInitializer, defaultConstructor, defaultPackageImports, descendsFrom, Double, equals, Error, Exception, fieldInstance, Final, findConstructor, findConstructor, findField, findField, findField, findMemberClass, findMemberClass, findMemberClass, findMethod, findMethod, flagsForBits, Float, forName, getTransformedClassName, getTypeEncoderRootSet, hasEnclosingInstance, hasFormals, hasMethod, hasMethodNamed, implemented, importTable, importTable, initialize, initializerInstance, Int, Interface, interfaces, isAccessible, isCanonical, isCastValid, isEnclosed, isImplicitCastValid, isSameMethod, isSubtype, isThrowable, isUncheckedException, leastCommonAncestor, loadedResolver, localInstance, Long, methodCallValid, moreSpecific, Native, NoFlags, Null, NullPointerException, numericConversionValid, numericConversionValid, Object, OutOfBoundsException, overrides, packageContextResolver, packageExists, packageForName, packageForName, parsedResolver, placeHolder, placeHolder, primitiveForName, Private, promote, promote, Protected, Public, RuntimeException, Serializable, Short, Static, staticTarget, StrictFP, String, superType, Synchronized, systemResolver, Throwable, throwsSubset, Transient, translateArray, translateClass, translatePackage, translatePrimitive, typeForName, unknownPackage, unknownQualifier, unknownType, Void, Volatile, wrapperTypeString
 

Constructor Detail

CofferTypeSystem_c

public CofferTypeSystem_c()
Method Detail

initTypes

protected void initTypes()
Overrides:
initTypes in class TypeSystem_c

createClassType

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

Specified by:
createClassType in interface TypeSystem
Overrides:
createClassType in class TypeSystem_c

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
Overrides:
methodInstance in class TypeSystem_c
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.

cofferMethodInstance

public CofferMethodInstance cofferMethodInstance(Position pos,
                                                 ReferenceType container,
                                                 Flags flags,
                                                 Type returnType,
                                                 java.lang.String name,
                                                 java.util.List argTypes,
                                                 KeySet entryKeys,
                                                 KeySet returnKeys,
                                                 java.util.List throwConstraints)
Specified by:
cofferMethodInstance in interface CofferTypeSystem

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
Overrides:
constructorInstance in class TypeSystem_c
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.

cofferConstructorInstance

public CofferConstructorInstance cofferConstructorInstance(Position pos,
                                                           ClassType container,
                                                           Flags flags,
                                                           java.util.List argTypes,
                                                           KeySet entryKeys,
                                                           KeySet returnKeys,
                                                           java.util.List throwConstraints)
Specified by:
cofferConstructorInstance in interface CofferTypeSystem

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
Overrides:
canOverride in class TypeSystem_c

emptyKeySet

public KeySet emptyKeySet(Position pos)
Specified by:
emptyKeySet in interface CofferTypeSystem

instKey

public InstKey instKey(Position pos,
                       java.lang.String name)
Specified by:
instKey in interface CofferTypeSystem

unknownKey

public UnknownKey unknownKey(Position pos,
                             java.lang.String name)
Specified by:
unknownKey in interface CofferTypeSystem

paramKey

public ParamKey paramKey(Position pos,
                         java.lang.String name)
Specified by:
paramKey in interface CofferTypeSystem

subst

public Subst subst(java.util.Map substMap,
                   java.util.Map cache)
Description copied from class: ParamTypeSystem_c
Create a substitutor.

Specified by:
subst in interface ParamTypeSystem
Overrides:
subst in class ParamTypeSystem_c
Parameters:
substMap - Map from formal parameters to actuals; the formals are not necessarily formals of t.
cache - Cache of substitutions performed, implemented as a map from type to substituted type. This is passed in to ensure pointers to outer classes are substituted correctly.

throwConstraint

public ThrowConstraint throwConstraint(Position pos,
                                       Type type,
                                       KeySet keys)
Specified by:
throwConstraint in interface CofferTypeSystem

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
Overrides:
createContext in class TypeSystem_c

uncheckedExceptions

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

Specified by:
uncheckedExceptions in interface TypeSystem
Overrides:
uncheckedExceptions in class TypeSystem_c