diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2009-02-11 00:20:18 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2009-02-11 00:20:18 +0000 |
commit | 15083156953072a635bab15eb76d73ef0faea1c7 (patch) | |
tree | 96d83589673c8cc81df473c5193eda86a71cb849 | |
parent | be562b70cac72a756fa2f8085c68ee6c231b917e (diff) | |
download | ATCD-15083156953072a635bab15eb76d73ef0faea1c7.tar.gz |
ChangeLogTag: Wed Feb 11 00:18:44 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu>
33 files changed, 535 insertions, 3799 deletions
diff --git a/flat/CIAO/CCF/CCF/CodeGenerationKit/IndentationCxx.hpp b/flat/CIAO/CCF/CCF/CodeGenerationKit/IndentationCxx.hpp index 6c4c05db38c..d521fe4eca7 100644 --- a/flat/CIAO/CCF/CCF/CodeGenerationKit/IndentationCxx.hpp +++ b/flat/CIAO/CCF/CCF/CodeGenerationKit/IndentationCxx.hpp @@ -83,39 +83,48 @@ namespace Indentation } case '{': { - ensure_new_line (); - output_indentation (); - result = write (c); - ensure_new_line (); - - indentation_.push (indentation_.top () + spaces_); + if (!(construct_ == CXX_COMMENT || construct_ == STRING_LITERAL)) + { + ensure_new_line (); + output_indentation (); + result = write (c); + ensure_new_line (); + indentation_.push (indentation_.top () + spaces_); + } + else + defaulting = true; break; } case '}': { - if (indentation_.size () > 1) - indentation_.pop (); - - // Reduce multiple newlines to one. - while (hold_.size () > 1) + if (!(construct_ == CXX_COMMENT || construct_ == STRING_LITERAL)) { - typename Hold::reverse_iterator i = hold_.rbegin (); - if (*i == '\n' && *(i + 1) == '\n') hold_.pop_back (); - else break; - } + if (indentation_.size () > 1) + indentation_.pop (); - ensure_new_line (); - output_indentation (); + // Reduce multiple newlines to one. + while (hold_.size () > 1) + { + typename Hold::reverse_iterator i = hold_.rbegin (); + if (*i == '\n' && *(i + 1) == '\n') hold_.pop_back (); + else break; + } - hold_.push_back (c); + ensure_new_line (); + output_indentation (); + + hold_.push_back (c); - // Add double newline after '}'. - // - hold_.push_back ('\n'); - hold_.push_back ('\n'); - position_ = 0; + // Add double newline after '}'. + // + hold_.push_back ('\n'); + hold_.push_back ('\n'); + position_ = 0; + } + else + defaulting = true; break; } @@ -184,12 +193,13 @@ namespace Indentation } case '\"': { - if (construct_ != CXX_COMMENT && - (hold_.empty () || hold_.back () != '\\')) + if (construct_ != CXX_COMMENT && (hold_.empty () || hold_.back () != '\\')) { // not escape sequence - if (construct_ == STRING_LITERAL) construct_ = OTHER; - else construct_ = STRING_LITERAL; + if (construct_ == STRING_LITERAL) + construct_ = OTHER; + else + construct_ = STRING_LITERAL; } defaulting = true; diff --git a/flat/CIAO/CCF/CCF/CodeGenerationKit/IndentationJava.hpp b/flat/CIAO/CCF/CCF/CodeGenerationKit/IndentationJava.hpp new file mode 100644 index 00000000000..6e6b373dbd8 --- /dev/null +++ b/flat/CIAO/CCF/CCF/CodeGenerationKit/IndentationJava.hpp @@ -0,0 +1,354 @@ +// file : CCF/CodeGenerationKit/IndentationJava.hpp +// author : James H. Hill <hillj@dre.vanderbilt.edu> +// cvs-id : $Id$ + +#ifndef CCF_CODE_GENERATION_KIT_INDENTATION_JAVA_HPP +#define CCF_CODE_GENERATION_KIT_INDENTATION_JAVA_HPP + +#include <deque> +#include <stack> + +#include "CCF/CodeGenerationKit/IndentationBuffer.hpp" + +namespace Indentation +{ + template <typename C> + class Java : public Buffer<C> + { + public: + typedef + typename Buffer<C>::traits_type + traits_type; + + typedef + typename Buffer<C>::char_type + char_type; + + typedef + typename Buffer<C>::int_type + int_type; + + typedef + typename Buffer<C>::EndOfStream + EndOfStream; + + public: + Java (Buffer<C>& out) + : out_ (out), + position_ (0), + paren_balance_ (0), + spaces_ (2), + construct_ (OTHER) + { + indentation_.push (0); + } + + virtual + ~Java () throw () {} + + public: + virtual int_type + put (char_type c) + { + int_type result = traits_type::to_int_type (c); + + try + { + bool defaulting = false; + + if (!hold_.empty () && hold_.back () == '(') + { + // We don't need to hold it any more. + unbuffer (); + + if (c == '\n') + indentation_.push (indentation_.top () + spaces_); + else + indentation_.push (position_); + } + + switch (c) + { + case '\n': + { + hold_.push_back (c); + position_ = 0; // Starting a new line. + + if (construct_ == JAVA_COMMENT) + { + //std::cerr << "end comment" << endl; + construct_ = OTHER; + } + + break; + } + case '{': + { + ensure_new_line (); + output_indentation (); + result = write (c); + ensure_new_line (); + + indentation_.push (indentation_.top () + spaces_); + + break; + } + case '}': + { + if (indentation_.size () > 1) + indentation_.pop (); + + // Reduce multiple newlines to one. + while (hold_.size () > 1) + { + typename Hold::reverse_iterator i = hold_.rbegin (); + + if (*i == '\n' && *(i + 1) == '\n') + hold_.pop_back (); + else + break; + } + + ensure_new_line (); + output_indentation (); + + hold_.push_back (c); + + // Add newline after '}'. + // + ensure_new_line (); + break; + } + case ';': + { + if (paren_balance_ != 0) + { + // We are inside for (;;) statement. Nothing to do here. + // + defaulting = true; + } + else if (construct_ != STRING_LITERAL && construct_ != CHAR_LITERAL) + { + output_indentation (); + result = write (c); + ensure_new_line (); + } + + break; + } + case '\\': + { + if (construct_ != JAVA_COMMENT) + { + output_indentation (); + hold_.push_back (c); + position_++; + } + else + defaulting = true; + + break; + } + case '\"': + { + if (construct_ != JAVA_COMMENT && + (hold_.empty () || hold_.back () != '\\')) + { + // not escape sequence + if (construct_ == STRING_LITERAL) construct_ = OTHER; + else construct_ = STRING_LITERAL; + } + + defaulting = true; + break; + } + case '\'': + { + if (construct_ != JAVA_COMMENT && + (hold_.empty () || hold_.back () != '\\')) + { + // not escape sequence + if (construct_ == CHAR_LITERAL) construct_ = OTHER; + else + { + //std::cerr << "char literal" << endl; + construct_ = CHAR_LITERAL; + } + + } + + defaulting = true; + break; + } + case '(': + { + if (construct_ == OTHER) + { + // Hold it so that we can see what's coming next. + // + output_indentation (); + hold_.push_back (c); + position_++; + paren_balance_++; + } + else + defaulting = true; + + break; + } + case ')': + { + if (construct_ == OTHER) + { + if (indentation_.size () > 1) + indentation_.pop (); + + if (paren_balance_ > 0) + paren_balance_--; + } + + defaulting = true; + break; + } + case '/': + { + if (construct_ == OTHER) + { + if (!hold_.empty () && hold_.back () == '/') + { + construct_ = JAVA_COMMENT; + //std::cerr << "start comment" << endl; + defaulting = true; + } + else + { + output_indentation (); + hold_.push_back (c); + position_++; + } + } + else + { + defaulting = true; + } + + break; + } + default: + { + defaulting = true; + break; + } + } + + if (defaulting) + { + output_indentation (); + result = write (c); + position_++; + } + } + catch (Full const&) + { + result = traits_type::eof (); + } + + return result; + } + + virtual void + unbuffer () + { + int_type result; + + while (!hold_.empty ()) + { + result = out_.put (hold_.front ()); + + //@@ failed + if (result == traits_type::eof ()) + { + throw EndOfStream ("unable to flush buffer"); + } + + hold_.pop_front (); + } + } + + private: + class Full {}; + + void + ensure_new_line () + { + if (hold_.empty () || hold_.back () != '\n') + { + hold_.push_back ('\n'); + position_ = 0; // Starting a new line. + } + } + + + void + output_indentation () + { + if (!hold_.empty () && hold_.back () == '\n') + { + unsigned long indent = indentation_.top (); + + for (unsigned long i = 0; i < indent; i ++) + write (' '); + + position_ += indentation_.top (); + } + } + + int_type + write (char_type c) + { + hold_.push_back (c); + + int_type result (traits_type::eof ()); + + while (!hold_.empty ()) + { + result = out_.put (hold_.front ()); + + if (result == traits_type::eof ()) + throw Full (); + + hold_.pop_front (); + } + + return result; + } + + + private: + Buffer<C>& out_; + unsigned long position_; // Current position on the line. + unsigned long paren_balance_; // ( ) balance. + std::stack<unsigned long> indentation_; + unsigned long spaces_; + + bool suppress_nl_; + + enum Construct + { + OTHER, + JAVA_COMMENT, + STRING_LITERAL, + CHAR_LITERAL + }; + + Construct construct_; + + typedef + std::deque<int_type> + Hold; + + Hold hold_; + }; +} + +#endif // CCF_CODE_GENERATION_KIT_INDENTATION_IDL_HPP diff --git a/flat/CIAO/CIDLC/AttributeHeaderEmitters.cpp b/flat/CIAO/CIDLC/AttributeHeaderEmitters.cpp index 7d5f664da36..d9687982e78 100644 --- a/flat/CIAO/CIDLC/AttributeHeaderEmitters.cpp +++ b/flat/CIAO/CIDLC/AttributeHeaderEmitters.cpp @@ -137,7 +137,7 @@ AttributeHeaderEmitter::pre (SemanticGraph::ReadAttribute& a) void AttributeHeaderEmitter::name (SemanticGraph::ReadAttribute& a) { - os << a.name () << " ()" << endl; + os << a.name () << " ()"; } void diff --git a/flat/CIAO/CIDLC/DescriptorGenerator.cpp b/flat/CIAO/CIDLC/DescriptorGenerator.cpp index 76a5a810774..e675c27eddf 100644 --- a/flat/CIAO/CIDLC/DescriptorGenerator.cpp +++ b/flat/CIAO/CIDLC/DescriptorGenerator.cpp @@ -515,6 +515,12 @@ void DescriptorGenerator::options (CL::Description& d) { d.add_option (CL::OptionDescription ( + "gen-desc-file", + "Generate the component descriptor file.", + CL::OptionType::flag, + 1)); + + d.add_option (CL::OptionDescription ( "desc-file-suffix", "suffix", "Use provided suffix instead of default \'.ccd\' " diff --git a/flat/CIAO/CIDLC/Literals.cpp b/flat/CIAO/CIDLC/Literals.cpp index 242519da4da..a7c723d06fd 100644 --- a/flat/CIAO/CIDLC/Literals.cpp +++ b/flat/CIAO/CIDLC/Literals.cpp @@ -67,7 +67,7 @@ namespace StringLiterals "CIDLC::RepositoryIdGenerator::TypePrefix", // TYPE_PREFIX "CIDLC::RepositoryIdGenerator::RepoId", // REPO_ID - "// Your code here.", // YCH + "/* Your code here. */", // YCH "//==================================================================", // SEP "variable-size", // VAR_SIZE diff --git a/flat/CIAO/CIDLC/ServantHeaderGenerator.cpp b/flat/CIAO/CIDLC/ServantHeaderGenerator.cpp index 1b1f52dd522..127463aeb33 100644 --- a/flat/CIAO/CIDLC/ServantHeaderGenerator.cpp +++ b/flat/CIAO/CIDLC/ServantHeaderGenerator.cpp @@ -21,6 +21,7 @@ using std::endl; using std::string; +using std::ostringstream; using namespace StringLiterals; using namespace CCF::CIDL; @@ -413,15 +414,15 @@ namespace string swap_option = cl_.get_value ("custom-container", ""); bool swapping = (swap_option == "upgradeable"); + ostringstream base_type; + base_type << "::CIAO::" << (swapping ? "Upgradeable_" : "") + << "Context_Impl < " << t.scoped_name ().scope_name () + << "::CCM_" << t.name () << "_Context, " << t.name () << "_Servant, " + << t.scoped_name () << ">"; + os << "class " << ctx.export_macro () << " " << t.name () << "_Context" << endl - << " : public virtual CIAO::" - << (swapping ? "Upgradeable_" : "") << "Context_Impl<" << endl - << " " << t.scoped_name ().scope_name () << "::CCM_" - << t.name () << "_Context," << endl - << " " << t.name () << "_Servant," << endl - << " " << t.scoped_name () << endl - << " >" << endl + << " : public virtual " << base_type.str () << endl << "{" << "public:" << endl; @@ -429,6 +430,15 @@ namespace << "access our state." << endl << "friend class " << t.name () << "_Servant;" << endl; + os << "// Type definition of the base type" << endl + << "typedef " << base_type.str () << " base_type;" << endl + << "// Type definition of the CCM context type" << endl + << "typedef base_type::context_type context_type;" << endl + << "// Type definition of the servant type" << endl + << "typedef base_type::servant_type servant_type;" << endl + << "// Type definition of the component type" << endl + << "typedef base_type::component_type component_type;" << endl; + os << t.name () << "_Context (" << endl << "::Components::CCMHome_ptr h," << endl << "::CIAO::Container_ptr c," << endl diff --git a/flat/CIAO/CIDLC/SizeTypeCalculator.cpp b/flat/CIAO/CIDLC/SizeTypeCalculator.cpp index b8f44e879ed..5aa0b9ba409 100644 --- a/flat/CIAO/CIDLC/SizeTypeCalculator.cpp +++ b/flat/CIAO/CIDLC/SizeTypeCalculator.cpp @@ -21,6 +21,7 @@ namespace public Traversal::Union, public Traversal::Wstring, public Traversal::UnboundedSequence, + public Traversal::BoundedSequence, public Traversal::Interface, public Traversal::ValueType { @@ -50,6 +51,12 @@ namespace } virtual void + traverse (SemanticGraph::BoundedSequence&) + { + top () = true; + } + + virtual void traverse (SemanticGraph::Interface&) { top () = true; diff --git a/flat/CIAO/CIDLC/cidlc.cpp b/flat/CIAO/CIDLC/cidlc.cpp index 5bc404730f1..c105e80d8a7 100644 --- a/flat/CIAO/CIDLC/cidlc.cpp +++ b/flat/CIAO/CIDLC/cidlc.cpp @@ -362,6 +362,7 @@ main (int argc, char* argv[]) } // Generate descriptor code. + if (cl.get_value ("gen-desc-file", false)) { DescriptorGenerator desc_gen; desc_gen.generate (cl, tu); diff --git a/flat/CIAO/ChangeLog b/flat/CIAO/ChangeLog index ebb21051d87..9ba3c7d1f04 100644 --- a/flat/CIAO/ChangeLog +++ b/flat/CIAO/ChangeLog @@ -1,9 +1,28 @@ +Wed Feb 11 00:18:44 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * CCF: + * CCF/CCF/CodeGenerationKit/IndentationCxx.hpp: + * CCF/CCF/CodeGenerationKit/IndentationJava.hpp: + * CIDLC: + * CIDLC/AttributeHeaderEmitters.cpp: + * CIDLC/DescriptorGenerator.cpp: + * CIDLC/Literals.cpp: + * CIDLC/ServantHeaderGenerator.cpp: + * CIDLC/SizeTypeCalculator.cpp: + * CIDLC/cidlc.cpp: + * docs: + * docs/tutorials/Quoter/Simple/Broker/StockBrokerDriver.cpp: + * docs/tutorials/Quoter/Simple/Distributor/StockDistributorDriver.cpp: + * tools/IDL3_to_IDL2: + + Merged changes in from trunk + Tue Feb 10 23:31:09 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> * DAnCE/TargetManager/TargetManager.mpc: - Disabled this for now. - + Disabled this for now. + Tue Feb 10 19:13:45 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> * DAnCE/NodeManager/Node_Manager_Module.cpp: diff --git a/flat/CIAO/docs/tutorials/Quoter/Simple/Broker/StockBrokerDriver.cpp b/flat/CIAO/docs/tutorials/Quoter/Simple/Broker/StockBrokerDriver.cpp index 59c788a3e20..652c01e45eb 100644 --- a/flat/CIAO/docs/tutorials/Quoter/Simple/Broker/StockBrokerDriver.cpp +++ b/flat/CIAO/docs/tutorials/Quoter/Simple/Broker/StockBrokerDriver.cpp @@ -9,15 +9,15 @@ #include "ace/streams.h" #include "ace/Get_Opt.h" -const char *broker_ior = "file://StockBroker.ior"; -const char *subscribe_name = 0; -const char *unsubscribe_name = 0; +const ACE_TCHAR *broker_ior = ACE_TEXT ("file://StockBroker.ior"); +const ACE_TCHAR *subscribe_name = 0; +const ACE_TCHAR *unsubscribe_name = 0; int -parse_args (int argc, char *argv[]) +parse_args (int argc, ACE_TCHAR *argv[]) { - ACE_Get_Opt get_opts (argc, argv, "k:s:u:"); + ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:s:u:")); int c; while ((c = get_opts ()) != -1) @@ -66,7 +66,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR* argv[]) // create the factory object reference of StockBrokerHome CORBA::Object_var broker_obj = - orb->string_to_object (broker_ior); + orb->string_to_object (ACE_TEXT_ALWAYS_CHAR (broker_ior)); // downcast the object reference to the appropriate type Stock::StockBroker_var broker = @@ -82,14 +82,14 @@ int ACE_TMAIN (int argc, ACE_TCHAR* argv[]) if (subscribe_name != 0) { - broker->stock_subscribe (subscribe_name); + broker->stock_subscribe (ACE_TEXT_ALWAYS_CHAR (subscribe_name)); ACE_DEBUG ((LM_DEBUG, "Subscribe successful!\n")); } if (unsubscribe_name != 0) { - broker->stock_unsubscribe (unsubscribe_name); + broker->stock_unsubscribe (ACE_TEXT_ALWAYS_CHAR (unsubscribe_name)); ACE_DEBUG ((LM_DEBUG, "Unsubscribe successful!\n")); } diff --git a/flat/CIAO/docs/tutorials/Quoter/Simple/Distributor/StockDistributorDriver.cpp b/flat/CIAO/docs/tutorials/Quoter/Simple/Distributor/StockDistributorDriver.cpp index 60a5ffca9a8..5f456333d6f 100644 --- a/flat/CIAO/docs/tutorials/Quoter/Simple/Distributor/StockDistributorDriver.cpp +++ b/flat/CIAO/docs/tutorials/Quoter/Simple/Distributor/StockDistributorDriver.cpp @@ -10,14 +10,14 @@ #include "ace/streams.h" #include "ace/Get_Opt.h" -const char *distributor_ior = "file://StockDistributor.ior"; +const ACE_TCHAR *distributor_ior = ACE_TEXT ("file://StockDistributor.ior"); int rate = 2; int turn_on = 1; int -parse_args (int argc, char *argv[]) +parse_args (int argc, ACE_TCHAR *argv[]) { - ACE_Get_Opt get_opts (argc, argv, "k:r:of"); + ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:r:of")); int c; while ((c = get_opts ()) != -1) @@ -73,7 +73,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR* argv[]) // create the factory object reference, CORBA::Object_var distributor_obj = - orb->string_to_object (distributor_ior); + orb->string_to_object (ACE_TEXT_ALWAYS_CHAR (distributor_ior)); // downcast the object reference to the appropriate type Stock::StockDistributor_var distributor = diff --git a/flat/CIAO/tools/IDL3_to_IDL2/CDMW_IDL3_TO_IDL2_BE_Export.hpp b/flat/CIAO/tools/IDL3_to_IDL2/CDMW_IDL3_TO_IDL2_BE_Export.hpp deleted file mode 100644 index fd405eb9ee4..00000000000 --- a/flat/CIAO/tools/IDL3_to_IDL2/CDMW_IDL3_TO_IDL2_BE_Export.hpp +++ /dev/null @@ -1,40 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl -// ------------------------------ -#ifndef CDMW_IDL3_TO_IDL2_BE_EXPORT_H -#define CDMW_IDL3_TO_IDL2_BE_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) -# if !defined (CDMW_IDL3_TO_IDL2_BE_HAS_DLL) -# define CDMW_IDL3_TO_IDL2_BE_HAS_DLL 0 -# endif /* ! CDMW_IDL3_TO_IDL2_BE_HAS_DLL */ -#else -# if !defined (CDMW_IDL3_TO_IDL2_BE_HAS_DLL) -# define CDMW_IDL3_TO_IDL2_BE_HAS_DLL 1 -# endif /* ! CDMW_IDL3_TO_IDL2_BE_HAS_DLL */ -#endif - -#if defined (CDMW_IDL3_TO_IDL2_BE_HAS_DLL) && (CDMW_IDL3_TO_IDL2_BE_HAS_DLL == 1) -# if defined (CDMW_IDL3_TO_IDL2_BE_BUILD_DLL) -# define CDMW_IDL3_TO_IDL2_BE_Export ACE_Proper_Export_Flag -# define CDMW_IDL3_TO_IDL2_BE_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define CDMW_IDL3_TO_IDL2_BE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* CDMW_IDL3_TO_IDL2_BE_BUILD_DLL */ -# define CDMW_IDL3_TO_IDL2_BE_Export ACE_Proper_Import_Flag -# define CDMW_IDL3_TO_IDL2_BE_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define CDMW_IDL3_TO_IDL2_BE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* CDMW_IDL3_TO_IDL2_BE_BUILD_DLL */ -#else /* CDMW_IDL3_TO_IDL2_BE_HAS_DLL == 1 */ -# define CDMW_IDL3_TO_IDL2_BE_Export -# define CDMW_IDL3_TO_IDL2_BE_SINGLETON_DECLARATION(T) -# define CDMW_IDL3_TO_IDL2_BE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* CDMW_IDL3_TO_IDL2_BE_HAS_DLL == 1 */ - -#endif /* CDMW_IDL3_TO_IDL2_BE_EXPORT_H */ - -// End of auto generated file. diff --git a/flat/CIAO/tools/IDL3_to_IDL2/CdmwBE.cpp b/flat/CIAO/tools/IDL3_to_IDL2/CdmwBE.cpp deleted file mode 100644 index 20d4afe3bb7..00000000000 --- a/flat/CIAO/tools/IDL3_to_IDL2/CdmwBE.cpp +++ /dev/null @@ -1,250 +0,0 @@ -/* ===================================================================== */ -/* - * This file is part of CARDAMOM (R) which is jointly developed by THALES - * and SELEX-SI. It is derivative work based on PERCO Copyright (C) THALES - * 2000-2003. All rights reserved. - * Copyright (C) THALES 2004-2005. All rights reserved. - * Copyright (C) SELEX-SI and THALES 2006. All rights reserved. - * - * CARDAMOM is free software; you can redistribute it and/or modify it - * under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * CARDAMOM is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - * License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with CARDAMOM; see the file COPYING. If not, write to the - * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ -/* ===================================================================== */ -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - - */ - -#include "CdmwBEExtern.hpp" -#include "InternalIDLVisitor.hpp" -#include "CdmwCifIDLVisitor.hpp" -#include "Config.hpp" - -#include "checking_visitor.h" -#include "idl3_to_idl2_visitor.h" - -#include "be_extern.h" -#include "be_helper.h" -#include "global_extern.h" -#include "ast_root.h" -#include "utl_string.h" - - -void -CdmwBE_version (void) -{ - COG_INFO ("Cdmw_idl3_to_idl2, version " << Cdmw::CodeGenerator::BE_VERSION); -} - -int -CdmwBE_init (int & /* argc */, char * /* argv */ []) -{ - // Initialize CARDAMOM BE global data object. - ACE_NEW_RETURN (cdmw_be_global, - CdmwBEGlobalData, - -1); - - // Set the base class pointer as well, so base class backend - // internal calls can reference it. - be_global = cdmw_be_global; - - idl_global->pass_orb_idl (true); - return 0; -} - -void -CdmwBE_post_init (char * /* files */ [], long /* nfiles */) -{ -} - -// Clean up before exit, whether successful or not. -// Need not be exported since it is called only from this file. -void -CdmwBE_cleanup (void) -{ - idl_global->destroy (); -} - -// Abort this run of the BE. -void -CdmwBE_abort (void) -{ - COG_FATAL("Fatal Error - Aborting\n"); - - CdmwBE_cleanup (); - - ACE_OS::exit (1); -} - -// Do the work of this BE. This is the starting point for code generation. -void -CdmwBE_produce (void) -{ - // Get the root node. - AST_Decl *d = idl_global->root (); - AST_Root *ast_root = AST_Root::narrow_from_decl (d); - - if (ast_root == 0) - { - COG_FATAL("No Root\n"); - CdmwBE_abort (); - } - - // Check whether it is an IDL3 file. - checking_visitor visitor0; - - if (visitor0.visit_root (ast_root) == -1) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%N:%l) CdmwBE_produce -") - ACE_TEXT (" failed to accept visitor\n"))); - } - - // 1st: Generate Equivalent IDL. - if (cdmw_be_global->gen_equivalent_idl ()) - { - if (visitor0.is_idl3 ()) - { - idl3_to_idl2_visitor visitor1; - - if (visitor1.visit_root (ast_root) == -1) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%N:%l) CdmwBE_produce - failed to ") - ACE_TEXT ("accept equivalent IDL visitor\n"))); - } - } - else - { - TAO_OutStream *os = 0; - int status = be_global->outfile_init (os, - "", - "_IDL2.idl", - "_TAO_IDL_", - "_IDL_"); - - if (status == -1) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%N:%l) BE_produce - ") - ACE_TEXT ("failed to initialize output file\n"))); - - delete os; - os = 0; - BE_abort (); - } - - *os << be_nl << be_nl - << "#include \"Components.idl\"" << be_nl - << "#include \"" - << idl_global->stripped_filename ()->get_string () - << "\"" << be_nl << be_nl - << "#endif /* ifndef */" << be_nl; - - delete os; - os = 0; - } - } - - // 2nd: Generate Internal IDL. - if (cdmw_be_global->gen_internal_idl ()) - { - Cdmw::CodeGenerator::InternalIDLVisitor visitor2; - visitor2.localIdl3 = visitor0.is_local_idl3 (); - - if (visitor2.visit_root (ast_root) == -1) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%N:%l) CdmwBE_produce - failed to ") - ACE_TEXT ("accept internal IDL visitor\n"))); - } - } - - // 3rd: Generate CDMW CIF IDL. - if (cdmw_be_global->gen_cdmw_cif_idl ()) - { - Cdmw::CodeGenerator::CdmwCifIDLVisitor visitor3; - visitor3.localIdl3 = visitor0.is_local_idl3 (); - - if (visitor3.visit_root (ast_root) == -1) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%N:%l) CdmwBE_produce - failed to ") - ACE_TEXT ("accept CdmwCif visitor\n"))); - } - } - - // Clean up. - CdmwBE_cleanup (); -} - diff --git a/flat/CIAO/tools/IDL3_to_IDL2/CdmwBEExtern.hpp b/flat/CIAO/tools/IDL3_to_IDL2/CdmwBEExtern.hpp deleted file mode 100644 index 2480213a6c1..00000000000 --- a/flat/CIAO/tools/IDL3_to_IDL2/CdmwBEExtern.hpp +++ /dev/null @@ -1,109 +0,0 @@ -// This may look like C, but it's really -*- C++ -*- -// $Id$ - -/* ===================================================================== */ -/* - * This file is part of CARDAMOM (R) which is jointly developed by THALES - * and SELEX-SI. It is derivative work based on PERCO Copyright (C) THALES - * 2000-2003. All rights reserved. - * Copyright (C) THALES 2004-2005. All rights reserved. - * Copyright (C) SELEX-SI and THALES 2006. All rights reserved. - * - * CARDAMOM is free software; you can redistribute it and/or modify it - * under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * CARDAMOM is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - * License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with CARDAMOM; see the file COPYING. If not, write to the - * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ -/* ===================================================================== */ -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - -*/ - -#ifndef INCL_CODE_GENERATOR_BE_EXTERN_HPP -#define INCL_CODE_GENERATOR_BE_EXTERN_HPP - -#include "CdmwBEGlobal.hpp" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -extern CDMW_IDL3_TO_IDL2_BE_Export CdmwBEGlobalData *cdmw_be_global; - -extern CDMW_IDL3_TO_IDL2_BE_Export int CdmwBE_init (int &, char*[]); -extern CDMW_IDL3_TO_IDL2_BE_Export void CdmwBE_post_init (char *[], long); -extern CDMW_IDL3_TO_IDL2_BE_Export void CdmwBE_version (void); -extern CDMW_IDL3_TO_IDL2_BE_Export void CdmwBE_produce (void); -extern CDMW_IDL3_TO_IDL2_BE_Export void CdmwBE_cleanup (void); -extern CDMW_IDL3_TO_IDL2_BE_Export void CdmwBE_abort (void); - -#endif /* INCL_CODE_GENERATOR_BE_EXTERN_HPP */ diff --git a/flat/CIAO/tools/IDL3_to_IDL2/CdmwBEGlobal.cpp b/flat/CIAO/tools/IDL3_to_IDL2/CdmwBEGlobal.cpp deleted file mode 100644 index 81e6726cbc1..00000000000 --- a/flat/CIAO/tools/IDL3_to_IDL2/CdmwBEGlobal.cpp +++ /dev/null @@ -1,190 +0,0 @@ -// $Id$ - -/* ===================================================================== */ -/* - * This file is part of CARDAMOM (R) which is jointly developed by THALES - * and SELEX-SI. It is derivative work based on PERCO Copyright (C) THALES - * 2000-2003. All rights reserved. - * Copyright (C) THALES 2004-2005. All rights reserved. - * Copyright (C) SELEX-SI and THALES 2006. All rights reserved. - * - * CARDAMOM is free software; you can redistribute it and/or modify it - * under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * CARDAMOM is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - * License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with CARDAMOM; see the file COPYING. If not, write to the - * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ -/* ===================================================================== */ -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - - */ - -#include "CdmwBEGlobal.hpp" - -#include "ace/Log_Msg.h" - -CDMW_IDL3_TO_IDL2_BE_Export CdmwBEGlobalData *cdmw_be_global = 0; - -CdmwBEGlobalData::CdmwBEGlobalData (void) - : BE_GlobalData (), - gen_equivalent_idl_ (true), - gen_internal_idl_ (true), - gen_cdmw_cif_idl_ (true) -{ - this->gen_copyright_ = false; -} - -CdmwBEGlobalData::~CdmwBEGlobalData (void) -{ -} - -void -CdmwBEGlobalData::parse_args (long &i, char **av) -{ - switch (av[i][1]) - { - case 'G': - // Enable generation of ... - if (av[i][2] == 'e') - { - // Equivalent IDL. - this->gen_equivalent_idl_ = true; - this->gen_internal_idl_ = false; - this->gen_cdmw_cif_idl_ = false; - } - else if (av[i][2] == 'i') - { - // Internal IDL. - this->gen_equivalent_idl_ = false; - this->gen_internal_idl_ = true; - this->gen_cdmw_cif_idl_ = false; - } - else if (av[i][2] == 'c') - { - // CDM-specific IDL. - this->gen_equivalent_idl_ = false; - this->gen_internal_idl_ = false; - this->gen_cdmw_cif_idl_ = true; - } - else if (av[i][2] == 'a') - { - // All of the above. - this->gen_equivalent_idl_ = true; - this->gen_internal_idl_ = true; - this->gen_cdmw_cif_idl_ = true; - } - - break; - default: - this->BE_GlobalData::parse_args (i, av); - } -} - -void -CdmwBEGlobalData::usage (void) const -{ - ACE_DEBUG (( - LM_DEBUG, - ACE_TEXT (" -Ge\t\t\tGenerate only equivalent IDL\n") - )); - ACE_DEBUG (( - LM_DEBUG, - ACE_TEXT (" -Gi\t\t\tGenerate only CDMW internal IDL\n") - )); - ACE_DEBUG (( - LM_DEBUG, - ACE_TEXT (" -Gc\t\t\tGenerate only CDMW CIF IDL\n") - )); - ACE_DEBUG (( - LM_DEBUG, - ACE_TEXT (" -Ga\t\t\tGenerate equivalent, internal, and CIF IDL\n") - )); - this->BE_GlobalData::usage (); -} - -bool -CdmwBEGlobalData::gen_equivalent_idl (void) const -{ - return this->gen_equivalent_idl_; -} - -bool -CdmwBEGlobalData::gen_internal_idl (void) const -{ - return this->gen_internal_idl_; -} - -bool -CdmwBEGlobalData::gen_cdmw_cif_idl (void) const -{ - return this->gen_cdmw_cif_idl_; -} - diff --git a/flat/CIAO/tools/IDL3_to_IDL2/CdmwBEGlobal.hpp b/flat/CIAO/tools/IDL3_to_IDL2/CdmwBEGlobal.hpp deleted file mode 100644 index d9e96427bca..00000000000 --- a/flat/CIAO/tools/IDL3_to_IDL2/CdmwBEGlobal.hpp +++ /dev/null @@ -1,128 +0,0 @@ -// This may look like C, but it's really -*- C++ -*- -// $Id$ - -/* ===================================================================== */ -/* - * This file is part of CARDAMOM (R) which is jointly developed by THALES - * and SELEX-SI. It is derivative work based on PERCO Copyright (C) THALES - * 2000-2003. All rights reserved. - * Copyright (C) THALES 2004-2005. All rights reserved. - * Copyright (C) SELEX-SI and THALES 2006. All rights reserved. - * - * CARDAMOM is free software; you can redistribute it and/or modify it - * under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * CARDAMOM is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - * License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with CARDAMOM; see the file COPYING. If not, write to the - * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ -/* ===================================================================== */ -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - -*/ - -#ifndef INCL_CODE_GENERATOR_BE_GLOBAL_HPP -#define INCL_CODE_GENERATOR_BE_GLOBAL_HPP - -#include "be_global.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "CDMW_IDL3_TO_IDL2_BE_Export.hpp" - -// Defines a class containing all back end global data. - -class CDMW_IDL3_TO_IDL2_BE_Export CdmwBEGlobalData : public BE_GlobalData -{ -public: - CdmwBEGlobalData (void); - virtual ~CdmwBEGlobalData (void); - - virtual void parse_args (long &i, char **av); - // Parse args that affect this backend. - - virtual void usage (void) const; - // Output usage message. - - // Accessors. - - bool gen_equivalent_idl (void) const; - bool gen_internal_idl (void) const; - bool gen_cdmw_cif_idl (void) const; - -private: - bool gen_equivalent_idl_; - bool gen_internal_idl_; - bool gen_cdmw_cif_idl_; -}; - -#endif // INCL_CODE_GENERATOR_BE_GLOBAL_HPP diff --git a/flat/CIAO/tools/IDL3_to_IDL2/CdmwCifIDLVisitor.cpp b/flat/CIAO/tools/IDL3_to_IDL2/CdmwCifIDLVisitor.cpp deleted file mode 100644 index ccb14550cd7..00000000000 --- a/flat/CIAO/tools/IDL3_to_IDL2/CdmwCifIDLVisitor.cpp +++ /dev/null @@ -1,619 +0,0 @@ -/* ===================================================================== */ -/* - * This file is part of CARDAMOM (R) which is jointly developed by THALES - * and SELEX-SI. It is derivative work based on PERCO Copyright (C) THALES - * 2000-2003. All rights reserved. - * Copyright (C) THALES 2004-2005. All rights reserved. - * Copyright (C) SELEX-SI and THALES 2006. All rights reserved. - * - * CARDAMOM is free software; you can redistribute it and/or modify it - * under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * CARDAMOM is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - * License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with CARDAMOM; see the file COPYING. If not, write to the - * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ -/* ===================================================================== */ -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - - */ - -#include "CdmwCifIDLVisitor.hpp" -#include "CdmwBEExtern.hpp" - -#include "identifier_helper.h" -#include "be_sunsoft.h" -#include "be_extern.h" - -#include "ast_component_fwd.h" -#include "ast_eventtype.h" -#include "ast_eventtype_fwd.h" -#include "ast_home.h" -#include "ast_root.h" -#include "utl_string.h" -#include "utl_identifier.h" -#include "global_extern.h" -#include "nr_extern.h" - -namespace Cdmw -{ - namespace CodeGenerator - { - CdmwCifIDLVisitor::CdmwCifIDLVisitor (void) - : basic_visitor (), - localIdl3 (false) - { - } - - CdmwCifIDLVisitor::~CdmwCifIDLVisitor (void) - { - } - - int - CdmwCifIDLVisitor::visit_module (AST_Module *node) - { - if (node->imported () || this->can_skip_module (node)) - { - return 0; - } - - *os << be_nl << be_nl; - - ACE_CString name; - - if (node->is_nested()) - { - name = IdentifierHelper::try_escape (node->original_local_name ()); - } - else - { - name = node->original_local_name()->get_string (); - } - - if (node->is_nested()) - { - *os << "module " << name.c_str() << be_nl - << "{" << be_idt << be_nl; - } - else - { - *os << "module Cdmw_" << name.c_str() << be_nl - << "{" << be_idt << be_nl; - } - - if (this->visit_scope (node) != 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "CdmwCifIDLVisitor::visit_module - " - "codegen for scope failed\n"), - -1); - } - - *os << be_uidt_nl << be_nl; - - if (node->is_nested()) - { - *os << "}; // end of module " << name.c_str (); - } - else - { - *os << "}; // end of module Cdmw_" << name.c_str (); - } - - return 0; - } - - int - CdmwCifIDLVisitor::visit_interface (AST_Interface *node) - { - if (node->imported ()) - { - return 0; - } - - if (!node->is_local () && !node->is_abstract ()) - { - *os << be_nl << be_nl - << "interface " - << IdentifierHelper::try_escape(node->original_local_name ()).c_str() - << " : " - << IdentifierHelper::orig_sn (node->name ()).c_str () - << be_idt_nl - << ", CosLifeCycle::LifeCycleObject " << be_uidt_nl - << "{" << be_nl - << "};"; - } - - return 0; - } - - int - CdmwCifIDLVisitor::visit_interface_fwd (AST_InterfaceFwd *node) - { - if (node->imported ()) - { - return 0; - } - - if (!node->is_local () && !node->is_abstract ()) - { - *os << be_nl << be_nl - << "interface " - << IdentifierHelper::try_escape(node->original_local_name ()).c_str() - << ";"; - } - - return 0; - } - - int - CdmwCifIDLVisitor::visit_valuebox (AST_ValueBox *) - { - // Do not generate - return 0; - } - - int - CdmwCifIDLVisitor::visit_valuetype (AST_ValueType *) - { - // Do not generate - return 0; - } - - int - CdmwCifIDLVisitor::visit_valuetype_fwd (AST_ValueTypeFwd *) - { - // Do not generate - return 0; - } - - int - CdmwCifIDLVisitor::visit_component (AST_Component *node) - { - if (node->imported ()) - { - return 0; - } - - UTL_Scope * scope = node->defined_in (); - ACE_CString s_scope; - - if (scope != 0) - { - AST_Decl *dummy = ScopeAsDecl( scope); - s_scope += IdentifierHelper::orig_sn (dummy->name ()); - } - - *os << be_nl << be_nl - << "local interface CCM_" << node->original_local_name () - << "_SessionContext : " << s_scope.c_str() << "::CCM_" - << node->original_local_name () << "_Context," << be_idt_nl - << "CdmwComponents::SessionContextExt" << be_uidt_nl - << "{" << be_nl - << "};" << be_nl << be_nl - << "interface " - << IdentifierHelper::try_escape(node->original_local_name ()).c_str () - << " : " - << IdentifierHelper::orig_sn (node->name ()).c_str () - << be_nl; - - // Inherit from facet interfaces. - { - ACE_Unbounded_Queue<AST_Component::port_description> &s = - node->provides (); - AST_Component::port_description *pd = 0; - - for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> iter (s); - ! iter.done (); - iter.advance ()) - { - iter.next (pd); - - *os << ", " - << IdentifierHelper::orig_sn (pd->impl->name ()).c_str () - << be_nl; - } - } - - // Inherit from Consumer interfaces. - { - ACE_Unbounded_Queue<AST_Component::port_description> &s = - node->consumes (); - AST_Component::port_description *pd = 0; - - for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> iter (s); - ! iter.done (); - iter.advance ()) - { - iter.next (pd); - - *os << ", " - << IdentifierHelper::orig_sn (pd->impl->name (), true).c_str () - << "Consumer" << be_nl; - } - } - - *os << "{" << be_nl - << "};"; - - return 0; - } - - int - CdmwCifIDLVisitor::visit_component_fwd (AST_ComponentFwd *node) - { - if (node->imported ()) - { - return 0; - } - - *os << be_nl << be_nl - << "local interface CCM_" << node->original_local_name () - << "_SessionContext;"; - - *os << be_nl << be_nl - << "interface " - << IdentifierHelper::try_escape(node->original_local_name ()).c_str () - << ";"; - - return 0; - } - - int - CdmwCifIDLVisitor::visit_eventtype (AST_EventType *node) - { - if (node->imported ()) - { - return 0; - } - - if (this->visit_valuetype (node) != 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "CdmwCifIDLVisitor::visit_eventtype - " - "codegen for valuetype failed\n"), - -1); - } - - *os << be_nl << be_nl - << "interface " << node->original_local_name () << "Consumer : " - << IdentifierHelper::orig_sn (node->name (), true).c_str () - << "Consumer," << be_idt_nl - << "CosEventComm::PushConsumer," << be_nl - << "CosLifeCycle::LifeCycleObject" << be_uidt_nl - << "{" << be_nl - << "};"; - - return 0; - } - - int - CdmwCifIDLVisitor::visit_eventtype_fwd (AST_EventTypeFwd *node) - { - if (node->imported ()) - { - return 0; - } - - if (this->visit_valuetype_fwd (node) != 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "CdmwCifIDLVisitor::visit_eventtype_fwd - " - "codegen for valuetype_fwd failed\n"), - -1); - } - - *os << be_nl << be_nl - << "interface " << node->original_local_name () << "Consumer;"; - - return 0; - } - - int - CdmwCifIDLVisitor::visit_home (AST_Home *node) - { - if (node->imported ()) - { - return 0; - } - - *os << be_nl << be_nl - << "interface " - << IdentifierHelper::try_escape(node->original_local_name ()).c_str () - << " : " - << IdentifierHelper::orig_sn (node->name ()).c_str () - << "," << be_idt_nl - << "Components::HomeConfiguration," << be_nl - << "CdmwCcmCif::CCMHome," << be_nl - << "CdmwCcmCif::KeylessCCMHome" << be_uidt_nl - << "{" << be_nl - << "};"; - - return 0; - } - - int - CdmwCifIDLVisitor::visit_factory (AST_Factory *) - { - // Do not generate - return 0; - } - - int - CdmwCifIDLVisitor::visit_structure (AST_Structure *) - { - // Do not generate - return 0; - } - - int - CdmwCifIDLVisitor::visit_structure_fwd (AST_StructureFwd *) - { - // Do not generate - return 0; - } - - int - CdmwCifIDLVisitor::visit_exception (AST_Exception *) - { - // Do not generate - return 0; - } - - int - CdmwCifIDLVisitor::visit_expression (AST_Expression *) - { - return 0; - } - - int - CdmwCifIDLVisitor::visit_enum (AST_Enum *) - { - // Do not generate - return 0; - } - - - int - CdmwCifIDLVisitor::visit_union (AST_Union *) - { - // Do not generate - return 0; - } - - int - CdmwCifIDLVisitor::visit_union_fwd (AST_UnionFwd *) - { - // Do not generate - return 0; - } - - int - CdmwCifIDLVisitor::visit_union_branch (AST_UnionBranch *) - { - // Do not generate - return 0; - } - - int - CdmwCifIDLVisitor::visit_union_label (AST_UnionLabel *) - { - // Do not generate - return 0; - } - - int - CdmwCifIDLVisitor::visit_constant (AST_Constant *) - { - // Do not generate - return 0; - } - - int - CdmwCifIDLVisitor::visit_enum_val (AST_EnumVal *) - { - return 0; - } - - int - CdmwCifIDLVisitor::visit_array (AST_Array *) - { - // Do not generate - return 0; - } - - int - CdmwCifIDLVisitor::visit_sequence (AST_Sequence *) - { - // Do not generate - return 0; - } - - - int - CdmwCifIDLVisitor::visit_root (AST_Root *node) - { - int status = be_global->outfile_init (this->os, - "Cdmw_", - "_cif.idl", - "_CDMW_IDL_CDMW_", - "_IDL_"); - - if (status == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("CdmwCifIDLVisitor::visit_root - ") - ACE_TEXT ("failed to initialize output file\n")), - -1); - } - - ACE_CString filename; - - for (size_t i = 0; i < idl_global->n_included_idl_files (); ++i) - { - if (i == 0) - { - *os << be_nl; - } - - ACE_CString raw_filename = - idl_global->included_idl_files ()[i]; - - // The included *_cif.idl file will pull these in, no need - // to repeat them. - if (raw_filename == "orb.idl" || raw_filename == "Components.idl") - { - continue; - } - - bool excluded_file_found = - this->match_excluded_file (raw_filename.c_str ()); - - if (raw_filename.find (".pidl") != ACE_CString::npos - || excluded_file_found) - { - filename = raw_filename; - } - else - { - if (raw_filename.rfind ('/') == ACE_CString::npos) - { - filename = - raw_filename.substr (0, raw_filename.rfind ('.')) - + "_cif.idl"; - - *os << be_nl - << "#include \"Cdmw_" << filename.c_str () << "\""; - } - else - { - ACE_CString filename_path = - raw_filename.substr (0, raw_filename.rfind ('/')); - ACE_CString filename_bis = - raw_filename.substr (raw_filename.rfind ('/') + 1, - raw_filename.length ()); - filename = - filename_bis.substr (0, filename_bis.rfind ('.')) - + "_cif.idl"; - - *os << be_nl - << "#include \"" << filename_path.c_str () << "/Cdmw_" - << filename.c_str () << "\""; - } - } - } - - ACE_CString fn (idl_global->stripped_filename ()->get_string ()); - fn = fn.substr (0, fn.rfind ('.')); - fn += "_cif.idl"; - - *os << be_nl << be_nl - << "#include \"" << fn.c_str () << "\""; - *os << be_nl - << "#include \"CdmwCcmCif.idl\""; - *os << be_nl - << "#include \"CdmwComponents.idl\""; - - *os << be_nl << be_nl - << "#pragma prefix \"thalesgroup.com\""; - - if (this->localIdl3) - { - if (this->visit_scope (node) != 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "CdmwCifIDLVisitor::visit_root - " - "codegen for scope failed\n"), - -1); - } - } - - *os << be_nl << be_nl - << "#endif /* ifndef */" << be_nl << be_nl; - - return 0; - } - - int - CdmwCifIDLVisitor::visit_native (AST_Native *) - { - // Do not generate - return 0; - } - - bool - CdmwCifIDLVisitor::scope_skip_type (AST_Decl *d) - { - AST_Decl::NodeType nt = d->node_type (); - return (nt == AST_Decl::NT_pre_defined - || nt == AST_Decl::NT_typedef); - } - } // End of CodeGenerator -} // End of Cdmw diff --git a/flat/CIAO/tools/IDL3_to_IDL2/CdmwCifIDLVisitor.hpp b/flat/CIAO/tools/IDL3_to_IDL2/CdmwCifIDLVisitor.hpp deleted file mode 100644 index 1d207836e7e..00000000000 --- a/flat/CIAO/tools/IDL3_to_IDL2/CdmwCifIDLVisitor.hpp +++ /dev/null @@ -1,406 +0,0 @@ -/* ===================================================================== */ -/* - * This file is part of CARDAMOM (R) which is jointly developed by THALES - * and SELEX-SI. It is derivative work based on PERCO Copyright (C) THALES - * 2000-2003. All rights reserved. - * Copyright (C) THALES 2004-2005. All rights reserved. - * Copyright (C) SELEX-SI and THALES 2006. All rights reserved. - * - * CARDAMOM is free software; you can redistribute it and/or modify it - * under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * CARDAMOM is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - * License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with CARDAMOM; see the file COPYING. If not, write to the - * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ -/* ===================================================================== */ -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - - */ - -#ifndef CDMW_CODE_GENERATOR_CIF_IDL_VISITOR_HPP -#define CDMW_CODE_GENERATOR_CIF_IDL_VISITOR_HPP - -#include "basic_visitor.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ast_visitor.h" -#include "utl_scoped_name.h" - -class UTL_ExceptList; - -namespace Cdmw -{ - namespace CodeGenerator - { - // This class generates the appropriate interfaces and local - // interfaces for lifecycle and context management - // considerations. - // - class CdmwCifIDLVisitor : public basic_visitor - { - public: - - /** - * Purpose: - * <p> Constructor. - * - *@param os The FmtOStringStream which will contain the code generated after the AST trip. - */ - CdmwCifIDLVisitor (void); - - /** - * Purpose: - * <p> Destructor. - */ - virtual ~CdmwCifIDLVisitor (void); - - /** - * Purpose: - * <p> The visit_module operation is used to visit a module node. - * - *@param node The module node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_module (AST_Module *node); - - /** - * Purpose: - * <p> The visit_interface operation is used to visit an interface node. - * - *@param node The interface node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_interface (AST_Interface *node); - - /** - * Purpose: - * <p> The visit_interface_fwd operation is used to visit an interface fwd node. - * - *@param node The interface fwd node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_interface_fwd (AST_InterfaceFwd *node); - - /** - * Purpose: - * <p> The visit_valuebox operation is used to visit a valuebox node. - * - *@param node The valuebox node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_valuebox (AST_ValueBox *node); - - /** - * Purpose: - * <p> The visit_valuetype operation is used to visit a valuetype node. - * - *@param node The valuetype node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_valuetype (AST_ValueType *node); - - /** - * Purpose: - * <p> The visit_valuetype_fwd operation is used to visit a valuetype fwd node. - * - *@param node The valuetype fwd node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_valuetype_fwd (AST_ValueTypeFwd *node); - - /** - * Purpose: - * <p> The visit_component operation is used to visit a component node. - * - *@param node The component node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_component (AST_Component *node); - - /** - * Purpose: - * <p> The visit_component_fwd operation is used to visit a component node. - * - *@param node The component fwd node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_component_fwd (AST_ComponentFwd *node); - - /** - * Purpose: - * <p> The visit_eventtype operation is used to visit a eventtype node. - * - *@param node The eventtype node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_eventtype (AST_EventType *node); - - /** - * Purpose: - * <p> The visit_eventtype_fwd operation is used to visit a eventtype fwd node. - * - *@param node The eventtype fwd node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_eventtype_fwd (AST_EventTypeFwd *node); - - /** - * Purpose: - * <p> The visit_home operation is used to visit a home node. - * - *@param node The home node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_home (AST_Home *node); - - /** - * Purpose: - * <p> The visit_factory operation is used to visit a factory construct node. - * - *@param node The factory construct node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_factory (AST_Factory *node); - - /** - * Purpose: - * <p> The visit_structure operation is used to visit a structure node. - * - *@param node The structure node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_structure (AST_Structure *node); - - /** - * Purpose: - * <p> The visit_structure_fwd operation is used to visit a structure fwd node - * - *@param node The structure fwd node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_structure_fwd (AST_StructureFwd *node); - - /** - * Purpose: - * <p> The visit_exception operation is used to visit an exception node. - * - *@param node The exception node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_exception (AST_Exception *node); - - /** - * Purpose: - * <p> The visit_expression operation is used to visit an expression node. - * - *@param node The expression node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_expression (AST_Expression *node); - - /** - * Purpose: - * <p> The visit_enum operation is used to visit an enum node. - * - *@param node The enum node. - *@return The operation statusn, zero if the operation is successful. - * - */ - virtual int visit_enum (AST_Enum *node); - - /** - * Purpose: - * <p> The visit_union operation is used to visit an union node. - * - *@param node The union node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_union (AST_Union *node); - - /** - * Purpose: - * <p> The visit_union_fwd operation is used to visit an union fwd node. - * - *@param node The union fwd node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_union_fwd (AST_UnionFwd *node); - - /** - * Purpose: - * <p> The visit_union_branch operation is used to visit an union branch node - * - *@param node The union branch node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_union_branch (AST_UnionBranch *node); - - /** - * Purpose: - * <p> The visit_union_label operation is used to visit an union label node. - * - *@param node The union label node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_union_label (AST_UnionLabel *node); - - /** - * Purpose: <p> The visit_constant operation is used to visit - * a constant fwd node. - * - *@param node The constant node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_constant (AST_Constant *node); - - /** - * Purpose: <p> The visit_enum_val operation is used to visit - * an enum val node. - * - *@param node The enum val node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_enum_val (AST_EnumVal *node); - - /** - * Purpose: - * <p> The visit_array operation is used to visit an array node. - * - *@param node The array node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_array (AST_Array *node); - - /** - * Purpose: - * <p> The visit_sequence operation is used to visit a sequence node. - * - *@parIdl3am node The sequence node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_sequence (AST_Sequence *node); - - /** - * Purpose: <p> The visit_root operation is used to visit - * a root node - * - *@param node The root node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_root (AST_Root *node); - - /** - * Purpose: <p> The visit_native operation is used to visit - * a native node - * - *@param node The native node. - *@return The operation status, zero if the operation is successful. - * - */ - virtual int visit_native (AST_Native *node); - - // local IDL3. - bool localIdl3; - - virtual bool scope_skip_type (AST_Decl *d); - }; - } // End of CodeGenerator -} // End of Cdmw - -#endif // CDMW_CODE_GENERATOR_CIF_IDL_VISITOR_HPP diff --git a/flat/CIAO/tools/IDL3_to_IDL2/Config.hpp b/flat/CIAO/tools/IDL3_to_IDL2/Config.hpp deleted file mode 100644 index bfc260ae79c..00000000000 --- a/flat/CIAO/tools/IDL3_to_IDL2/Config.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/* ===================================================================== */ -/* - * This file is part of CARDAMOM (R) which is jointly developed by THALES - * and SELEX-SI. It is derivative work based on PERCO Copyright (C) THALES - * 2000-2003. All rights reserved. - * Copyright (C) THALES 2004-2005. All rights reserved. - * Copyright (C) SELEX-SI and THALES 2006. All rights reserved. - * - * CARDAMOM is free software; you can redistribute it and/or modify it - * under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * CARDAMOM is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - * License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with CARDAMOM; see the file COPYING. If not, write to the - * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ -/* ===================================================================== */ - -#ifndef CDMW_CODE_GENERATOR_CONFIG_HPP -#define CDMW_CODE_GENERATOR_CONFIG_HPP - -#include <iostream> - -#define COG_DEBUG(X) std::cout << X << std::endl; -#define COG_INFO(X) std::cout << X << std::endl; -#define COG_WARN(X) std::cout << X << std::endl; -#define COG_ERROR(X) std::cerr << X << std::endl; -#define COG_FATAL(X) std::cerr << X << std::endl; - -/** -* Root namespace for CDMW runtime. -*/ -namespace Cdmw -{ - namespace CodeGenerator - { - const char* const BE_VERSION = "V1.0"; - - const char* const BE_LOGGER_NAME = "CDMW.IDL_BE"; - } // End of TAO_IDL_FE namespace -} // End of Cdmw namespace - - -#endif // CDMW_CODE_GENERATOR_CONFIG_HPP diff --git a/flat/CIAO/tools/IDL3_to_IDL2/IDL3_to_IDL2.mpc b/flat/CIAO/tools/IDL3_to_IDL2/IDL3_to_IDL2.mpc index 8104e9908be..f78261df4d5 100644 --- a/flat/CIAO/tools/IDL3_to_IDL2/IDL3_to_IDL2.mpc +++ b/flat/CIAO/tools/IDL3_to_IDL2/IDL3_to_IDL2.mpc @@ -36,8 +36,7 @@ project(TAO_IDL3_TO_IDL2_BE) : acelib, install, tao_output, crosscompile { } } - -project(TAO_IDL3_TO_IDL2_EXE) : aceexe, install, tao_output, crosscompile { +project(TAO_IDL3_TO_IDL2_EXE) : aceexe, install, tao_output, crosscompile, tao_idl_mcpp { after += TAO_IDL3_TO_IDL2_BE TAO_IDL_FE exename = tao_idl3_to_idl2 libs += TAO_IDL3_TO_IDL2_BE TAO_IDL_FE @@ -45,7 +44,11 @@ project(TAO_IDL3_TO_IDL2_EXE) : aceexe, install, tao_output, crosscompile { $(TAO_ROOT)/TAO_IDL/fe \ $(TAO_ROOT) libpaths += $(TAO_ROOT)/TAO_IDL - install = $(ACE_ROOT)/bin + exeout = $(ACE_ROOT)/bin + + // Adding a strict ordering dependency with TAO_IDL_EXE. It appears on some systems, there + // can be a race between these two projects for tao_idl.cpp, causing some erroors. + after += TAO_IDL_EXE // This is necessary for MPC to pull in rules.ciao.GNU includes += $(CIAO_ROOT) @@ -56,13 +59,10 @@ project(TAO_IDL3_TO_IDL2_EXE) : aceexe, install, tao_output, crosscompile { else CPPFLAGS += -DTAO_IDL_PREPROCESSOR=\\\"$(subst \\,\\,$(TAO_IDL_PREPROCESSOR))\\\" endif - - VPATH = $(TAO_ROOT)/TAO_IDL $(TAO_ROOT)/TAO_IDL/driver } Source_Files { $(TAO_ROOT)/TAO_IDL/driver/drv_args.cpp - $(TAO_ROOT)/TAO_IDL/driver/drv_preproc.cpp $(TAO_ROOT)/TAO_IDL/tao_idl.cpp } @@ -70,68 +70,3 @@ project(TAO_IDL3_TO_IDL2_EXE) : aceexe, install, tao_output, crosscompile { $(TAO_ROOT)/TAO_IDL/include/drv_extern.h } } - -project (CDMW_IDL3_TO_IDL2_BE) : acelib, install, tao_output, crosscompile { - sharedname = CDMW_IDL3_TO_IDL2_BE - after += TAO_IDL3_TO_IDL2_BE - libs += TAO_IDL_FE \ - TAO_IDL3_TO_IDL2_BE - libpaths += $(TAO_ROOT)/TAO_IDL - dynamicflags = CDMW_IDL3_TO_IDL2_BE_BUILD_DLL - includes += $(TAO_ROOT)/TAO_IDL/include \ - $(TAO_ROOT) - - // This is necessary for MPC to pull in rules.ciao.GNU - includes += $(CIAO_ROOT) - - Source_Files { - CdmwBE.cpp - CdmwBEGlobal.cpp - CdmwCifIDLVisitor.cpp - InternalIDLVisitor.cpp - } - - Header_Files { - CDMW_IDL3_TO_IDL2_BE_Export.hpp - CdmwBEExtern.hpp - CdmwBEGlobal.hpp - CdmwCifIDLVisitor.hpp - Config.hpp - InternalIDLVisitor.hpp - } -} - -project (CDMW_IDL3_TO_IDL2_EXE) : aceexe, install, tao_output, crosscompile, tao_idl_mcpp { - exename = cdmw_idl3_to_idl2 - install = $(ACE_ROOT)/bin - after += CDMW_IDL3_TO_IDL2_BE - libs += CDMW_IDL3_TO_IDL2_BE \ - TAO_IDL3_TO_IDL2_BE \ - TAO_IDL_FE - libpaths += $(TAO_ROOT)/TAO_IDL - includes += . $(TAO_ROOT)/TAO_IDL/include \ - $(TAO_ROOT)/TAO_IDL/fe \ - $(TAO_ROOT) - - // This is necessary for MPC to pull in rules.ciao.GNU - includes += $(CIAO_ROOT) - - verbatim(gnuace, local) { - ifeq ($(TAO_IDL_PREPROCESSOR),) - CPPFLAGS += -DTAO_IDL_PREPROCESSOR=\\\"$(strip $(CXX))\\\" - else - CPPFLAGS += -DTAO_IDL_PREPROCESSOR=\\\"$(subst \\,\\,$(TAO_IDL_PREPROCESSOR))\\\" - endif - - VPATH = . $(TAO_ROOT)/TAO_IDL/driver - } - - Source_Files { - cdmw_idl.cpp - $(TAO_ROOT)/TAO_IDL/driver/drv_args.cpp - } - - Header_Files { - $(TAO_ROOT)/TAO_IDL/include/drv_extern.h - } -} diff --git a/flat/CIAO/tools/IDL3_to_IDL2/IDL3_to_IDL2.mwc b/flat/CIAO/tools/IDL3_to_IDL2/IDL3_to_IDL2.mwc deleted file mode 100644 index 5a08c906a8e..00000000000 --- a/flat/CIAO/tools/IDL3_to_IDL2/IDL3_to_IDL2.mwc +++ /dev/null @@ -1,6 +0,0 @@ -// $Id$ -workspace { - $(ACE_ROOT)/ace - $(TAO_ROOT)/TAO_IDL/tao_idl_fe.mpc - $(CIAO_ROOT)/tools/IDL3_to_IDL2 -} diff --git a/flat/CIAO/tools/IDL3_to_IDL2/InternalIDLVisitor.cpp b/flat/CIAO/tools/IDL3_to_IDL2/InternalIDLVisitor.cpp deleted file mode 100644 index 674351fa0cf..00000000000 --- a/flat/CIAO/tools/IDL3_to_IDL2/InternalIDLVisitor.cpp +++ /dev/null @@ -1,948 +0,0 @@ -/* ===================================================================== */ -/* - * This file is part of CARDAMOM (R) which is jointly developed by THALES - * and SELEX-SI. It is derivative work based on PERCO Copyright (C) THALES - * 2000-2003. All rights reserved. - * Copyright (C) THALES 2004-2005. All rights reserved. - * Copyright (C) SELEX-SI and THALES 2006. All rights reserved. - * - * CARDAMOM is free software; you can redistribute it and/or modify it - * under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * CARDAMOM is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - * License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with CARDAMOM; see the file COPYING. If not, write to the - * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ -/* ===================================================================== */ -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - - */ - -#include "InternalIDLVisitor.hpp" -#include "CdmwBEExtern.hpp" - -#include "identifier_helper.h" -#include "be_sunsoft.h" -#include "be_extern.h" - -#include "ast_attribute.h" -#include "ast_component_fwd.h" -#include "ast_eventtype.h" -#include "ast_eventtype_fwd.h" -#include "ast_home.h" -#include "ast_operation.h" -#include "ast_root.h" -#include "utl_string.h" -#include "utl_exceptlist.h" -#include "utl_identifier.h" -#include "global_extern.h" -#include "nr_extern.h" - -namespace Cdmw -{ - namespace CodeGenerator - { - InternalIDLVisitor::InternalIDLVisitor (void) - : basic_visitor (), - localIdl3 (false) - { - } - - InternalIDLVisitor::~InternalIDLVisitor (void) - { - } - - int - InternalIDLVisitor::visit_module (AST_Module *node) - { - if (node->imported () || this->can_skip_module (node)) - { - return 0; - } - - ACE_CString name = - IdentifierHelper::try_escape (node->original_local_name ()); - - *os << be_nl << be_nl - << "module " << name.c_str () << be_nl - << "{" << be_idt; - - if (this->visit_scope (node) != 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "InternalIDLVisitor::visit_module - " - "codegen for scope failed\n"), - -1); - } - - *os << be_uidt_nl - << "}; // end of module " << name.c_str (); - - return 0; - } - - int - InternalIDLVisitor::visit_interface (AST_Interface *node) - { - - if (node->imported ()) - { - return 0; - } - - if (!node->is_local () && !node->is_abstract ()) - { - *os << be_nl << be_nl - << "local interface CCM_" - << node->original_local_name () << " : " - << IdentifierHelper::try_escape (node->original_local_name ()).c_str() - << "{" << be_nl - << "};"; - } - - return 0; - } - - int - InternalIDLVisitor::visit_interface_fwd (AST_InterfaceFwd *node) - { - if (node->imported ()) - { - return 0; - } - - if (!node->is_local () && !node->is_abstract ()) - { - *os << be_nl << be_nl - << "local interface CCM_" - << node->original_local_name () << ";"; - } - - return 0; - } - - int - InternalIDLVisitor::visit_valuebox (AST_ValueBox *) - { - // Do not generate - return 0; - } - - int - InternalIDLVisitor::visit_valuetype (AST_ValueType *) - { - // Do not generate - return 0; - } - - int - InternalIDLVisitor::visit_valuetype_fwd (AST_ValueTypeFwd *) - { - // Do not generate - return 0; - } - - int - InternalIDLVisitor::visit_component (AST_Component *node) - { - if (node->imported ()) - { - return 0; - } - - this->gen_main_executor (node); - this->gen_monolithic_executor (node); - this->gen_context (node); - - return 0; - } - - int - InternalIDLVisitor::visit_component_fwd (AST_ComponentFwd *node) - { - if (node->imported ()) - { - return 0; - } - - *os << be_nl << be_nl - << "local interface CCM_" - << node->original_local_name () << "_Executor;" << be_nl - << "local interface CCM_" - << node->original_local_name () << ";" << be_nl - << "local interface CCM_" - << node->original_local_name () << "_Context;" << be_nl; - - return 0; - } - - int - InternalIDLVisitor::visit_eventtype (AST_EventType *node) - { - if (node->imported ()) - { - return 0; - } - - *os << be_nl << be_nl - << "local interface CCM_" - << node->original_local_name () << "Consumer" << be_nl - << "{" << be_idt_nl - << "void push (in " - << IdentifierHelper::try_escape (node->original_local_name ()).c_str() - << " ev);" << be_uidt_nl - << "};"; - - return 0; - } - - int - InternalIDLVisitor::visit_eventtype_fwd (AST_EventTypeFwd *node) - { - if (node->imported ()) - { - return 0; - } - - *os << be_nl << be_nl - << "local interface CCM_" << node->original_local_name () - << "Consumer;" << be_nl; - - return 0; - } - - int - InternalIDLVisitor::visit_home (AST_Home *node) - { - if (node->imported ()) - { - return 0; - } - - this->gen_home_implicit_executor (node); - this->gen_home_explicit_executor (node); - this->gen_home_main_executor (node); - - return 0; - } - - - int - InternalIDLVisitor::visit_factory (AST_Factory *) - { - // Do not generate - return 0; - } - - int - InternalIDLVisitor::visit_structure (AST_Structure *) - { - // Do not generate - return 0; - } - - int - InternalIDLVisitor::visit_structure_fwd (AST_StructureFwd *) - { - // Do not generate - return 0; - } - - int - InternalIDLVisitor::visit_exception (AST_Exception *) - { - // Do not generate - return 0; - } - - int - InternalIDLVisitor::visit_expression (AST_Expression *) - { - return 0; - } - - int - InternalIDLVisitor::visit_enum (AST_Enum *) - { - // Do not generate - return 0; - } - - - int - InternalIDLVisitor::visit_union (AST_Union *) - { - // Do not generate - return 0; - } - - int - InternalIDLVisitor::visit_union_fwd (AST_UnionFwd *) - { - // Do not generate - return 0; - } - - int - InternalIDLVisitor::visit_union_branch (AST_UnionBranch *) - { - // Do not generate - return 0; - } - - int - InternalIDLVisitor::visit_union_label (AST_UnionLabel *) - { - // Do not generate - return 0; - } - - int - InternalIDLVisitor::visit_constant (AST_Constant *) - { - // Do not generate - return 0; - } - - int - InternalIDLVisitor::visit_enum_val (AST_EnumVal *) - { - return 0; - } - - int - InternalIDLVisitor::visit_root (AST_Root *node) - { - int status = be_global->outfile_init (this->os, - "", - "_cif.idl", - "_CDMW_IDL_", - "_IDL_"); - - if (status == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("InternalIDLVisitor::visit_root - ") - ACE_TEXT ("failed to initialize output file\n")), - -1); - } - - ACE_CString filename; - - for (size_t i = 0; i < idl_global->n_included_idl_files (); ++i) - { - if (i == 0) - { - *os << be_nl; - } - - ACE_CString raw_filename = - idl_global->included_idl_files ()[i]; - - // The included *_IDL2.idl file will pull these in, no need - // to repeat them. - if (raw_filename == "orb.idl" || raw_filename == "Components.idl") - { - continue; - } - - bool excluded_file_found = - this->match_excluded_file (raw_filename.c_str ()); - - if (raw_filename.find (".pidl") != ACE_CString::npos - || excluded_file_found) - { - filename = raw_filename; - } - else - { - filename = - raw_filename.substr (0, raw_filename.rfind ('.')) + "_cif.idl"; - } - - *os << be_nl - << "#include \"" << filename.c_str () << "\""; - } - - ACE_CString fn (idl_global->stripped_filename ()->get_string ()); - fn = fn.substr (0, fn.rfind ('.')); - fn += "_IDL2.idl"; - - *os << be_nl - << "#include \"" << fn.c_str () << "\""; - - const char *pfix = node->prefix (); - - if (ACE_OS::strcmp (pfix, "") != 0) - { - *os << be_nl << be_nl - << "#pragma prefix \"" << pfix << "\""; - } - - if (this->localIdl3) - { - if (this->visit_scope (node) != 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "InternalIDLVisitor::visit_root - " - "codegen for scope failed\n"), - -1); - } - } - - *os << be_nl << be_nl - << "#endif /* ifndef */" << be_nl << be_nl; - - return 0; - } - - int - InternalIDLVisitor::visit_native (AST_Native *) - { - // Do not generated - return 0; - } - - bool - InternalIDLVisitor::scope_skip_type (AST_Decl *d) - { - AST_Decl::NodeType nt = d->node_type (); - return (nt == AST_Decl::NT_pre_defined - || nt == AST_Decl::NT_typedef); - } - - void - InternalIDLVisitor::gen_context (AST_Component *node) - { - AST_Component *base = node->base_component (); - - *os << be_nl << be_nl - << "local interface CCM_" << node->original_local_name () - << "_Context"; - - ACE_CString s_base_context; - - if (base != 0) - { - UTL_Scope * base_scope = base->defined_in (); - - if (base_scope != 0) - { - AST_Decl *dummy = ScopeAsDecl(base_scope); - s_base_context = "::"; - s_base_context += IdentifierHelper::orig_sn (dummy->name()); - s_base_context += "::"; - } - - s_base_context += "CCM_"; - s_base_context += base->original_local_name ()->get_string(); - s_base_context += "_Context"; - } - else - { - s_base_context = "Components::CCMContext"; - } - - *os << " : " << s_base_context.c_str() - << be_nl - << "{" << be_idt_nl; - - // Generate additional operations for receptacles and event sources - { - ACE_Unbounded_Queue<AST_Component::port_description> &s = - node->uses (); - AST_Component::port_description *pd = 0; - - for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> iter (s); - ! iter.done (); - iter.advance ()) - { - iter.next (pd); - - *os << be_nl << be_nl; - - Identifier * id__ = - IdentifierHelper::original_local_name (pd->id); - - if (pd->is_multiple) - { - *os << IdentifierHelper::try_escape (node->original_local_name ()).c_str () - << "::" << id__ << "Connections get_connections_" - << id__ << " ();"; - } - else - { - *os << IdentifierHelper::orig_sn (pd->impl->name ()).c_str () - << " get_connection_" << id__ << " ();"; - } - - id__->destroy (); - delete id__; - id__ = 0; - } - } - // Publishes - { - - ACE_Unbounded_Queue<AST_Component::port_description> &s = - node->publishes (); - AST_Component::port_description *pd = 0; - - for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> iter (s); - ! iter.done (); - iter.advance ()) - { - iter.next (pd); - Identifier * id__ = - IdentifierHelper::original_local_name (pd->id); - - *os << be_nl << be_nl - << "void push_" << id__ - << " (in " - << IdentifierHelper::orig_sn (pd->impl->name ()).c_str () - << " ev);"; - - id__->destroy (); - delete id__; - id__ = 0; - } - } - // Emits - { - ACE_Unbounded_Queue<AST_Component::port_description> &s = - node->emits (); - AST_Component::port_description *pd = 0; - - for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> iter (s); - ! iter.done (); - iter.advance ()) - { - iter.next (pd); - Identifier * id__ = - IdentifierHelper::original_local_name (pd->id); - - *os << be_nl << be_nl - << "void push_" << id__ - << " (in " - << IdentifierHelper::orig_sn (pd->impl->name ()).c_str () - << " ev);"; - - id__->destroy (); - delete id__; - id__ = 0; - } - } - - *os << be_uidt_nl - << "};"; - } - - void - InternalIDLVisitor::gen_main_executor (AST_Component *node) - { - AST_Component *base = node->base_component (); - - *os << be_nl << be_nl - << "local interface CCM_" << node->original_local_name () - << "_Executor"; - - ACE_CString s_base_context; - - if (base != 0) - { - UTL_Scope * base_scope = base->defined_in (); - - if (base_scope != 0) - { - AST_Decl *dummy = ScopeAsDecl(base_scope); - s_base_context += IdentifierHelper::orig_sn (dummy->name ()).c_str (); - s_base_context += "::"; - } - - s_base_context += "CCM_"; - s_base_context += base->original_local_name ()->get_string (); - s_base_context += "_Executor"; - } - else - { - s_base_context = "Components::EnterpriseComponent"; - } - - *os << " : " << s_base_context.c_str(); - - // Any supported interfaces? - long nsupports = node->n_supports (); - - for (long i = 0; i < nsupports; ++i) - { - *os << be_nl - << ", " - << IdentifierHelper::orig_sn (node->supports ()[i]->name ()).c_str (); - } - - *os << be_nl - << "{" << be_idt_nl; - - // Generate attributes declared by the component - { - // Any attributes and operations? - for (UTL_ScopeActiveIterator decl_iter (node, UTL_Scope::IK_decls); - ! decl_iter.is_done (); - decl_iter.next ()) - { - AST_Decl *d = decl_iter.item (); - AST_Attribute * attr = AST_Attribute::narrow_from_decl(d); - - if (attr != 0 && d->ast_accept (this) != 0) - { - ACE_ERROR ((LM_ERROR, - "InternalIDLVisitor::gen_home_explicit_executor - " - "codegen for scope failed\n")); - return; - } - } - } - - *os << be_uidt_nl - << "};"; - } - - void - InternalIDLVisitor::gen_monolithic_executor (AST_Component *node) - { - *os << be_nl << be_nl - << "local interface CCM_" - << node->original_local_name () << " : CCM_" - << node->original_local_name () << "_Executor" << be_nl - << "{" << be_idt_nl; - - // Facet ports - { - - ACE_Unbounded_Queue<AST_Component::port_description> &s = - node->provides (); - AST_Component::port_description *pd = 0; - - for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> iter (s); - ! iter.done (); - iter.advance ()) - { - iter.next (pd); - Identifier * id__ = - IdentifierHelper::original_local_name (pd->id); - - // CCM_<type> get_<name> (); - - ACE_CString s_impl; - UTL_Scope * base_scope = pd->impl->defined_in (); - - if (base_scope != 0) - { - AST_Decl *dummy = ScopeAsDecl(base_scope); - s_impl += IdentifierHelper::orig_sn (dummy->name ()).c_str (); - s_impl += "::"; - s_impl += "CCM_"; - s_impl += pd->impl->original_local_name ()->get_string(); - } - else - { - s_impl += "CCM_"; - s_impl += pd->impl->original_local_name ()->get_string(); - } - - *os << be_nl << be_nl - << s_impl.c_str () << " get_" << id__ << " ();"; - - id__->destroy (); - delete id__; - id__ = 0; - } - } - // Consumer ports - { - ACE_Unbounded_Queue<AST_Component::port_description> &s = - node->consumes (); - AST_Component::port_description *pd = 0; - - for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> iter (s); - ! iter.done (); - iter.advance ()) - { - iter.next (pd); - - Identifier * id__ = - IdentifierHelper::original_local_name (pd->id); - - *os << be_nl << be_nl - << "void push_" << id__ << " (in " - << IdentifierHelper::orig_sn (pd->impl->name ()).c_str () - << " ev );"; - - id__->destroy (); - delete id__; - id__ = 0; - } - } - - *os << be_uidt_nl - << "};"; - } - - void - InternalIDLVisitor::gen_home_implicit_executor (AST_Home *node) - { - AST_ValueType *key = node->primary_key (); - - *os << be_nl << be_nl - << "local interface CCM_" - << node->original_local_name () << "Implicit" << be_nl - << "{"<< be_idt_nl; - - if (key != 0) - { - ACE_CString key_name = - IdentifierHelper::orig_sn (key->name ()); - - *os << "Components::EnterpriseComponent " - << "create (in " << key_name.c_str () << " key)" << be_idt_nl - << "raises (Components::CCMException);" << be_uidt_nl - << "Components::EnterpriseComponent " - << "find_by_primary_key (in " << key_name.c_str () - << " key)" << be_idt_nl - << "raises (Components::CCMException);" << be_uidt_nl - << "void remove (in " << key_name.c_str () - << " key)" << be_idt_nl - << "raises (Components::CCMException);" << be_uidt_nl; - } - else - { - *os << "Components::EnterpriseComponent create()" << be_idt_nl - << "raises (Components::CCMException);" << be_uidt_nl; - } - - *os << be_uidt_nl - << "};"; - } - - void - InternalIDLVisitor::gen_home_explicit_executor (AST_Home *node) - { - ACE_CString explicit_name ("CCM_"); - explicit_name += node->original_local_name ()->get_string (); - explicit_name += "Explicit"; - - *os << be_nl << be_nl - << "local interface " << explicit_name.c_str () << " : "; - - AST_Home *base = node->base_home (); - - if (base == 0) - { - *os << "Components::HomeExecutorBase"; - } - else - { - ACE_CString s_base_home; - UTL_Scope * base_scope = base->defined_in (); - - if (base_scope != 0) - { - AST_Decl *dummy = ScopeAsDecl(base_scope); - s_base_home += IdentifierHelper::orig_sn (dummy->name ()).c_str (); - s_base_home += "::"; - } - - s_base_home += "CCM_"; - s_base_home += base->original_local_name ()->get_string (); - s_base_home += "Explicit"; - - *os << s_base_home.c_str (); - } - - *os << be_idt_nl; - - AST_Interface **parents = node->inherits (); - - for (long i = 0; i < node->n_inherits (); ++i) - { - *os << ", " - << IdentifierHelper::orig_sn (parents[i]->name ()).c_str () - << be_nl; - } - - *os << be_uidt_nl - << "{" << be_idt_nl; - - // Any attributes and operations? - for (UTL_ScopeActiveIterator decl_iter (node, UTL_Scope::IK_decls); - ! decl_iter.is_done (); - decl_iter.next ()) - { - AST_Decl *d = decl_iter.item (); - - // (JP) This is a hack, used only to make a version comparison - // work down the line when the container's version is fetched. - // The explicit home node is created in the idl3_to_idl2 visitor - // and is only/ a temporary one - that visitor wasn't designed - // for subsequent visitors to use the same AST. - d->set_defined_in (node); - - if (d->ast_accept (this) != 0) - { - ACE_ERROR (( - LM_ERROR, - ACE_TEXT ("InternalIDLVisitor::gen_home_explicit_executor - ") - ACE_TEXT ("codegen for scope failed\n"))); - - return; - } - - } - // Generate factory operations - { - *os << be_nl; - - AST_Operation **item = 0; - - for (ACE_Unbounded_Queue_Iterator<AST_Operation *> i (node->factories ()); - ! i.done (); - i.advance ()) - { - i.next (item); - - *os << "Components::EnterpriseComponent " - << IdentifierHelper::try_escape((*item)->original_local_name ()).c_str() - << " ("; - - this->gen_params (*item, (*item)->argument_count ()); - - *os << ")"; - - UTL_ExceptList *exceps = (*item)->exceptions (); - - if (exceps != 0 && exceps->length () > 0) - { - this->gen_exception_list (exceps, "", true); - } - - *os << ";" << be_nl; - } - } - - // Generate finder operations - { - *os << be_nl; - - AST_Operation **item = 0; - - for (ACE_Unbounded_Queue_Iterator<AST_Operation *> i (node->finders ()); - ! i.done (); - i.advance ()) - { - i.next (item); - - *os << "Components::EnterpriseComponent " - << IdentifierHelper::try_escape((*item)->original_local_name ()).c_str() - << " ("; - - this->gen_params (*item, (*item)->argument_count ()); - - *os << ")"; - - UTL_ExceptList *exceps = (*item)->exceptions (); - - if (exceps != 0 && exceps->length () > 0) - { - this->gen_exception_list (exceps, "", true); - } - - *os << ";"; - } - } - - *os << be_uidt_nl - << "};"; - } - - void - InternalIDLVisitor::gen_home_main_executor (AST_Home *node) - { - *os << be_nl << be_nl - << "local interface CCM_" - << node->original_local_name () << " : " << be_idt_nl - << "CCM_" << node->original_local_name () - << "Explicit," << be_nl - << "CCM_" << node->original_local_name () - << "Implicit" << be_uidt_nl - << "{" << be_nl - << "};"; - } - } // End of CodeGenerator -} // End of Cdmw diff --git a/flat/CIAO/tools/IDL3_to_IDL2/InternalIDLVisitor.hpp b/flat/CIAO/tools/IDL3_to_IDL2/InternalIDLVisitor.hpp deleted file mode 100644 index 53d89b8c686..00000000000 --- a/flat/CIAO/tools/IDL3_to_IDL2/InternalIDLVisitor.hpp +++ /dev/null @@ -1,402 +0,0 @@ -/* ===================================================================== */ -/* - * This file is part of CARDAMOM (R) which is jointly developed by THALES - * and SELEX-SI. It is derivative work based on PERCO Copyright (C) THALES - * 2000-2003. All rights reserved. - * Copyright (C) THALES 2004-2005. All rights reserved. - * Copyright (C) SELEX-SI and THALES 2006. All rights reserved. - * - * CARDAMOM is free software; you can redistribute it and/or modify it - * under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * CARDAMOM is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - * License for more details. - * - * You should have rCCM_<component name>Homeeceived a copy of the GNU Library General Public - * License along with CARDAMOM; see the file COPYING. If not, write to the - * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ -/* ===================================================================== */ -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - - */ - -#ifndef CDMW_CODE_GENERATOR_INTERNAL_IDL_VISITOR_HPP -#define CDMW_CODE_GENERATOR_INTERNAL_IDL_VISITOR_HPP - -#include "basic_visitor.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ast_visitor.h" -#include "utl_scoped_name.h" - -class UTL_ExceptList; - -namespace Cdmw -{ - namespace CodeGenerator - { - // This class generates the local interfaces used at the - // server side. - // - class InternalIDLVisitor : public basic_visitor - { - public: - /** - * Purpose: - * <p> Constructor. - * - *@param os The FmtOStringStream which will contain the code generated after the AST trip. - */ - InternalIDLVisitor (void); - - /** - * Purpose: - * <p> Destructor. - */ - virtual ~InternalIDLVisitor (void); - - /** - * Purpose: - * <p> The visit_module operation is used to visit a module node. - * - *@param node The module node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_module (AST_Module *node); - - /** - * Purpose: - * <p> The visit_interface operation is used to visit an interface node. - * - *@param node The interface node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_interface (AST_Interface *node); - - /** - * Purpose: - * <p> The visit_interface_fwd operation is used to visit an interface fwd node. - * - *@param node The interface fwd node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_interface_fwd (AST_InterfaceFwd *node); - - /** - * Purpose: - * <p> The visit_valuebox operation is used to visit a valuebox node. - * - *@param node The valuebox node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_valuebox (AST_ValueBox *node); - - /** - * Purpose: - * <p> The visit_valuetype operation is used to visit a valuetype node. - * - *@param node The valuetype node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_valuetype (AST_ValueType *node); - - /** - * Purpose: - * <p> The visit_valuetype_fwd operation is used to visit a valuetype fwd node. - * - *@param node The valuetype fwd node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_valuetype_fwd (AST_ValueTypeFwd *node); - - /** - * Purpose: - * <p> The visit_component operation is used to visit a component node. - * - *@param node The component node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_component (AST_Component *node); - - /** - * Purpose: - * <p> The visit_component_fwd operation is used to visit a component - * - *@param node The component fwd node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_component_fwd (AST_ComponentFwd *node); - - /** - * Purpose: - * <p> The visit_eventtype operation is used to visit a eventtype node. - * - *@param node The eventtype node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_eventtype (AST_EventType *node); - - /** - * Purpose: - * <p> The visit_eventtype_fwd operation is used to visit a eventtype fwd node. - * - *@param node The eventtype fwd node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_eventtype_fwd (AST_EventTypeFwd *node); - - /** - * Purpose: - * <p> The visit_home operation is used to visit a home node. - * - *@param node The home node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_home (AST_Home *node); - - /** - * Purpose: - * <p> The visit_factory operation is used to visit a factory construct node. - * - *@param node The factory construct node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_factory (AST_Factory *node); - - /** - * Purpose: - * <p> The visit_structure operation is used to visit a structure node. - * - *@param node The structure node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_structure (AST_Structure *node); - - /** - * Purpose: - * <p> The visit_structure_fwd operation is used to visit a structure fwd node - * - *@param node The structure fwd node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_structure_fwd (AST_StructureFwd *node); - - /** - * Purpose: - * <p> The visit_exception operation is used to visit an exception node. - * - *@param node The exception node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_exception (AST_Exception *node); - - /** - * Purpose: - * <p> The visit_expression operation is used to visit an expression node. - * - *@param node The expression node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_expression (AST_Expression *node); - - /** - * Purpose: - * <p> The visit_enum operation is used to visit an enum node. - * - *@param node The enum node. - *@return The operation statusn, zero if the operation is successful. - */ - virtual int visit_enum (AST_Enum *node); - - /** - * Purpose: - * <p> The visit_union operation is used to visit an union node. - * - *@param node The union node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_union (AST_Union *node); - - /** - * Purpose: - * <p> The visit_union_fwd operation is used to visit an union fwd node. - * - *@param node The union fwd node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_union_fwd (AST_UnionFwd *node); - - /** - * Purpose: - * <p> The visit_union_branch operation is used to visit an union branch node - * - *@param node The union branch node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_union_branch (AST_UnionBranch *node); - - /** - * Purpose: - * <p> The visit_union_label operation is used to visit an union label node. - * - *@param node The union label node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_union_label (AST_UnionLabel *node); - - /** - * Purpose: <p> The visit_constant operation is used to visit - * a constant fwd node. - * - *@param node The constant node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_constant (AST_Constant *node); - - /** - * Purpose: <p> The visit_enum_val operation is used to visit - * an enum val node. - * - *@param node The enum val node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_enum_val (AST_EnumVal *node); - - /** - * Purpose: <p> The visit_root operation is used to visit - * a root node - * - *@param node The root node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_root (AST_Root *node); - - /** - * Purpose: <p> The visit_native operation is used to visit - * a native node - * - *@param node The native node. - *@return The operation status, zero if the operation is successful. - */ - virtual int visit_native (AST_Native *node); - - bool localIdl3; - - virtual bool scope_skip_type (AST_Decl *d); - - private: - /** - * Purpose: <p> The gen_context operation is used to generate a context interface. - * - *@param node The AST Component node. - */ - void gen_context (AST_Component *node); - - /** - * Purpose: <p> The gen_main_executor operation is used to generate an executor local interface. - * - *@param node The AST Component node. - */ - void gen_main_executor (AST_Component *node); - - /** - * Purpose: <p> The gen_monolithic_executor operation is used to generate a local interface of a monolithic executor. - * - *@param node The AST Component node. - */ - void gen_monolithic_executor (AST_Component *node); - - /** - * Purpose: <p> The gen_home_implicit_executor operation is used to generate the local interface of a home implict executor. - * - *@param node The AST Home node. - */ - void gen_home_implicit_executor (AST_Home *node); - - /** - * Purpose: <p> The gen_home_explicit_executor operation is used to - * generate the local interface of a home explicit executor. - * - *@param node The AST Home node. - */ - void gen_home_explicit_executor (AST_Home *node); - - /** - * Purpose: <p> The gen_home_main_executor operation is used to generate the local interface of a home. - * - *@param node The AST Home node. - */ - void gen_home_main_executor (AST_Home *node); - }; - } // End of CodeGenerator -} // End of Cdmw - -#endif // CDMW_CODE_GENERATOR_INTERNAL_IDL_VISITOR_HPP diff --git a/flat/CIAO/tools/IDL3_to_IDL2/README b/flat/CIAO/tools/IDL3_to_IDL2/README index 3f3672c2115..23ebd734b7e 100644 --- a/flat/CIAO/tools/IDL3_to_IDL2/README +++ b/flat/CIAO/tools/IDL3_to_IDL2/README @@ -34,6 +34,16 @@ BACKEND OPTIONS: output directory, overriding the default, which is the directory of execution. +-x <filename> Excludes included IDL file <filename> from having its +corresponding include generated with an '_IDL2' suffix. This feature +is to be used when an included IDL file cannot or need not be +itself coverted by this tool. + +-e Generates a file foo_IDL2.idl from foo.idl that simply includes +foo.idl instead of generating its IDL declarations. Note that this +option takes effect only if foo.idl contains no 'IDL3' declarations, +otherwise it's a no-op. + CAVEAT: When using the TAO IDL compiler on files that are generated by this tool, diff --git a/flat/CIAO/tools/IDL3_to_IDL2/TAO_IDL3_TO_IDL2_BE_Export.h b/flat/CIAO/tools/IDL3_to_IDL2/TAO_IDL3_TO_IDL2_BE_Export.h index ca8bb4e2394..7b54e254326 100644 --- a/flat/CIAO/tools/IDL3_to_IDL2/TAO_IDL3_TO_IDL2_BE_Export.h +++ b/flat/CIAO/tools/IDL3_to_IDL2/TAO_IDL3_TO_IDL2_BE_Export.h @@ -2,22 +2,20 @@ // -*- C++ -*- // $Id$ // Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl +// This file is generated automatically by generate_export_file.pl TAO_IDL3_TO_IDL2_BE // ------------------------------ #ifndef TAO_IDL3_TO_IDL2_BE_EXPORT_H #define TAO_IDL3_TO_IDL2_BE_EXPORT_H #include "ace/config-all.h" -#if defined (ACE_AS_STATIC_LIBS) -# if !defined (TAO_IDL3_TO_IDL2_BE_HAS_DLL) -# define TAO_IDL3_TO_IDL2_BE_HAS_DLL 0 -# endif /* ! TAO_IDL3_TO_IDL2_BE_HAS_DLL */ -#else -# if !defined (TAO_IDL3_TO_IDL2_BE_HAS_DLL) -# define TAO_IDL3_TO_IDL2_BE_HAS_DLL 1 -# endif /* ! TAO_IDL3_TO_IDL2_BE_HAS_DLL */ -#endif +#if defined (ACE_AS_STATIC_LIBS) && !defined (TAO_IDL3_TO_IDL2_BE_HAS_DLL) +# define TAO_IDL3_TO_IDL2_BE_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && TAO_IDL3_TO_IDL2_BE_HAS_DLL */ + +#if !defined (TAO_IDL3_TO_IDL2_BE_HAS_DLL) +# define TAO_IDL3_TO_IDL2_BE_HAS_DLL 1 +#endif /* ! TAO_IDL3_TO_IDL2_BE_HAS_DLL */ #if defined (TAO_IDL3_TO_IDL2_BE_HAS_DLL) && (TAO_IDL3_TO_IDL2_BE_HAS_DLL == 1) # if defined (TAO_IDL3_TO_IDL2_BE_BUILD_DLL) @@ -35,6 +33,26 @@ # define TAO_IDL3_TO_IDL2_BE_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) #endif /* TAO_IDL3_TO_IDL2_BE_HAS_DLL == 1 */ +// Set TAO_IDL3_TO_IDL2_BE_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (TAO_IDL3_TO_IDL2_BE_NTRACE) +# if (ACE_NTRACE == 1) +# define TAO_IDL3_TO_IDL2_BE_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define TAO_IDL3_TO_IDL2_BE_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !TAO_IDL3_TO_IDL2_BE_NTRACE */ + +#if (TAO_IDL3_TO_IDL2_BE_NTRACE == 1) +# define TAO_IDL3_TO_IDL2_BE_TRACE(X) +#else /* (TAO_IDL3_TO_IDL2_BE_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define TAO_IDL3_TO_IDL2_BE_TRACE(X) ACE_TRACE_IMPL(X) +# include "ace/Trace.h" +#endif /* (TAO_IDL3_TO_IDL2_BE_NTRACE == 1) */ + #endif /* TAO_IDL3_TO_IDL2_BE_EXPORT_H */ // End of auto generated file. diff --git a/flat/CIAO/tools/IDL3_to_IDL2/basic_visitor.cpp b/flat/CIAO/tools/IDL3_to_IDL2/basic_visitor.cpp index 1d9b0f6f2cc..a444f67794c 100644 --- a/flat/CIAO/tools/IDL3_to_IDL2/basic_visitor.cpp +++ b/flat/CIAO/tools/IDL3_to_IDL2/basic_visitor.cpp @@ -398,7 +398,7 @@ basic_visitor::visit_enum (AST_Enum *node) *os << be_nl; AST_EnumVal *ev = AST_EnumVal::narrow_from_decl (i.item ()); - + *os << IdentifierHelper::try_escape (ev->original_local_name ()).c_str (); // Advance here so the check below will work. @@ -506,7 +506,7 @@ basic_visitor::visit_union (AST_Union *node) << "union " << IdentifierHelper::try_escape (node->original_local_name ()).c_str () << " switch ("; - + *os << this->type_name (node->disc_type ()) << ")" << be_nl << "{" << be_idt; @@ -1021,12 +1021,12 @@ basic_visitor::gen_label_value (AST_UnionLabel *node) { *os << IdentifierHelper::orig_sn (ScopeAsDecl (s)->name ()).c_str () << "::"; - + Identifier *id = IdentifierHelper::original_local_name (val->n ()->last_component ()); *os << IdentifierHelper::try_escape (id).c_str (); - + id->destroy (); delete id; id = 0; @@ -1057,7 +1057,7 @@ basic_visitor::gen_label_value (AST_UnionLabel *node) case AST_Expression::EV_ulonglong: #if ! defined (ACE_LACKS_LONGLONG_T) *os << "ACE_UINT64_LITERAL ("; - this->os->print (ACE_UINT64_FORMAT_SPECIFIER, ev->u.ullval); + this->os->print (ACE_UINT64_FORMAT_SPECIFIER_ASCII, ev->u.ullval); *os << ")"; #endif /* ! defined (ACE_LACKS_LONGLONG_T) */ break; @@ -1093,7 +1093,7 @@ basic_visitor::can_skip_module (AST_Module *m) { AST_Decl *d = si.item (); AST_Decl::NodeType nt = d->node_type (); - + switch (nt) { case AST_Decl::NT_interface: @@ -1107,14 +1107,14 @@ basic_visitor::can_skip_module (AST_Module *m) { break; } - + return false; case AST_Decl::NT_module: if (!this->can_skip_module (AST_Module::narrow_from_decl (d))) { return false; } - + break; default: break; @@ -1127,25 +1127,25 @@ basic_visitor::can_skip_module (AST_Module *m) bool basic_visitor::match_excluded_file (const char *raw_filename) { - size_t p = 0; + ACE_CString::size_type p = 0; // If this included IDL file matches one of the 'excluded' files, // generate the include without tacking on the suffix. - while (p != static_cast<size_t> (ACE_CString::npos)) + while (p != ACE_CString::npos) { - size_t cursor = p; + ACE_CString::size_type cursor = p; p = be_global->excluded_filenames ().find (' ', cursor); - + ACE_CString one_filename = be_global->excluded_filenames ().substr (cursor, p - cursor); - + if (one_filename == raw_filename) { return true; } - - // Skip the whitespace. - if (p != static_cast<size_t> (ACE_CString::npos)) + + // Skip the whitespace. + if (p != ACE_CString::npos) { while (be_global->excluded_filenames ()[p] == ' ') { @@ -1153,6 +1153,6 @@ basic_visitor::match_excluded_file (const char *raw_filename) } } } - + return false; } diff --git a/flat/CIAO/tools/IDL3_to_IDL2/be_extern.h b/flat/CIAO/tools/IDL3_to_IDL2/be_extern.h index 472600e9d8b..c7dc3daaf41 100644 --- a/flat/CIAO/tools/IDL3_to_IDL2/be_extern.h +++ b/flat/CIAO/tools/IDL3_to_IDL2/be_extern.h @@ -76,7 +76,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. extern TAO_IDL3_TO_IDL2_BE_Export BE_GlobalData *be_global; -extern TAO_IDL3_TO_IDL2_BE_Export int BE_init (int &, char*[]); +extern TAO_IDL3_TO_IDL2_BE_Export int BE_init (int &, ACE_TCHAR*[]); extern TAO_IDL3_TO_IDL2_BE_Export void BE_post_init (char *[], long); extern TAO_IDL3_TO_IDL2_BE_Export void BE_version (void); extern TAO_IDL3_TO_IDL2_BE_Export void BE_produce (void); diff --git a/flat/CIAO/tools/IDL3_to_IDL2/be_global.cpp b/flat/CIAO/tools/IDL3_to_IDL2/be_global.cpp index b84b1ac320e..4aa8ba19182 100644 --- a/flat/CIAO/tools/IDL3_to_IDL2/be_global.cpp +++ b/flat/CIAO/tools/IDL3_to_IDL2/be_global.cpp @@ -159,6 +159,11 @@ BE_GlobalData::usage (void) const ACE_TEXT (" -x <filename>\t\tIncluded IDL file that wasn't processed") ACE_TEXT (" by this tool (regenerate include directive unchanged)\n") )); + ACE_DEBUG (( + LM_DEBUG, + ACE_TEXT (" -e\t\t\tGenerate just an include of original IDL file") + ACE_TEXT (" if no IDL3 declarations are found\n") + )); } AST_Generator * diff --git a/flat/CIAO/tools/IDL3_to_IDL2/be_init.cpp b/flat/CIAO/tools/IDL3_to_IDL2/be_init.cpp index a7eaf1d2543..fe111e60a47 100644 --- a/flat/CIAO/tools/IDL3_to_IDL2/be_init.cpp +++ b/flat/CIAO/tools/IDL3_to_IDL2/be_init.cpp @@ -14,7 +14,7 @@ BE_version (void) } TAO_IDL3_TO_IDL2_BE_Export int -BE_init (int & /* argc */, char * /*argv */ []) +BE_init (int & /* argc */, ACE_TCHAR * /*argv */ []) { // Initialize BE global data object. ACE_NEW_RETURN (be_global, diff --git a/flat/CIAO/tools/IDL3_to_IDL2/be_produce.cpp b/flat/CIAO/tools/IDL3_to_IDL2/be_produce.cpp index 20781b61107..791be2e68ef 100644 --- a/flat/CIAO/tools/IDL3_to_IDL2/be_produce.cpp +++ b/flat/CIAO/tools/IDL3_to_IDL2/be_produce.cpp @@ -88,9 +88,8 @@ BE_abort (void) ACE_ERROR ((LM_ERROR, ACE_TEXT ("Fatal Error - Aborting\n"))); - BE_cleanup (); - - ACE_OS::exit (1); + // BE_cleanup will be called after the exception is caught. + throw Bailout (); } // Do the work of this BE. This is the starting point for code generation. diff --git a/flat/CIAO/tools/IDL3_to_IDL2/be_sunsoft.cpp b/flat/CIAO/tools/IDL3_to_IDL2/be_sunsoft.cpp index b2a25d255f7..78b439b5da6 100644 --- a/flat/CIAO/tools/IDL3_to_IDL2/be_sunsoft.cpp +++ b/flat/CIAO/tools/IDL3_to_IDL2/be_sunsoft.cpp @@ -30,7 +30,7 @@ TAO_SunSoft_OutStream::print (Identifier *id) { ACE_OS::fprintf (this->fp_, id->get_string ()); - + return *this; } @@ -63,7 +63,7 @@ TAO_SunSoft_OutStream::print (AST_Expression *expr) case AST_Expression::EV_ulonglong: #if ! defined (ACE_LACKS_LONGLONG_T) this->TAO_OutStream::print ("ACE_UINT64_LITERAL ("); - this->TAO_OutStream::print (ACE_UINT64_FORMAT_SPECIFIER, + this->TAO_OutStream::print (ACE_UINT64_FORMAT_SPECIFIER_ASCII, ev->u.ullval); this->TAO_OutStream::print (")"); #endif /* ! defined (ACE_LACKS_LONGLONG_T) */ diff --git a/flat/CIAO/tools/IDL3_to_IDL2/cdmw_idl.cpp b/flat/CIAO/tools/IDL3_to_IDL2/cdmw_idl.cpp deleted file mode 100644 index 4aa132a0208..00000000000 --- a/flat/CIAO/tools/IDL3_to_IDL2/cdmw_idl.cpp +++ /dev/null @@ -1,484 +0,0 @@ -// $Id$ - -/* ===================================================================== */ -/* - * This file is part of CARDAMOM (R) which is jointly developed by THALES - * and SELEX-SI. It is derivative work based on PERCO Copyright (C) THALES - * 2000-2003. All rights reserved. - * Copyright (C) THALES 2004-2005. All rights reserved. - * Copyright (C) SELEX-SI and THALES 2006. All rights reserved. - * - * CARDAMOM is free software; you can redistribute it and/or modify it - * under the terms of the GNU Library General Public License as published - * by the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * CARDAMOM is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - * License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with CARDAMOM; see the file COPYING. If not, write to the - * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ -/* ===================================================================== */ -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - -*/ - -#include "CdmwBEExtern.hpp" - -#include "global_extern.h" -#include "be_extern.h" -#include "fe_extern.h" -#include "ast_root.h" -#include "ast_extern.h" -#include "utl_string.h" -#include "drv_extern.h" -#include "tao/Version.h" - -#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) -// FUZZ: disable check_for_streams_include -# include "ace/streams.h" -#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ - -ACE_RCSID (TAO_IDL, - tao_idl, - "$Id$") - -char *DRV_files[NFILES]; -long DRV_nfiles = 0; -long DRV_file_index = -1; - -#ifndef TAO_CXX - // make a guess - #ifdef WIN32 - #ifdef _MSC_VER - #define TAO_CXX "Microsoft Visual C++" - #elif defined ( CYGWIN32 ) - #ifdef __GNUG__ - #define TAO_CXX "g++" - #else - #define TAO_CXX "unknown" - #endif - #endif - #elif defined ( __GNUG__ ) - #define TAO_CXX "g++" - #else - #define TAO_CXX "unknown" - #endif -#endif - -#ifndef TAO_CXX_VERSION - // make a guess - #ifdef WIN32 - #ifdef _MSC_VER - #if _MSC_VER < 1300 - #define TAO_CXX_VERSION "6.0" - #else - #define TAO_CXX_VERSION "7.1" - #endif - #elif defined ( CYGWIN32 ) - #ifdef __GNUG__ - #define TAO_CXX_VERSION __VERSION__ - #else - #define TAO_CXX_VERSION "unknown" - #endif - #else - #define TAO_CXX_VERSION "unknown" - #endif - #elif defined ( __GNUG__ ) - #define TAO_CXX_VERSION __VERSION__ - #else - #define TAO_CXX_VERSION "unknown" - #endif -#endif - -#ifndef TAO_PLATFORM - // make a guess - #ifdef WIN32 - #ifdef _MSC_VER - #define TAO_PLATFORM "Microsoft Win32" - #elif defined ( CYGWIN32 ) - #define TAO_PLATFORM "Cygwin" - #else - #define TAO_PLATFORM "unknown" - #endif - #else - #define TAO_PLATFORM "unknown" - #endif -#endif - -#ifndef TAO_PROJECT_CONFIGURATION - #ifdef __ACE_INLINE__ - #define TAO_PROJECT_CONFIGURATION "inline" - #else - #ifdef ACE_NDEBUG - #define TAO_PROJECT_CONFIGURATION "standard" - #else - #define TAO_PROJECT_CONFIGURATION "debug" - #endif - #endif -#endif - -void -DRV_version (void) -{ - char build_compiler[] = - TAO_CXX - " " - TAO_CXX_VERSION - ; - - char build_platform[] = - TAO_PLATFORM - ; - - char build_libtype[] = - TAO_PROJECT_CONFIGURATION - ; - - ACE_DEBUG ((LM_DEBUG, - "%s\n" - "%s %s (%s %s)\n" - "%s\n" - "%s\n" - " %s %s\n %s %s\n" - " %s %s\n %s %s\n", - idl_global->prog_name (), - ACE_TEXT ("TAO_IDL_FE, version"), - ACE_TEXT (TAO_VERSION), - ACE_TEXT ("Based on Sun IDL FE, version"), - ACE_TEXT (SUN_IDL_FE_VERSION), - ACE_TEXT ("PrismTech Build No: 070308 "), - ACE_TEXT ("PrismTech Version No: TAO 1.5.1.1"), - ACE_TEXT ("PreProcessor is"), - idl_global->cpp_location (), - ACE_TEXT ("Compiler is"), - build_compiler, - ACE_TEXT ("Platform is"), - build_platform, - ACE_TEXT ("Library is"), - build_libtype)); - - CdmwBE_version (); -} - -int -DRV_init (int &argc, char *argv[]) -{ - // Initialize BE. - FE_init (); - - // Initialize driver private data - DRV_nfiles = 0; - DRV_file_index = 0; - -#if defined (TAO_IDL_PREPROCESSOR) - idl_global->set_cpp_location (TAO_IDL_PREPROCESSOR); -#elif defined (ACE_CC_PREPROCESSOR) - idl_global->set_cpp_location (ACE_CC_PREPROCESSOR); -#else - // Just default to cc - idl_global->set_cpp_location ("cc"); -#endif /* TAO_IDL_PREPROCESSOR */ - - // Does nothing for IDL compiler, stores -ORB args, initializes - // ORB and IFR for IFR loader. - return CdmwBE_init (argc, argv); -} - -void -DRV_refresh (void) -{ - idl_global->set_err_count (0); - idl_global->set_filename (0); - idl_global->set_main_filename (0); - idl_global->set_real_filename (0); - idl_global->set_stripped_filename (0); -// idl_global->set_import (true); -// idl_global->set_in_main_file (false); - idl_global->set_lineno (-1); - idl_global->reset_flag_seen (); -} - -/* -** Drive the compilation -** -** LOGIC: -** -** 2. Initialize the BE. This builds an instance of the generator -** 3. Initialize the FE. This builds the global scope -** and populates it with the predefined types -** 4. Invoke FE_yyparse -** 5. Check for errors from FE_yyparse. If any, exit now -** 6. Check for undefined forward declared interfaces. If any, exit now -** 7. Check if asked to dump AST. If so, do. -** 8. Invoke BE. -*/ - -void -DRV_drive (const char *s) -{ - // Set the name of the IDL file we are parsing. This is useful to - // the backend when it generates C++ headers and files. - UTL_String *src_file = 0; - ACE_NEW (src_file, - UTL_String (s)); - - idl_global->idl_src_file (src_file); - - // Pass through CPP. - if (idl_global->compile_flags () & IDL_CF_INFORMATIVE) - { - ACE_DEBUG ((LM_DEBUG, - "%s%s %s\n", - idl_global->prog_name (), - ACE_TEXT (": preprocessing"), - s)); - } - - DRV_pre_proc (s); - - // Parse. - if (idl_global->compile_flags () & IDL_CF_INFORMATIVE) - { - ACE_DEBUG ((LM_DEBUG, - "%s%s %s\n", - idl_global->prog_name(), - ACE_TEXT (": parsing"), - s)); - } - - FE_yyparse (); - - // We must do this as late as possible to make sure any - // forward declared structs or unions contained in a - // primary key at some level have been fully defined. - idl_global->check_primary_keys (); - - // If there were any errors, stop. - if (idl_global->err_count () > 0) - { - ACE_ERROR ((LM_ERROR, - "%s%s %s%s %d %s%s\n", - idl_global->prog_name (), - ACE_TEXT (":"), - s, - ACE_TEXT (": found"), - idl_global->err_count (), - ACE_TEXT ("error"), - ACE_TEXT ((idl_global->err_count () > 1 - ? ACE_TEXT ("s") - : ACE_TEXT (""))))); - - // Call BE_abort to allow a BE to clean up after itself. - CdmwBE_abort (); - - ACE_OS::exit (static_cast<int> (idl_global->err_count ())); - } - - // Dump the code. - if ((idl_global->compile_flags () & IDL_CF_INFORMATIVE) - && (idl_global->compile_flags () & IDL_CF_DUMP_AST)) - { - ACE_DEBUG ((LM_DEBUG, - "%s%s %s\n", - idl_global->prog_name (), - ACE_TEXT (": dump"), - s)); - } - - if (idl_global->compile_flags () & IDL_CF_DUMP_AST) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Dump of AST:\n"))); - - idl_global->root ()->dump (*ACE_DEFAULT_LOG_STREAM); - } - - // Call the main entry point for the BE. - if (idl_global->compile_flags () & IDL_CF_INFORMATIVE) - { - ACE_DEBUG ((LM_DEBUG, - "%s%s %s\n", - idl_global->prog_name (), - ACE_TEXT (": BE processing on"), - s)); - } - - // Make sure all forward declared structs and unions are defined - // before proceeding to code generation. - AST_check_fwd_decls (); - long error_count = idl_global->err_count (); - - if (error_count == 0) - { - CdmwBE_produce (); - } - else - { - ACE_OS::exit (static_cast<int> (error_count)); - } - - DRV_refresh (); -} - -/* -** LOGIC: -** -** 1. Initialize compiler driver -** 2. Parse command line args -** 3. If more than one file to parse, fork -** 4. Otherwise, for the single file, invoke DRV_drive -*/ - -int -ACE_TMAIN (int argc, ACE_TCHAR *argv[]) -{ - // Initialize driver and global variables. - int init_status = DRV_init (argc, argv); - - if (init_status != 0) - { - ACE_OS::exit (init_status); - } - - // Parse arguments. - DRV_parse_args (argc, argv); - - // If a version message is requested, print it and exit. - if (idl_global->compile_flags () & IDL_CF_VERSION) - { - DRV_version (); - ACE_OS::exit (0); - } - - // If a usage message is requested, give it and exit. - if (idl_global->compile_flags () & IDL_CF_ONLY_USAGE) - { - DRV_usage (); - ACE_OS::exit (0); - } - - // If there are no input files, and we are not using the - // directory recursion option, there's no sense going any further. - if (DRV_nfiles == 0 && idl_global->recursion_start () == 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("IDL: No input files\n"))); - - ACE_OS::exit (99); - } - - AST_Generator *gen = be_global->generator_init (); - - if (gen == 0) - { - ACE_ERROR (( - LM_ERROR, - ACE_TEXT ("IDL: DRV_generator_init() failed to create ") - ACE_TEXT ("generator, exiting\n") - )); - - ACE_OS::exit (99); - } - else - { - idl_global->set_gen (gen); - } - - // Initialize AST and load predefined types. - FE_populate (); - - // Does various things in various backends. - CdmwBE_post_init (DRV_files, DRV_nfiles); - - for (DRV_file_index = 0; - DRV_file_index < DRV_nfiles; - ++DRV_file_index) - { - DRV_drive (DRV_files[DRV_file_index]); - } - - cdmw_be_global->destroy (); - delete cdmw_be_global; - cdmw_be_global = 0; - - idl_global->fini (); - delete idl_global; - idl_global = 0; - - for (DRV_file_index = 0; - DRV_file_index < DRV_nfiles; - ++DRV_file_index) - { - ACE::strdelete (DRV_files[DRV_file_index]); - } - - ACE_OS::exit (0); - - // NOT REACHED - return 0; -} diff --git a/flat/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp b/flat/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp index 25575cc8496..d443365a105 100644 --- a/flat/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp +++ b/flat/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp @@ -314,10 +314,7 @@ idl3_to_idl2_visitor::visit_home (AST_Home *node) *os << be_uidt_nl << "};" << be_nl << be_nl; - // (@@@ JP) A hack for now, eventually some redesign will be - // necessary to take into account the fact that other visitors - // may execute after this one. - // xplicit.destroy (); + xplicit.destroy (); sn->destroy (); delete sn; sn = 0; @@ -404,24 +401,21 @@ idl3_to_idl2_visitor::visit_root (AST_Root *node) } ACE_CString filename; - - *os << be_nl << be_nl - << "#include \"Components.idl\""; for (size_t i = 0; i < idl_global->n_included_idl_files (); ++i) { - ACE_CString raw_filename = idl_global->included_idl_files ()[i]; - - if (raw_filename == "Components.idl") + if (i == 0) { - continue; + *os << be_nl; } - + + ACE_CString raw_filename = idl_global->included_idl_files ()[i]; bool excluded_file_found = this->match_excluded_file (raw_filename.c_str ()); if (raw_filename.find (".pidl") != ACE_CString::npos || raw_filename == "orb.idl" + || raw_filename == "Components.idl" || excluded_file_found) { filename = raw_filename; |