|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object avrora.core.isdl.ast.Stmt avrora.core.isdl.ast.IfStmt
The IfStmt
class represents a simple branch within the IR. Since loops and switch statements
are not allowed, if statements (and subroutine calls) are the only form of control flow.
Field Summary | |
Expr |
cond
The cond field stores a reference to the expression that is evaluated as the condition
determining which branch is executed. |
java.util.List |
falseBranch
The falseBranch field stores a reference to the list of statements to be executed if the
condition is false. |
java.util.List |
trueBranch
The trueBranch field stores a reference to the list of statements to be executed if the
condition is true. |
Constructor Summary | |
IfStmt(Expr c,
java.util.List t,
java.util.List f)
The constructor of the IfStmt class simply initializes the internal fields based on the
parameters. |
Method Summary | |
Stmt |
accept(StmtRebuilder r,
java.lang.Object env)
The accept() method implements one half of the visitor pattern for visiting the abstract
syntax trees representing the code of a particular instruction or subroutine. |
void |
accept(StmtVisitor v)
The accept() method implements one half of the visitor pattern for visiting the abstract
syntax trees representing the code of a particular instruction or subroutine. |
java.lang.String |
toString()
The toString() method recursively converts this statement to a string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public final Expr cond
cond
field stores a reference to the expression that is evaluated as the condition
determining which branch is executed.
public final java.util.List trueBranch
trueBranch
field stores a reference to the list of statements to be executed if the
condition is true.
public final java.util.List falseBranch
falseBranch
field stores a reference to the list of statements to be executed if the
condition is false.
Constructor Detail |
public IfStmt(Expr c, java.util.List t, java.util.List f)
IfStmt
class simply initializes the internal fields based on the
parameters.
c
- a reference to the expression representing the conditiont
- a reference to the list of statements to execute if the condition evaluates to truef
- a reference to the list of statements to execute if the condition evaluates to falseMethod Detail |
public void accept(StmtVisitor v)
accept()
method implements one half of the visitor pattern for visiting the abstract
syntax trees representing the code of a particular instruction or subroutine.
accept
in class Stmt
v
- the visitor to acceptpublic java.lang.String toString()
toString()
method recursively converts this statement to a string.
public Stmt accept(StmtRebuilder r, java.lang.Object env)
accept()
method implements one half of the visitor pattern for visiting the abstract
syntax trees representing the code of a particular instruction or subroutine. The
StmtRebuilder
interface allows visitors to rearrange and rebuild the statements.
accept
in class Stmt
r
- the visitor to accept
visit()
of the rebuilder passed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |