#include <PSDL_Interface_Scope.h>
Inheritance diagram for TAO_PSDL_Interface_Scope:
Public Member Functions | |
TAO_PSDL_Interface_Scope (TAO_PSDL_Scope *parent_scope) | |
~TAO_PSDL_Interface_Scope (void) | |
int | add_interface (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) |
int | add_exception (ACE_CString identifier) |
int | add_op_dcl (ACE_CString identifier) |
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) |
int | get_module_name (const ACE_CString &identifier_name, ACE_CString &module_name) |
int | get_interface_name (const ACE_CString &identifier_name, ACE_CString &interface_name) |
TAO_PSDL_Scope * | parent_scope (void) |
Return the pointer to the parent scope. | |
Scope_Map * | scope_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 | interface_scope_ |
TAO_PSDL_Scope * | parent_scope_ |
ACE_CString | identifier_type_ |
ACE_CString | module_name_ |
ACE_CString | interface_name_ |
Definition at line 31 of file PSDL_Interface_Scope.h.
TAO_PSDL_Interface_Scope::TAO_PSDL_Interface_Scope | ( | TAO_PSDL_Scope * | parent_scope | ) |
Definition at line 9 of file PSDL_Interface_Scope.cpp.
00010 : interface_scope_ (), 00011 parent_scope_ (parent_scope) 00012 { 00013 // Constructor 00014 }
TAO_PSDL_Interface_Scope::~TAO_PSDL_Interface_Scope | ( | void | ) |
int TAO_PSDL_Interface_Scope::add_const_decl | ( | ACE_CString | identifier, | |
ACE_CString | identifier_type | |||
) | [virtual] |
Reimplemented from TAO_PSDL_Scope.
Definition at line 45 of file PSDL_Interface_Scope.cpp.
References TAO_PSDL_Scope::add_const_decl_to_scope(), identifier_type(), and TAO_PSDL_Scope::instance().
00047 { 00048 return TAO_PSDL_Scope::instance ()->add_const_decl_to_scope (identifier, 00049 identifier_type, 00050 this); 00051 }
int TAO_PSDL_Interface_Scope::add_except_decl | ( | ACE_CString | identifier, | |
ACE_CString | identifier_type | |||
) | [virtual] |
Reimplemented from TAO_PSDL_Scope.
Definition at line 54 of file PSDL_Interface_Scope.cpp.
References TAO_PSDL_Scope::add_except_decl_to_scope(), identifier_type(), and TAO_PSDL_Scope::instance().
00056 { 00057 return TAO_PSDL_Scope::instance ()->add_except_decl_to_scope (identifier, 00058 identifier_type, 00059 this); 00060 }
int TAO_PSDL_Interface_Scope::add_exception | ( | ACE_CString | identifier | ) | [virtual] |
Reimplemented from TAO_PSDL_Scope.
Definition at line 63 of file PSDL_Interface_Scope.cpp.
References TAO_PSDL_Scope::add_exception_to_scope(), and TAO_PSDL_Scope::instance().
00064 { 00065 return TAO_PSDL_Scope::instance ()->add_exception_to_scope (identifier, 00066 this); 00067 }
int TAO_PSDL_Interface_Scope::add_interface | ( | ACE_CString | identifier | ) | [virtual] |
Reimplemented from TAO_PSDL_Scope.
Definition at line 22 of file PSDL_Interface_Scope.cpp.
References TAO_PSDL_Scope::add_interface_to_scope(), TAO_PSDL_Scope::instance(), and interface_name().
00023 { 00024 return TAO_PSDL_Scope::instance ()->add_interface_to_scope (interface_name, 00025 this); 00026 }
int TAO_PSDL_Interface_Scope::add_op_dcl | ( | ACE_CString | identifier | ) | [virtual] |
Reimplemented from TAO_PSDL_Scope.
Definition at line 70 of file PSDL_Interface_Scope.cpp.
References TAO_PSDL_Scope::add_op_dcl_to_scope(), and TAO_PSDL_Scope::instance().
00071 { 00072 return TAO_PSDL_Scope::instance ()->add_op_dcl_to_scope (identifier, 00073 this); 00074 }
int TAO_PSDL_Interface_Scope::add_struct | ( | ACE_CString | identifier | ) | [virtual] |
Reimplemented from TAO_PSDL_Scope.
Definition at line 29 of file PSDL_Interface_Scope.cpp.
References TAO_PSDL_Scope::add_struct_to_scope(), and TAO_PSDL_Scope::instance().
00030 { 00031 return TAO_PSDL_Scope::instance ()->add_struct_to_scope (struct_name, 00032 this); 00033 }
int TAO_PSDL_Interface_Scope::add_typedef | ( | ACE_CString | identifier, | |
ACE_CString | identifier_type | |||
) | [virtual] |
Reimplemented from TAO_PSDL_Scope.
Definition at line 36 of file PSDL_Interface_Scope.cpp.
References TAO_PSDL_Scope::add_typedef_to_scope(), identifier_type(), and TAO_PSDL_Scope::instance().
00038 { 00039 return TAO_PSDL_Scope::instance ()->add_typedef_to_scope (identifier, 00040 identifier_type, 00041 this); 00042 }
void TAO_PSDL_Interface_Scope::dump | ( | CORBA::ULong | depth | ) | [virtual] |
Function to help indent the output of the parse tree.
Reimplemented from TAO_PSDL_Scope.
Definition at line 77 of file PSDL_Interface_Scope.cpp.
References ACE_DEBUG, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), interface_scope_, and LM_DEBUG.
00078 { 00079 depth = depth + 5; 00080 00081 for (Scope_Map_Iterator i = this->interface_scope_.begin (); 00082 i != this->interface_scope_.end (); 00083 ++i) 00084 { 00085 this->print_depth (depth); 00086 ACE_DEBUG ((LM_DEBUG, 00087 "%s (interface/exception/struct)\n", 00088 (*i).ext_id_.c_str ())); 00089 (*i).int_id_->dump (depth); 00090 } 00091 }
int TAO_PSDL_Interface_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 120 of file PSDL_Interface_Scope.cpp.
References ACE_String_Base< CHAR >::c_str(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), interface_scope_, and ACE_OS::strcmp().
00121 { 00122 for (Scope_Map_Iterator i = this->interface_scope_.begin (); 00123 i != this->interface_scope_.end (); 00124 ++i) 00125 { 00126 if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0) 00127 { 00128 return 0; 00129 } 00130 else 00131 { 00132 if ((*i).int_id_->find (identifier_name) == 0) 00133 { 00134 // #@@@@ deal 00135 // identifier_type = identifier_info->type; 00136 return 0; 00137 } 00138 } 00139 } 00140 00141 return -1; 00142 }
int TAO_PSDL_Interface_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 94 of file PSDL_Interface_Scope.cpp.
References ACE_String_Base< CHAR >::c_str(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), identifier_type(), interface_scope_, and ACE_OS::strcmp().
00096 { 00097 for (Scope_Map_Iterator i = this->interface_scope_.begin (); 00098 i != this->interface_scope_.end (); 00099 ++i) 00100 { 00101 if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0) 00102 { 00103 identifier_type = (*i).int_id_->identifier_type (); 00104 return 0; 00105 } 00106 else 00107 { 00108 if ((*i).int_id_->find (identifier_name, 00109 identifier_type) == 0) 00110 { 00111 return 0; 00112 } 00113 } 00114 } 00115 00116 return -1; 00117 }
int TAO_PSDL_Interface_Scope::get_interface_name | ( | const ACE_CString & | identifier_name, | |
ACE_CString & | interface_name | |||
) | [virtual] |
To get the name of the interface to which an identifier_name belongs. returns '0' on succes and '-1' on failure.
Reimplemented from TAO_PSDL_Scope.
Definition at line 171 of file PSDL_Interface_Scope.cpp.
References ACE_String_Base< CHAR >::c_str(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), interface_name(), interface_scope_, and ACE_OS::strcmp().
00173 { 00174 for (Scope_Map_Iterator i = this->interface_scope_.begin (); 00175 i != this->interface_scope_.end (); 00176 ++i) 00177 { 00178 if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0) 00179 { 00180 interface_name = (*i).int_id_->interface_name (); 00181 return 0; 00182 } 00183 else 00184 { 00185 if ((*i).int_id_->get_interface_name (identifier_name, 00186 interface_name) == 0) 00187 { 00188 return 0; 00189 } 00190 } 00191 } 00192 00193 return -1; 00194 }
int TAO_PSDL_Interface_Scope::get_module_name | ( | const ACE_CString & | identifier_name, | |
ACE_CString & | module_name | |||
) | [virtual] |
To get the name of the module to which an identifier_name belongs. returns '0' on succes and '-1' on failure.
Reimplemented from TAO_PSDL_Scope.
Definition at line 145 of file PSDL_Interface_Scope.cpp.
References ACE_String_Base< CHAR >::c_str(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), interface_scope_, module_name(), and ACE_OS::strcmp().
00147 { 00148 for (Scope_Map_Iterator i = this->interface_scope_.begin (); 00149 i != this->interface_scope_.end (); 00150 ++i) 00151 { 00152 if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0) 00153 { 00154 module_name = (*i).int_id_->module_name (); 00155 return 0; 00156 } 00157 else 00158 { 00159 if ((*i).int_id_->get_module_name (identifier_name, 00160 module_name) == 0) 00161 { 00162 return 0; 00163 } 00164 } 00165 } 00166 00167 return -1; 00168 }
ACE_CString TAO_PSDL_Interface_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 209 of file PSDL_Interface_Scope.cpp.
References identifier_type_.
Referenced by add_const_decl(), add_except_decl(), add_typedef(), and find().
00210 { 00211 return this->identifier_type_; 00212 }
ACE_CString TAO_PSDL_Interface_Scope::interface_name | ( | void | ) | [virtual] |
Reimplemented from TAO_PSDL_Scope.
Definition at line 221 of file PSDL_Interface_Scope.cpp.
References interface_name_.
Referenced by add_interface(), and get_interface_name().
00222 { 00223 return this->interface_name_; 00224 }
ACE_CString TAO_PSDL_Interface_Scope::module_name | ( | void | ) | [virtual] |
Reimplemented from TAO_PSDL_Scope.
Definition at line 215 of file PSDL_Interface_Scope.cpp.
References module_name_.
Referenced by get_module_name().
00216 { 00217 return this->module_name_; 00218 }
TAO_PSDL_Scope * TAO_PSDL_Interface_Scope::parent_scope | ( | void | ) | [virtual] |
Return the pointer to the parent scope.
Reimplemented from TAO_PSDL_Scope.
Definition at line 197 of file PSDL_Interface_Scope.cpp.
References parent_scope_.
00198 { 00199 return this->parent_scope_; 00200 }
Scope_Map * TAO_PSDL_Interface_Scope::scope_map | ( | void | ) | [virtual] |
Return the pointer to Scope_Map of the instance.
Reimplemented from TAO_PSDL_Scope.
Definition at line 203 of file PSDL_Interface_Scope.cpp.
References interface_scope_.
00204 { 00205 return &this->interface_scope_; 00206 }
Reimplemented from TAO_PSDL_Scope.
Definition at line 90 of file PSDL_Interface_Scope.h.
Referenced by interface_name().
Definition at line 86 of file PSDL_Interface_Scope.h.
Referenced by dump(), find(), get_interface_name(), get_module_name(), and scope_map().