#include <class.h>
Inheritance diagram for Class_scope:
Public Methods | |
Class_scope (Class_symbol *sym) | |
~Class_scope () | |
Class_symbol * | get_class_symbol () const |
Type | get_this_type () const |
Get type of "*this". More... | |
std::string | get_unique_name (std::string name) |
Get unique naming prefix. 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 class 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... | |
bool | is_constructor (Ptree *tree) |
Check whether /tree/ names a constructor. More... | |
Private Attributes | |
Class_symbol * | sym |
std::string | prefix |
|
|
|
|
|
Declare a function. Returns the declared signature. Implements Abstract_scope. Definition at line 811 of file class.cc. References Function_symbol::add_signature(), add_symbol(), Class_symbol::bases_t, compile_error(), Class_symbol::enumerate_base_classes(), f_Virtual, Function_specifier_set, Type::get_function_signature(), Symbol_name::get_kind(), Symbol_name::get_name(), Type::get_return_type(), Type_symbol::get_type(), is_covariant_or_same(), Symbol::is_declared(), Symbol_name::is_qualified(), Symbol_name::is_template(), lookup_here(), Class_symbol::member_functions, Function_symbol::must_be_new, Class_symbol::pod, s_Member, s_None, s_Static, Symbol::set_status(), Function_symbol::sig_begin(), Function_symbol::sig_end(), Function_symbol::Sig_it, Symbol::st_Declared, Storage_class_specifier, sym, Symbol_pair::tag, and Symbol_pair::untag. |
|
Add function implementation.
Implements Abstract_scope. Definition at line 879 of file class.cc. References Abstract_scope::add_function_implementation(), f_Inline, Abstract_scope::get_parent(), and Function_signature::merge_fspec(). |
|
Add another symbol (nested type, ...).
Implements Abstract_scope. Definition at line 712 of file class.cc. References Symbol_table::add_symbol(), Symbol_table::get_instance(), and get_unique_name(). Referenced by add_function_decl(), add_variable(), Class_symbol::finish_definition(), and Class_symbol::start_definition(). |
|
Add a variable at class scope.
Implements Abstract_scope. Definition at line 722 of file class.cc. References add_symbol(), compile_error(), Type::get_kind(), Symbol::get_name(), Symbol_name::get_name(), Symbol::is_defined(), Type::is_enum_type(), Type::is_int(), Type::is_pod(), Type::is_qualified(), Symbol_name::is_qualified(), Symbol_name::is_template(), Type::k_Function, Type::k_Member, Type::k_Reference, Symbol_name::lookup_for_decl(), Class_symbol::members, Class_symbol::pod, Type::q_Const, s_Extern, s_Member, s_Mutable, s_None, s_Static, Type::sans_array(), Variable_symbol::set_class(), Symbol::st_Declared, Symbol::st_Defined, Storage_class_specifier, sym, Symbol_pair::tag, and Symbol_pair::untag. |
|
Definition at line 216 of file class.h. References sym. Referenced by Namespace_scope::add_function_decl(), Declaration_reader::parse_declarator_internal(), and Expr_annotator::process_member_access(). |
|
Get type of "*this".
Implements Abstract_scope. |
|
Get unique naming prefix. I hope to never need this function Implements Abstract_scope. Definition at line 656 of file class.cc. References Symbol_name::get_mangled_symbol_name(), and prefix. Referenced by add_symbol(). |
|
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 from Abstract_scope. Definition at line 894 of file class.cc. References Class_symbol::get_real_name(), Ptree::IsLeaf(), sym, and Ptree::ToString(). |
|
Look up name here.
Implements Abstract_scope. Definition at line 694 of file class.cc. References Class_lookup_helper::add_class(), Class_lookup_helper::finish(), Class_name_lookup_helper::get_result(), Class_symbol::lookup_helper(), and sym. Referenced by add_function_decl(), Expr_annotator::do_funcall(), gen_constructors(), Expr_annotator::visit_array(), Expr_annotator::visit_arrowmember(), Expr_annotator::visit_assign(), Expr_annotator::visit_comma(), Expr_annotator::visit_postfix(), and Expr_annotator::visit_unary(). |
|
Definition at line 23 of file class.h. Referenced by get_unique_name(). |
|
Definition at line 22 of file class.h. Referenced by add_function_decl(), add_variable(), get_class_symbol(), is_constructor(), and lookup_here(). |