00001 // -*- C++ -*- 00002 // PSDL_Module_Visitor.cpp,v 1.1 2002/07/25 15:25:51 pgontla Exp 00003 00004 #include "PSDL_Module_Visitor.h" 00005 #include "PSDL_Scope.h" 00006 #include "PSDL_Stream.h" 00007 00008 ACE_RCSID (PSS, PSDL_Module_Visitor, "PSDL_Module_Visitor.cpp,v 1.1 2002/07/25 15:25:51 pgontla Exp") 00009 00010 TAO_PSDL_Module_Visitor::TAO_PSDL_Module_Visitor (void) 00011 { 00012 } 00013 00014 TAO_PSDL_Module_Visitor::~TAO_PSDL_Module_Visitor (void) 00015 { 00016 } 00017 00018 int 00019 TAO_PSDL_Module_Visitor::visit_module (TAO_PSDL_Module *module) 00020 { 00021 // Get a pointer to PSDL_Stream of the stub header. 00022 TAO_PSDL_Stream *ps_sh = TAO_PSDL_Scope::instance ()->get_sh (); 00023 00024 // The visitor method for the modules. We invoke the accept method 00025 // of the TAO_PSDL_Module. This method is going to invoke the chain 00026 // of visitor methods for members in the module scope. 00027 *ps_sh << "TAO_NAMESPACE " 00028 << module->identifier_name ().c_str () 00029 << " {"; 00030 00031 ps_sh->nl (); 00032 00033 ps_sh->incr_indent (); 00034 TAO_PSDL_Scope::instance ()->set_name_space (module->identifier_name ()); 00035 00036 if (module->specification ()->accept (this) == -1) 00037 { 00038 ACE_ERROR_RETURN ((LM_ERROR, 00039 "(%N:%l) PSDL_Module_Visitor::" 00040 "visit_module - " 00041 "codegen for scope failed\n"), -1); 00042 } 00043 00044 ps_sh->decr_indent (); 00045 ps_sh->nl (); 00046 00047 *ps_sh << "} TAO_NAMESPACE_CLOSE // module " 00048 << module->identifier_name ().c_str () 00049 << "\n\n"; 00050 00051 return 0; 00052 }