Collaboration diagram for symtable::chain_elem:

Public Member Functions | |
| chain_elem (void) | |
| ~chain_elem (void) | |
| sym * | search_list (STRING item) |
| Search for a symbol in the hash chain list, using its STRING field as a key. | |
| unsigned int | list_len (void) |
Public Attributes | |
| LIST< sym * > | list |
Private Member Functions | |
| chain_elem (const chain_elem &) | |
Definition at line 64 of file symtable.h.
|
|
Definition at line 68 of file symtable.h.
00068 {}
|
|
|
Definition at line 70 of file symtable.h. References list.
00070 { list = LIST<sym *>(); }
|
|
|
Definition at line 71 of file symtable.h. References LIST< sym * >::dealloc(), and list.
|
|
|
Definition at line 75 of file symtable.h. References LIST< sym * >::first(), list, LIST< sym * >::next(), and NULL.
|
|
|
Search for a symbol in the hash chain list, using its STRING field as a key. The strings should have been entered in the string table. As a result, an address compare can be used, since all strings are unique in the string table. Note that there must be a symbol table for each unique scope. Definition at line 33 of file symtable.C. References LIST< sym * >::first(), LIST< sym * >::get_item(), sym::get_name(), STRING::GetText(), list, LIST< sym * >::next(), and NULL.
00034 {
00035 LIST<sym *>::handle h;
00036 sym *list_sym, *sym;
00037
00038 sym = NULL;
00039 for (h = list.first(); h != NULL; h = list.next(h)) {
00040 list_sym = list.get_item( h );
00041 if ( list_sym->get_name().GetText() == item.GetText() ) {
00042 sym = list_sym;
00043 break;
00044 } // if
00045 } // for
00046
00047 return sym;
00048 } // search_list
|
|
|
Definition at line 66 of file symtable.h. Referenced by chain_elem(), list_len(), search_list(), and ~chain_elem(). |
1.3.3