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 TypeMethodDescriptionint
Returns the address of the the Symbol.Returns the label of the the Symbol.boolean
isData()
Finds the type of symbol, text or data.boolean
isText()
Finds the type of symbol, text or data.void
setAddress
(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
-true
if the address is in a segment of memory containing data, orfalse
if 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.
-