Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members

sym_component Class Reference

A component is a bound entity architecture pair. More...

#include <dsym.h>

Inheritance diagram for sym_component:

Inheritance graph
[legend]
Collaboration diagram for sym_component:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 sym_component (STRING n)
 sym_component ()
 ~sym_component ()
const uint get_sy_kind (void)
void init (void)
void dealloc (void)
void * GetMem (uint num_bytes)
 Allocate memory from the pool that is local to the component.

LIST< sym * > * get_proc_list (void)
LIST< NODE * > * get_sigass_list (void)

Private Member Functions

 sym_component (const sym_component &c)
void proc_list_dealloc (void)
 Deallocate the process list symbol tables.


Private Attributes

pool mem
LIST< sym * > proc_list
LIST< NODE * > sigass_list

Detailed Description

A component is a bound entity architecture pair.

As a result, components only exist after elaboration when this binding is defined.

After p-code and "import" information is generated for a component the statement trees and VHDL symbol information can be discarded. As a result, a component has its own associated memory pool, in addition to having its own symbol table (which it inherits from the sym_scope class).

As with all symbols, the sym_component object is usually dynamically allocated. Since the copy constructor is not allowed for a pool, the class must be explicitly initialized by calling init().

Definition at line 393 of file dsym.h.


Constructor & Destructor Documentation

sym_component::sym_component const sym_component c  )  [inline, private]
 

Definition at line 399 of file dsym.h.

References FALSE.

00400     {
00401         assert( FALSE );
00402     }

sym_component::sym_component STRING  n  )  [inline]
 

Definition at line 411 of file dsym.h.

References init().

00411                               : sym_scope( n )
00412     {
00413         init();
00414     }

sym_component::sym_component  )  [inline]
 

Definition at line 415 of file dsym.h.

References init().

00416     {
00417         init();
00418     }

sym_component::~sym_component  )  [inline]
 

Definition at line 420 of file dsym.h.

References dealloc().

00421     {
00422         dealloc();
00423     }


Member Function Documentation

void sym_component::dealloc void   )  [inline, virtual]
 

deallocate symbol and type table from base class

release the memory pool

Reimplemented from sym_scope.

Definition at line 437 of file dsym.h.

References LIST< NODE * >::dealloc(), sym_scope::dealloc(), pool::delete_pool(), mem, proc_list_dealloc(), and sigass_list.

Referenced by ~sym_component().

00438     {
00440         sym_scope::dealloc();  
00441         proc_list_dealloc();
00442         sigass_list.dealloc();
00444         mem.delete_pool();  
00445     }

LIST<sym *>* sym_component::get_proc_list void   )  [inline, virtual]
 

Reimplemented from sym.

Definition at line 459 of file dsym.h.

References proc_list.

00460     {
00461         return &proc_list;
00462     }

LIST<NODE *>* sym_component::get_sigass_list void   )  [inline, virtual]
 

Reimplemented from sym.

Definition at line 463 of file dsym.h.

References sigass_list.

00464     {
00465         return &sigass_list;
00466     }

const uint sym_component::get_sy_kind void   )  [inline, virtual]
 

Reimplemented from sym.

Definition at line 425 of file dsym.h.

References sy_component, and uint.

00425 { return sy_component; }

void* sym_component::GetMem uint  num_bytes  )  [inline, virtual]
 

Allocate memory from the pool that is local to the component.

Reimplemented from sym.

Definition at line 451 of file dsym.h.

References pool::GetMem(), and mem.

00452     {
00453         void *pMem;
00454 
00455         pMem = mem.GetMem( num_bytes );
00456         return pMem;
00457     }

void sym_component::init void   )  [inline, virtual]
 

get a new memory pool

Set the memory allocation pools for the symbol and type tables.

Reimplemented from sym.

Definition at line 427 of file dsym.h.

References mem, pool::new_pool(), typetable::set_pool(), symtable::set_pool(), sym_scope::symtab, and sym_scope::typtab.

Referenced by sym_component().

00428     {
00430         mem.new_pool();   
00433         symtab.set_pool( &mem );
00434         typtab.set_pool( &mem );
00435         
00436     }

void sym_component::proc_list_dealloc void   )  [private]
 

Deallocate the process list symbol tables.

Definition at line 69 of file sym.C.

References LIST< sym * >::dealloc(), symtable::dealloc(), symtable::dealloc_sub_tables(), LIST< sym * >::first(), LIST< sym * >::get_item(), sym::get_symtab(), sym::has_scope(), LIST< sym * >::next(), NULL, and proc_list.

Referenced by dealloc().

00070 {
00071     LIST<sym *>::handle h;
00072     sym *pListSym;
00073 
00074     for (h = proc_list.first(); h != NULL; h = proc_list.next( h ) ) {
00075         pListSym = proc_list.get_item( h );
00076         if (pListSym != NULL && pListSym->has_scope()) {
00077             pListSym->get_symtab()->dealloc_sub_tables();
00078             pListSym->get_symtab()->dealloc();
00079         }
00080     } // for
00081     proc_list.dealloc();
00082 } // proc_list_dealloc


Member Data Documentation

pool sym_component::mem [private]
 

Definition at line 395 of file dsym.h.

Referenced by dealloc(), GetMem(), and init().

LIST<sym *> sym_component::proc_list [private]
 

Definition at line 407 of file dsym.h.

Referenced by get_proc_list(), and proc_list_dealloc().

LIST<NODE *> sym_component::sigass_list [private]
 

Definition at line 408 of file dsym.h.

Referenced by dealloc(), and get_sigass_list().


The documentation for this class was generated from the following files:
Generated on Wed Mar 31 21:16:10 2004 for Data Structures for a VHDL Compiler by doxygen 1.3.3