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

sym Class Reference

Memory Allocation. More...

#include <sym.h>

Inheritance diagram for sym:

Inheritance graph
[legend]
Collaboration diagram for sym:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 sym (STRING n)
 sym ()
void * operator new (unsigned int num_bytes)
void * operator new (unsigned int num_bytes, pool *mem_pool)
void operator delete (void *addr)
STRING get_name (void)
void set_name (const STRING str)
void set_referenced (void)
void unset_referenced (void)
const Boolean is_referenced (void)
virtual const uint get_sy_kind (void)
virtual void set_scope (pSym scope)
virtual const pSym get_parent_scope (void)
virtual void set_const (pConst c)
virtual const pConst get_const (void)
virtual void set_ty_type (pType t)
virtual const pType get_ty_type (void)
virtual void set_alloc (uint alloc)
virtual const uint get_alloc (void)
virtual void set_id_kind (uint kind)
virtual const uint get_id_kind (void)
virtual void set_id_type (pType t)
virtual const pType get_id_type (void)
virtual symLookupFromScope (STRING s)
virtual symLookupFromScope (const char *pChar)
virtual symtableget_symtab (void)
virtual typetableget_typtab (void)
virtual Boolean has_scope ()
virtual void set_statement (NODE *s)
virtual const NODEget_statement (void)
virtual void set_func_type (pType t)
virtual const pType get_func_type (void)
virtual void init (void)
virtual void dealloc (void)
virtual void * GetMem (uint num_bytes)
virtual LIST< sym * > * get_proc_list (void)
virtual LIST< NODE * > * get_sigass_list (void)

Private Attributes

STRING name
src_ref m_sr
uint m_referenced: 1
uint m_unused: 31

Detailed Description

Memory Allocation.

New for symbols is only called from the symbol table. New for types is only called from the type table. If new compilers are not available, this localized code will have to be modified.

Definition at line 73 of file sym.h.


Constructor & Destructor Documentation

sym::sym STRING  n  )  [inline]
 

Definition at line 81 of file sym.h.

References FALSE, m_referenced, and name.

00082     {
00083         name = n;
00084         m_referenced = FALSE;
00085     } // sym constructor

sym::sym  )  [inline]
 

Definition at line 87 of file sym.h.

References FALSE, m_referenced, name, NULL, and STRING::SetText().

00088     {
00089         name.SetText( NULL );
00090         m_referenced = FALSE;
00091     } // sym constructor


Member Function Documentation

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

Reimplemented in sym_scope, and sym_component.

Definition at line 256 of file sym.h.

Referenced by symtable::dealloc_sub_tables().

00257     {
00258         // its ok to do nothing if there's nothing to deallocate
00259     }

virtual const uint sym::get_alloc void   )  [inline, virtual]
 

Reimplemented in sym_ident.

Definition at line 174 of file sym.h.

References FALSE, and uint.

00175     {
00176         assert( FALSE );
00177         return 0;
00178     }

virtual const pConst sym::get_const void   )  [inline, virtual]
 

Reimplemented in sym_const.

Definition at line 150 of file sym.h.

References NULL.

00151     {
00152         assert( NULL );
00153         return NULL;
00154     }

virtual const pType sym::get_func_type void   )  [inline, virtual]
 

Reimplemented in sym_subprog.

Definition at line 244 of file sym.h.

References FALSE, and NULL.

00245     {
00246         assert( FALSE );
00247         return NULL;
00248     }

virtual const uint sym::get_id_kind void   )  [inline, virtual]
 

Reimplemented in sym_ident.

Definition at line 183 of file sym.h.

References FALSE, and uint.

00184     {
00185         assert( FALSE );
00186         return 0;
00187     }

virtual const pType sym::get_id_type void   )  [inline, virtual]
 

Reimplemented in sym_ident.

Definition at line 192 of file sym.h.

References FALSE, and NULL.

00193     { 
00194         assert( FALSE );
00195         return NULL; 
00196     }

STRING sym::get_name void   )  [inline]
 

Definition at line 112 of file sym.h.

References name.

Referenced by type_record::find_elem(), symtable::pr(), and symtable::chain_elem::search_list().

00112 { return name; }

virtual const pSym sym::get_parent_scope void   )  [inline, virtual]
 

Reimplemented in sym_scoped.

Definition at line 139 of file sym.h.

References NULL.

Referenced by sym_scope::find_in_scope().

00140     {
00141         return NULL;
00142     }

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

Reimplemented in sym_component.

Definition at line 268 of file sym.h.

References FALSE, and NULL.

00269     {
00270         assert( FALSE );
00271         return NULL;
00272     }

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

Reimplemented in sym_component.

Definition at line 273 of file sym.h.

References FALSE, and NULL.

00274     {
00275         assert( FALSE );
00276         return NULL;
00277     }

virtual const NODE* sym::get_statement void   )  [inline, virtual]
 

Reimplemented in sym_subprog.

Definition at line 234 of file sym.h.

References FALSE, and NULL.

00235     {
00236         assert( FALSE );
00237         return NULL;
00238     }

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

Reimplemented in sym_const, sym_type, sym_ident, sym_subprog, sym_process, and sym_component.

Definition at line 122 of file sym.h.

References bad_symbol, and uint.

00122 { return bad_symbol; }

virtual symtable* sym::get_symtab void   )  [inline, virtual]
 

Reimplemented in sym_scope.

Definition at line 210 of file sym.h.

References FALSE, and NULL.

Referenced by symtable::dealloc_sub_tables(), symtable::new_sym(), and sym_component::proc_list_dealloc().

