| java.lang.Object xtc.lang.JavaTypeConverter
JavaTypeConverter | final public class JavaTypeConverter (Code) | | Java type conversions and promotions.
author: Martin Hirzel See Also: JLS 2 §5 |
Method Summary | |
public static Type | convertAssigning(SymbolTable tab, List<File> paths, Type tgt, Type src) Perform assignment conversion. | public static Type | convertCasting(SymbolTable tab, List<File> paths, Type tgt, Type src) Perform casting conversion. | public static Type | convertIdentity(Type tgt, Type src) Perform identity conversion. | public static Type | convertParameterPassing(SymbolTable tab, List<File> paths, Type tgt, Type src) Perform method invocation conversion. | public static Type | convertString(SymbolTable tab, Type src) Perform string conversion. | public static boolean | isAssignable(SymbolTable tab, List<File> paths, Type tgt, Type src) | public static boolean | isCastable(SymbolTable tab, List<File> paths, Type tgt, Type src) | public static boolean | isIdentical(Type x, Type y) | public static boolean | isNarrowerPrimitive(Type tgt, Type src) | public static boolean | isNarrowerReference(SymbolTable tab, List<File> paths, Type tgt, Type src) | public static boolean | isParameterPassable(SymbolTable tab, List<File> paths, Type tgt, Type src) | public static boolean | isPromotableBinaryNumeric(Type other, Type src) | public static boolean | isReturnTypeSubstitutable(SymbolTable tab, List<File> paths, Type tgt, Type src) Is src return-type substitutable for tgt? This method implements
Java 3 Language Specification §8.4.5, unlike the rest of
this type checker, which deals with Java 2 only. | public static boolean | isWiderPrimitive(Type tgt, Type src) | public static boolean | isWiderReference(SymbolTable tab, List<File> paths, Type tgt, Type src) | public static strictfp Type | narrowPrimitive(Type tgt, Type src) Perform narrowing primitive conversion. | public static Type | narrowReference(SymbolTable tab, List<File> paths, Type tgt, Type src) Perform narrowing reference conversion. | public static Type | promoteBinaryNumeric(Type other, Type src) Perform binary numeric promotion. | public static Type | promoteUnaryNumeric(Type src) Perform unary numeric promotion. | public static strictfp Type | widenPrimitive(Type tgt, Type src) Perform widening primitive conversion. | public static Type | widenReference(SymbolTable tab, List<File> paths, Type tgt, Type src) Perform widening reference conversion. |
convertAssigning | public static Type convertAssigning(SymbolTable tab, List<File> paths, Type tgt, Type src)(Code) | | Perform assignment conversion. Assumes that src and tgt are
either not aliases, or if aliases, are already resolved. May
resolve other aliases, such as supertypes, method parameter and
return types, etc.
The converted type, or null if this kind of conversion does not apply. See Also: JLS 2 §5.2 |
convertCasting | public static Type convertCasting(SymbolTable tab, List<File> paths, Type tgt, Type src)(Code) | | Perform casting conversion. Assumes that src and tgt are either
not aliases, or if aliases, are already resolved. May resolve
other aliases, such as supertypes, method parameter and return
types, etc.
The converted type, or null if this kind of conversion does notapply. See Also: JLS 2 §5.5 |
convertIdentity | public static Type convertIdentity(Type tgt, Type src)(Code) | | Perform identity conversion. Assumes that src and tgt are either
not aliases, or if aliases, are already resolved.
The converted type, or null if this kind of conversion does not apply. See Also: JLS 2 §5.1.1 |
convertParameterPassing | public static Type convertParameterPassing(SymbolTable tab, List<File> paths, Type tgt, Type src)(Code) | | Perform method invocation conversion. Assumes that src and tgt
are either not aliases, or if aliases, are already resolved. May
resolve other aliases, such as supertypes, method parameter and
return types, etc.
The converted type, or null if this kind of conversion does not apply. See Also: JLS 2 §5.3 |
isNarrowerPrimitive | public static boolean isNarrowerPrimitive(Type tgt, Type src)(Code) | | |
isPromotableBinaryNumeric | public static boolean isPromotableBinaryNumeric(Type other, Type src)(Code) | | |
isReturnTypeSubstitutable | public static boolean isReturnTypeSubstitutable(SymbolTable tab, List<File> paths, Type tgt, Type src)(Code) | | Is src return-type substitutable for tgt? This method implements
Java 3 Language Specification §8.4.5, unlike the rest of
this type checker, which deals with Java 2 only.
|
isWiderPrimitive | public static boolean isWiderPrimitive(Type tgt, Type src)(Code) | | |
narrowPrimitive | public static strictfp Type narrowPrimitive(Type tgt, Type src)(Code) | | Perform narrowing primitive conversion.
The converted type, or null if this kind of conversion does not apply. See Also: JLS 2 §5.1.3 |
narrowReference | public static Type narrowReference(SymbolTable tab, List<File> paths, Type tgt, Type src)(Code) | | Perform narrowing reference conversion. Assumes that src and tgt
are either not aliases, or if aliases, are already resolved. May
resolve other aliases, such as supertypes, method parameter and
return types, etc.
The converted type, or null if this kind of conversion does not apply. See Also: JLS 2 §5.1.5 |
promoteBinaryNumeric | public static Type promoteBinaryNumeric(Type other, Type src)(Code) | | Perform binary numeric promotion. Given a binary expression "a op
b", this method should be called twice: once with src=a and
other=b, and once with src=b and other=a.
Parameters: src - The type of the operand that is being promoted. Parameters: other - The type of the other operand. The converted type of the src operand, or null if this kind ofconversion does not apply. See Also: JLS 2 §5.6.2 |
promoteUnaryNumeric | public static Type promoteUnaryNumeric(Type src)(Code) | | Perform unary numeric promotion.
The converted type, or null if this kind of conversion does not apply. See Also: JLS 2 §5.6.1 |
widenPrimitive | public static strictfp Type widenPrimitive(Type tgt, Type src)(Code) | | Perform widening primitive conversion.
The converted type, or null if this kind of conversion does not apply. See Also: JLS 2 §5.1.2 |
widenReference | public static Type widenReference(SymbolTable tab, List<File> paths, Type tgt, Type src)(Code) | | Perform widening reference conversion. Assumes that src and tgt
are either not aliases, or if aliases, are already resolved. May
resolve other aliases, such as supertypes, method parameter and
return types, etc.
The converted type, or null if this kind of conversion does not apply. See Also: JLS 2 §5.1.4 |
|
|