public class CfgBlockStatement extends CfgStatement implements AssignmentContainer
Basic blocks can be either of concurrent (non-blocking) type or of sequential (blocking) type. The concurrent type means that all the assignments should be executed simultaneously in such a concurrent mode. The sequential type means that all the assignments should be executed sequentially in the same order they have in it's collection.
Constructor and Description |
---|
CfgBlockStatement(Assignment assignment)
Constructs object with the specified assignment and of non-concurrent type.
|
CfgBlockStatement(Assignment assignment,
boolean concurrent)
Constructs object with the specified assignment and the flag type.
|
CfgBlockStatement(boolean concurrent)
Constructs object of the specified type flag.
|
CfgBlockStatement(java.util.List<Assignment> assignments)
Constructs object with the specified collection of assignments.
|
CfgBlockStatement(java.util.List<Assignment> assignments,
boolean concurrent)
Constructs object with the specified assignments and the type flag.
|
CfgBlockStatement(ru.ispras.fortress.expression.NodeVariable target,
ru.ispras.fortress.expression.Node value)
Constructs object that contains one assignment with the specified target and value.
|
CfgBlockStatement(RangedVariable target,
ru.ispras.fortress.expression.Node value)
Constructs object that contains one assignment with the specified target and value.
|
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.
|
void |
addAssignment(Assignment stmt)
Adds assignment statement.
|
void |
addAssignments(java.util.List<Assignment> statements)
Appends assignments list to the last assignment of basic block.
|
void |
apply(java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
Applies bindings to this statement.
|
CfgStatement |
deepCopy()
Returns a copy of this statement and all it's sub-statements.
|
java.util.List<Assignment> |
getAssignments()
Returns all block assignments.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getDefines()
Returns a set of defined variables.
|
java.lang.String |
getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
Returns a string description in the format of the specified printer.
|
CfgStatement |
getStatement(int num)
Returns a child statement of the specified number.
|
int |
getStatementNum()
Returns a number of child statements.
|
CfgStatementType |
getType()
Returns statement type.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getUses()
Returns a set of used variables.
|
boolean |
isConcurrent()
Checks whether object contains only concurrent assignments.
|
void |
remove(CfgStatement statement)
Removes the specified statement from children.
|
void |
removeAssignments()
Removes all block assignments.
|
void |
setConcurrent(boolean concurrent)
Sets the concurrent flag to the specified value.
|
add, contains, containStatements, equals, getDescription, getId, getParent, getStatement, hashCode, hasParent, indexOf, isType, removeAll, removeParent, removeStatement, setParent
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getMetaInfo, getMetaInfo, getMetaInfo, hasMetaInfo, hasMetaInfo, removeMetaInfo
public CfgBlockStatement(boolean concurrent)
concurrent
- block type flagpublic CfgBlockStatement(java.util.List<Assignment> assignments, boolean concurrent)
assignments
- assignmentsconcurrent
- block type flagjava.lang.IllegalArgumentException
- when first argument is null
.public CfgBlockStatement(Assignment assignment, boolean concurrent)
assignment
- assignmentconcurrent
- block type flagjava.lang.IllegalArgumentException
- when assignment argument is null
.public CfgBlockStatement(java.util.List<Assignment> assignments)
The default value of concurrent flag is false
assignments
- assignmentsjava.lang.IllegalArgumentException
- when argument is null
.public CfgBlockStatement(Assignment assignment)
assignment
- assignmentpublic CfgBlockStatement(RangedVariable target, ru.ispras.fortress.expression.Node value)
target
- target variablevalue
- expression valueAssignment
public CfgBlockStatement(ru.ispras.fortress.expression.NodeVariable target, ru.ispras.fortress.expression.Node value)
target
- target variablevalue
- expression valueAssignment
public CfgStatementType getType()
CfgStatement
getType
in class CfgStatement
public CfgStatement deepCopy()
CfgStatement
deepCopy
in class CfgStatement
public void addAssignment(Assignment stmt)
Assignment will be added with on 1 greater number than other assignments have.
addAssignment
in interface AssignmentContainer
stmt
- assignment to be addedjava.lang.IllegalArgumentException
- when argument is null
.public void addAssignments(java.util.List<Assignment> statements)
addAssignments
in interface AssignmentContainer
statements
- list of concurrent assignmentsjava.lang.IllegalArgumentException
- when argument is null
.public java.util.List<Assignment> getAssignments()
getAssignments
in interface AssignmentContainer
public void removeAssignments()
removeAssignments
in interface AssignmentContainer
public boolean isConcurrent()
true
if contains only concurrent assignments,
false
otherwise.public void setConcurrent(boolean concurrent)
concurrent
- concurrent flagpublic void apply(java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
CfgStatement
apply
in interface Instantiated
apply
in class CfgStatement
bindings
- Pairs of variable names and bounded expressions.public java.lang.String getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
Identifiable
getDescription
in interface Identifiable
printer
- Printer that provides an output string format.public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getUses()
UseDef
getUses
in interface UseDef
getUses
in class CfgStatement
public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getDefines()
UseDef
getDefines
in interface UseDef
getDefines
in class CfgStatement
public int getStatementNum()
CfgStatement
getStatementNum
in class CfgStatement
public CfgStatement getStatement(int num)
CfgStatement
getStatement
in class CfgStatement
num
- Child statement number.null
if there is no such.public void add(CfgStatement statement)
CfgStatement
statement
- Statement to be added.public void remove(CfgStatement statement)
CfgStatement
statement
- Statement to be removed from child statements.public void addAll(java.util.List<CfgStatement> list)
CfgStatement
list
- Children statements to be added.