public final 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(ru.ispras.castle.ast.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(Statement statement)
Adds the specified statement as child to this object.
|
void |
addAll(java.util.Collection<Statement> list)
Adds all the statements from the specified list as children.
|
void |
addAssignment(Assignment stmt)
Adds assignment.
|
void |
addAssignments(java.util.List<Assignment> statements)
Appends assignments list to the last assignment of this object.
|
void |
apply(java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
Applies bindings to this statement.
|
Statement |
deepCopy()
Returns a copy of this statement and all it's sub-statements.
|
boolean |
equals(java.lang.Object object) |
java.util.List<Assignment> |
getAssignments()
Returns all assignments.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getDefines() |
java.lang.String |
getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
Returns a string description in the format of the specified printer.
|
Statement |
getStatement(int num)
Returns a child statement of the specified index.
|
int |
getStatementNum()
Returns the number of child statements.
|
CfgStatementType |
getType()
Returns the statement type.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getUses() |
int |
hashCode() |
boolean |
isConcurrent()
Checks rather this object includes concurrent or blocking assignments.
|
void |
remove(Statement statement)
Removes the specified statement from children.
|
void |
removeAssignments()
Removes all assignments.
|
void |
setBlocking()
Mark the statement as blocking (non-concurrent).
|
void |
setConcurrent()
Mark this statement as concurrent.
|
isSequential
add, contains, containStatements, getDescription, getId, getParent, indexOf, isType, removeAll, removeParent, setParent
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getAllMetaInfo, getMetaInfo, getMetaInfo, getStringMetaInfo, getStringMetaInfo, hasMetaInfo, hasMetaInfo
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(ru.ispras.castle.ast.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()
Statement
public Statement deepCopy()
Statement
public void addAssignment(Assignment stmt)
AssignmentContainer
addAssignment
in interface AssignmentContainer
stmt
- Assignment to be added.public void addAssignments(java.util.List<Assignment> statements)
AssignmentContainer
addAssignments
in interface AssignmentContainer
statements
- Assignments to be added.public java.util.List<Assignment> getAssignments()
AssignmentContainer
getAssignments
in interface AssignmentContainer
public void removeAssignments()
AssignmentContainer
removeAssignments
in interface AssignmentContainer
public boolean isConcurrent()
AssignmentContainer
isConcurrent
in interface AssignmentContainer
true
if this object contains concurrent assignments only,
false
if this object contains blocking assignments only.public void setConcurrent()
public void setBlocking()
public void apply(java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
Statement
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()
public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getDefines()
getDefines
in interface ru.ispras.castle.ast.UseDef
getDefines
in class Statement
public int getStatementNum()
getStatementNum
in class Statement
public Statement getStatement(int num)
Statement
getStatement
in class Statement
num
- The index of child statement.null
if there is no such.public void add(Statement statement)
Statement
public void remove(Statement statement)
Statement