00001 /* -*- C++ -*- */ 00002 // PSDL_Interface_Scope.h,v 1.2 2003/07/21 23:51:30 dhinton Exp 00003 // 00004 // ============================================================================ 00005 // 00006 // = LIBRARY 00007 // PSS 00008 // 00009 // = FILENAME 00010 // PSDL_Interface_Scope 00011 // 00012 // = DESCRIPTION 00013 // Scope class for Interfaces helpful for building the ASTs. 00014 // 00015 // = AUTHOR 00016 // Priyanka Gontla <gontla_p@ociweb.com> 00017 // 00018 // ============================================================================ 00019 00020 #ifndef TAO_PSDL_INTERFACE_SCOPE_H 00021 #define TAO_PSDL_INTERFACE_SCOPE_H 00022 00023 #include /**/ "ace/pre.h" 00024 00025 #include "PSDL_Scope.h" 00026 00027 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00028 # pragma once 00029 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00030 00031 class TAO_PSDL_Export TAO_PSDL_Interface_Scope : public TAO_PSDL_Scope 00032 { 00033 public: 00034 00035 TAO_PSDL_Interface_Scope (TAO_PSDL_Scope *parent_scope); 00036 00037 ~TAO_PSDL_Interface_Scope (void); 00038 00039 // Override the add methods which will be useful in the interface 00040 // scope. Interfaces can have other inteface declarations, 00041 // interfaces, structs, typedefs, constant declarations, exceptions 00042 // and operations. If the interfaces can have any other types, 00043 // corresponding add methods should also go here. 00044 int add_interface (ACE_CString identifier); 00045 00046 int add_struct (ACE_CString identifier); 00047 00048 int add_typedef (ACE_CString identifier, 00049 ACE_CString identifier_type); 00050 00051 int add_const_decl (ACE_CString identifier, 00052 ACE_CString identifier_type); 00053 00054 int add_except_decl (ACE_CString identifier, 00055 ACE_CString identifier_type); 00056 00057 int add_exception (ACE_CString identifier); 00058 00059 int add_op_dcl (ACE_CString identifier); 00060 00061 // See PSDL_Scope.h 00062 void dump (CORBA::ULong depth); 00063 00064 int find (const ACE_CString &identifier_name, 00065 ACE_CString &identifier_type); 00066 00067 int find (const ACE_CString &identifier_name); 00068 00069 int get_module_name (const ACE_CString &identifier_name, 00070 ACE_CString &module_name); 00071 00072 int get_interface_name (const ACE_CString &identifier_name, 00073 ACE_CString &interface_name); 00074 00075 // Helper methods to get a pointer to the private variables. 00076 TAO_PSDL_Scope *parent_scope (void); 00077 00078 Scope_Map *scope_map (void); 00079 00080 ACE_CString identifier_type (void); 00081 ACE_CString module_name (void); 00082 ACE_CString interface_name (void); 00083 00084 private: 00085 00086 Scope_Map interface_scope_; 00087 TAO_PSDL_Scope *parent_scope_; 00088 ACE_CString identifier_type_; 00089 ACE_CString module_name_; 00090 ACE_CString interface_name_; 00091 }; 00092 00093 #include /**/ "ace/post.h" 00094 00095 #endif /* TAO_PSDL_INTERFACE_SCOPE_H */