|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gnu.jel.OP
A tree node, representing an operation.
Field Summary | |
OP[] |
chi
Holds references to children of this node |
int |
resID
Holds type ID of the result of this OP |
java.lang.Class |
resType
Holds type of the result of this OP |
static java.lang.Class[] |
specialTypes
Classes of the special types by ID. |
static byte[] |
unwrapType
Unwraps the type ID. |
Constructor Summary | |
OP()
|
Method Summary | |
abstract void |
compile(ClassFile cf)
Called to generate the code implementing this OP. |
abstract java.lang.Object |
eval()
Called to evaluate this node and all its sub-nodes. |
static boolean |
isWidening(java.lang.Class c1,
java.lang.Class c2)
Used to find out if the conversion t1->t2 is widening. |
static boolean |
isWidening(int id1,
java.lang.Class c1,
int id2,
java.lang.Class c2)
Used to find out if the conversion t1->t2 is widening. |
static int |
typeID(java.lang.Class c)
Identifies the primitive type of the given class. |
static int |
typeIDObject(java.lang.Object o)
Identify the primitive type corresponding to the given reflection object. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public OP[] chi
public int resID
public java.lang.Class resType
public static final java.lang.Class[] specialTypes
The frequently used types (those on which many operations are defined) are identified by an integer number. The advantage is the possibility to have almost completely table driven code generator.
So, the special types are only special in the fact that except of the reference to their class object they are also identified by an integer number.
public static final byte[] unwrapType
That is all special types which are references are translated into 8.
Constructor Detail |
public OP()
Method Detail |
public abstract java.lang.Object eval() throws java.lang.Exception
Upon success this node is to be replaced by the constant node holding the returned object.
if
- can't evaluate, in this case the sub-nodes
java.lang.Exception
public abstract void compile(ClassFile cf)
cf
- class file with a new open method to write the code into.public static final int typeID(java.lang.Class c)
c
- class to identify.
public static final int typeIDObject(java.lang.Object o)
o
- object to identify.
public static boolean isWidening(int id1, java.lang.Class c1, int id2, java.lang.Class c2)
id1
- type ID to convert fromc1
- class to convert from (used if id1==8)id2
- type ID to convert toc2
- class to convert to (used if id2==8)
public static boolean isWidening(java.lang.Class c1, java.lang.Class c2)
c1
- class to convert from (used if id1==8)c2
- class to convert to (used if id2==8)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |