FileDocCategorySizeDatePackage
SymbolTable.javaAPI DocGlassfish v2 API3950Fri May 04 22:34:50 BST 2007com.sun.jdo.spi.persistence.support.ejb.ejbqlc

SymbolTable

public class SymbolTable extends Object
The symbol table handling declared identifies.
author
Michael Bouschen

Fields Summary
protected Map
symbols
The table of declared identifier (symbols).
Constructors Summary
Methods Summary
public java.lang.Objectdeclare(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.

param
ident identifier to be declared
param
definition new definition of identifier
return
the old definition if the identifier was already declared; null otherwise


	                                                                                	 
         
    
        Object old = symbols.get(ident);
        if (old == null) {
            symbols.put(ident.toUpperCase(), decl);
        }
        return old;
    
public java.lang.ObjectgetDeclaration(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.

param
ident the name of identifier
return
the declaration object if ident is declared; null otherise.

        return symbols.get(ident.toUpperCase());
    
public booleanisDeclared(java.lang.String ident)
Checks whether the specified identifier is declared.

param
ident the name of identifier to be tested
return
true if the identifier is declared; false otherwise.

        return (getDeclaration(ident) != null);