P4
1
name analysis
|
Public Member Functions | |
SymTable () | |
void | addDecl (String name, SemSym sym) throws DuplicateSymException, EmptySymTableException, NullPointerException |
void | addScope () |
SemSym | lookupLocal (String name) |
SemSym | lookupGlobal (String name) |
Package Functions | |
void | removeScope () throws EmptySymTableException |
void | print () |
The SymTable class allocates a List of HashMaps each of which pertain to a scope and hold symbols pertaining to the declarations of that scope
Constructs new, empty SymTable initialized with one empty HashMap
void SymTable.addDecl | ( | String | name, |
SemSym | sym | ||
) | throws DuplicateSymException, EmptySymTableException, NullPointerException |
Add a new declaration to the current (top of list) scope
declaration | name |
declaration | symbol |
DuplicateSymException | |
EmptySymTableException | |
NullPointerException |
void SymTable.addScope | ( | ) |
Add new scope to the scope list
SemSym SymTable.lookupGlobal | ( | String | name | ) |
Return symbol from Global scope given its declaration name
SemSym SymTable.lookupLocal | ( | String | name | ) |
Return symbol from local scope given its declaration name
void SymTable.print | ( | ) | [package] |
Debugging method to dump symbol table
void SymTable.removeScope | ( | ) | throws EmptySymTableException [package] |
Remove top scope from the scope list
EmptySymTableException |