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

Class_lookup_helper Class Reference

#include <class.h>

Inheritance diagram for Class_lookup_helper:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual ~Class_lookup_helper ()
void add_class (Class_symbol *sym)
 Add a base class subobject to the result set. More...

void finish (Class_symbol *sym)
 Finish up the result set. More...


Protected Types

typedef std::vector< Class_symbol * > classes_t

Protected Methods

virtual bool predicate (Class_symbol *sym)=0
 Class_lookup_helper ()
 Helper class to implement lookup of class members. More...


Protected Attributes

classes_t result_set
classes_t hidden_vbcs

Member Typedef Documentation

typedef std::vector<Class_symbol*> Class_lookup_helper::classes_t [protected]
 

Definition at line 145 of file class.h.


Constructor & Destructor Documentation

Class_lookup_helper::~Class_lookup_helper   [virtual]
 

Definition at line 529 of file class.cc.

Class_lookup_helper::Class_lookup_helper   [protected]
 

Helper class to implement lookup of class members.

10.2: First, every declaration for the name in the class and in each of its base class sub-objects is considered. A member name f in one sub-object B hides a member name f in a sub-object A if A is a base class sub-object of B. Any declarations that are so hidden are eliminated from consideration. Each of these declarations that was introduced by a using-declaration is considered to be from each sub-object of C that is of the type containing the declara-tion designated by the using-declaration.96) If the resulting set of declarations are not all from sub-objects of the same type, or the set has a nonstatic member and includes members from distinct sub-objects, there is an ambiguity and the program is ill-formed. Otherwise that set is the result of the lookup.

FIXME: g++ accepts the following: struct A { struct stat {}; }; struct B { static void stat(); }; struct C : A, B { }; struct C::stat x; and rejects void x() { C::stat(); } We currently reject both.

Definition at line 523 of file class.cc.


Member Function Documentation

void Class_lookup_helper::add_class Class_symbol   sym
 

Add a base class subobject to the result set.

Definition at line 536 of file class.cc.

References Class_symbol::base_classes, hidden_vbcs, predicate(), result_set, and Class_symbol::virtual_base_classes.

Referenced by Class_op_lookup_helper::is_visible_in(), and Class_scope::lookup_here().

void Class_lookup_helper::finish Class_symbol   sym
 

Finish up the result set.

This adds the non-hidden base classes to the set.

Definition at line 561 of file class.cc.

References hidden_vbcs, predicate(), result_set, and Class_symbol::virtual_base_classes.

Referenced by Class_op_lookup_helper::is_visible_in(), and Class_scope::lookup_here().

virtual bool Class_lookup_helper::predicate Class_symbol   sym [protected, pure virtual]
 

Implemented in Class_name_lookup_helper, and Class_op_lookup_helper.

Referenced by add_class(), and finish().


Member Data Documentation

classes_t Class_lookup_helper::hidden_vbcs [protected]
 

Definition at line 147 of file class.h.

Referenced by add_class(), and finish().

classes_t Class_lookup_helper::result_set [protected]
 

Definition at line 146 of file class.h.

Referenced by add_class(), finish(), Class_name_lookup_helper::get_result(), and Class_op_lookup_helper::is_visible_in().


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