#include <dsym.h>
Inheritance diagram for sym_scope:


Public Member Functions | |
| sym_scope (STRING n) | |
| sym_scope () | |
| void | dealloc (void) |
| sym * | LookupFromScope (STRING s) |
| Start in the local scope and search upward toward the component scope. | |
| sym * | LookupFromScope (const char *pChar) |
| symtable * | get_symtab (void) |
| typetable * | get_typtab (void) |
| Boolean | has_scope () |
| Return true when the symbol has associated scope (e.g., a symbol table. | |
Protected Attributes | |
| symtable | symtab |
| typetable | typtab |
Private Member Functions | |
| sym * | find_in_scope (sym *pSym, STRING sym_name) |
| Recursively search the symbol scope for the symbol with the name str. | |
| sym_scope (const sym_scope &s) | |
| Don't allow copying of sym_scope objects via copy constructor. | |
These objects also exist in a scope, so the object is derived from sym_scoped. However, for some scope objects, like components (an elaborated entity architecture pair) there is no parent scope.
Definition at line 223 of file dsym.h.
|
|
Don't allow copying of sym_scope objects via copy constructor.
Definition at line 229 of file dsym.h. References FALSE.
00230 {
00231 assert( FALSE );
00232 }
|
|
|
Definition at line 242 of file dsym.h.
00242 : sym_scoped( n ) 00243 { 00244 } |
|
|
Definition at line 246 of file dsym.h.
00247 {
00248 }
|
|
|
Reimplemented from sym. Reimplemented in sym_component. Definition at line 250 of file dsym.h. References symtable::dealloc(), symtab, and typtab. Referenced by sym_component::dealloc().
|
|
||||||||||||
|
Recursively search the symbol scope for the symbol with the name str.
Definition at line 26 of file sym.C. References sym::get_parent_scope(), sym::has_scope(), NULL, and pSym. Referenced by LookupFromScope().
00027 {
00028 sym *retsym = NULL;
00029
00030 if (pSym != NULL && pSym->has_scope() ) {
00031 retsym = ((sym_scope *)pSym)->symtab.find_sym( sym_name );
00032 if (retsym == NULL && pSym->get_parent_scope() != NULL) {
00033 // the symbol was not found in the local scope, so go up one
00034 // scope level.
00035 retsym = find_in_scope( pSym->get_parent_scope(), sym_name );
00036 }
00037 }
00038
00039 return retsym;
00040 } // find_in_scope
|
|
|
Reimplemented from sym. Definition at line 266 of file dsym.h. References symtab.
00267 {
00268 return &symtab;
00269 }
|
|
|
Reimplemented from sym. Definition at line 271 of file dsym.h. References typtab.
00272 {
00273 return &typtab;
00274 }
|
|
|
Return true when the symbol has associated scope (e.g., a symbol table.
Reimplemented from sym. Definition at line 279 of file dsym.h.
00280 {
00281 return TRUE;
00282 }
|
|
|
Reimplemented from sym. Definition at line 258 of file dsym.h. References LookupFromScope(), pChar, and STRING::SetText().
00259 {
00260 STRING local_str;
00261
00262 local_str.SetText( pChar );
00263 return LookupFromScope( local_str );
00264 }
|
|
|
Start in the local scope and search upward toward the component scope.
Reimplemented from sym. Definition at line 47 of file sym.C. References FALSE, find_in_scope(), strtable::find_string(), STRING::GetText(), NULL, and strtab. Referenced by LookupFromScope().
00048 {
00049 sym *retsym = NULL;
00050
00051 if (str.GetText() != NULL) {
00052 STRING local_str;
00053
00054 // if its not in the string table, its not in the symbol table
00055 local_str = strtab.find_string( str, FALSE ); // don't enter
00056 if (local_str.GetText() != NULL) {
00057 retsym = find_in_scope( this, local_str );
00058 }
00059 }
00060
00061 return retsym;
00062 } // LookupFromScope
|
|
|
Definition at line 235 of file dsym.h. Referenced by dealloc(), get_symtab(), and sym_component::init(). |
|
|
Definition at line 236 of file dsym.h. Referenced by dealloc(), get_typtab(), and sym_component::init(). |
1.3.3