org.apache.xalan.xsltc.compiler.util
Class Type

java.lang.Object
  |
  +--org.apache.xalan.xsltc.compiler.util.Type
Direct Known Subclasses:
BooleanType, MethodType, NodeSetType, NodeType, NumberType, ObjectType, ReferenceType, ResultTreeType, StringType, VoidType

public abstract class Type
extends java.lang.Object
implements Constants


Field Summary
static Type Attribute
           
static Type Boolean
           
static Type Comment
           
static Type Element
           
static Type Int
           
static Type Node
           
static Type NodeSet
           
static Type Object
           
static Type Processing_Instruction
           
static Type Real
           
static Type Reference
           
static Type ResultTree
           
static Type Root
           
static Type String
           
static Type Text
           
static Type Void
           
 
Constructor Summary
Type()
           
 
Method Summary
 org.apache.bcel.generic.Instruction ADD()
           
 org.apache.bcel.generic.Instruction CMP(boolean less)
           
 int distanceTo(Type type)
          Returns the distance between two types.
 org.apache.bcel.generic.Instruction DIV()
           
 org.apache.bcel.generic.Instruction DUP()
           
 org.apache.bcel.generic.BranchInstruction GE(boolean tozero)
           
 java.lang.String getClassName()
          Returns the class name of an internal type's external representation.
 org.apache.bcel.generic.BranchInstruction GT(boolean tozero)
           
abstract  boolean identicalTo(Type other)
          Returns true if this and other are identical types.
 boolean implementedAsMethod()
          Returns true if this type has no object representaion.
 boolean isNumber()
          Returns true if this type is a numeric type.
 boolean isSimple()
          Returns true if this type is a simple type.
 org.apache.bcel.generic.BranchInstruction LE(boolean tozero)
           
 org.apache.bcel.generic.Instruction LOAD(int slot)
           
 org.apache.bcel.generic.BranchInstruction LT(boolean tozero)
           
 org.apache.bcel.generic.Instruction MUL()
           
 org.apache.bcel.generic.Instruction NEG()
           
static Type newObjectType(java.lang.Class clazz)
          Factory method to instantiate object types.
static Type newObjectType(java.lang.String javaClassName)
          Factory method to instantiate object types.
 org.apache.bcel.generic.Instruction POP()
           
 org.apache.bcel.generic.Instruction REM()
           
 org.apache.bcel.generic.Instruction STORE(int slot)
           
 org.apache.bcel.generic.Instruction SUB()
           
abstract  org.apache.bcel.generic.Type toJCType()
           
abstract  java.lang.String toSignature()
          Returns the signature of an internal type's external representation.
abstract  java.lang.String toString()
          Returns a string representation of this type.
 void translateBox(ClassGenerator classGen, MethodGenerator methodGen)
          Translates an object of this type to its boxed representation.
 void translateFrom(ClassGenerator classGen, MethodGenerator methodGen, java.lang.Class clazz)
          Translates an external (Java) type denoted by clazz to an object of this type.
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, java.lang.Class clazz)
          Translates an object of this type to the external (Java) type denoted by clazz.
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, Type type)
          Translates an object of this type to an object of type type.
 FlowList translateToDesynthesized(ClassGenerator classGen, MethodGenerator methodGen, BooleanType type)
          Translates an object of this type to an non-synthesized boolean.
 FlowList translateToDesynthesized(ClassGenerator classGen, MethodGenerator methodGen, Type type)
          Translates object of this type to an object of type type.
 void translateUnBox(ClassGenerator classGen, MethodGenerator methodGen)
          Translates an object of this type to its unboxed representation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Int

public static final Type Int

Real

public static final Type Real

Boolean

public static final Type Boolean

NodeSet

public static final Type NodeSet

String

public static final Type String

ResultTree

public static final Type ResultTree

Reference

public static final Type Reference

Void

public static final Type Void

Object

public static final Type Object

Node

public static final Type Node

Root

public static final Type Root

Element

public static final Type Element

Attribute

public static final Type Attribute

Text

public static final Type Text

Comment

public static final Type Comment

Processing_Instruction

public static final Type Processing_Instruction
Constructor Detail

Type

public Type()
Method Detail

newObjectType

public static Type newObjectType(java.lang.String javaClassName)
Factory method to instantiate object types. Returns a pre-defined instance for "java.lang.Object" and "java.lang.String".

newObjectType

public static Type newObjectType(java.lang.Class clazz)
Factory method to instantiate object types. Returns a pre-defined instance for java.lang.Object.class and java.lang.String.class.

toString

public abstract java.lang.String toString()
Returns a string representation of this type.
Overrides:
toString in class java.lang.Object

identicalTo

public abstract boolean identicalTo(Type other)
Returns true if this and other are identical types.

isNumber

public boolean isNumber()
Returns true if this type is a numeric type. Redefined in NumberType.

implementedAsMethod

public boolean implementedAsMethod()
Returns true if this type has no object representaion. Redefined in ResultTreeType.

isSimple

public boolean isSimple()
Returns true if this type is a simple type. Redefined in NumberType, BooleanType and StringType.

toJCType

public abstract org.apache.bcel.generic.Type toJCType()

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.

toSignature

public abstract java.lang.String toSignature()
Returns the signature of an internal type's external representation.

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,
                                         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.

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.

translateTo

public void translateTo(ClassGenerator classGen,
                        MethodGenerator methodGen,
                        java.lang.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.

translateFrom

public void translateFrom(ClassGenerator classGen,
                          MethodGenerator methodGen,
                          java.lang.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.

translateBox

public void translateBox(ClassGenerator classGen,
                         MethodGenerator methodGen)
Translates an object of this type to its boxed representation.

translateUnBox

public void translateUnBox(ClassGenerator classGen,
                           MethodGenerator methodGen)
Translates an object of this type to its unboxed representation.

getClassName

public java.lang.String getClassName()
Returns the class name of an internal type's external representation.

ADD

public org.apache.bcel.generic.Instruction ADD()

SUB

public org.apache.bcel.generic.Instruction SUB()

MUL

public org.apache.bcel.generic.Instruction MUL()

DIV

public org.apache.bcel.generic.Instruction DIV()

REM

public org.apache.bcel.generic.Instruction REM()

NEG

public org.apache.bcel.generic.Instruction NEG()

LOAD

public org.apache.bcel.generic.Instruction LOAD(int slot)

STORE

public org.apache.bcel.generic.Instruction STORE(int slot)

POP

public org.apache.bcel.generic.Instruction POP()

GT

public org.apache.bcel.generic.BranchInstruction GT(boolean tozero)

GE

public org.apache.bcel.generic.BranchInstruction GE(boolean tozero)

LT

public org.apache.bcel.generic.BranchInstruction LT(boolean tozero)

LE

public org.apache.bcel.generic.BranchInstruction LE(boolean tozero)

CMP

public org.apache.bcel.generic.Instruction CMP(boolean less)

DUP

public org.apache.bcel.generic.Instruction DUP()


Copyright 2006 Apache XML Project. All Rights Reserved.