Package mars.assembler
Class Symbol
java.lang.Object
mars.assembler.Symbol
Represents a MIPS program identifier to be stored in the symbol table.
- Version:
- June 2003
- Author:
- Jason Bumgarner, Jason Shrewsbury
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the address of the the Symbol.getName()
Returns the label of the the Symbol.boolean
getType()
Finds the type of symbol, text or data.void
setAddress(int newAddress)
Sets (replaces) the address of the the Symbol.
-
Field Details
-
TEXT_SYMBOL
public static final boolean TEXT_SYMBOL- See Also:
- Constant Field Values
-
DATA_SYMBOL
public static final boolean DATA_SYMBOL- See Also:
- Constant Field Values
-
-
Constructor Details
-
Symbol
Basic constructor, creates a symbol object.- Parameters:
name
- The name of the Symbol.address
- The memory address that the Symbol refers to.data
- The type of Symbol that it is.
-
-
Method Details
-
getAddress
public int getAddress()Returns the address of the the Symbol.- Returns:
- The address of the Symbol.
-
getName
Returns the label of the the Symbol.- Returns:
- The label of the Symbol.
-
getType
public boolean getType()Finds the type of symbol, text or data.- Returns:
- The type of the data.
-
setAddress
public void setAddress(int newAddress)Sets (replaces) the address of the the Symbol.- Parameters:
newAddress
- The revised address of the Symbol.
-