public class DeclarationContainer extends MetaInfo
Constructor and Description |
---|
DeclarationContainer()
Default constructor.
|
DeclarationContainer(java.util.Map<ru.ispras.fortress.expression.NodeVariable,Declaration> map)
Constructs the object with the specified data.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsInput(java.lang.String name)
Checks whether this object contain input signal variable with the specified name.
|
boolean |
containsOutput(java.lang.String name)
Checks whether this object contains output signal variable with the specified name.
|
boolean |
containsRegister(java.lang.String name)
Checks whether this object contains internal variable with the specified name.
|
boolean |
containsVariable(ru.ispras.fortress.expression.NodeVariable variable)
Checks does this object contain the specified variable.
|
boolean |
containsVariable(java.lang.String name)
Checks whether object contains a variable with the specified name.
|
void |
declareVariable(ru.ispras.fortress.expression.NodeVariable variable)
Declares non-existing variable.
|
void |
declareVariable(ru.ispras.fortress.expression.NodeVariable variable,
ru.ispras.fortress.expression.Node initValue)
Declares the specified variable with the specified initial value.
|
void |
declareVariable(ru.ispras.fortress.expression.NodeVariable variable,
ru.ispras.fortress.expression.Node initialValue,
ru.ispras.castle.ast.Range invariant)
Declares the specified variable with the specified initial value and the specified invariant.
|
void |
declareVariable(ru.ispras.fortress.expression.NodeVariable variable,
ru.ispras.castle.ast.Range invariant)
Declares the specified variable with the specified invariant.
|
void |
declareVariables(java.util.Map<ru.ispras.fortress.expression.NodeVariable,Declaration> map)
Declares all the variables from the specified mapping.
|
boolean |
equals(java.lang.Object obj) |
ru.ispras.fortress.data.DataType |
getDataType(java.lang.String name)
Returns data type of the declared variable with the specified name.
|
Declaration |
getDeclaration(ru.ispras.fortress.expression.NodeVariable variable)
Returns the declaration for the specified variable.
|
java.util.Map<ru.ispras.fortress.expression.NodeVariable,Declaration> |
getDeclarationMap()
Returns the mapping from declared variables to their declarations.
|
java.util.Collection<Declaration> |
getDeclarations()
Returns variables declarations.
|
ru.ispras.fortress.expression.Node |
getInitialValue(java.lang.String name)
Returns the initial value for declared variable with the specified name.
|
java.util.Collection<java.lang.String> |
getInputNames()
Returns the collection of names of already declared input variables.
|
java.util.Collection<ru.ispras.fortress.expression.NodeVariable> |
getInputs()
Returns a collection of input signal variables that are declared into this object.
|
ru.ispras.fortress.expression.Node |
getInvariant(java.lang.String name)
Returns invariant of the declared variable with the specified name.
|
java.util.Collection<java.lang.String> |
getOutputNames()
Returns the collection of names of already declared output variables.
|
java.util.Collection<ru.ispras.fortress.expression.NodeVariable> |
getOutputs()
Returns a collection of output signal variables that are declared into this object.
|
java.util.Collection<java.lang.String> |
getRegisterNames()
Returns the collection of names of already declared internal (register) variables.
|
ru.ispras.fortress.expression.NodeVariable |
getVariable(java.lang.String name)
Returns declared variable with specified name.
|
java.util.Collection<java.lang.String> |
getVariableNames()
Returns the collection of names for already declared variables.
|
int |
getVariableNum()
Returns the number of declared variables.
|
java.util.List<ru.ispras.fortress.expression.NodeVariable> |
getVariables()
Returns declared variables.
|
int |
hashCode() |
void |
removeDeclaration(ru.ispras.fortress.expression.NodeVariable variable)
Removes the declaration for the variable.
|
void |
removeDeclaration(java.lang.String name)
Removes the declaration for the variable with the specified name.
|
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getAllMetaInfo, getMetaInfo, getMetaInfo, getStringMetaInfo, getStringMetaInfo, hasMetaInfo, hasMetaInfo
public DeclarationContainer()
public DeclarationContainer(java.util.Map<ru.ispras.fortress.expression.NodeVariable,Declaration> map)
map
- The mapping from variables to their declarations.public Declaration getDeclaration(ru.ispras.fortress.expression.NodeVariable variable)
variable
- The variable that declaration should be returned.null
otherwise.public java.util.Map<ru.ispras.fortress.expression.NodeVariable,Declaration> getDeclarationMap()
public java.util.Collection<Declaration> getDeclarations()
public ru.ispras.fortress.expression.NodeVariable getVariable(java.lang.String name)
name
- name of variable to be returnednull
if there is no such variable.java.lang.IllegalArgumentException
- when argument is null
.public java.util.List<ru.ispras.fortress.expression.NodeVariable> getVariables()
public java.util.Collection<java.lang.String> getVariableNames()
public java.util.Collection<java.lang.String> getInputNames()
public java.util.Collection<java.lang.String> getOutputNames()
public java.util.Collection<java.lang.String> getRegisterNames()
public int getVariableNum()
public java.util.Collection<ru.ispras.fortress.expression.NodeVariable> getInputs()
public java.util.Collection<ru.ispras.fortress.expression.NodeVariable> getOutputs()
public ru.ispras.fortress.data.DataType getDataType(java.lang.String name)
name
- variable namenull
otherwise.public ru.ispras.fortress.expression.Node getInvariant(java.lang.String name)
name
- variable namenull
otherwise.public ru.ispras.fortress.expression.Node getInitialValue(java.lang.String name)
name
- The name for declared variable.null
otherwise.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.IllegalArgumentException
- when argument is null
.public boolean containsVariable(java.lang.String name)
name
- variable nametrue
if object contains a variable with the specified name,
false
otherwise.public boolean containsInput(java.lang.String name)
name
- variable nametrue
if this object contains an input signal variable with the specified name,
false
otherwise.public boolean containsOutput(java.lang.String name)
name
- variable nametrue
if this object contains an output signal variable with the specified name,
false
otherwise.public boolean containsRegister(java.lang.String name)
name
- The name of declared variable.true
if this object contains an internal variable with the specified name,
false
otherwise.public void declareVariable(ru.ispras.fortress.expression.NodeVariable variable)
Object MUST NOT contain the specified variable. Check this fact by corresponding check-method first.
variable
- variable to be addedjava.lang.IllegalArgumentException
- when argument is null
.java.lang.IllegalStateException
- when this object
already contains such variable.public void declareVariable(ru.ispras.fortress.expression.NodeVariable variable, ru.ispras.fortress.expression.Node initValue)
variable
- The variable to be declared.initValue
- The initial value of the specified variable.java.lang.IllegalArgumentException
- when initial value argument is null
.public void declareVariable(ru.ispras.fortress.expression.NodeVariable variable, ru.ispras.castle.ast.Range invariant)
mObject MUST NOT contain the specified variable. Check this fact by corresponding method first.
variable
- variable to be addedinvariant
- variable invariant (can be null
)java.lang.IllegalArgumentException
- when variable argument is null
.java.lang.IllegalStateException
- when this module object
already contains such variable.public void declareVariable(ru.ispras.fortress.expression.NodeVariable variable, ru.ispras.fortress.expression.Node initialValue, ru.ispras.castle.ast.Range invariant)
Invariant keeps a constraint on variable value.
variable
- variableinitialValue
- initial value of variableinvariant
- variable invariantjava.lang.IllegalArgumentException
- when variable argument is null
.public void declareVariables(java.util.Map<ru.ispras.fortress.expression.NodeVariable,Declaration> map)
map
- The mapping from variables to their declaration descriptorspublic void removeDeclaration(java.lang.String name)
name
- The name for variable to be removed.public void removeDeclaration(ru.ispras.fortress.expression.NodeVariable variable)
variable
- The variable that is declared in this object.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object