|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.util.Utils
at.dms.compiler.Phylum
at.dms.kjc.JPhylum
at.dms.kjc.JExpression
at.dms.kjc.JBinaryExpression
public abstract class JBinaryExpression
This class is an abstract root class for binary expressions
Field Summary | |
---|---|
protected JExpression |
left
|
protected JExpression |
right
|
protected CType |
type
|
Fields inherited from class at.dms.kjc.JExpression |
---|
EMPTY |
Fields inherited from class at.dms.util.Utils |
---|
EMPTY_LIST, getForLoopCallers |
Fields inherited from interface at.dms.kjc.Constants |
---|
CMP_VERSION, JAV_CLASS, JAV_CLONE, JAV_CLONEABLE, JAV_CONSTRUCTOR, JAV_ERROR, JAV_EXCEPTION, JAV_INIT, JAV_LENGTH, JAV_NAME_SEPARATOR, JAV_OBJECT, JAV_OUTER_THIS, JAV_RUNTIME, JAV_RUNTIME_EXCEPTION, JAV_STATIC_INIT, JAV_STRING, JAV_STRINGBUFFER, JAV_THIS, JAV_THROWABLE, OPE_BAND, OPE_BNOT, OPE_BOR, OPE_BSR, OPE_BXOR, OPE_EQ, OPE_GE, OPE_GT, OPE_LE, OPE_LNOT, OPE_LT, OPE_MINUS, OPE_NE, OPE_PERCENT, OPE_PLUS, OPE_POSTDEC, OPE_POSTINC, OPE_PREDEC, OPE_PREINC, OPE_SIMPLE, OPE_SL, OPE_SLASH, OPE_SR, OPE_STAR, TID_ARRAY, TID_BIT, TID_BOOLEAN, TID_BYTE, TID_CHAR, TID_CLASS, TID_DOUBLE, TID_FLOAT, TID_INT, TID_LONG, TID_SHORT, TID_VECTOR, TID_VOID, VECTOR_EMPTY |
Constructor Summary | |
---|---|
protected |
JBinaryExpression()
|
|
JBinaryExpression(TokenReference where,
JExpression left,
JExpression right)
Construct a node in the parsing tree This method is directly called by the parser |
Method Summary | |
---|---|
JExpression |
constantFolding()
|
Object |
deepClone()
Returns a deep clone of this object. |
protected void |
deepCloneInto(JBinaryExpression other)
Clones all fields of this into |
void |
genBooleanResultCode(CodeSequence code,
boolean discardValue)
Generates a sequence of bytescodes |
void |
genBranch(boolean cond,
CodeSequence code,
at.dms.kjc.CodeLabel label)
Generates a sequence of bytescodes to branch on a label This method helps to handle heavy optimizables conditions |
protected void |
genBranch(JExpression left,
JExpression right,
boolean cond,
CodeSequence code,
at.dms.kjc.CodeLabel label)
Optimize a bi-conditional expression |
JExpression |
getLeft()
Returns what appears on left. |
JExpression |
getRight()
Returns what appears on right. |
CType |
getType()
Returns the type of this expression (call after parsing only) |
void |
setLeft(JExpression left)
Set what appears on the left of this. |
void |
setRight(JExpression right)
Set what appears on the right of this. |
void |
setType(CType t)
Set the type of this expression. |
Methods inherited from class at.dms.kjc.JExpression |
---|
accept, accept, accept, analyse, booleanValue, byteValue, charValue, convertType, convertType, deepCloneInto, doubleValue, fail, floatValue, genCode, genEndStoreCode, genStartStoreCode, getIdent, getLiteral, intValue, isAssignableTo, isConstant, isDynamic, isFinal, isInitialized, isLValue, isStatementExpression, longValue, setInitialized, shortValue, stringValue |
Methods inherited from class at.dms.kjc.JPhylum |
---|
assertMutable, check, check, check, check, deepCloneInto, setLineNumber |
Methods inherited from class at.dms.compiler.Phylum |
---|
deepCloneInto, getTokenReference, setTokenReference |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected CType type
protected JExpression left
protected JExpression right
Constructor Detail |
---|
protected JBinaryExpression()
public JBinaryExpression(TokenReference where, JExpression left, JExpression right)
where
- the line of this node in the source codeleft
- left operandright
- right operandMethod Detail |
---|
public CType getType()
JExpression
getType
in class JExpression
public void setType(CType t)
JExpression
setType
in class JExpression
t
- the CType to set.public void genBooleanResultCode(CodeSequence code, boolean discardValue)
code
- the code listpublic JExpression constantFolding()
public void genBranch(boolean cond, CodeSequence code, at.dms.kjc.CodeLabel label)
genBranch
in class JExpression
code
- the code listprotected void genBranch(JExpression left, JExpression right, boolean cond, CodeSequence code, at.dms.kjc.CodeLabel label)
public void setLeft(JExpression left)
public void setRight(JExpression right)
public JExpression getLeft()
public JExpression getRight()
public Object deepClone()
deepClone
in interface DeepCloneable
deepClone
in class JExpression
protected void deepCloneInto(JBinaryExpression other)
other
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |