TAO_PSDL_Struct_Scope Class Reference

#include <PSDL_Struct_Scope.h>

Inheritance diagram for TAO_PSDL_Struct_Scope:

Inheritance graph
[legend]
Collaboration diagram for TAO_PSDL_Struct_Scope:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_PSDL_Struct_Scope (TAO_PSDL_Scope *parent_scope)
int add_module (ACE_CString identifier)
int add_struct (ACE_CString identifier)
int add_typedef (ACE_CString identifier, ACE_CString identifier_type)
int add_const_decl (ACE_CString identifier, ACE_CString identifier_type)
int add_except_decl (ACE_CString identifier, ACE_CString identifier_type)
void dump (CORBA::ULong depth)
 Function to help indent the output of the parse tree.

int find (const ACE_CString &identifier_name, ACE_CString &identifier_type)
 Function to find the TAO_PSDL_Scope for the given identifier_name.

int find (const ACE_CString &identifier_name)
TAO_PSDL_Scopeparent_scope (void)
 Return the pointer to the parent scope.

Scope_Mapscope_map (void)
 Return the pointer to Scope_Map of the instance.

ACE_CString identifier_type (void)
ACE_CString module_name (void)
ACE_CString interface_name (void)

Private Attributes

Scope_Map struct_scope_
TAO_PSDL_Scopeparent_scope_
ACE_CString identifier_type_
ACE_CString module_name_
ACE_CString interface_name_

Constructor & Destructor Documentation

TAO_PSDL_Struct_Scope::TAO_PSDL_Struct_Scope TAO_PSDL_Scope parent_scope  ) 
 

Definition at line 8 of file PSDL_Struct_Scope.cpp.

00009   : struct_scope_ (),
00010     parent_scope_ (parent_scope),
00011     identifier_type_ ("struct")
00012 {
00013 }


Member Function Documentation

int TAO_PSDL_Struct_Scope::add_const_decl ACE_CString  identifier,
ACE_CString  identifier_type
[virtual]
 

Reimplemented from TAO_PSDL_Scope.

Definition at line 39 of file PSDL_Struct_Scope.cpp.

References TAO_PSDL_Scope::add_const_decl_to_scope(), and TAO_PSDL_Scope::instance().

00041 {
00042   return TAO_PSDL_Scope::instance ()->add_const_decl_to_scope (identifier,
00043                                                                identifier_type,
00044                                                                this);
00045 }

int TAO_PSDL_Struct_Scope::add_except_decl ACE_CString  identifier,
ACE_CString  identifier_type
[virtual]
 

Reimplemented from TAO_PSDL_Scope.

Definition at line 48 of file PSDL_Struct_Scope.cpp.

References TAO_PSDL_Scope::add_except_decl_to_scope(), and TAO_PSDL_Scope::instance().

00050 {
00051   return TAO_PSDL_Scope::instance ()->add_except_decl_to_scope (identifier,
00052                                                                 identifier_type,
00053                                                                 this);
00054 }

int TAO_PSDL_Struct_Scope::add_module ACE_CString  identifier  )  [virtual]
 

The add functions are overridden by the derived classes to add the respective types in their scopes. The return value is a '0' if successful and '-1' if it ends up as a failure.

Reimplemented from TAO_PSDL_Scope.

Definition at line 16 of file PSDL_Struct_Scope.cpp.

References TAO_PSDL_Scope::add_module_to_scope(), and TAO_PSDL_Scope::instance().

00017 {
00018   return TAO_PSDL_Scope::instance ()->add_module_to_scope (identifier,
00019                                                            this);
00020 }

int TAO_PSDL_Struct_Scope::add_struct ACE_CString  identifier  )  [virtual]
 

Reimplemented from TAO_PSDL_Scope.

Definition at line 23 of file PSDL_Struct_Scope.cpp.

References TAO_PSDL_Scope::add_struct_to_scope(), and TAO_PSDL_Scope::instance().

00024 {
00025   return TAO_PSDL_Scope::instance ()->add_struct_to_scope (struct_name,
00026                                                            this);
00027 }

int TAO_PSDL_Struct_Scope::add_typedef ACE_CString  identifier,
ACE_CString  identifier_type
[virtual]
 

Reimplemented from TAO_PSDL_Scope.

Definition at line 30 of file PSDL_Struct_Scope.cpp.

References TAO_PSDL_Scope::add_typedef_to_scope(), and TAO_PSDL_Scope::instance().

00032 {
00033   return TAO_PSDL_Scope::instance ()->add_typedef_to_scope (identifier,
00034                                                             identifier_type,
00035                                                             this);
00036 }

void TAO_PSDL_Struct_Scope::dump CORBA::ULong  depth  )  [virtual]
 

Function to help indent the output of the parse tree.

Reimplemented from TAO_PSDL_Scope.

Definition at line 57 of file PSDL_Struct_Scope.cpp.

References ACE_DEBUG, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::begin(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), LM_DEBUG, TAO_PSDL_Scope::print_depth(), Scope_Map_Iterator, and struct_scope_.

