|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.dms.kjc.EmptyAttributeVisitor
at.dms.kjc.ReplacingVisitor
at.dms.kjc.SLIRReplacingVisitor
at.dms.kjc.StatementQueueVisitor
public class StatementQueueVisitor
This visitor is for analyses that want to add one or more statements every time they see a given expression. Since an expression cannot be directly replaced by a statement, this class keeps track of pending statements and adds them as soon as possible at the statement level. For example, if you want to replace "pop()" by "buffer[index]; index = (index+1) % buffer_size" then you should extend this and treat the increment of "index" as the pending statement.
| Field Summary |
|---|
| Fields inherited from class at.dms.kjc.EmptyAttributeVisitor |
|---|
forwards |
| 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 | |
|---|---|
StatementQueueVisitor()
// ---------------------------------------------------------------------- // INTERFACE // ---------------------------------------------------------------------- |
|
| Method Summary | |
|---|---|
protected void |
addPendingStatement(JStatement stmt)
Subclasses should call this when visiting an expression to add a statement to the queue. |
Object |
visitDoStatement(JDoStatement self,
JExpression cond,
JStatement body)
prints a do statement |
Object |
visitExpressionListStatement(JExpressionListStatement self,
JExpression[] expr)
prints an expression list statement |
Object |
visitExpressionStatement(JExpressionStatement self,
JExpression expr)
prints an expression statement |
Object |
visitForStatement(JForStatement self,
JStatement init,
JExpression cond,
JStatement incr,
JStatement body)
visits a for statement |
Object |
visitIfStatement(JIfStatement self,
JExpression cond,
JStatement thenClause,
JStatement elseClause)
prints a if statement |
Object |
visitMessageStatement(SIRMessageStatement self,
JExpression portal,
String iname,
String ident,
JExpression[] args,
SIRLatency latency)
Visits a message statement. |
Object |
visitPrintStatement(SIRPrintStatement self,
JExpression arg)
Visits a print statement. |
Object |
visitReturnStatement(JReturnStatement self,
JExpression expr)
prints a return statement |
Object |
visitSwitchStatement(JSwitchStatement self,
JExpression expr,
JSwitchGroup[] body)
prints a switch statement |
Object |
visitVariableDeclarationStatement(JVariableDeclarationStatement self,
JVariableDefinition[] vars)
prints a variable declaration statement |
Object |
visitWhileStatement(JWhileStatement self,
JExpression cond,
JStatement body)
// ---------------------------------------------------------------------- // STATEMENT VISITORS // ---------------------------------------------------------------------- |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StatementQueueVisitor()
| Method Detail |
|---|
protected void addPendingStatement(JStatement stmt)
public Object visitWhileStatement(JWhileStatement self,
JExpression cond,
JStatement body)
visitWhileStatement in interface AttributeVisitor<Object>visitWhileStatement in class ReplacingVisitor
public Object visitVariableDeclarationStatement(JVariableDeclarationStatement self,
JVariableDefinition[] vars)
ReplacingVisitor
visitVariableDeclarationStatement in interface AttributeVisitor<Object>visitVariableDeclarationStatement in class ReplacingVisitor
public Object visitSwitchStatement(JSwitchStatement self,
JExpression expr,
JSwitchGroup[] body)
ReplacingVisitor
visitSwitchStatement in interface AttributeVisitor<Object>visitSwitchStatement in class ReplacingVisitor
public Object visitIfStatement(JIfStatement self,
JExpression cond,
JStatement thenClause,
JStatement elseClause)
ReplacingVisitor
visitIfStatement in interface AttributeVisitor<Object>visitIfStatement in class ReplacingVisitor
public Object visitForStatement(JForStatement self,
JStatement init,
JExpression cond,
JStatement incr,
JStatement body)
ReplacingVisitor
visitForStatement in interface AttributeVisitor<Object>visitForStatement in class ReplacingVisitor
public Object visitExpressionStatement(JExpressionStatement self,
JExpression expr)
ReplacingVisitor
visitExpressionStatement in interface AttributeVisitor<Object>visitExpressionStatement in class ReplacingVisitor
public Object visitExpressionListStatement(JExpressionListStatement self,
JExpression[] expr)
ReplacingVisitor
visitExpressionListStatement in interface AttributeVisitor<Object>visitExpressionListStatement in class ReplacingVisitor
public Object visitDoStatement(JDoStatement self,
JExpression cond,
JStatement body)
ReplacingVisitor
visitDoStatement in interface AttributeVisitor<Object>visitDoStatement in class ReplacingVisitor
public Object visitMessageStatement(SIRMessageStatement self,
JExpression portal,
String iname,
String ident,
JExpression[] args,
SIRLatency latency)
SLIRReplacingVisitor
visitMessageStatement in interface SLIRAttributeVisitor<Object>visitMessageStatement in class SLIRReplacingVisitor
public Object visitPrintStatement(SIRPrintStatement self,
JExpression arg)
SLIRReplacingVisitor
visitPrintStatement in interface SLIRAttributeVisitor<Object>visitPrintStatement in class SLIRReplacingVisitor
public Object visitReturnStatement(JReturnStatement self,
JExpression expr)
ReplacingVisitor
visitReturnStatement in interface AttributeVisitor<Object>visitReturnStatement in class ReplacingVisitor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||