#include <scope.h>
Inheritance diagram for Abstract_scope:
Public Methods | |
Abstract_scope (Abstract_scope *parent) | |
virtual | ~Abstract_scope () |
virtual Symbol_pair | lookup_here (std::string name, bool for_decl)=0 |
Look up a symbol in this scope. More... | |
virtual Variable_symbol * | add_variable (Storage_class_specifier storage, Type type, Ptree *name, Ptree *init, Ptree *bitsize)=0 |
Add a variable. More... | |
virtual Function_signature * | add_function_decl (Storage_class_specifier storage, Function_specifier_set fspec, Type type, const Symbol_name &sym_name)=0 |
Declare a function. More... | |
virtual void | add_function_implementation (Function_signature *, Block_scope *, Ptree *, Ptree *)=0 |
Add function implementation. More... | |
virtual void | add_symbol (std::string name, Symbol *)=0 |
Add another symbol (nested type, ...). More... | |
virtual std::string | get_unique_name (std::string name)=0 |
Get unique naming prefix. More... | |
virtual Type | get_this_type () const=0 |
Get type of "*this". More... | |
Abstract_scope * | get_parent () const |
void | set_parent (Abstract_scope *p) |
virtual Symbol_pair | lookup_unqualified (std::string name) |
Look up an unqualified symbol. More... | |
virtual bool | is_constructor (Ptree *tree) |
Check whether /tree/ names a constructor. More... | |
virtual void | process_pending () |
Process pending tasks. More... | |
Abstract_scope * | get_global_scope () |
Get global scope. More... | |
Private Attributes | |
Abstract_scope * | parent |
|
|
|
|
|
Declare a function. Returns the declared signature. Implemented in Block_scope, Class_scope, Namespace_scope, and Template_defn_scope. Referenced by Template_defn_scope::add_function_decl(), Simple_declaration_reader::declare_variable(), and init_default_symbols(). |
|
Add function implementation.
Implemented in Block_scope, Class_scope, Namespace_scope, and Template_defn_scope. Referenced by Template_defn_scope::add_function_implementation(), Class_scope::add_function_implementation(), and Simple_declaration_reader::declare_variable(). |
|
Add another symbol (nested type, ...).
Implemented in Block_scope, Class_scope, Namespace_scope, and Template_defn_scope. Referenced by Template_class_adder::add_class(), Default_class_adder::add_class(), Template_visitor::declare_class(), Typedef_declaration_reader::declare_variable(), Mangle::insert(), parse_enum(), Enum_symbol::process_value(), and Annotator::visit_namespacespec(). |
|
Add a variable. Returns variable symbol if this is a definition of a variable which must appear in output. Implemented in Block_scope, Class_scope, Namespace_scope, and Template_defn_scope. Referenced by Simple_declaration_reader::declare_variable(). |
|
Get global scope. That is the scope without a parent. Definition at line 50 of file scope.cc. References get_parent(). Referenced by Template_visitor::declare_name(), Symbol_name::Symbol_name(), and Expr_annotator::visit_new(). |
|
Definition at line 65 of file scope.h. Referenced by Template_class_adder::add_class(), Template_defn_scope::add_function_decl(), Template_defn_scope::add_function_implementation(), Class_scope::add_function_implementation(), Template_visitor::declare_name(), Simple_declaration_reader::declare_variable(), get_global_scope(), Mangle::leave_scope(), Block_scope::lookup_here(), lookup_unqualified(), parse_class(), and Symbol_name::Symbol_name(). |
|
Get type of "*this".
Implemented in Block_scope, Class_scope, Namespace_scope, and Template_defn_scope. Referenced by Expr_annotator::do_funcall(), Expr_annotator::visit_name(), and Expr_annotator::visit_this(). |
|
Get unique naming prefix. I hope to never need this function Implemented in Block_scope, Class_scope, Namespace_scope, and Template_defn_scope. Referenced by Mangle::enter_scope(), and Function_symbol::fill_in_mangled_names(). |
|
Check whether /tree/ names a constructor. This is used by Symbol_name when parsing apart a name. Only Class_scope needs to override this. Reimplemented in Class_scope. Definition at line 32 of file scope.cc. Referenced by Symbol_name::init_name(). |
|
Look up a symbol in this scope.
Implemented in Block_scope, Class_scope, Namespace_scope, and Template_defn_scope. Referenced by Namespace_scope::add_function_decl(), Template_visitor::declare_class(), Template_visitor::declare_name(), Typedef_declaration_reader::declare_variable(), Mangle::insert(), Symbol_name::lookup_for_decl(), Symbol_name::lookup_for_use(), Block_scope::lookup_here(), Symbol_name::lookup_symbol_in_scope(), lookup_unqualified(), parse_enum(), Annotator::visit_namespacespec(), and Expr_annotator::visit_new(). |
|
Look up an unqualified symbol. That is, look up the symbol in this scope and all containing scopes. Definition at line 12 of file scope.cc. References get_parent(), and lookup_here(). Referenced by Template_visitor::declare_name(), Symbol_name::lookup_for_use(), Mangle::lookup_global_name(), Expr_annotator::visit_array(), Expr_annotator::visit_assign(), Expr_annotator::visit_comma(), Expr_annotator::visit_postfix(), and Expr_annotator::visit_unary(). |
|
Process pending tasks. This is called periodically by the main annotator code. This is needed to process definition of functions inside classes. Reimplemented in Namespace_scope. Definition at line 43 of file scope.cc. Referenced by Annotator::process_pending(). |
|
|
|
|