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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the address of the the Symbol.Returns the label of the the Symbol.booleanisData()Finds the type of symbol, text or data.booleanisText()Finds the type of symbol, text or data.voidsetAddress(int address) Sets (replaces) the address of the the Symbol.
-
Constructor Details
-
Symbol
Basic constructor, creates a symbol object.- Parameters:
identifier- The name of the symbol.address- The address in memory which the symbol refers to.isData-trueif the address is in a segment of memory containing data, orfalseif in a segment of memory containing text.
-
-
Method Details
-
getAddress
public int getAddress()Returns the address of the the Symbol.- Returns:
- The address of the Symbol.
-
getIdentifier
Returns the label of the the Symbol.- Returns:
- The label of the Symbol.
-
isData
public boolean isData()Finds the type of symbol, text or data.- Returns:
- The type of the symbol. (true is data, false is text)
-
isText
public boolean isText()Finds the type of symbol, text or data.- Returns:
- The type of the symbol. (true is text, false is data)
-
setAddress
public void setAddress(int address) Sets (replaces) the address of the the Symbol.- Parameters:
address- The revised address of the Symbol.
-