#include <PSDL_Simple_Scope.h>
Inheritance diagram for TAO_PSDL_Simple_Scope:
Public Member Functions | |
TAO_PSDL_Simple_Scope (TAO_PSDL_Scope *parent_scope, ACE_CString identifier_type) | |
~TAO_PSDL_Simple_Scope (void) | |
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_enum_decl (ACE_CString identifier, ACE_CString identifier_type) |
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) |
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) |
Protected Attributes | |
Scope_Map | scope_map_ |
TAO_PSDL_Scope * | parent_scope_ |
ACE_CString | identifier_type_ |
ACE_CString | module_name_ |
ACE_CString | interface_name_ |
Definition at line 31 of file PSDL_Simple_Scope.h.
TAO_PSDL_Simple_Scope::TAO_PSDL_Simple_Scope | ( | TAO_PSDL_Scope * | parent_scope, | |
ACE_CString | identifier_type | |||
) |
Definition at line 9 of file PSDL_Simple_Scope.cpp.
00011 : scope_map_ (), 00012 parent_scope_ (parent_scope), 00013 identifier_type_ (identifier_type) 00014 { 00015 }
TAO_PSDL_Simple_Scope::~TAO_PSDL_Simple_Scope | ( | void | ) |
int TAO_PSDL_Simple_Scope::add_const_decl | ( | ACE_CString | identifier, | |
ACE_CString | identifier_type | |||
) | [virtual] |
Reimplemented from TAO_PSDL_Scope.
Definition at line 31 of file PSDL_Simple_Scope.cpp.
References TAO_PSDL_Scope::add_const_decl_to_scope(), identifier_type(), and TAO_PSDL_Scope::instance().
00033 { 00034 return TAO_PSDL_Scope::instance ()->add_const_decl_to_scope (identifier, 00035 identifier_type, 00036 this); 00037 }
int TAO_PSDL_Simple_Scope::add_enum_decl | ( | ACE_CString | identifier, | |
ACE_CString | identifier_type | |||
) |
Definition at line 49 of file PSDL_Simple_Scope.cpp.
References TAO_PSDL_Scope::add_enum_decl_to_scope(), identifier_type(), and TAO_PSDL_Scope::instance().
00051 { 00052 return TAO_PSDL_Scope::instance ()->add_enum_decl_to_scope (identifier, 00053 identifier_type, 00054 this); 00055 }
int TAO_PSDL_Simple_Scope::add_except_decl | ( | ACE_CString | identifier, | |
ACE_CString | identifier_type | |||
) | [virtual] |
Reimplemented from TAO_PSDL_Scope.
Definition at line 40 of file PSDL_Simple_Scope.cpp.
References TAO_PSDL_Scope::add_except_decl_to_scope(), identifier_type(), and TAO_PSDL_Scope::instance().
00042 { 00043 return TAO_PSDL_Scope::instance ()->add_except_decl_to_scope (identifier, 00044 identifier_type, 00045 this); 00046 }
int TAO_PSDL_Simple_Scope::add_op_dcl | ( | ACE_CString | identifier | ) | [virtual] |
Reimplemented from TAO_PSDL_Scope.
Definition at line 58 of file PSDL_Simple_Scope.cpp.
References TAO_PSDL_Scope::add_op_dcl_to_scope(), and TAO_PSDL_Scope::instance().
00059 { 00060 return TAO_PSDL_Scope::instance ()->add_op_dcl_to_scope (identifier, 00061 this); 00062 }
int TAO_PSDL_Simple_Scope::add_typedef | ( | ACE_CString | identifier, | |
ACE_CString | identifier_type | |||
) | [virtual] |
Reimplemented from TAO_PSDL_Scope.
Definition at line 22 of file PSDL_Simple_Scope.cpp.
References TAO_PSDL_Scope::add_typedef_to_scope(), identifier_type(), and TAO_PSDL_Scope::instance().
00024 { 00025 return TAO_PSDL_Scope::instance ()->add_typedef_to_scope (identifier, 00026 identifier_type, 00027 this); 00028 }
void TAO_PSDL_Simple_Scope::dump | ( | CORBA::ULong | depth | ) | [virtual] |
Function to help indent the output of the parse tree.
Reimplemented from TAO_PSDL_Scope.
Definition at line 65 of file PSDL_Simple_Scope.cpp.
References ACE_DEBUG, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end(), LM_DEBUG, and scope_map_.
00066 { 00067 depth = depth + 5; 00068 00069 for (Scope_Map_Iterator i = this->scope_map_.begin (); 00070 i != this->scope_map_.end (); 00071 ++i) 00072 { 00073 this->print_depth (depth); 00074 ACE_DEBUG ((LM_DEBUG, 00075 "%s (simple types)", 00076 (*i).ext_id_.c_str ())); 00077 (*i).int_id_->dump (depth); 00078 } 00079 }
int TAO_PSDL_Simple_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 108 of file PSDL_Simple_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(), scope_map_, and ACE_OS::strcmp().
00109 { 00110 for (Scope_Map_Iterator i = this->scope_map_.begin (); 00111 i != this->scope_map_.end (); 00112 ++i) 00113 { 00114 if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0) 00115 { 00116 return 0; 00117 } 00118 else 00119 { 00120 if ((*i).int_id_->find (identifier_name) == 0) 00121 { 00122 // #@@@@ deal 00123 // identifier_type = identifier_info->type; 00124 return 0; 00125 } 00126 } 00127 } 00128 00129 return -1; 00130 }
int TAO_PSDL_Simple_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 82 of file PSDL_Simple_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(), scope_map_, and ACE_OS::strcmp().
00084 { 00085 for (Scope_Map_Iterator i = this->scope_map_.begin (); 00086 i != this->scope_map_.end (); 00087 ++i) 00088 { 00089 if (ACE_OS::strcmp (identifier_name.c_str (), (*i).ext_id_.c_str ()) == 0) 00090 { 00091 identifier_type = (*i).int_id_->identifier_type (); 00092 return 0; 00093 } 00094 else 00095 { 00096 if ((*i).int_id_->find (identifier_name, 00097 identifier_type) == 0) 00098 { 00099 return 0; 00100 } 00101 } 00102 } 00103 00104 return -1; 00105 }
ACE_CString TAO_PSDL_Simple_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 133 of file PSDL_Simple_Scope.cpp.
References identifier_type_.
Referenced by add_const_decl(), add_enum_decl(), add_except_decl(), add_typedef(), and find().
00134 { 00135 return this->identifier_type_; 00136 }
ACE_CString TAO_PSDL_Simple_Scope::interface_name | ( | void | ) | [virtual] |
Reimplemented from TAO_PSDL_Scope.
Definition at line 145 of file PSDL_Simple_Scope.cpp.
References interface_name_.
00146 { 00147 return this->interface_name_; 00148 }
ACE_CString TAO_PSDL_Simple_Scope::module_name | ( | void | ) | [virtual] |
Reimplemented from TAO_PSDL_Scope.
Definition at line 139 of file PSDL_Simple_Scope.cpp.
References module_name_.
00140 { 00141 return this->module_name_; 00142 }
TAO_PSDL_Scope * TAO_PSDL_Simple_Scope::parent_scope | ( | void | ) | [virtual] |
Return the pointer to the parent scope.
Reimplemented from TAO_PSDL_Scope.
Definition at line 151 of file PSDL_Simple_Scope.cpp.
References parent_scope_.
00152 { 00153 return this->parent_scope_; 00154 }
Scope_Map * TAO_PSDL_Simple_Scope::scope_map | ( | void | ) | [virtual] |
Return the pointer to Scope_Map of the instance.
Reimplemented from TAO_PSDL_Scope.
Definition at line 157 of file PSDL_Simple_Scope.cpp.
References scope_map_.
00158 { 00159 return &this->scope_map_; 00160 }
ACE_CString TAO_PSDL_Simple_Scope::identifier_type_ [protected] |
ACE_CString TAO_PSDL_Simple_Scope::interface_name_ [protected] |
Reimplemented from TAO_PSDL_Scope.
Definition at line 76 of file PSDL_Simple_Scope.h.
Referenced by interface_name().
ACE_CString TAO_PSDL_Simple_Scope::module_name_ [protected] |
TAO_PSDL_Scope* TAO_PSDL_Simple_Scope::parent_scope_ [protected] |
Scope_Map TAO_PSDL_Simple_Scope::scope_map_ [protected] |