geneseo.cs.compiler
Interface SymbolTable

All Known Implementing Classes:
MinimLSymbolTable

public interface SymbolTable

The interface that an object must implement in order to be a symbol table. Roughly, a symbol table is anything that can map strings (i.e., names) to objects (i.e., descriptors). Symbol tables may, but don't need to be, divided into scope contours.


Method Summary
 void clear()
          Remove all entries from a symbol table.
 java.lang.Object find(java.lang.String name)
          Look up a name in a symbol table.
 void insert(java.lang.String name, java.lang.Object descriptor)
          Add a name and descriptor to a symbol table.
 

Method Detail

clear

public void clear()
Remove all entries from a symbol table.

insert

public void insert(java.lang.String name,
                   java.lang.Object descriptor)
            throws CompilerException
Add a name and descriptor to a symbol table.
Parameters:
name - The name being added to the table.
descriptor - The descriptor to associate with this name.
Throws:
CompilerException - If the name already has an entry in the symbol table's current scope.

find

public java.lang.Object find(java.lang.String name)
                      throws CompilerException
Look up a name in a symbol table.
Parameters:
name - The name to look up.
Returns:
The object associated with this name.
Throws:
CompilerException - If the name isn't visible in the symbol table's current scope.