|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavafe.tc.Types
Field Summary | |
static PrimitiveType |
booleanType
|
static PrimitiveType |
byteType
|
static PrimitiveType |
charType
|
static PrimitiveType |
doubleType
|
static Type |
errorType
Used to indicate the type of an illegal operation, so that error messages do not unnecessarily propagate; should only be used if the error has already been reported. |
static PrimitiveType |
floatType
|
static Types |
inst
Types uses the inst pattern to allow subclasses to provide alternative implementations of some of the static methods here. |
static PrimitiveType |
intType
|
static FieldDecl |
lengthFieldDecl
|
protected static Identifier |
lenId
|
static PrimitiveType |
longType
|
static PrimitiveType |
nullType
|
private static TypeSig |
s_javaLangClass
|
private static TypeSig |
s_javaLangCloneable
|
private static TypeSig |
s_javaLangError
|
private static TypeSig |
s_javaLangException
|
private static TypeSig |
s_javaLangObject
|
private static java.lang.String[] |
s_javaLangPackage
|
private static TypeSig |
s_javaLangRuntimeException
|
private static TypeSig |
s_javaLangString
|
private static TypeSig |
s_javaLangSystem
|
private static TypeSig |
s_javaLangThrowable
|
static PrimitiveType |
shortType
|
static PrimitiveType |
voidType
|
Constructor Summary | |
Types()
|
Method Summary | |
static Type |
baseType(Type t)
|
static Type |
binaryNumericPromotion(Type x,
Type y)
|
static Type[] |
getFormalParaTypes(FormalParaDeclVec args)
|
static TypeSig |
getJavaLang(java.lang.String T)
Find the TypeSig for the required package-member type java.lang.T. |
protected static boolean |
isAnyPrimitiveConvertable(Type x,
Type y)
Returns true iff the first argument is convertable to the second argument, either through a widening primitive conversion, a narrowing primitive conversion, or the identity conversion. |
static boolean |
isBooleanType(Type t)
|
static boolean |
isByteType(Type t)
|
static boolean |
isCastable(Type s,
Type t)
Checks if one Type is castable to another. |
protected boolean |
isCastableInstance(Type s,
Type t)
|
static boolean |
isCharType(Type t)
|
(package private) static boolean |
isCheckedException(Type E)
Is an exception a checked one? |
(package private) static boolean |
isCompatibleAccess(int x,
int y)
|
(package private) static boolean |
isCompatibleRaises(TypeNameVec x,
TypeNameVec y)
Is "throws |
static boolean |
isDoubleType(Type t)
|
static boolean |
isErrorType(Type t)
* Predicates on types: * * |
static boolean |
isFloatingPointType(Type t)
|
boolean |
isFloatingPointTypeInstance(Type t)
|
static boolean |
isFloatType(Type t)
|
static boolean |
isIntegralType(Type t)
|
boolean |
isIntegralTypeInstance(Type t)
|
static boolean |
isIntType(Type t)
|
static boolean |
isInvocationConvertable(Type x,
Type y)
|
protected boolean |
isInvocationConvertableInstance(Type x,
Type y)
|
static boolean |
isLongType(Type t)
|
static boolean |
isNumericType(Type t)
|
boolean |
isNumericTypeInstance(Type t)
|
private static boolean |
isPrimitiveType(Type t,
int tag)
|
static boolean |
isReferenceOrNullType(Type t)
|
static boolean |
isReferenceType(Type t)
|
static boolean |
isSameFormalParaDeclVec(FormalParaDeclVec x,
FormalParaDeclVec y)
|
static boolean |
isSameMethodSig(MethodDecl x,
MethodDecl y)
|
static boolean |
isSameType(Type x,
Type y)
|
protected boolean |
isSameTypeInstance(Type x,
Type y)
|
static boolean |
isShortType(Type t)
|
static boolean |
isSubclassOf(Type x,
TypeSig y)
Returns true if and only if x is a subclass or
superinterface of y . |
static boolean |
isSubClassOrEq(Type x,
Type y)
Returns true iff x is a superclass or
superinterface of y , or if x is the
same type as y .
|
static boolean |
isVoidType(Type t)
|
protected static boolean |
isWideningPrimitiveConvertable(Type x,
Type y)
|
protected boolean |
isWideningPrimitiveConvertableInstance(Type x,
Type y)
|
protected static boolean |
isWideningReferenceConvertable(Type s,
Type t)
|
protected boolean |
isWideningReferenceConvertableInstance(Type s,
Type t)
|
static TypeSig |
javaLangClass()
|
static TypeSig |
javaLangCloneable()
|
static TypeSig |
javaLangError()
|
static TypeSig |
javaLangException()
|
static TypeSig |
javaLangObject()
|
static java.lang.String[] |
javaLangPackage()
Return the package java.lang as a String[] for use in calling OutsideEnv.lookup[deferred]. |
static TypeSig |
javaLangRuntimeException()
|
static TypeSig |
javaLangString()
|
static TypeSig |
javaLangSystem()
|
static TypeSig |
javaLangThrowable()
|
static FieldDecl |
lookupField(Type t,
Identifier id,
TypeSig caller)
|
protected FieldDecl |
lookupFieldInstance(Type t,
Identifier id,
TypeSig caller)
|
static MethodDecl |
lookupMethod(Type t,
Identifier id,
Type[] args,
TypeSig caller)
|
protected MethodDecl |
lookupMethodInstance(Type t,
Identifier id,
Type[] args,
TypeSig caller)
|
private static PrimitiveType |
makePrimitiveType(int tag)
|
protected static TypeSig |
makeTypeSig(java.lang.String[] packageName,
java.lang.String simpleName,
TypeSig enclosingType,
TypeDecl decl,
CompilationUnit CU)
Factory method for TypeSig structures |
static TypeSig |
makeTypeSig(java.lang.String simpleName,
Env enclosingEnv,
TypeDecl decl)
Factory method for TypeSig structures |
protected TypeSig |
makeTypeSigInstance(java.lang.String[] packageName,
java.lang.String simpleName,
TypeSig enclosingType,
TypeDecl decl,
CompilationUnit CU)
|
protected TypeSig |
makeTypeSigInstance(java.lang.String simpleName,
Env enclosingEnv,
TypeDecl decl)
|
static java.lang.String |
printName(Type t)
Returns the name of a Type as a
String . |
static java.lang.String |
printName(Type[] ts)
Formats an array of Type s as a String
containing a parenthesized list of user-readable names. |
protected java.lang.String |
printNameInstance(Type t)
|
static void |
remakeTypes()
|
static boolean |
routineMoreSpecific(RoutineDecl x,
RoutineDecl y)
|
static TypeSig |
toClassTypeSig(Type x)
Returns the TypeSig for a Type x, if x denotes a class type, otherwise returns null. |
static Type |
unaryPromote(Type t)
|
static LiteralExpr |
zeroEquivalent(Type t)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static Types inst
public static Type errorType
public static PrimitiveType voidType
public static PrimitiveType booleanType
public static PrimitiveType intType
public static PrimitiveType doubleType
public static PrimitiveType floatType
public static PrimitiveType longType
public static PrimitiveType charType
public static PrimitiveType nullType
public static PrimitiveType byteType
public static PrimitiveType shortType
private static java.lang.String[] s_javaLangPackage
private static TypeSig s_javaLangObject
private static TypeSig s_javaLangSystem
private static TypeSig s_javaLangError
private static TypeSig s_javaLangException
private static TypeSig s_javaLangThrowable
private static TypeSig s_javaLangString
private static TypeSig s_javaLangRuntimeException
private static TypeSig s_javaLangCloneable
private static TypeSig s_javaLangClass
protected static Identifier lenId
public static FieldDecl lengthFieldDecl
Constructor Detail |
public Types()
Method Detail |
public static TypeSig makeTypeSig(java.lang.String simpleName, Env enclosingEnv, TypeDecl decl)
protected TypeSig makeTypeSigInstance(java.lang.String simpleName, Env enclosingEnv, TypeDecl decl)
protected static TypeSig makeTypeSig(java.lang.String[] packageName, java.lang.String simpleName, TypeSig enclosingType, TypeDecl decl, CompilationUnit CU)
protected TypeSig makeTypeSigInstance(java.lang.String[] packageName, java.lang.String simpleName, TypeSig enclosingType, TypeDecl decl, CompilationUnit CU)
private static final PrimitiveType makePrimitiveType(int tag)
public static void remakeTypes()
public static java.lang.String[] javaLangPackage()
public static TypeSig getJavaLang(java.lang.String T)
If the type is not found in the classpath, an error message is reported via ErrorSet and an unloaded TypeSig is returned.
Precondition: the TypeSig has been initialized.
public static TypeSig javaLangObject()
public static TypeSig javaLangSystem()
public static TypeSig javaLangError()
public static TypeSig javaLangException()
public static TypeSig javaLangThrowable()
public static TypeSig javaLangString()
public static TypeSig javaLangRuntimeException()
public static TypeSig javaLangCloneable()
public static TypeSig javaLangClass()
public static boolean isErrorType(Type t)
public static boolean isReferenceType(Type t)
public static boolean isReferenceOrNullType(Type t)
private static boolean isPrimitiveType(Type t, int tag)
public static boolean isByteType(Type t)
public static boolean isBooleanType(Type t)
public static boolean isShortType(Type t)
public static boolean isCharType(Type t)
public static boolean isDoubleType(Type t)
public static boolean isFloatType(Type t)
public static boolean isIntType(Type t)
public static boolean isLongType(Type t)
public static boolean isVoidType(Type t)
public static boolean isNumericType(Type t)
public boolean isNumericTypeInstance(Type t)
public static boolean isIntegralType(Type t)
public boolean isIntegralTypeInstance(Type t)
public static boolean isFloatingPointType(Type t)
public boolean isFloatingPointTypeInstance(Type t)
public static boolean isSameType(Type x, Type y)
protected boolean isSameTypeInstance(Type x, Type y)
public static boolean isSubclassOf(Type x, TypeSig y)
x
is a subclass or
superinterface of y
. (The occurrence of "class"
in the name of the method is rather unfortunate.)
public static boolean isSubClassOrEq(Type x, Type y)
x
is a superclass or
superinterface of y
, or if x
is the
same type as y
.
Warning: This is *not* the same as is x
a
subtype of y
! It does not consider short below
int.
public static boolean isCastable(Type s, Type t)
protected boolean isCastableInstance(Type s, Type t)
public static boolean isInvocationConvertable(Type x, Type y)
protected boolean isInvocationConvertableInstance(Type x, Type y)
protected static boolean isWideningPrimitiveConvertable(Type x, Type y)
protected boolean isWideningPrimitiveConvertableInstance(Type x, Type y)
protected static boolean isAnyPrimitiveConvertable(Type x, Type y)
protected static boolean isWideningReferenceConvertable(Type s, Type t)
protected boolean isWideningReferenceConvertableInstance(Type s, Type t)
public static TypeSig toClassTypeSig(Type x)
public static Type unaryPromote(Type t)
public static Type binaryNumericPromotion(Type x, Type y)
public static Type baseType(Type t)
public static LiteralExpr zeroEquivalent(Type t)
public static boolean isSameMethodSig(MethodDecl x, MethodDecl y)
public static boolean isSameFormalParaDeclVec(FormalParaDeclVec x, FormalParaDeclVec y)
public static boolean routineMoreSpecific(RoutineDecl x, RoutineDecl y)
static boolean isCheckedException(Type E)
static boolean isCompatibleRaises(TypeNameVec x, TypeNameVec y)
Answer: Each exception E in the list
static boolean isCompatibleAccess(int x, int y)
public static Type[] getFormalParaTypes(FormalParaDeclVec args)
public static java.lang.String printName(Type t)
Type
as a
String
. The resulting name will be fully qualified
if the Type
has been name resolved.
Note: t
may safely be null.
Precondition: PrettyPrint.inst
!= null
protected java.lang.String printNameInstance(Type t)
public static java.lang.String printName(Type[] ts)
Type
s as a String
containing a parenthesized list of user-readable names. The
resulting names will be fully qualified if the
Type
s have been name resolved. Sample output: "(int, javafe.tc.TypeSig, char[])"
Precondition: PrettyPrint.inst
!= null,
ts
!= null
public static FieldDecl lookupField(Type t, Identifier id, TypeSig caller) throws LookupException
LookupException
protected FieldDecl lookupFieldInstance(Type t, Identifier id, TypeSig caller) throws LookupException
LookupException
public static MethodDecl lookupMethod(Type t, Identifier id, Type[] args, TypeSig caller) throws LookupException
LookupException
protected MethodDecl lookupMethodInstance(Type t, Identifier id, Type[] args, TypeSig caller) throws LookupException
LookupException
|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |