All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----epp.Type
Type
class is a type information that is attached to a node
of an abstract syntax tree.
Within the type checking pass, the TypeChecker
converts
each node of a Tree
into a Tree
with type
information.
You can obtain type information from the Tree
with type
information using the tree.type()
method.
You can obtain the type of a type using the type.tag()
method call. The following type tags specify standard Java types.
:void, :char, :byte, :short, :int, :long, :float, :double, :boolean, :null :class :arrayOfThese types are expressed by subclasses of class
Type
,
including PrimitiveType
, NullType
,
ClassType
, and ArrayType
.
For details on accessing the internals of ClassType
and
ArrayType
, please refer to the description of these classes.
PrimitiveType
and NullType
do not have any
internal structures.
Plug-ins may introduce new types into the Java language by defining a subclass
of class Type
and providing a new tag.
However, you cannot add new primitive types.
The Type
class only holds information required to descibe a type
and does not define any "type semantics."
Type semantics are defined by a method that defines TypeSystem
and
the TypeChecker
object.
Though not included in this javadoc, the following static variables that hold the built-in type instances are defined.
Type.Tnull Type.Tvoid Type.Tchar Type.Tbyte Type.Tshort Type.Tint Type.Tlong Type.Tfloat Type.Tdouble Type.Tboolean Type.TString // java.lang.String Type.TObject // java.lang.Object Type.TClass // java.lang.Class
ClassInfo
if this type is :class type.
Opts.out
in a human readable form.
public Type(Symbol tag)
public static Obj epp()equals
public static boolean equals(Type type1, Type type2)
public static boolean isSuperType(Type type1, Type type2)
public static Tree coerce(Type type, Tree tree)
public static FieldInfo selectField(Type targetType, Symbol fieldName)
public static Object[] typeCheckAndSelectMethod(Type targetType, Symbol methodName, Tree argumentList)
public static void typeCheckBlockStatements(int i, Tree args[], TreeVec newArgs)
public boolean isPrimitiveType()
:null, :class, and :arrayOf are not primitive types.
public Symbol tag()
public ClassInfo classInfo()
ClassInfo
if this type is :class type.
Otherwise, a fatal error occurs.
public abstract Tree toTree()
EppUserError
will be thrown.
public Type print()
Opts.out
in a human readable form.
Used for debugging.
This method returns itself as the return value.
All Packages Class Hierarchy This Package Previous Next Index