All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----epp.TypeSystem
TypeSystem.java
file defines methods of the EPP preprocessor
that define the relationship between types.
Note: This class is provided for the sake of creating javadocs. It does not exist in the actual EPP source code.
Plug-ins can extend this method to define a relationship between a newly introduced type and an existing type.
Some of the methods are also defined as static methods of class
Type
to make it easier to call from TypeChecker
.
For example, the method isSuperType(t1, t2)
can be called
from a method of TypeChecker
by writing
Type.isSuperType(t1, t2)
.
Actually, this method is delegated to an Ld-2 method.
argumentList
into a single string.
tree
can be used as
type type
and returns a tree.
arguemntList
to the type selectedMethod
expects.
method
matchs argumentList
and
returns false otherwise.
type
is a super type of a type an
expression specified by the argument tree
.
info1
is implemented by info2
.
t1
and t2
are of the same type,
and returns false otherwise.
Info1
is a super class of info2
.
t1
is a super type of t2
.
fieldName
if targetType
has any such field.
methods
that
matches the argument specified by argument arguemntList
and is the most determinative.
arguemntList
and selects a method to call.
i
of
args
and puts the result into newArgs
.
public TypeSystem()
public boolean equals(Type t1, Type t2)
t1
and t2
are of the same type,
and returns false otherwise.
This method is delegated from a static method of class Type
.
public void confirmType(Type type, Tree tree)
type
is a super type of a type an
expression specified by the argument tree
.
If it is, nothing will happen. If it is not the super type,
an EppUserError
will be thrown.
public boolean isSuperType(Type t1, Type t2)
t1
is a super type of t2
.
Otherwise returns false.
To be more precise, the following will occur.
Returns true if t1 is a super type of, or the same type as t2.
If t1 is an "unknown extended type", a fatal error results.
Otherwise, if t2 is an "unknown extended type", false will be returned.
This method is delegated from a static method of the Type
.
public boolean isAncestor(ClassInfo info1, ClassInfo info2)
Info1
is a super class of info2
.
Otherwise returns false.
To be more precise, the following will occur.
Returns true if info1 and info2 have the same name,
or class info1 is an ancestor of class info2.
Both info1
and info2
must be a
ClassInfo
that expresses a class.
(The behaviour when either is a ClassInfo
that expresses an
interface is undefined.)
public boolean doesImplement(ClassInfo info1, ClassInfo info2)
info1
is implemented by info2
.
Otherwise returns false.
info1
must be a ClassInfo
that expresses
an interface. info2
may be a class or an interface.
To be more precise, the following will occur.
Return true if info1 and info2 have the same name,
or interface info1 is implemented by class info2,
or interface info1 is extended by interface info2.
public Tree coerce(Type type, Tree tree)
tree
can be used as
type type
and returns a tree.
If it cannot be used as the type, an EppUserError
will be
thrown. Normally, the tree will be returned unchanged.
Plug-ins may extend this method to implement an "implicit type conversion" not included in standard Java.
This method is delegated from a static method of
the Type
class.
public FieldInfo selectField(Type targetType, Symbol fieldName)
fieldName
if targetType
has any such field.
If not, an EppUserError
will be thrown.
This method is delegated from a static method of
the Type
class.
public Object[] typeCheckAndSelectMethod(Type targetType, Symbol methodName, Tree argumentList)
arguemntList
and selects a method to call.
This method returns two values.
One is the selected method, and its type is MethodInfo
.
The second is the type checked argumentList
, and its
type is Tree
.
This method is delegated from a static method of
the Type
class.
public MethodInfo selectMostSpecificMethod(String methodName, MethodInfo methods[], Tree argumentList)
methods
that
matches the argument specified by argument arguemntList
and is the most determinative.
If such method is not found, an EppUserError
is thrown.
Argument methodName
is used in the error message.
public boolean confirmArgs(MethodInfo method, Tree argumentList)
method
matchs argumentList
and
returns false otherwise.
public boolean moreSpecificMethod(MethodInfo m1, MethodInfo m2)
public Tree coerceArgumentList(Tree argumentList, MethodInfo selectedMethod)
arguemntList
to the type selectedMethod
expects.
public String argumentListToSignatureString(Tree argumentList)
argumentList
into a single string. This method is called from
selectMostSpecificMethod
when creating an error message.
public void typeCheckBlockStatements(int i, Tree args[], TreeVec newArgs)
i
of
args
and puts the result into newArgs
.
This method is called in cases such as type checking a block.
This method is delegated from a static method of
the Type
class.
public void typeCheckBlockStatement(Tree tree, int i, Tree args[], TreeVec newArgs)typeCheckVariableDeclarators
public void typeCheckVariableDeclarators(int vi, Tree vardecls[], TreeVec newVardecls, Tree declTree, Tree modifiers, Tree typeTree, int i, Tree args[], TreeVec newArgs)typeCheckVariableDeclarator
public void typeCheckVariableDeclarator(Tree tree, int vi, Tree vardecls[], TreeVec newVardecls, Tree declTree, Tree modifiers, Tree typeTree, int i, Tree args[], TreeVec newArgs)checkVariableDeclaratorId
public Tree checkVariableDeclaratorId(Type type, Tree tree, Tree declaredVars[])
All Packages Class Hierarchy This Package Previous Next Index