public interface SymbolTable extends Traversable
| Modifier and Type | Method and Description |
|---|---|
void |
addDeclaration(Declaration decl)
Add a declaration to the end of the set of declarations
and place the declared symbols in the symbol table.
|
void |
addDeclarationAfter(Declaration ref,
Declaration decl)
Add a declaration after the reference declaration.
|
void |
addDeclarationBefore(Declaration ref,
Declaration decl)
Add a declaration before the reference declaration.
|
boolean |
containsDeclaration(Declaration decl)
Checks if the symbol table contains the specified declaration.
|
boolean |
containsSymbol(Symbol symbol)
Checks if the symbol table contains the specified symbol.
|
Declaration |
findSymbol(IDExpression name)
Retrieves the declaration for a symbol, possibly searching
through parent symbol tables.
|
java.util.Set<Declaration> |
getDeclarations()
Returns the set of declarations declared within the symbol table object.
|
java.util.List<SymbolTable> |
getParentTables()
Returns a list of symbol tables that are parents
of this table in the distributed symbol table graph.
|
java.util.Set<Symbol> |
getSymbols()
Returns the set of declared symbols in the symbol table object.
|
getChildren, getParent, removeChild, setChild, setParentvoid addDeclaration(Declaration decl)
decl - The declaration to add.void addDeclarationBefore(Declaration ref, Declaration decl)
ref - The reference point.decl - The declaration to add.void addDeclarationAfter(Declaration ref, Declaration decl)
ref - The reference point.decl - The declaration to add.Declaration findSymbol(IDExpression name)
name - The name of the symbol.java.util.List<SymbolTable> getParentTables()
boolean containsDeclaration(Declaration decl)
boolean containsSymbol(Symbol symbol)
java.util.Set<Symbol> getSymbols()
java.util.Set<Declaration> getDeclarations()