public abstract class CfgVariableContainerNode extends CfgModelNode
CfgModel
that contains a collection of variable declarations
VariableDeclaration
and a collection of bindings
between internal variables and external expressions.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NEW_VAR_PREFIX |
Constructor and Description |
---|
CfgVariableContainerNode()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addDeclaration(java.lang.String name,
VariableDeclaration declaration)
Adds the variable with the specified name and the specified declaration.
|
ru.ispras.fortress.expression.NodeVariable |
addNewVariable(ru.ispras.fortress.data.DataType dataType)
Creates new variable of the specified data type and adds it to the declarations of this module.
|
void |
addVariable(ru.ispras.fortress.expression.NodeVariable variable)
Adds variable declaration.
|
void |
addVariable(ru.ispras.fortress.expression.NodeVariable variable,
ru.ispras.fortress.expression.Node invariant)
Adds variable declaration.
|
ru.ispras.fortress.expression.NodeVariable |
addVariableVersion(RangedVariable variable)
Creates a version of already declared variable and adds it to the declarations of this module.
|
boolean |
containsVariable(ru.ispras.fortress.expression.NodeVariable variable)
Checks does this module contain the specified variable.
|
java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> |
getBindings()
Returns module's bindings.
|
VariableDeclaration |
getDeclaration(ru.ispras.fortress.expression.NodeVariable variable)
Returns the declaration of the specified variable.
|
java.util.Collection<VariableDeclaration> |
getDeclarations()
Returns a collection of variables declarations.
|
ru.ispras.fortress.expression.NodeVariable |
getVariable(java.lang.String name)
Returns declared variable with specified name.
|
java.util.List<ru.ispras.fortress.expression.NodeVariable> |
getVariables()
Returns declared variables.
|
java.util.Map<java.lang.String,VariableDeclaration> |
getVariablesMapping()
Mapping of names of internal variables to variable declarations.
|
void |
removeDeclaration(java.lang.String name)
Removes declaration of variable with the specified name.
|
void |
setBindings(java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
Sets module's bindings.
|
void |
setVariablesMapping(java.util.Map<java.lang.String,VariableDeclaration> map)
Sets declared variables mapping.
|
addChild, addParent, deepcopy, getChildren, getDescription, getId, getOnlyChild, getOnlyParent, getParents, getType, hasChildren, hasParents, removeChild, removeParent
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getMetaInfo, getMetaInfo, getMetaInfo, hasMetaInfo, hasMetaInfo, removeMetaInfo, removeMetaInfo
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDefines, getUses
public static final java.lang.String NEW_VAR_PREFIX
public CfgVariableContainerNode()
public java.util.Collection<VariableDeclaration> getDeclarations()
public java.util.Map<java.lang.String,VariableDeclaration> getVariablesMapping()
public java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> getBindings()
public void setBindings(java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
bindings
- new bindingsjava.lang.NullPointerException
- when argument is null
.public boolean containsVariable(ru.ispras.fortress.expression.NodeVariable variable)
variable
- variable to be checkedtrue
if module already has such variable declared, false
otherwise.java.lang.NullPointerException
- when argument is null
.public VariableDeclaration getDeclaration(ru.ispras.fortress.expression.NodeVariable variable)
variable
- variable of which the declaration should be returnedjava.lang.NullPointerException
- when argument is null
.public void addVariable(ru.ispras.fortress.expression.NodeVariable variable)
variable
- variable to be addedjava.lang.NullPointerException
- when variable argument is null
.java.lang.IllegalStateException
- when this module object
already contains such variable.public void addVariable(ru.ispras.fortress.expression.NodeVariable variable, ru.ispras.fortress.expression.Node invariant)
variable
- variable to be addedinvariant
- variable invariant (can be null
)java.lang.NullPointerException
- when variable argument is null
.java.lang.IllegalStateException
- when this module object
already contains such variable.public ru.ispras.fortress.expression.NodeVariable addNewVariable(ru.ispras.fortress.data.DataType dataType)
dataType
- new variable data typejava.lang.NullPointerException
- when argument is null
.public ru.ispras.fortress.expression.NodeVariable addVariableVersion(RangedVariable variable)
variable
- an already declared module variablejava.lang.NullPointerException
- when argument is null
.java.lang.IllegalArgumentException
- when this object does not contain
the specified variable.public ru.ispras.fortress.expression.NodeVariable getVariable(java.lang.String name)
name
- name of variable to be returnedjava.lang.NullPointerException
- when argument is null
.public void setVariablesMapping(java.util.Map<java.lang.String,VariableDeclaration> map)
map
- mapping of variable name to variable declarationjava.lang.NullPointerException
- when argument is null
.public java.util.List<ru.ispras.fortress.expression.NodeVariable> getVariables()
public void removeDeclaration(java.lang.String name)
name
- variable namejava.lang.NullPointerException
- when argument is null
.public void addDeclaration(java.lang.String name, VariableDeclaration declaration)
name
- variable namedeclaration
- variable declarationjava.lang.NullPointerException
- when any of the arguments is null
.