#include <namespace.h>
Inheritance diagram for Namespace_scope:
Public Methods | |
Namespace_scope (Namespace_scope *parent, std::string prefix) | |
Namespace_scope (Namespace_scope *parent, Namespace_symbol *sym) | |
std::string | get_unique_name (std::string name) |
Get unique naming prefix. More... | |
Type | get_this_type () const |
Get type of "*this". More... | |
Symbol_pair | lookup_here (std::string name, bool for_decl) |
Look up name here. More... | |
void | add_symbol (std::string name, Symbol *sym) |
Add another symbol (nested type, ...). More... | |
Variable_symbol * | add_variable (Storage_class_specifier storage, Type type, Ptree *name, Ptree *init, Ptree *bitsize) |
Add a variable at namespace scope. More... | |
Function_signature * | add_function_decl (Storage_class_specifier storage, Function_specifier_set fspec, Type type, const Symbol_name &sym_name) |
Declare a function. More... | |
void | add_function_implementation (Function_signature *fsig, Block_scope *scope, Ptree *tree, Ptree *initializer) |
Add function implementation. More... | |
void | process_pending () |
Process pending tasks. More... | |
Private Attributes | |
std::string | prefix |
Namespace_symbol * | sym |
Function_body_queue * | fbqueue |
|
Definition at line 39 of file namespace.cc. |
|
Definition at line 47 of file namespace.cc. |
|
Declare a function. Returns the declared signature. Implements Abstract_scope. Definition at line 170 of file namespace.cc. References Function_symbol::add_signature(), add_symbol(), compile_error(), Function_specifier_set, Class_scope::get_class_symbol(), Symbol_name::get_kind(), Symbol_name::get_name(), Symbol_name::get_scope(), Type_symbol::get_type(), Symbol::is_declared(), Symbol_name::is_qualified(), Symbol_name::is_template(), Abstract_scope::lookup_here(), lookup_here(), Function_symbol::may_be_anything, Function_symbol::must_be_declared, s_Extern, s_None, s_Static, Symbol::set_status(), Symbol::st_Declared, Storage_class_specifier, Symbol_pair::tag, and Symbol_pair::untag. |
|
Add function implementation.
Implements Abstract_scope. Definition at line 223 of file namespace.cc. References Function_body_queue::add_function(), and fbqueue. |
|
Add another symbol (nested type, ...).
Implements Abstract_scope. Definition at line 84 of file namespace.cc. References Symbol_table::add_symbol(), Symbol_table::get_instance(), and get_unique_name(). Referenced by add_function_decl(), and add_variable(). |
|
Add a variable at namespace scope.
Implements Abstract_scope. Definition at line 93 of file namespace.cc. References add_symbol(), compile_error(), Variable_symbol::define_variable(), Type::get_kind(), Symbol_name::get_name(), Symbol::get_name(), Symbol_name::get_scope(), Variable_symbol::get_storage_class(), Variable_symbol::get_type(), Type::get_unqualified_type(), Symbol::is_declared(), Symbol::is_defined(), Variable_symbol::is_member_variable(), Symbol_name::is_qualified(), Type::is_qualified(), Symbol_name::is_template(), Type::k_Function, Symbol_name::lookup_for_decl(), Type::q_Const, s_Auto, s_Extern, s_Mutable, s_None, s_Register, s_Static, Symbol::set_status(), Symbol::st_Declared, Symbol::st_Defined, Storage_class_specifier, Symbol_pair::tag, and Symbol_pair::untag. |
|
Get type of "*this".
Implements Abstract_scope. Definition at line 66 of file namespace.cc. |
|
Get unique naming prefix. I hope to never need this function Implements Abstract_scope. Definition at line 58 of file namespace.cc. References Symbol_name::get_mangled_symbol_name(), and prefix. Referenced by add_symbol(), and lookup_here(). |
|
Look up name here.
Implements Abstract_scope. Definition at line 75 of file namespace.cc. References Symbol_table::get_instance(), Symbol_table::get_symbol(), and get_unique_name(). Referenced by add_function_decl(). |
|
Process pending tasks. This is called periodically by the main annotator code. This is needed to process definition of functions inside classes. Reimplemented from Abstract_scope. Definition at line 236 of file namespace.cc. References fbqueue, and Function_body_queue::process(). |
|
Definition at line 27 of file namespace.h. Referenced by add_function_implementation(), and process_pending(). |
|
Definition at line 25 of file namespace.h. Referenced by get_unique_name(). |
|
Definition at line 26 of file namespace.h. |