Class LabelReference
- java.lang.Object
-
- ru.ispras.microtesk.test.template.LabelReference
-
public final class LabelReference extends java.lang.Object
TheLabelReference
class describes a reference to a label. This means a label specified as an argument of a control-transfer instruction. The important point is that a reference is not linked to a specific label, it just provides information used for label lookup during simulation. There may be several labels with the same name located in different blocks. Which one will be chosen for control transfer will be chosen depending on the context (seeLabelManager
).
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LabelReference(LabelReference other)
LabelReference(LabelValue lazyLabel)
LabelReference(LabelValue lazyLabel, LocationAccessor patcher)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<LabelReference>
copyAll(java.util.List<LabelReference> labelRefs)
java.math.BigInteger
getArgumentValue()
Returns the value assigned (instead of a real address or offset) to the primitive (OP or MODE) argument the label reference is associated with.java.lang.String
getName()
Returns the unique name of the target or referenced label if the target is not assigned.LocationAccessor
getPatcher()
Label
getReference()
Return aLabel
object that describes a reference to a label with a specific name made from a specific block.java.lang.String
getReferenceSuffix()
LabelManager.Target
getTarget()
void
resetTarget()
void
setReference(Label label)
void
setTarget(LabelManager.Target target)
java.lang.String
toString()
-
-
-
Constructor Detail
-
LabelReference
public LabelReference(LabelValue lazyLabel)
-
LabelReference
public LabelReference(LabelValue lazyLabel, LocationAccessor patcher)
-
LabelReference
protected LabelReference(LabelReference other)
-
-
Method Detail
-
copyAll
public static java.util.List<LabelReference> copyAll(java.util.List<LabelReference> labelRefs)
-
getReference
public Label getReference()
Return aLabel
object that describes a reference to a label with a specific name made from a specific block. There is no correspondence between the returned label and the actual label that will be chosen for control transfer. It just provides context that helps choose the most suitable label.- Returns:
- Label object describing a reference to a label.
-
setReference
public void setReference(Label label)
-
getReferenceSuffix
public java.lang.String getReferenceSuffix()
-
getArgumentValue
public java.math.BigInteger getArgumentValue()
Returns the value assigned (instead of a real address or offset) to the primitive (OP or MODE) argument the label reference is associated with.- Returns:
- Value assigned to the associated primitive argument.
-
getTarget
public LabelManager.Target getTarget()
-
getName
public java.lang.String getName()
Returns the unique name of the target or referenced label if the target is not assigned.- Returns:
- Unique name of the target or referenced label if the target is not assigned.
-
setTarget
public void setTarget(LabelManager.Target target)
-
resetTarget
public void resetTarget()
-
getPatcher
public LocationAccessor getPatcher()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-