public class Process extends VariableContainer implements CfgModelNode
NEW_VAR_PREFIX
Constructor and Description |
---|
Process()
Default constructor.
|
Process(boolean initial)
Constructs new process with the specified value of initial flag.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(CfgModelNode node)
Adds child node.
|
void |
addNode(CfgNode node)
Adds control flow graph node.
|
void |
addNodes(java.util.Collection<CfgNode> nodes)
Adds control flow graph nodes collection.
|
void |
addParent(CfgModelNode node)
Adds parent node.
|
void |
append(java.util.List<CfgNode> nodes)
Appends another control flow graph nodes collection.
|
void |
applyBindings(java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
Applies bindings to process control flow graph and sensitivity list.
|
CfgModelNode |
deepCopy()
Returns a copy of this node.
|
boolean |
equals(java.lang.Object obj) |
java.util.Collection<CfgModelNode> |
getChildren()
Return child nodes.
|
java.lang.String |
getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
Returns node string description in the format of the specified printer.
|
java.lang.String |
getId()
Returns unique node identifier in string form.
|
java.util.List<CfgNode> |
getNodes()
Returns all nodes.
|
CfgModelNode |
getOnlyChild()
Returns the only child node.
|
CfgModelNode |
getOnlyParent()
Returns the only parent node.
|
java.util.Collection<CfgModelNode> |
getParents()
Returns parent nodes.
|
EventList |
getSensitivityList()
Returns
EventList sensitivity list. |
CfgNodeType |
getType()
Returns node type.
|
boolean |
hasChildren()
Checks rather node has child nodes.
|
int |
hashCode() |
boolean |
hasOnlyChild()
Checks rather node has exactly one child node.
|
boolean |
hasOnlyParent()
Checks rather node has exactly one parent node.
|
boolean |
hasParents()
Checks rather node has parent nodes.
|
boolean |
isInitial()
Checks rather process is of initial kind.
|
void |
removeChild(CfgModelNode node)
Removes child node.
|
void |
removeNode(CfgNode node)
Removes node.
|
void |
removeParent(CfgModelNode node)
Removes parent node.
|
void |
setSensitivityList(EventList eventList)
Sets new
EventList sensitivity list. |
containsInput, containsOutput, containsRegister, containsVariable, containsVariable, declareNewVariable, declareVariable, declareVariable, declareVariable, declareVariables, declareVariableVersion, getBindings, getDataType, getDeclaration, getDeclarations, getInitialValue, getInputNames, getInvariant, getOutputNames, getRegisterNames, getVariable, getVariableNames, getVariables, getVariablesMapping, removeDeclaration, setBindings, setVariablesMapping
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getMetaInfo, getMetaInfo, getMetaInfo, hasMetaInfo, hasMetaInfo, removeMetaInfo
public Process()
Constructs non-initial process.
public Process(boolean initial)
initial
- initial flagpublic void addNode(CfgNode node)
The argument node will only be added to control flow graph without establishing any "child-parent" links with already added nodes.
node
- node to be addedjava.lang.IllegalArgumentException
- when argument is null
.public void addNodes(java.util.Collection<CfgNode> nodes)
The argument nodes will only be added to control flow graph without establishing any "child-parent" links with already added nodes.
nodes
- nodes to be addedjava.lang.IllegalArgumentException
- when argument is null
.public void append(java.util.List<CfgNode> nodes)
The argument's nodes will not only be added to this nodes
but argument Source
starting source node will be linked
with this Sink
finishing sink node.
nodes
- nodes to be appendedpublic void removeNode(CfgNode node)
The specified node will only be removed from this object without removing any "child-parent" links with existing nodes.
node
- node to be removedjava.lang.IllegalArgumentException
- when argument is null
.public java.util.List<CfgNode> getNodes()
public boolean isInitial()
true
if process is initial, false
otherwise.public EventList getSensitivityList()
EventList
sensitivity list.public void setSensitivityList(EventList eventList)
EventList
sensitivity list.eventList
- event listjava.lang.IllegalArgumentException
- when either argument is null
or object is initial and argument is non-empty.public void applyBindings(java.util.Map<java.lang.String,ru.ispras.fortress.expression.Node> bindings)
bindings
- "variable name - expression" bindingpublic CfgModelNode deepCopy()
CfgModelNode
The copy does not keep the same links to parent or child nodes as this has.
deepCopy
in interface CfgModelNode
public java.lang.String getId()
CfgModelNode
getId
in interface CfgModelNode
public void addChild(CfgModelNode node)
CfgModelNode
addChild
in interface CfgModelNode
node
- child nodepublic void addParent(CfgModelNode node)
CfgModelNode
addParent
in interface CfgModelNode
node
- parent nodepublic void removeChild(CfgModelNode node)
CfgModelNode
removeChild
in interface CfgModelNode
node
- child nodepublic void removeParent(CfgModelNode node)
CfgModelNode
removeParent
in interface CfgModelNode
node
- parent nodepublic java.util.Collection<CfgModelNode> getParents()
CfgModelNode
getParents
in interface CfgModelNode
public CfgModelNode getOnlyChild()
CfgModelNode
getOnlyChild
in interface CfgModelNode
public java.util.Collection<CfgModelNode> getChildren()
CfgModelNode
getChildren
in interface CfgModelNode
public java.lang.String getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
CfgModelNode
getDescription
in interface CfgModelNode
printer
- printerpublic CfgNodeType getType()
CfgModelNode
By default, node has CfgNodeType.UNKNOWN
type.
getType
in interface CfgModelNode
public boolean hasParents()
CfgModelNode
hasParents
in interface CfgModelNode
true
if node has at least one parent, false
otherwise.public boolean hasOnlyParent()
CfgModelNode
hasOnlyParent
in interface CfgModelNode
true
if node has exactly one parent at the moment, false
otherwise.public boolean hasChildren()
CfgModelNode
hasChildren
in interface CfgModelNode
true
if node has at least one child, false
otherwise.public boolean hasOnlyChild()
CfgModelNode
hasOnlyChild
in interface CfgModelNode
true
if node has exactly one child at the moment, false
otherwise.public CfgModelNode getOnlyParent()
CfgModelNode
getOnlyParent
in interface CfgModelNode
public boolean equals(java.lang.Object obj)
equals
in class VariableContainer
public int hashCode()
hashCode
in class VariableContainer