misim.asm
Class Label
java.lang.Object
|
+--misim.asm.Label
- public class Label
- extends java.lang.Object
A lebel defines the value of a text label in the assembly listing.
Labels are handled by Context objects, that define the scope of
each label.
Constructor Summary |
Label(java.lang.String text,
int labelType)
Construct a new undefined label for the given text and type |
Label(java.lang.String text,
int value,
int labelType)
Construct a new defined label for the given text, value
and type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LABEL_CONSTANT
public static final int LABEL_CONSTANT
LABEL_VARIABLE
public static final int LABEL_VARIABLE
LABEL_ADDRESS
public static final int LABEL_ADDRESS
LABEL_UNKNOWN
public static final int LABEL_UNKNOWN
Label
public Label(java.lang.String text,
int labelType)
- Construct a new undefined label for the given text and type
- Parameters:
text
- The text for this labellabelType
- The type of this label
Label
public Label(java.lang.String text,
int value,
int labelType)
- Construct a new defined label for the given text, value
and type.
- Parameters:
text
- The text for this labelvalue
- The value for this labellabelType
- The type of this label
getValue
public int getValue(Token aToken)
throws EditorException
- Get the numeric value for this label
- Parameters:
aToken
- The token that referred to this label- Returns:
- The integer value of this label
- Throws:
EditorException
- If this label is undefined
setValue
public void setValue(int value,
Token aToken)
throws EditorException
- Set the numeric value for this label
- Parameters:
value
- The new value for this labelaToken
- The token that referred to this label- Throws:
EditorException
- if this label is a constant and cannot be changed
isDefined
public boolean isDefined()
undefine
public void undefine()
getType
public int getType()
setType
public void setType(int newType)