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

Namespace_scope Class Reference

#include <namespace.h>

Inheritance diagram for Namespace_scope:

Inheritance graph
[legend]
Collaboration diagram for Namespace_scope:

Collaboration graph
[legend]
List of all members.

Public Methods

 Namespace_scope (Namespace_scope *parent, std::string prefix)
 Namespace_scope (Namespace_scope *parent, Namespace_symbol *sym)
std::string get_unique_name (std::string name)
 Get unique naming prefix. More...

Type get_this_type () const
 Get type of "*this". 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 namespace 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...

void process_pending ()
 Process pending tasks. More...


Private Attributes

std::string prefix
Namespace_symbolsym
Function_body_queuefbqueue

Constructor & Destructor Documentation

Namespace_scope::Namespace_scope Namespace_scope *    parent,
std::string    prefix
 

Definition at line 39 of file namespace.cc.

Namespace_scope::Namespace_scope Namespace_scope *    parent,
Namespace_symbol   sym
 

Definition at line 47 of file namespace.cc.


Member Function Documentation

Function_signature * Namespace_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 170 of file namespace.cc.

References Function_symbol::add_signature(), add_symbol(), compile_error(), Function_specifier_set, Class_scope::get_class_symbol(), Symbol_name::get_kind(), Symbol_name::get_name(), Symbol_name::get_scope(), Type_symbol::get_type(), Symbol::is_declared(), Symbol_name::is_qualified(), Symbol_name::is_template(), Abstract_scope::lookup_here(), lookup_here(), Function_symbol::may_be_anything, Function_symbol::must_be_declared, s_Extern, s_None, s_Static, Symbol::set_status(), Symbol::st_Declared, Storage_class_specifier, Symbol_pair::tag, and Symbol_pair::untag.

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

Add function implementation.

Implements Abstract_scope.

Definition at line 223 of file namespace.cc.

References Function_body_queue::add_function(), and fbqueue.

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

Add another symbol (nested type, ...).

Implements Abstract_scope.

Definition at line 84 of file namespace.cc.

References Symbol_table::add_symbol(), Symbol_table::get_instance(), and get_unique_name().

Referenced by add_function_decl(), and add_variable().

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

Add a variable at namespace scope.

Implements Abstract_scope.

Definition at line 93 of file namespace.cc.

References add_symbol(), compile_error(), Variable_symbol::define_variable(), Type::get_kind(), Symbol_name::get_name(), Symbol::get_name(), Symbol_name::get_scope(), Variable_symbol::get_storage_class(), Variable_symbol::get_type(), Type::get_unqualified_type(), Symbol::is_declared(), Symbol::is_defined(), Variable_symbol::is_member_variable(), Symbol_name::is_qualified(), Type::is_qualified(), Symbol_name::is_template(), Type::k_Function, Symbol_name::lookup_for_decl(), Type::q_Const, s_Auto, s_Extern, s_Mutable, s_None, s_Register, s_Static, Symbol::set_status(), Symbol::st_Declared, Symbol::st_Defined, Storage_class_specifier, Symbol_pair::tag, and Symbol_pair::untag.

Type Namespace_scope::get_this_type   const [virtual]
 

Get type of "*this".

Implements Abstract_scope.

Definition at line 66 of file namespace.cc.

std::string Namespace_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 58 of file namespace.cc.

References Symbol_name::get_mangled_symbol_name(), and prefix.

Referenced by add_symbol(), and lookup_here().

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

Look up name here.

Implements Abstract_scope.

Definition at line 75 of file namespace.cc.

References Symbol_table::get_instance(), Symbol_table::get_symbol(), and get_unique_name().

Referenced by add_function_decl().

void Namespace_scope::process_pending   [virtual]
 

Process pending tasks.

This is called periodically by the main annotator code. This is needed to process definition of functions inside classes.

Reimplemented from Abstract_scope.

Definition at line 236 of file namespace.cc.

References fbqueue, and Function_body_queue::process().


Member Data Documentation

Function_body_queue* Namespace_scope::fbqueue [private]
 

Definition at line 27 of file namespace.h.

Referenced by add_function_implementation(), and process_pending().

std::string Namespace_scope::prefix [private]
 

Definition at line 25 of file namespace.h.

Referenced by get_unique_name().

Namespace_symbol* Namespace_scope::sym [private]
 

Definition at line 26 of file namespace.h.


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