#include <symbol_table.h>
Collaboration diagram for Symbol_table:
Public Types | |
typedef content_type::const_iterator | Sym_it |
Public Methods | |
Sym_it | begin () const |
Sym_it | end () const |
Symbol_table () | |
Create new, empty symbol table. More... | |
virtual | ~Symbol_table () |
void | add_symbol (std::string name, std::string::size_type base_len, Symbol *sym) |
Add a symbol. More... | |
void | set_peer (Symbol *orig, Symbol *faelschung) |
Set "peer" of a symbol. More... | |
Symbol_pair | get_symbol (std::string name) const |
Fetch a symbol. More... | |
void | dump (std::ostream &out) |
Dump symbol table to /out/. More... | |
void | clear () |
Static Public Methods | |
Symbol_table & | get_instance () |
bool | has_dump_flag (char c) |
Static Public Attributes | |
const char * | dump_flags = "" |
Private Types | |
typedef std::map< std::string, Symbol_pair > | content_type |
Private Attributes | |
content_type | content |
Static Private Attributes | |
Symbol_table | instance |
Definition at line 101 of file symbol_table.h.
|
Definition at line 103 of file symbol_table.h. Referenced by clear(). |
|
Definition at line 106 of file symbol_table.h. |
|
Create new, empty symbol table. Generally, you should use Symbol_table::get_instance() instead of creating new symbol tables. Definition at line 21 of file symbol_table.cc. |
|
Definition at line 27 of file symbol_table.cc. |
|
Add a symbol. Throws exception on error. Definition at line 34 of file symbol_table.cc. References compile_error(), content, Symbol::is_tagged(), and Symbol::set_name(). Referenced by Namespace_scope::add_symbol(), Class_scope::add_symbol(), and Block_scope::add_symbol(). |
|
Definition at line 110 of file symbol_table.h. References content, and Sym_it. Referenced by main(). |
|
Definition at line 121 of file symbol_table.cc. References content, and content_type. |
|
Dump symbol table to /out/.
Definition at line 95 of file symbol_table.cc. References content. Referenced by main(). |
|
Definition at line 111 of file symbol_table.h. References content, and Sym_it. Referenced by main(). |
|
Definition at line 108 of file symbol_table.h. Referenced by Namespace_scope::add_symbol(), Class_scope::add_symbol(), Block_scope::add_symbol(), Typedef_declaration_reader::declare_variable(), Type::get_type_symbol(), Class_symbol::lookup_helper(), Namespace_scope::lookup_here(), Block_scope::lookup_here(), main(), and Class_symbol::start_definition(). |
|
Fetch a symbol. Returns the symbol table entry. Definition at line 82 of file symbol_table.cc. References content. Referenced by Type::get_type_symbol(), Namespace_scope::lookup_here(), and Block_scope::lookup_here(). |
|
Definition at line 109 of file symbol_table.cc. References dump_flags. Referenced by Variable_symbol::dump(), Function_signature::dump(), main(), print_annotated_tree(), process(), and Program_from_fd::Program_from_fd(). |
|
Set "peer" of a symbol. This is used for the construction "typedef class A {} B;". In that case, "B" becomes an alternate name for A. Hence, the "untag" slot of the symbol B contains the typedef, the "tag" slot becomes the base type. Definition at line 71 of file symbol_table.cc. References content, Symbol::get_name(), and Symbol::is_tagged(). Referenced by Typedef_declaration_reader::declare_variable(), and Class_symbol::start_definition(). |
|
Definition at line 104 of file symbol_table.h. Referenced by add_symbol(), begin(), clear(), dump(), end(), get_symbol(), and set_peer(). |
|
Definition at line 13 of file symbol_table.cc. Referenced by has_dump_flag(), and main(). |
|
Definition at line 10 of file symbol_table.cc. |