|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstory.dbcore.grammars.SymbolTable
public class SymbolTable
Implements a symbol table for the command language. Allows the language to store and retrieve typed variables with separate typed declarations.
Constructor Summary | |
---|---|
SymbolTable()
Constructor with no outer scope |
|
SymbolTable(SymbolTable outerScope)
Constructor with pointer to outer scope |
Method Summary | |
---|---|
java.lang.Object |
clone()
Make a deep copy of the symbol table. |
void |
declare(VariableID ID,
VariableType variableType)
Declare a variable |
java.lang.Object |
define(VariableID ID,
java.lang.Object value)
Define a variable. |
java.lang.Object |
get(VariableID ID)
Retrieve a variable |
VariableType |
getType(VariableID ID)
Returns the VariableType of a variable. |
boolean |
isDeclared(VariableID ID)
Returns whether a variable has been declared. |
boolean |
isDefined(VariableID ID)
Returns whether a variable has been defined. |
static SymbolTable |
mergeTables(SymbolTable first,
SymbolTable second)
Merge two symbol tables. |
int |
numDeclarations()
|
java.lang.StringBuffer |
render()
Render the symbol table (without any supertables) as a StringBuffer table with newline. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SymbolTable()
public SymbolTable(SymbolTable outerScope)
Method Detail |
---|
public void declare(VariableID ID, VariableType variableType) throws Scheherexception
Scheherexception
public boolean isDeclared(VariableID ID)
public boolean isDefined(VariableID ID)
public VariableType getType(VariableID ID) throws Scheherexception
Scheherexception
public java.lang.Object define(VariableID ID, java.lang.Object value) throws Scheherexception
Scheherexception
public java.lang.Object get(VariableID ID) throws Scheherexception
Scheherexception
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.StringBuffer render() throws Scheherexception
Scheherexception
public static SymbolTable mergeTables(SymbolTable first, SymbolTable second) throws Scheherexception
Scheherexception
public int numDeclarations()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |