public class CfgLoopStatement extends CfgStatement
Modifier and Type | Class and Description |
---|---|
static class |
CfgLoopStatement.Type
Loop statement types.
|
Constructor and Description |
---|
CfgLoopStatement(CfgLoopStatement.Type type,
ru.ispras.fortress.expression.Node condition,
Assignment init,
Assignment increment)
Constructs loop statement with the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
add(CfgStatement statement)
Adds the specified statement as child to this object.
|
void |
addAll(java.util.List<CfgStatement> list)
Adds all the statements from the specified list as children.
|
CfgStatement |
deepCopy()
Returns a copy of this statement and all it's sub-statements.
|
ru.ispras.fortress.expression.Node |
getCondition()
Returns loop counter condition.
|
java.lang.String |
getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
Returns a string description in the format of the specified printer.
|
Assignment |
getIncrement()
Returns loop counter incrementation assignment.
|
Assignment |
getInit()
Returns loop counter initialization assignment.
|
CfgLoopStatement.Type |
getLoopType()
Returns loop type.
|
CfgStatementType |
getType()
Returns statement type.
|
void |
remove(CfgStatement statement)
Removes the specified statement from children.
|
void |
setCondition(ru.ispras.fortress.expression.Node condition)
Sets loop counter condition.
|
void |
setIncrement(Assignment increment)
Sets loop counter incrementation assignment.
|
void |
setInit(Assignment init)
Sets loop counter initialization assignment
|
void |
setType(CfgLoopStatement.Type type)
Sets loop type.
|
add, apply, contains, containStatements, equals, getDefines, getDescription, getId, getParent, getStatement, getStatement, getStatementNum, getUses, hashCode, hasParent, indexOf, isType, removeAll, removeParent, removeStatement, setParent
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getMetaInfo, getMetaInfo, getMetaInfo, hasMetaInfo, hasMetaInfo, removeMetaInfo
public CfgLoopStatement(CfgLoopStatement.Type type, ru.ispras.fortress.expression.Node condition, Assignment init, Assignment increment)
Constructs loop statement of the specified type, with the specified condition, initialization and incrementation assignments on loop counter
type
- loop typecondition
- loop counter conditioninit
- loop counter initialization assignmentincrement
- loop counter incrementation assignmentjava.lang.IllegalArgumentException
- when type argument is null
.public CfgLoopStatement.Type getLoopType()
public void setType(CfgLoopStatement.Type type)
type
- loop typejava.lang.IllegalArgumentException
- when argument is null
.public Assignment getInit()
public void setInit(Assignment init)
init
- loop counter initialization assignmentjava.lang.IllegalArgumentException
- when argument is null
for REPEAT
and FOR
loops.public ru.ispras.fortress.expression.Node getCondition()
public void setCondition(ru.ispras.fortress.expression.Node condition)
condition
- loop counter conditionjava.lang.IllegalArgumentException
- when argument is null
and loop type
is not equal to FOREVER
.public Assignment getIncrement()
public void setIncrement(Assignment increment)
increment
- loop counter incrementation assignmentjava.lang.IllegalArgumentException
- when argument is null
for REPEAT
and FOR
loops.public CfgStatementType getType()
CfgStatement
getType
in class CfgStatement
public CfgStatement deepCopy()
CfgStatement
deepCopy
in class CfgStatement
public java.lang.String getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
Identifiable
printer
- Printer that provides an output string format.public void add(CfgStatement statement)
CfgStatement
add
in class CfgStatement
statement
- Statement to be added.public void remove(CfgStatement statement)
CfgStatement
remove
in class CfgStatement
statement
- Statement to be removed from child statements.public void addAll(java.util.List<CfgStatement> list)
CfgStatement
addAll
in class CfgStatement
list
- Children statements to be added.