public class CfgSwitchStatement extends CfgStatement
Constructor and Description |
---|
CfgSwitchStatement(Event event)
Constructs an object with the specified event.
|
CfgSwitchStatement(Event event,
ru.ispras.fortress.expression.Node condition)
Constructs an object with the specified event and condition.
|
CfgSwitchStatement(ru.ispras.fortress.expression.Node condition)
Constructs an object with the specified condition.
|
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> statements)
Adds all the statements from the specified list as children.
|
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.
|
ru.ispras.fortress.expression.Node |
getCondition()
Returns
Node condition. |
java.lang.String |
getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
Returns a string description in the format of the specified printer.
|
EventList |
getEventList()
Returns event list.
|
CfgStatementType |
getType()
Returns statement type.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getUses()
Returns a set of used variables.
|
boolean |
hasEvents()
Checks whether this object contains an event.
|
void |
remove(CfgStatement statement)
Removes the specified statement from children.
|
void |
setCondition(ru.ispras.fortress.expression.Node expr)
Sets new
Node condition. |
add, contains, containStatements, equals, getDefines, getDescription, getId, getParent, getStatement, getStatement, getStatementNum, hashCode, hasParent, indexOf, isType, removeAll, removeParent, removeStatement, setParent
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getMetaInfo, getMetaInfo, getMetaInfo, hasMetaInfo, hasMetaInfo, removeMetaInfo
public CfgSwitchStatement(Event event, ru.ispras.fortress.expression.Node condition)
event
- Switch event.condition
- Switch condition.public CfgSwitchStatement(ru.ispras.fortress.expression.Node condition)
condition
- switch conditionpublic CfgSwitchStatement(Event event)
The condition is set to (@code true}.
event
- eventpublic void setCondition(ru.ispras.fortress.expression.Node expr)
Node
condition.expr
- expressionjava.lang.IllegalArgumentException
- when argument is either null
or not of the same DataType
data type
that its children CfgCaseStatement
nodes have.public CfgStatementType getType()
CfgStatement
getType
in class CfgStatement
public CfgStatement deepCopy()
CfgStatement
deepCopy
in class CfgStatement
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> statements)
CfgStatement
statements
- Children statements to be added.public ru.ispras.fortress.expression.Node getCondition()
Node
condition.public EventList getEventList()
public boolean hasEvents()
true
when this object containt an event,
false
otherwisepublic java.lang.String getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
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 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.