Methods Summary |
---|
public java.lang.Object | declare(java.lang.String ident, java.lang.Object decl)This method adds the specified identifier to this SymbolTable.
The specified decl object provides details anbout the declaration.
If this SymbolTable already defines an identifier with the same name,
the SymbolTable is not changed and the existing declaration is returned.
Otherwise null is returned.
Object old = symbols.get(ident);
if (old == null) {
symbols.put(ident.toUpperCase(), decl);
}
return old;
|
public java.lang.Object | getDeclaration(java.lang.String ident)Checks the symbol table for the actual declaration of the specified
identifier. The method returns the declaration object if available or
null for an undeclared identifier.
return symbols.get(ident.toUpperCase());
|
public boolean | isDeclared(java.lang.String ident)Checks whether the specified identifier is declared.
return (getDeclaration(ident) != null);
|