public final class Assignment<Tag extends java.lang.Enum<Tag>> extends SyntaxNode<Tag> implements UseDef
Consists of defined RangedVariable
target
variable and used value expression.
RangedVariable
SyntaxNode.Kind
Constructor and Description |
---|
Assignment(java.lang.Class<Tag> tagType,
Tag tag)
Constructs an assignment node.
|
Assignment(java.lang.Class<Tag> tagType,
Tag tag,
ru.ispras.fortress.expression.NodeVariable var,
ru.ispras.fortress.expression.Node expr)
Constructs object with the specified target non-ranged variable and value expression.
|
Assignment(java.lang.Class<Tag> tagType,
Tag tag,
RangedVariable target,
ru.ispras.fortress.expression.Node value)
Constructs object with the specified target variable and value expression.
|
Modifier and Type | Method and Description |
---|---|
Assignment<Tag> |
clone() |
boolean |
equals(java.lang.Object obj) |
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getDefines()
Returns a set of defined variables.
|
java.lang.String |
getSeparatedDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer,
java.lang.String separator)
Returns this assignment description that is presented in format of the specified printer
with the specified separator.
|
RangedVariable |
getTarget()
Returns defined ranged variable.
|
java.util.Set<java.lang.String> |
getUsedVariableNames()
Returns names of variables that are used in this object.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getUses()
Returns a set of used variables.
|
ru.ispras.fortress.expression.Node |
getValue()
Returns value expression.
|
ru.ispras.fortress.expression.NodeVariable |
getVariable()
Returns defined variable.
|
int |
hashCode() |
boolean |
isInitialized()
Checks rather all the object's fields are not
null . |
boolean |
ranged()
Checks rather this object contains a defining to ranged variable.
|
void |
setValue(ru.ispras.fortress.expression.Node value)
Sets new value expression.
|
void |
setVariable(RangedVariable variable)
Sets the specified variable as objects' target.
|
java.lang.String |
toString() |
add, containsAttribute, find, findRecursively, getAttribute, getChildren, getChildren, getKind, getName, getParent, getTag, getTagType, hasName, hasScope, setAttribute, setAttributes, setName, setParent, setRedefinitionHandler
public Assignment(java.lang.Class<Tag> tagType, Tag tag)
tagType
- the enumeration type representing node tags.tag
- the node tag.public Assignment(java.lang.Class<Tag> tagType, Tag tag, RangedVariable target, ru.ispras.fortress.expression.Node value)
tagType
- the enumeration type representing node tags.tag
- the node tag.target
- defined variablevalue
- used expressionjava.lang.IllegalArgumentException
- when any of arguments is null
.public Assignment(java.lang.Class<Tag> tagType, Tag tag, ru.ispras.fortress.expression.NodeVariable var, ru.ispras.fortress.expression.Node expr)
tagType
- the enumeration type representing node tags.tag
- the node tag.var
- defined variableexpr
- used expressionjava.lang.IllegalArgumentException
- when any of arguments is null
.public RangedVariable getTarget()
public ru.ispras.fortress.expression.NodeVariable getVariable()
public boolean ranged()
true
if this object defines ranged variable,
false
otherwisepublic void setVariable(RangedVariable variable)
variable
- new target variablejava.lang.IllegalArgumentException
- when argument is null
.public ru.ispras.fortress.expression.Node getValue()
public void setValue(ru.ispras.fortress.expression.Node value)
value
- new value expressionjava.lang.IllegalArgumentException
- when argument is null
.public java.util.Set<java.lang.String> getUsedVariableNames()
public java.lang.String getSeparatedDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer, java.lang.String separator)
printer
- expression printerseparator
- assignment separator between defined and used variablesjava.lang.IllegalArgumentException
- when any of the arguments is null
.public boolean isInitialized()
null
.true
when all the object's fields are not null
,
false
otherwisepublic 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 Assignment<Tag> clone()
clone
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object