C-Breeze
C Compiler Infrastructure

[ Project home page]
Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

SymbolTable< T > Class Template Reference

#include <symbol.h>

List of all members.

Public Member Functions

 SymbolTable (bool is_nested)
 ~SymbolTable ()
void mark_nodes (void)
void reset ()
insert (const string &name, T sym)
lookup (const string &name)
void print (FILE *out)
string insert_unique (const string &root, T sym)
void enter_scope ()
void exit_scope ()

Private Types

typedef map< string, T, less<
string > > 
scope
typedef scope::iterator scope_p
typedef list< scope * > table
typedef table::iterator table_p

Private Member Functions

virtual void shadow (T create, T shadowed)=0
virtual void notify_exit_scope (T dead)=0

Private Attributes

bool _is_nested
table _table

template<class T>
class SymbolTable< T >


Member Typedef Documentation

template<class T>
typedef map<string, T, less< string > > SymbolTable< T >::scope [private]
 

Definition at line 58 of file symbol.h.

Referenced by SymbolTable< T >::enter_scope(), SymbolTable< T >::exit_scope(), SymbolTable< T >::insert(), SymbolTable< T >::lookup(), SymbolTable< T >::mark_nodes(), SymbolTable< T >::reset(), and SymbolTable< labelNode * >::SymbolTable().

template<class T>
typedef scope::iterator SymbolTable< T >::scope_p [private]
 

Definition at line 60 of file symbol.h.

Referenced by SymbolTable< T >::exit_scope(), SymbolTable< T >::insert(), SymbolTable< T >::lookup(), SymbolTable< T >::mark_nodes(), and SymbolTable< T >::reset().

template<class T>
typedef list< scope * > SymbolTable< T >::table [private]
 

Definition at line 62 of file symbol.h.

template<class T>
typedef table::iterator SymbolTable< T >::table_p [private]
 

Definition at line 63 of file symbol.h.

Referenced by SymbolTable< T >::lookup(), SymbolTable< T >::mark_nodes(), SymbolTable< T >::reset(), and SymbolTable< T >::~SymbolTable().


Constructor & Destructor Documentation

template<class T>
SymbolTable< T >::SymbolTable bool    is_nested [inline]
 

Definition at line 72 of file symbol.h.

template<class T>
SymbolTable< T >::~SymbolTable  
 

Definition at line 60 of file symbol.cc.

References SymbolTable< T >::_table, and SymbolTable< T >::table_p.


Member Function Documentation

template<class T>
void SymbolTable< T >::enter_scope  
 

Definition at line 170 of file symbol.cc.

References SymbolTable< T >::_table, and SymbolTable< T >::scope.

template<class T>
void SymbolTable< T >::exit_scope  
 

Definition at line 179 of file symbol.cc.

References SymbolTable< T >::_table, SymbolTable< T >::notify_exit_scope(), SymbolTable< T >::scope, and SymbolTable< T >::scope_p.

template<class T>
T SymbolTable< T >::insert const string &    name,
  sym
 

Definition at line 114 of file symbol.cc.

References SymbolTable< T >::_table, SymbolTable< T >::scope, and SymbolTable< T >::scope_p.

Referenced by SymbolTable< T >::insert_unique().

template<class T>
string SymbolTable< T >::insert_unique const string &    root,
  sym
 

Definition at line 199 of file symbol.cc.

References SymbolTable< T >::insert(), and SymbolTable< T >::lookup().

template<class T>
T SymbolTable< T >::lookup const string &    name
 

Definition at line 140 of file symbol.cc.

References SymbolTable< T >::_table, SymbolTable< T >::scope, SymbolTable< T >::scope_p, and SymbolTable< T >::table_p.

Referenced by SymbolTable< T >::insert_unique().

template<class T>
void SymbolTable< T >::mark_nodes void   
 

Definition at line 70 of file symbol.cc.

References SymbolTable< T >::_table, Node::mark, SymbolTable< T >::scope, SymbolTable< T >::scope_p, and SymbolTable< T >::table_p.

template<class T>
virtual void SymbolTable< T >::notify_exit_scope   dead [private, pure virtual]
 

Implemented in Identifiers_table, Labels_table, Tags_table, and Externals_table.

Referenced by SymbolTable< T >::exit_scope(), and SymbolTable< T >::reset().

template<class T>
void SymbolTable< T >::print FILE *    out
 

Definition at line 194 of file symbol.cc.

template<class T>
void SymbolTable< T >::reset  
 

Definition at line 87 of file symbol.cc.

References SymbolTable< T >::_table, SymbolTable< T >::notify_exit_scope(), SymbolTable< T >::scope, SymbolTable< T >::scope_p, and SymbolTable< T >::table_p.

template<class T>
virtual void SymbolTable< T >::shadow   create,
  shadowed
[private, pure virtual]
 

Implemented in Identifiers_table, Labels_table, Tags_table, and Externals_table.


Member Data Documentation

template<class T>
bool SymbolTable< T >::_is_nested [private]
 

Definition at line 52 of file symbol.h.

template<class T>
table SymbolTable< T >::_table [private]
 

Definition at line 65 of file symbol.h.

Referenced by SymbolTable< T >::enter_scope(), SymbolTable< T >::exit_scope(), SymbolTable< T >::insert(), SymbolTable< T >::lookup(), SymbolTable< T >::mark_nodes(), SymbolTable< T >::reset(), and SymbolTable< T >::~SymbolTable().


The documentation for this class was generated from the following files:

Generated on August 27, 2003
Back to the C-Breeze home page