Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Class_scope Class Reference

#include <class.h>

Inheritance diagram for Class_scope:

Inheritance graph
[legend]
Collaboration diagram for Class_scope:

Collaboration graph
[legend]
List of all members.

Public Methods

 Class_scope (Class_symbol *sym)
 ~Class_scope ()
Class_symbolget_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_symboladd_variable (Storage_class_specifier storage, Type type, Ptree *name, Ptree *init, Ptree *bitsize)
 Add a variable at class scope. More...

Function_signatureadd_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_symbolsym
std::string prefix

Constructor & Destructor Documentation

Class_scope::Class_scope Class_symbol   sym
 

Definition at line 634 of file class.cc.

Class_scope::~Class_scope  
 

Definition at line 642 of file class.cc.


Member Function Documentation

Function_signature * Class_scope::add_function_decl Storage_class_specifier    storage,
Function_specifier_set    fspec,
Type    type,
const Symbol_name   sym_name
[virtual]
 

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.

void Class_scope::add_function_implementation Function_signature   fsig,
Block_scope   scope,
Ptree   tree,
Ptree   initializer
[virtual]
 

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().

void Class_scope::add_symbol std::string    name,
Symbol   sym
[virtual]
 

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().

Variable_symbol * Class_scope::add_variable Storage_class_specifier    storage,
Type    type,
Ptree   name,
Ptree   init,
Ptree   bitsize
[virtual]
 

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.

Class_symbol * Class_scope::get_class_symbol   const [inline]
 

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().

Type Class_scope::get_this_type   const [virtual]
 

Get type of "*this".

Implements Abstract_scope.

Definition at line 648 of file class.cc.

std::string Class_scope::get_unique_name std::string    name [virtual]
 

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().

bool Class_scope::is_constructor Ptree   tree [virtual]
 

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().

Symbol_pair Class_scope::lookup_here std::string    name,
bool    for_decl
[virtual]
 

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().


Member Data Documentation

std::string Class_scope::prefix [private]
 

Definition at line 23 of file class.h.

Referenced by get_unique_name().

Class_symbol* Class_scope::sym [private]
 

Definition at line 22 of file class.h.

Referenced by add_function_decl(), add_variable(), get_class_symbol(), is_constructor(), and lookup_here().


The documentation for this class was generated from the following files:
Generated on Mon Feb 10 17:35:22 2003 for VFiasco Semantics Compiler by doxygen1.2.15