|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mars.assembler.SymbolTable
Creats a table of Symbol objects.
Field Summary | |
static int |
NOT_FOUND
|
Constructor Summary | |
SymbolTable(java.lang.String filename)
Create a new empty symbol table for given file |
Method Summary | |
void |
addSymbol(Token token,
int address,
boolean b,
ErrorList errors)
Adds a Symbol object into the array of Symbols. |
void |
clear()
Creates a fresh arrayList for a new table. |
void |
fixSymbolTableAddress(int originalAddress,
int replacementAddress)
Fix address in symbol table entry. |
int |
getAddress(java.lang.String s)
Method to return the address associated with the given label. |
int |
getAddressLocalOrGlobal(java.lang.String s)
Method to return the address associated with the given label. |
java.util.ArrayList |
getAllSymbols()
For obtaining all the Symbols. |
java.util.ArrayList |
getDataSymbols()
For obtaining the Data Symbols. |
int |
getSize()
Get the count of entries currently in the table. |
Symbol |
getSymbol(java.lang.String s)
Produce Symbol object from symbol table that corresponds to given String. |
Symbol |
getSymbolGivenAddress(java.lang.String s)
Produce Symbol object from symbol table that has the given address. |
Symbol |
getSymbolGivenAddressLocalOrGlobal(java.lang.String s)
Produce Symbol object from either local or global symbol table that has the given address. |
java.util.ArrayList |
getTextSymbols()
For obtaining the Text Symbols. |
void |
removeSymbol(Token token)
Removes a symbol from the Symbol table. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NOT_FOUND
Constructor Detail |
public SymbolTable(java.lang.String filename)
filename
- name of file this symbol table is associated with. Will be
used only for output/display so it can be any descriptive string.Method Detail |
public void addSymbol(Token token, int address, boolean b, ErrorList errors)
token
- The token representing the Symbol.address
- The address of the Symbol.b
- The type of Symbol, true for data, false for text.errors
- List to which to add any processing errors that occur.public void removeSymbol(Token token)
token
- The token representing the Symbol.public int getAddress(java.lang.String s)
s
- The label.
public int getAddressLocalOrGlobal(java.lang.String s)
s
- The label.
public Symbol getSymbol(java.lang.String s)
s
- target String
public Symbol getSymbolGivenAddress(java.lang.String s)
s
- String representing address
public Symbol getSymbolGivenAddressLocalOrGlobal(java.lang.String s)
s
- String representing address
public java.util.ArrayList getDataSymbols()
public java.util.ArrayList getTextSymbols()
public java.util.ArrayList getAllSymbols()
public int getSize()
public void clear()
public void fixSymbolTableAddress(int originalAddress, int replacementAddress)
originalAddress
- Address associated with 0 or more symtab entries.replacementAddress
- Any entry that has originalAddress will have its
address updated to this value. Does nothing if none do.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |