Attribute
public static final Type Attribute
Boolean
public static final Type Boolean
Comment
public static final Type Comment
Element
public static final Type Element
Int
public static final Type Int
Node
public static final Type Node
NodeSet
public static final Type NodeSet
Object
public static final Type Object
ObjectString
public static final Type ObjectString
Processing_Instruction
public static final Type Processing_Instruction
Real
public static final Type Real
Reference
public static final Type Reference
ResultTree
public static final Type ResultTree
Root
public static final Type Root
String
public static final Type String
Text
public static final Type Text
Void
public static final Type Void
ADD
public Instruction ADD()
CMP
public Instruction CMP(boolean less)
DIV
public Instruction DIV()
DUP
public Instruction DUP()
GE
public BranchInstruction GE(boolean tozero)
GT
public BranchInstruction GT(boolean tozero)
LE
public BranchInstruction LE(boolean tozero)
LOAD
public Instruction LOAD(int slot)
LT
public BranchInstruction LT(boolean tozero)
MUL
public Instruction MUL()
NEG
public Instruction NEG()
POP
public Instruction POP()
REM
public Instruction REM()
STORE
public Instruction STORE(int slot)
SUB
public Instruction SUB()
distanceTo
public int distanceTo(Type type)
Returns the distance between two types. This measure is used to select
overloaded functions/operators. This method is typically redefined by
the subclasses.
getClassName
public String getClassName()
Returns the class name of an internal type's external representation.
identicalTo
public boolean identicalTo(Type other)
Returns true if this and other are identical types.
implementedAsMethod
public boolean implementedAsMethod()
Returns true if this type has no object representaion. Redefined in
ResultTreeType.
isNumber
public boolean isNumber()
Returns true if this type is a numeric type. Redefined in NumberType.
isSimple
public boolean isSimple()
Returns true if this type is a simple type. Redefined in NumberType,
BooleanType and StringType.
newObjectType
public static Type newObjectType(Class clazz)
Factory method to instantiate object types. Returns a pre-defined
instance for java.lang.Object.class and java.lang.String.class.
newObjectType
public static Type newObjectType(String javaClassName)
Factory method to instantiate object types. Returns a pre-defined
instance for "java.lang.Object" and "java.lang.String".
toJCType
public org.apache.bcel.generic.Type toJCType()
toSignature
public String toSignature()
Returns the signature of an internal type's external representation.
toString
public String toString()
Returns a string representation of this type.
translateBox
public void translateBox(ClassGenerator classGen,
MethodGenerator methodGen)
Translates an object of this type to its boxed representation.
translateFrom
public void translateFrom(ClassGenerator classGen,
MethodGenerator methodGen,
Class clazz)
Translates an external (Java) type denoted by clazz
to
an object of this type. This method is used to translate return values
when external functions are called.
translateTo
public void translateTo(ClassGenerator classGen,
MethodGenerator methodGen,
Class clazz)
Translates an object of this type to the external (Java) type denoted
by clazz
. This method is used to translate parameters
when external functions are called.
translateTo
public void translateTo(ClassGenerator classGen,
MethodGenerator methodGen,
Type type)
Translates an object of this type to an object of type
type
.
Expects an object of the former type and pushes an object of the latter.
translateToDesynthesized
public FlowList translateToDesynthesized(ClassGenerator classGen,
MethodGenerator methodGen,
BooleanType type)
Translates an object of this type to an non-synthesized boolean. It
does not push a 0 or a 1 but instead returns branchhandle list to be
appended to the false list.
translateToDesynthesized
public FlowList translateToDesynthesized(ClassGenerator classGen,
MethodGenerator methodGen,
Type type)
Translates object of this type to an object of type type
.
Expects an object of the former type and pushes an object of the latter
if not boolean. If type type
is boolean then a branchhandle
list (to be appended to the false list) is returned.
translateUnBox
public void translateUnBox(ClassGenerator classGen,
MethodGenerator methodGen)
Translates an object of this type to its unboxed representation.