Type.NeverReturns| Modifier and Type | Field and Description |
|---|---|
static PrimType |
byteType |
static LangPrimType |
characterOrEofType |
static LangPrimType |
characterType |
static LangPrimType |
charType |
static PrimType |
doubleType |
static PrimType |
floatType |
static PrimType |
intType |
static PrimType |
longType |
static PrimType |
shortType |
static LangPrimType |
stringCursorType |
static PrimType |
voidType |
boolean_ctype, boolean_type, booleanType, booleanValue_method, byte_type, char_type, clone_method, double_type, doubleValue_method, errorType, float_type, floatValue_method, int_type, intValue_method, java_lang_Class_type, javalangannotationAnnotationType, javalangBooleanType, javalangCharacterType, javalangClassType, javalanginvokeMethodHandleType, javalangNumberType, javalangObjectType, javalangStringType, javalangThrowableType, long_type, longValue_method, neverReturnsType, nullType, number_type, objectType, pointer_type, reflectClass, short_type, string_type, throwable_type, toString_method, tostring_type, toStringType, typeArray0, void_type| Constructor and Description |
|---|
LangPrimType(PrimType type) |
LangPrimType(PrimType type,
Language language) |
LangPrimType(java.lang.String nam,
java.lang.String sig,
int siz,
java.lang.Class reflectClass) |
LangPrimType(java.lang.String nam,
java.lang.String sig,
int siz,
java.lang.Class reflectClass,
Language language) |
| Modifier and Type | Method and Description |
|---|---|
ClassType |
boxedType() |
char |
charValue(java.lang.Object value)
Coerce value to a char.
|
java.lang.Object |
coerceFromObject(java.lang.Object obj)
Convert an object to a value of this Type.
|
java.lang.Object |
coerceToObject(java.lang.Object obj)
Given a raw JVM value convert it to an object of this type.
|
int |
compare(Type other)
Return a numeric code showing "subtype" relationship:
1: if other is a pure subtype of this;
0: if has the same values;
-1: if this is a pure subtype of other;
-2: if they have values in common but neither is a subtype of the other;
-3: if the types have no values in common.
|
java.lang.Object |
convertToRaw(java.lang.Object obj) |
Expression |
convertValue(Expression value)
Return converted expression or null.
|
void |
emitCoerceFromObject(CodeAttr code)
Compile code to coerce/convert from Object to this type.
|
void |
emitCoerceToObject(CodeAttr code)
Compile code to convert a object of this type on the stack to Object.
|
void |
emitIsInstance(CodeAttr code) |
void |
emitIsInstance(Variable incoming,
Compilation comp,
Target target)
Emit code for incoming instanceof this_type.
|
void |
emitTestIf(Variable incoming,
Declaration decl,
Compilation comp)
Emit code for
if (incoming instanceof this_type) decl = incoming ....
|
java.lang.String |
encodeType(Language language) |
Procedure |
getConstructor()
Get the constructor function for this type.
|
Type |
getImplementationType()
Return Java-level implementation type.
|
int |
isCompatibleWithValue(Type valueType)
If this is the target type, is a given source type compatible?
Return -1 if no; 1 if yes; 0 if need to check at run-time.
|
booleanValue, compare, promotedType, unboxedTypeemitConvertFromPrimitive, getGenericSignature, getMaybeGenericSignature, getName, getRawType, getRealType, getReflectClass, getSignature, getSize, getSizeInWords, getType, hashCode, isExisting, isInstance, isInterface, isMoreSpecific, isSubtype, isValidJavaTypeName, isVoid, lookupType, lowestCommonSuperType, make, make, printSignature, promote, registerTypeForClass, setGenericSignature, setName, setReflectClass, setSignature, signatureLength, signatureLength, signatureToName, signatureToPrimitive, signatureToType, signatureToType, swappedCompareResult, toStringpublic static final PrimType byteType
public static final PrimType shortType
public static final PrimType intType
public static final PrimType longType
public static final PrimType floatType
public static final PrimType doubleType
public static final LangPrimType charType
public static final PrimType voidType
public static final LangPrimType characterType
public static final LangPrimType characterOrEofType
public static final LangPrimType stringCursorType
public LangPrimType(PrimType type)
public LangPrimType(java.lang.String nam,
java.lang.String sig,
int siz,
java.lang.Class reflectClass)
public LangPrimType(java.lang.String nam,
java.lang.String sig,
int siz,
java.lang.Class reflectClass,
Language language)
public Type getImplementationType()
TypegetImplementationType in interface TypeValuegetImplementationType in class Typepublic java.lang.Object coerceFromObject(java.lang.Object obj)
TypecoerceFromObject in class PrimTypepublic char charValue(java.lang.Object value)
PrimTypepublic void emitIsInstance(CodeAttr code)
emitIsInstance in class PrimTypepublic void emitCoerceFromObject(CodeAttr code)
TypeemitCoerceFromObject in class PrimTypepublic java.lang.Object coerceToObject(java.lang.Object obj)
TypegetRawType(), boxed as needed. The result may be
a language-specific (boxed) value. Generally a no-op.coerceToObject in class Typepublic java.lang.Object convertToRaw(java.lang.Object obj)
convertToRaw in class PrimTypepublic void emitCoerceToObject(CodeAttr code)
TypeemitCoerceToObject in class PrimTypepublic int compare(Type other)
Typepublic int isCompatibleWithValue(Type valueType)
TypeisCompatibleWithValue in class Typepublic void emitTestIf(Variable incoming, Declaration decl, Compilation comp)
TypeValueemitTestIf in interface TypeValueincoming - Contains the value we are testing to see if it has the
type of this. If null, use top-of-stack.
May not be null if decl is non-null.decl - If non-null, assign value after coercion to Declaration.comp - The compilation state.public Expression convertValue(Expression value)
TypeValueconvertValue in interface TypeValuepublic void emitIsInstance(Variable incoming, Compilation comp, Target target)
TypeValueInstanceOf
.emitIsInstance which is a conveniece method that calls
emitTestIf.emitIsInstance in interface TypeValueincoming - Contains the value we are testing to see if it has the
the type of 'this'. If null, use top-of-stack.comp - The compilation state.target - Where to leave the result.public Procedure getConstructor()
TypeValuegetConstructor in interface TypeValuepublic java.lang.String encodeType(Language language)
encodeType in interface TypeValue