#include <mangle.h>
Collaboration diagram for Mangle:
Public Methods | |
Mangle () | |
void | enter_scope (const std::string &scopename, char symprefix) |
void | leave_scope () |
std::string & | insert (Ptree &name, char symprefix) |
bool | lookup_global_name (Ptree &name, std::string *out_global_name) |
Private Types | |
typedef std::hash_map< void *, std::string > | Bind_map |
typedef std::deque< std::string > | Scopes |
Private Methods | |
std::string | current_scope () |
Private Attributes | |
Scopes | _scope |
Bind_map | _map |
std::string | _current_scope |
Abstract_scope * | _env |
Identifiers are assigned a global name when they are declared using insert(); later, an (potentially scope-qualified) aidentifier occurrence can be mapped to the global name by calling lookup_global_name().
Global names are scoped using the name and type of the scope in which they were declared. Use the enter_scope() and leave_scope() functions around invocations of insert() to define the scope.
Definition at line 29 of file mangle.h.
|
|
|
|
|
|
|
Definition at line 43 of file mangle.cc. References _scope. Referenced by insert(). |
|
Definition at line 21 of file mangle.cc. References _env, _scope, and Abstract_scope::get_unique_name(). Referenced by Translate_visitor::visit_function(). |
|
Definition at line 58 of file mangle.cc. References _env, _map, Abstract_scope::add_symbol(), current_scope(), Abstract_scope::lookup_here(), s_None, Symbol::st_Defined, Ptree::ToString(), and Symbol_pair::untag. Referenced by Translate_visitor::visit_function(), and Translate_visitor::visit_name_declaration(). |
|
Definition at line 33 of file mangle.cc. References _env, _scope, and Abstract_scope::get_parent(). Referenced by Translate_visitor::visit_function(). |
|
Definition at line 85 of file mangle.cc. References _env, _map, Abstract_scope::lookup_unqualified(), Ptree::ToString(), and Symbol_pair::untag. Referenced by Translate_visitor::visit_funcall(), and Translate_visitor::visit_name(). |
|
|
|
Definition at line 37 of file mangle.h. Referenced by enter_scope(), insert(), leave_scope(), and lookup_global_name(). |
|
Definition at line 35 of file mangle.h. Referenced by insert(), and lookup_global_name(). |
|
Definition at line 34 of file mangle.h. Referenced by current_scope(), enter_scope(), and leave_scope(). |