public SymbolTableEntry Lookup(string name, int kind) { // treat inferface, classe and function names as case insensitive if (kind == SymbolTable.INTERFACE || kind == SymbolTable.CLASS || kind == SymbolTable.FUNCTION) { name = name.ToLower(); } Hashtable entry = (Hashtable)Entries[name]; // no entry with this name and kind found in current scope if (entry == null || entry[kind] == null) { // no parent scope, so we are at top scope if (Parent == null) { return(null); } // parent scope available, so lookup there else { return(Parent.Lookup(name, kind)); } } // entry found with matching kind else { return((SymbolTableEntry)entry[kind]); } }
public SymbolTableEntry Lookup(string name, int kind) { return(CurScope.Lookup(name, kind)); }