public final class SymbolTable<S extends Symbol>
extends java.lang.Object
Constructor and Description |
---|
SymbolTable(ErrorStream error)
Construct symbol table with denoted error stream.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(SymbolTable<S> stable,
boolean override,
boolean skip)
Add symbols from another table to this table.
|
S |
get(Identifier key)
Returns symbol associated to key and links key with symbol.
|
java.util.Collection<S> |
getSymbols()
Return collection of symbols in table.
|
boolean |
has(Identifier key)
Checks whether table has an entry for key.
|
boolean |
put(S value)
Puts symbol into table to be looked up for the name of the symbol.
|
public SymbolTable(ErrorStream error)
error
- the error stream.public java.util.Collection<S> getSymbols()
public boolean put(S value)
value
- the symbol.public S get(Identifier key)
key
- the lookup key.public boolean has(Identifier key)
key
- the lookup key.public boolean add(SymbolTable<S> stable, boolean override, boolean skip)
stable
- the table providing new symbols for this table.override
- if true, new declarations override old ones.skip
- if true (and there is no overriding), conflicting symbols
are skipped without reporting errors.