|
||||||||||
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.JStatement
at.dms.kjc.JLoopStatement
at.dms.kjc.JForStatement
at.dms.kjc.rstream.JDoLoopStatement
public class JDoLoopStatement
An SIR node representing a do loop. It is equivalent to a for loop with: for (*type_of_induction* *induction* = *initExpr*; *induction* < *cond*; *induction* += incr) *body*. The resulting for loop generated by this class will be semantically equal. Note this class is not visited by Kjc visitors!
Field Summary |
---|
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 |
JDoLoopStatement()
|
|
JDoLoopStatement(JLocalVariable induction,
JExpression initVal,
JExpression condVal,
JExpression incrVal,
JStatement body,
boolean countUp)
construct a new JDoLoopStatement, see the class comment for semantics. |
|
JDoLoopStatement(JLocalVariable induction,
JExpression initVal,
JExpression condVal,
JExpression incrVal,
JStatement body,
boolean countUp,
boolean zeroInit)
construct a new JDoLoopStatement, see the class comment for semantics. |
Method Summary | |
---|---|
boolean |
countUp()
return true if this loop increments the induction var |
Object |
deepClone()
Returns a deep clone of this object. |
protected void |
deepCloneInto(JDoLoopStatement other)
Clones all fields of this into |
JExpression |
getCondValue()
return the value that the induction var is compared to in : *induction* < *cond* |
int |
getIncrInt()
return the integer value of the increment value, if not a int literal, fail |
JExpression |
getIncrValue()
return the value that is added to the induction var for each iterations |
JLocalVariable |
getInduction()
return the induction var of this loop |
JExpression |
getInitValue()
return the value that the induction var is initialized to |
int |
getTripCount()
return the trip count of the loop, for this function to pass, the loop must have static bounds |
boolean |
staticBounds()
return true if the init, cond, and incr values are int literals at compile time |
boolean |
zeroInit()
return true if this loop initializes the induction to zero |
Methods inherited from class at.dms.kjc.JForStatement |
---|
accept, accept, analyse, deepCloneInto, genCode, getBody, getCondition, getIncrement, getInit, getUnrolled, setBody, setCond, setIncr, setInit, setUnrolled |
Methods inherited from class at.dms.kjc.JLoopStatement |
---|
deepCloneInto, getBreakLabel, getContinueLabel |
Methods inherited from class at.dms.kjc.JStatement |
---|
deepCloneInto, fail, getComments, setComments |
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 |
Constructor Detail |
---|
public JDoLoopStatement(JLocalVariable induction, JExpression initVal, JExpression condVal, JExpression incrVal, JStatement body, boolean countUp)
public JDoLoopStatement(JLocalVariable induction, JExpression initVal, JExpression condVal, JExpression incrVal, JStatement body, boolean countUp, boolean zeroInit)
protected JDoLoopStatement()
Method Detail |
---|
public JExpression getCondValue()
public JLocalVariable getInduction()
public boolean countUp()
public boolean zeroInit()
public JExpression getInitValue()
public JExpression getIncrValue()
public boolean staticBounds()
public int getIncrInt()
public int getTripCount()
public Object deepClone()
deepClone
in interface DeepCloneable
deepClone
in class JForStatement
protected void deepCloneInto(JDoLoopStatement other)
other
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |