public class Assignment extends MetaInfo implements Identifiable, UseDef
Consists of defined RangedVariable
target
variable and used value expression.
RangedVariable
Constructor and Description |
---|
Assignment()
Default constructor.
|
Assignment(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(RangedVariable target,
ru.ispras.fortress.expression.Node value)
Constructs object with the specified target variable and value expression.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getDefines()
Returns a set of defined variables.
|
java.lang.String |
getDescription()
Returns a
String description of the object in the format of the default system printer. |
java.lang.String |
getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
Returns a string description in the format of the specified printer.
|
java.lang.String |
getId()
Returns unique node identifier in string form.
|
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.
|
java.lang.String |
getSeparator(ru.ispras.fortress.expression.printer.ExprTreePrinter printer,
boolean concurrent)
Returns assignment separator for the specified printer and basic block concurrent type.
|
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 whether all the object's fields are not
null . |
boolean |
ranged()
Checks whether 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() |
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getMetaInfo, getMetaInfo, getMetaInfo, hasMetaInfo, hasMetaInfo, removeMetaInfo
public Assignment()
public Assignment(RangedVariable target, ru.ispras.fortress.expression.Node value)
target
- Defined target variable.value
- Used expression.java.lang.IllegalArgumentException
- when any of arguments is null
.public Assignment(ru.ispras.fortress.expression.NodeVariable var, ru.ispras.fortress.expression.Node expr)
var
- Defined target variable.expr
- Used expression.java.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
otherwise.public void setVariable(RangedVariable variable)
variable
- New target variable.java.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 expression.java.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 printer.separator
- Assignment separator between defined and used variables.String
description of assignment with the specified separator.java.lang.IllegalArgumentException
- when any of the arguments is null
.public java.lang.String getSeparator(ru.ispras.fortress.expression.printer.ExprTreePrinter printer, boolean concurrent)
An assignment separator is a symbol that stands between target and value expressions of assignment.
printer
- Expression printer.concurrent
- Concurrent kind of block statement above.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 java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getId()
Identifiable
getId
in interface Identifiable
public java.lang.String getDescription(ru.ispras.fortress.expression.printer.ExprTreePrinter printer)
Identifiable
getDescription
in interface Identifiable
printer
- Printer that provides an output string format.public java.lang.String getDescription()
Identifiable
String
description of the object in the format of the default system printer.getDescription
in interface Identifiable