[opengtl-commits] [741] no more of the non sense of forward declaration

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 741
Author:   cyrille
Date:     2009-05-26 15:10:32 +0200 (Tue, 26 May 2009)

Log Message:
-----------
no more of the non sense of forward declaration

Modified Paths:
--------------
    trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/GenerationContext_p.cpp
    trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/GenerationContext_p.h
    trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateAST.cpp


Modified: trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/GenerationContext_p.cpp
===================================================================
--- trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/GenerationContext_p.cpp	2009-05-26 13:08:09 UTC (rev 740)
+++ trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/GenerationContext_p.cpp	2009-05-26 13:10:32 UTC (rev 741)
@@ -37,7 +37,6 @@
 }
 
 void TemplateGenerationContext::mergeLocalContext(TemplateGenerationContext* _localContext) {
-  append(_localContext->m_forward);
   append(_localContext->code());
   delete _localContext;
 }
@@ -46,11 +45,6 @@
   m_code.append(_c);
 }
 
-void TemplateGenerationContext::appendForward(const GTLCore::String& _c) {
-  GTL_ASSERT(m_isLocalContext);
-  m_forward.append(_c);
-}
-
 const GTLCore::String& TemplateGenerationContext::code() const {
   return m_code;
 }
@@ -59,23 +53,6 @@
   return m_pixelDescription;
 }
 
-void TemplateGenerationContext::startOperation() {
-  m_registeredVariables.clear();
-}
-
-void TemplateGenerationContext::registerVariable( const GTLCore::String& variable) {
-  GTL_ASSERT(not isAllreadyRegistered( variable ) );
-  m_registeredVariables.push_back(variable);
-}
-
-bool TemplateGenerationContext::isAllreadyRegistered( const GTLCore::String& variable) const {
-  foreach( const GTLCore::String& string, m_registeredVariables)
-  {
-    if( string == variable ) return true;
-  }
-  return false;
-}
-
 const GTLCore::String& TemplateGenerationContext::suffix() const {
   GTL_ASSERT(m_isLocalContext);
   return m_suffix;

Modified: trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/GenerationContext_p.h
===================================================================
--- trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/GenerationContext_p.h	2009-05-26 13:08:09 UTC (rev 740)
+++ trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/GenerationContext_p.h	2009-05-26 13:10:32 UTC (rev 741)
@@ -29,23 +29,17 @@
       TemplateGenerationContext* createLocalContext(const GTLCore::String& suffix, int _currentChannel);
       void mergeLocalContext(TemplateGenerationContext* );
       void append(const GTLCore::String& _c);
-      void appendForward(const GTLCore::String& _c);
       const GTLCore::String& code() const;
       const GTLCore::PixelDescription& pixelDescription() const;
-      void startOperation();
-      void registerVariable( const GTLCore::String& variable);
-      bool isAllreadyRegistered( const GTLCore::String& variable) const;
       const GTLCore::String& suffix() const;
       int currentChannel() const;
       const GTLCore::Type* currentChannelType() const;
     private:
       GTLCore::String m_code;
-      GTLCore::String m_forward;
       bool m_isLocalContext;
       GTLCore::String m_suffix;
       int m_currentChannel;
       GTLCore::PixelDescription m_pixelDescription;
-      std::list< GTLCore::String > m_registeredVariables;
   };
 }
 

Modified: trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateAST.cpp
===================================================================
--- trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateAST.cpp	2009-05-26 13:08:09 UTC (rev 740)
+++ trunk/OpenGTL/OpenCTL/OpenCTL/templatecompiler/TemplateAST.cpp	2009-05-26 13:10:32 UTC (rev 741)
@@ -180,7 +180,6 @@
   }
   header += "," + outHeader + " )";
   _context->append(header);
-  _context->startOperation();
 }
 
 AllChannelsNode::AllChannelsNode( NodesList* _nodesList, WhichChannel _whichChannel ) : m_nodesList(_nodesList), m_whichChannel(_whichChannel) {
@@ -226,11 +225,6 @@
 
 void VarNode::generate(TemplateGenerationContext* _context) {
   GTLCore::String realname = m_name + _context->suffix();
-  if(not _context->isAllreadyRegistered(realname))
-  {
-    _context->registerVariable(realname);
-    _context->appendForward( typeToString(_context->currentChannelType()) + " " + realname + ";" );
-  }
   _context->append(realname);
 }
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/