00211     {
00212         assert( FALSE );
00213         return NULL;
00214     }

virtual const pType sym::get_ty_type void   )  [inline, virtual]
 

Reimplemented in sym_type.

Definition at line 162 of file sym.h.

References FALSE, and NULL.

00163     { 
00164         assert( FALSE );
00165         return NULL; 
00166     } // get_type

virtual typetable* sym::get_typtab void   )  [inline, virtual]
 

Reimplemented in sym_scope.

Definition at line 216 of file sym.h.

References FALSE, and NULL.

Referenced by symtable::new_sym().

00217     {
00218         assert( FALSE );
00219         return NULL;
00220     }

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

Reimplemented in sym_component.

Definition at line 262 of file sym.h.

References FALSE, and NULL.

00263     {
00264         assert( FALSE );
00265         return NULL;
00266     }

virtual Boolean sym::has_scope  )  [inline, virtual]
 

Reimplemented in sym_scope.

Definition at line 221 of file sym.h.

References Boolean, and FALSE.

Referenced by symtable::dealloc_sub_tables(), sym_scope::find_in_scope(), and sym_component::proc_list_dealloc().

00222     {
00223         // return false for any symbol that is not of
00224         // the sym_scope sub-class
00225         return FALSE;
00226     }

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

Reimplemented in sym_component.

Definition at line 252 of file sym.h.

00253     {
00254         // its ok to do nothing if there's nothing to initialize
00255     }

const Boolean sym::is_referenced void   )  [inline]
 

Definition at line 117 of file sym.h.

References Boolean, and m_referenced.

00117 { return m_referenced; }

virtual sym* sym::LookupFromScope const char *  pChar  )  [inline, virtual]
 

Reimplemented in sym_scope.

Definition at line 205 of file sym.h.

References FALSE, and NULL.

00206     {
00207         assert( FALSE );
00208         return NULL;
00209     }

virtual sym* sym::LookupFromScope STRING  s  )  [inline, virtual]
 

Reimplemented in sym_scope.

Definition at line 200 of file sym.h.

References FALSE, and NULL.

00201     {
00202         assert( FALSE );
00203         return NULL;
00204     }

void sym::operator delete void *  addr  )  [inline]
 

Definition at line 110 of file sym.h.

00110 {/* do nothing */}

void* sym::operator new unsigned int  num_bytes,
pool mem_pool
[inline]
 

Definition at line 103 of file sym.h.

References pool::GetMem().

00104     {
00105         return mem_pool->GetMem( num_bytes );
00106     }

void* sym::operator new unsigned int  num_bytes  )  [inline]
 

Definition at line 94 of file sym.h.

References FALSE, and NULL.

00095     {
00096         assert( FALSE );
00097         return NULL;
00098     }

virtual void sym::set_alloc uint  alloc  )  [inline, virtual]
 

Reimplemented in sym_ident.

Definition at line 170 of file sym.h.

References FALSE.

00171     {
00172         assert( FALSE );
00173     } // set_offset

virtual void sym::set_const pConst  c  )  [inline, virtual]
 

Reimplemented in sym_const.

Definition at line 146 of file sym.h.

References FALSE.

00147     {
00148         assert( FALSE );
00149     }

virtual void sym::set_func_type pType  t  )  [inline, virtual]
 

Reimplemented in sym_subprog.

Definition at line 240 of file sym.h.

References FALSE.

00241     {
00242         assert( FALSE );
00243     }

virtual void sym::set_id_kind uint  kind  )  [inline, virtual]
 

Reimplemented in sym_ident.

Definition at line 179 of file sym.h.

References FALSE.

00180     {
00181         assert( FALSE );
00182     }

virtual void sym::set_id_type pType  t  )  [inline, virtual]
 

Reimplemented in sym_ident.

Definition at line 188 of file sym.h.

References FALSE.

00189     { 
00190         assert( FALSE );
00191     } // set_id_type

void sym::set_name const STRING  str  )  [inline]
 

Definition at line 113 of file sym.h.

References name.

00113 { name = str; }

void sym::set_referenced void   )  [inline]
 

Definition at line 115 of file sym.h.

References m_referenced, and TRUE.

00115 { m_referenced = TRUE; }

virtual void sym::set_scope pSym  scope  )  [inline, virtual]
 

Reimplemented in sym_scoped.

Definition at line 129 of file sym.h.

References FALSE.

Referenced by symtable::new_sym().

00130     {
00131         assert( FALSE );
00132     }

virtual void sym::set_statement NODE s  )  [inline, virtual]
 

Reimplemented in sym_subprog.

Definition at line 230 of file sym.h.

References FALSE.

00231     {
00232         assert( FALSE );
00233     }

virtual void sym::set_ty_type pType  t  )  [inline, virtual]
 

Reimplemented in sym_type.

Definition at line 158 of file sym.h.

References NULL.

00159     { 
00160         assert( NULL );
00161     } // set_type

void sym::unset_referenced void   )  [inline]
 

Definition at line 116 of file sym.h.

References FALSE, and m_referenced.

00116 { m_referenced = FALSE; }


Member Data Documentation

uint sym::m_referenced [private]
 

Definition at line 77 of file sym.h.

Referenced by is_referenced(), set_referenced(), sym(), and unset_referenced().

src_ref sym::m_sr [private]
 

Definition at line 76 of file sym.h.

uint sym::m_unused [private]
 

Definition at line 77 of file sym.h.

STRING sym::name [private]
 

Definition at line 75 of file sym.h.

Referenced by get_name(), set_name(), and sym().


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