00058 {
00059   depth = depth + 5;
00060 
00061   for (Scope_Map_Iterator i = this->struct_scope_.begin ();
00062        i != this->struct_scope_.end ();
00063        ++i)
00064     {
00065       this->print_depth (depth);
00066       ACE_DEBUG ((LM_DEBUG,
00067                   "%s (struct)\n",
00068                   (*i).ext_id_.c_str ()));
00069       (*i).int_id_->dump (depth);
00070     }
00071 }

int TAO_PSDL_Struct_Scope::find const ACE_CString identifier_name  )  [virtual]
 

Function to check if a particular identifier_name exists in the scope.

Reimplemented from TAO_PSDL_Scope.

Definition at line 100 of file PSDL_Struct_Scope.cpp.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::begin(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), Scope_Map_Iterator, ACE_OS::strcmp(), and struct_scope_.

00101 {
00102   for (Scope_Map_Iterator i = this->struct_scope_.begin ();
00103        i != this->struct_scope_.end ();
00104        ++i)
00105     {
00106       if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
00107         {
00108           return 0;
00109         }
00110       else
00111         {
00112           if ((*i).int_id_->find (identifier_name) == 0)
00113             {
00114               // #@@@@ deal
00115               //      identifier_type = identifier_info->type;
00116               return 0;
00117             }
00118         }
00119     }
00120 
00121   return -1;
00122 }

int TAO_PSDL_Struct_Scope::find const ACE_CString identifier_name,
ACE_CString identifier_type
[virtual]
 

Function to find the TAO_PSDL_Scope for the given identifier_name.

Reimplemented from TAO_PSDL_Scope.

Definition at line 74 of file PSDL_Struct_Scope.cpp.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::begin(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), Scope_Map_Iterator, ACE_OS::strcmp(), and struct_scope_.

00076 {
00077   for (Scope_Map_Iterator i = this->struct_scope_.begin ();
00078        i != this->struct_scope_.end ();
00079        ++i)
00080     {
00081       if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0)
00082         {
00083           identifier_type = (*i).int_id_->identifier_type ();
00084           return 0;
00085         }
00086       else
00087         {
00088           if ((*i).int_id_->find (identifier_name,
00089                                   identifier_type) == 0)
00090             {
00091               return 0;
00092             }
00093         }
00094     }
00095 
00096   return -1;
00097 }

ACE_CString TAO_PSDL_Struct_Scope::identifier_type void   )  [virtual]
 

Each identifier will have an instance of a derived type of TAO_PSDL_Scope *.. the following method is an accessor to the type of the identifier name

Reimplemented from TAO_PSDL_Scope.

Definition at line 137 of file PSDL_Struct_Scope.cpp.

00138 {
00139   return this->identifier_type_;
00140 }

ACE_CString TAO_PSDL_Struct_Scope::interface_name void   )  [virtual]
 

Reimplemented from TAO_PSDL_Scope.

Definition at line 149 of file PSDL_Struct_Scope.cpp.

00150 {
00151   return this->interface_name_;
00152 }

ACE_CString TAO_PSDL_Struct_Scope::module_name void   )  [virtual]
 

Reimplemented from TAO_PSDL_Scope.

Definition at line 143 of file PSDL_Struct_Scope.cpp.

00144 {
00145   return this->module_name_;
00146 }

TAO_PSDL_Scope * TAO_PSDL_Struct_Scope::parent_scope void   )  [virtual]
 

Return the pointer to the parent scope.

Reimplemented from TAO_PSDL_Scope.

Definition at line 125 of file PSDL_Struct_Scope.cpp.

00126 {
00127   return this->parent_scope_;
00128 }

Scope_Map * TAO_PSDL_Struct_Scope::scope_map void   )  [virtual]
 

Return the pointer to Scope_Map of the instance.

Reimplemented from TAO_PSDL_Scope.

Definition at line 131 of file PSDL_Struct_Scope.cpp.

References struct_scope_.

00132 {
00133   return &this->struct_scope_;
00134 }


Member Data Documentation

ACE_CString TAO_PSDL_Struct_Scope::identifier_type_ [private]
 

Definition at line 66 of file PSDL_Struct_Scope.h.

ACE_CString TAO_PSDL_Struct_Scope::interface_name_ [private]
 

Reimplemented from TAO_PSDL_Scope.

Definition at line 68 of file PSDL_Struct_Scope.h.

ACE_CString TAO_PSDL_Struct_Scope::module_name_ [private]
 

Definition at line 67 of file PSDL_Struct_Scope.h.

TAO_PSDL_Scope* TAO_PSDL_Struct_Scope::parent_scope_ [private]
 

Definition at line 65 of file PSDL_Struct_Scope.h.

Scope_Map TAO_PSDL_Struct_Scope::struct_scope_ [private]
 

Definition at line 64 of file PSDL_Struct_Scope.h.

Referenced by dump(), find(), and scope_map().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 14:10:30 2006 for TAO_PSS by doxygen 1.3.6