proof.parse
Class SymbolTable
java.lang.Object
|
+--proof.parse.SymbolTable
- public class SymbolTable
- extends java.lang.Object
A simple symbol table, using a Hashtable, and Vectors
for scoping.
|
Method Summary |
void |
declare(java.lang.String name)
Declare a variable, creating a new Var object with
the given name. |
void |
declare(Var x)
Declare a variable, which already is a Var object. |
Var |
lookup(java.lang.String name)
Look up a variable. |
void |
undeclare(java.lang.String name)
"Undeclare" a variable, removing it from scope. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SymbolTable
public SymbolTable()
- Constructor.
declare
public void declare(java.lang.String name)
- Declare a variable, creating a new Var object with
the given name.
- Parameters:
name - the name of the variable
declare
public void declare(Var x)
- Declare a variable, which already is a Var object.
(this may go away...)
- Parameters:
x - the Var object in question
undeclare
public void undeclare(java.lang.String name)
- "Undeclare" a variable, removing it from scope. Should
be called when we're done parsing some construct.
- Parameters:
name - the name of the variable to undeclare.
lookup
public Var lookup(java.lang.String name)
- Look up a variable.
- Parameters:
name - the name of the variable to look up- Returns:
- that variable, or null if it wasn't found.