public abstract class DecStatement extends Statement
Modifier and Type | Method and Description |
---|---|
ru.ispras.fortress.expression.NodeVariable |
declareNewVariable(ru.ispras.fortress.data.DataType dataType)
Declares new variable of the specified data type.
|
boolean |
declares(ru.ispras.fortress.expression.NodeVariable variable)
Checks does this object contain the specified variable.
|
boolean |
declares(java.lang.String name)
Checks whether object contains a variable with the specified name.
|
boolean |
declaresInput(java.lang.String name)
Checks whether this object contain input signal variable with the specified name.
|
boolean |
declaresOutput(java.lang.String name)
Checks whether this object contain output signal variable with the specified name.
|
boolean |
declaresRegister(java.lang.String name)
Checks whether this object contain register 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,
Declaration declaration)
Declares the specified variable with the related data.
|
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> declarations)
Declares the specified collection of variables.
|
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 of the specified variable.
|
java.util.Map<ru.ispras.fortress.expression.NodeVariable,Declaration> |
getDeclarationMap()
Mapping of internal variables names to variable declarations.
|
java.util.Collection<Declaration> |
getDeclarations()
Returns variables declarations.
|
ru.ispras.fortress.expression.Node |
getInitialValue(java.lang.String name)
Returns initial value of the declared variable with the specified name.
|
java.util.Collection<java.lang.String> |
getInputNames()
Returns a collection of names of the declared input signal 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 a collection of names of the declared output signal 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 a collection of names of the declared 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 a collection of this object variables names.
|
java.util.List<ru.ispras.fortress.expression.NodeVariable> |
getVariables()
Returns declared variables.
|
void |
removeDeclaration(ru.ispras.fortress.expression.NodeVariable variable)
Removes declaration of the specified variable.
|
void |
removeDeclaration(java.lang.String name)
Removes declaration of variable with the specified name.
|
add, add, addAll, apply, contains, containStatements, deepCopy, equals, getDefines, getDescription, getId, getParent, getStatement, getStatementNum, getType, getUses, hashCode, indexOf, isSequential, isType, remove, removeAll, removeParent, setParent
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getAllMetaInfo, getMetaInfo, getMetaInfo, getStringMetaInfo, getStringMetaInfo, hasMetaInfo, hasMetaInfo
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getDescription
public java.util.Collection<Declaration> getDeclarations()
public Declaration getDeclaration(ru.ispras.fortress.expression.NodeVariable variable)
variable
- variablejava.lang.IllegalArgumentException
- when argument is null
.public java.util.Map<ru.ispras.fortress.expression.NodeVariable,Declaration> getDeclarationMap()
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<ru.ispras.fortress.expression.NodeVariable> getInputs()
public java.util.Collection<java.lang.String> getOutputNames()
public java.util.Collection<ru.ispras.fortress.expression.NodeVariable> getOutputs()
public java.util.Collection<java.lang.String> getRegisterNames()
public ru.ispras.fortress.data.DataType getDataType(java.lang.String name)
name
- variable namenull
otherwise.public ru.ispras.fortress.expression.Node getInitialValue(java.lang.String name)
name
- variable namenull
otherwise.public ru.ispras.fortress.expression.Node getInvariant(java.lang.String name)
name
- variable namenull
otherwise.public boolean declares(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 declares(java.lang.String name)
name
- variable nametrue
if object contains a variable with the specified name,
false
otherwise.java.lang.IllegalArgumentException
- when argument is null
.public boolean declaresInput(java.lang.String name)
name
- variable nametrue
if this object contains an input signal variable with the specified name,
false
otherwise.java.lang.IllegalArgumentException
- when argument is null
.public boolean declaresOutput(java.lang.String name)
name
- variable nametrue
if this object contains an output signal variable with the specified name,
false
otherwise.java.lang.IllegalArgumentException
- when argument is null
.public boolean declaresRegister(java.lang.String name)
name
- variable nametrue
if this object contains a register variable with the specified name,
false
otherwise.java.lang.IllegalArgumentException
- when argument is null
.public void declareVariables(java.util.Map<ru.ispras.fortress.expression.NodeVariable,Declaration> declarations)
declarations
- variables declarationsjava.lang.IllegalArgumentException
- when argument is null
.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 declareVariable(ru.ispras.fortress.expression.NodeVariable variable, Declaration declaration)
variable
- The variable to be declared.declaration
- The variable data.public ru.ispras.fortress.expression.NodeVariable declareNewVariable(ru.ispras.fortress.data.DataType dataType)
NOTE: the VariableDescriptor
variable data is not set here
because of Verilog parser features.
dataType
- new variable data typejava.lang.IllegalArgumentException
- when argument is null
.public void removeDeclaration(java.lang.String name)
name
- variable namejava.lang.IllegalArgumentException
- when argument is null
.public void removeDeclaration(ru.ispras.fortress.expression.NodeVariable variable)
variable
- The variable that is declared here.java.lang.IllegalArgumentException
- when argument is null
.