public abstract class CfgStatement extends MetaInfo implements Instantiated, Identifiable, UseDef
Modifier | Constructor and Description |
---|---|
protected |
CfgStatement() |
protected |
CfgStatement(CfgStatement statement) |
Modifier and Type | Method and Description |
---|---|
void |
add(CfgStatement statement)
Adds the specified statement as child to this object.
|
void |
add(CfgStatement statement,
int num)
Adds the specified child statement to this statement at the specified position.
|
void |
addAll(java.util.List<CfgStatement> list)
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.
|
boolean |
contains(CfgStatement statement)
Checks whether this statement contains the specified as the child.
|
boolean |
containStatements()
Checks whether this statement contains any other embedded statements.
|
abstract CfgStatement |
deepCopy()
Returns a copy of this statement and all it's sub-statements.
|
boolean |
equals(java.lang.Object obj) |
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getDefines()
Returns a set of defined variables.
|
java.lang.String |
getDescription()
Returns a
String description of the object in the format of the default system printer. |
java.lang.String |
getId()
Returns unique node identifier in string form.
|
CfgStatement |
getParent()
Returns parent statement.
|
CfgStatement |
getStatement(int num)
Returns a child statement of the specified number.
|
CfgStatement |
getStatement(java.lang.String id)
Returns sub-statement with the specified identifier.
|
int |
getStatementNum()
Returns a number of child statements.
|
abstract CfgStatementType |
getType()
Returns statement type.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getUses()
Returns a set of used variables.
|
int |
hashCode() |
boolean |
hasParent()
Checks whether this statement has parent statement.
|
int |
indexOf(CfgStatement statement)
Returns index of the specified statement.
|
boolean |
isType(CfgStatementType type)
Checks whether this statement is of specified type.
|
void |
remove(CfgStatement statement)
Removes the specified statement from children.
|
void |
removeAll()
Removes all the child statements.
|
void |
removeParent(CfgStatement parent)
Removes link with the specified statement.
|
void |
removeStatement(java.lang.String id)
Remove nested statement with the specified identifier.
|
void |
setParent(CfgStatement parent)
Sets the specified statement as parent.
|
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getMetaInfo, getMetaInfo, getMetaInfo, hasMetaInfo, hasMetaInfo, removeMetaInfo
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getDescription
protected CfgStatement()
protected CfgStatement(CfgStatement statement)
public abstract CfgStatementType getType()
public boolean isType(CfgStatementType type)
type
- Statement type.true
if this statement is of the specified type,
false
otherwise.public boolean containStatements()
true
if this statement contains statements, false
otherwise.public abstract CfgStatement deepCopy()
public int getStatementNum()
public CfgStatement getStatement(int num)
num
- Child statement number.null
if there is no such.public CfgStatement getStatement(java.lang.String id)
id
- Statement identifier.java.util.NoSuchElementException
- when there is no such sub-statement with the specified
identifier.public java.lang.String getId()
getId
in interface Identifiable
public int indexOf(CfgStatement statement)
statement
- Statement which index is returned.-1
otherwise.public boolean contains(CfgStatement statement)
statement
- Statement which existence in this object is checked.true
if this object contains the specified statement, false
otherwise.public void add(CfgStatement statement)
statement
- Statement to be added.java.lang.IllegalArgumentException
- when argument is null
.java.lang.IllegalArgumentException
- when this object already contains the specified statement.java.lang.IllegalArgumentException
- when the specified statement already has parent statement
and this parent is not equal to this statement.public void add(CfgStatement statement, int num)
statement
- Statement to be added as child.num
- New child statement position number.java.lang.IndexOutOfBoundsException
- if position argument is greater or equal to this statement
children number, or less that 0
.public void remove(CfgStatement statement)
statement
- Statement to be removed from child statements.java.lang.IllegalArgumentException
- when argument is null
.java.lang.IllegalArgumentException
- when this statement already contain the specified
statement as child.java.lang.IllegalArgumentException
- when the specified statement already has parent statement
and the parent statement is not equal to this statement.public void removeStatement(java.lang.String id)
Removes the statement with the specified identifier whether it is included into this statement's children or some of it's children at any degree of inclusion.
id
- Identifier of the statement to be removed.java.util.NoSuchElementException
- when there is no nested statement with the specified identifier.public void addAll(java.util.List<CfgStatement> list)
list
- Children statements to be added.public void removeAll()
public boolean hasParent()
true
if this statement has non-null parent statement, false
otherwise.public CfgStatement getParent()
public void setParent(CfgStatement parent)
parent
- Statement to be set as parent.java.lang.IllegalArgumentException
- when argument is null
.java.lang.IllegalStateException
- when this statement already has non-null parent statement
and the parent statement does not equal to the specified statement.public void removeParent(CfgStatement parent)
The specified statement should be a parent statement for this before this method.
parent
- parent statementjava.lang.IllegalArgumentException
- when argument is null
.java.lang.IllegalArgumentException
- when either this statement does not have parent
or it's parent is not equal to the specified statement.public void apply(java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
apply
in interface Instantiated
bindings
- Pairs of variable names and bounded expressions.public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getUses()
UseDef
public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getDefines()
UseDef
getDefines
in interface UseDef
public java.lang.String getDescription()
Identifiable
String
description of the object in the format of the default system printer.getDescription
in interface Identifiable