]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkInterpreter.cxx
std2wx related troubles.
[bbtk.git] / kernel / src / bbtkInterpreter.cxx
index 690ddb857146f1595533294900d60d224877f5dc..39eb9ce948a2b55632a69945b8677661df6f5c22 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.cxx,v $ $
   Language:  C++
-  Date:      $Date: 2008/03/20 09:51:28 $
-  Version:   $Revision: 1.48 $
+  Date:      $Date: 2008/03/20 11:04:57 $
+  Version:   $Revision: 1.49 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -311,6 +311,7 @@ bufferNb =0;
     try 
     {
       SwitchToFile(filename);
+
       bool insideComment = false; // for multiline comment
       while (mFile.size()>0) 
       {
@@ -914,7 +915,6 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
 
     if(pkgname == "*") // =========================================== load all boxes (e.g. std/boxes/*)
     {
-// std::cout << "JPR==================  * found, load all boxes " << std::endl;
       int nbBssFiles;
 
       std::stringstream* stream = new std::stringstream;
@@ -922,27 +922,17 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
       
       if (upath[0]=='/' || upath[1] == ':' ) // ==== absolute name, load all .bbs files
       {
-// std::cout << "JPR==================  absolute name, load all .bbs files " << std::endl;      
         int nbFiles = Utilities::Explore(upath, false, Filenames);
         nbBssFiles = 0;
         for (std::vector<std::string>::iterator i = Filenames.begin(); i!= Filenames.end(); ++i)
         {
-// std::cout << "JPR==================  iterate [" << *i << "]" << std::endl;
            int lgr = (*i).size();
           if (lgr < 5)
              continue;  // ignore non .bbs file
            if ((*i).substr(lgr-4, 4) != ".bbs")
              continue;
-          /*
-          if (lgr > 10) // 10 -> '-appli.bbs'
-          {    
-           if ((*i).substr(lgr-10, 10) == "-appli.bbs")
-              continue;      // ignore  '-appli.bbs' files
-          }
-          */
 
-       (*stream) << "include " << *i << "\n";
-//EED  InterpretFile(*i);
+          (*stream) << "include " << *i << "\n";
 
            nbBssFiles++;
         } // for vector
@@ -994,23 +984,13 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
         nbBssFiles = 0;
         for (std::vector<std::string>::iterator i = Filenames.begin(); i!= Filenames.end(); ++i)
         {
-// std::cout << "JPR==================  iterate [" << *i << "]" << std::endl;
            int lgr = (*i).size();
           if (lgr < 5)
              continue;  // ignore non .bbs file
            if ((*i).substr(lgr-4, 4) != ".bbs")
              continue;
-           /*
-          if (lgr > 10) // 10 -> '-appli.bbs'
-          {    
-           if ((*i).substr(lgr-10, 10) == "-appli.bbs")
-              continue;      // ignore  '-appli.bbs' files
-          }
-          */
-
-      (*stream) << "include " << *i << "\n";
-//EED    InterpretFile(*i);
 
+           (*stream) << "include " << *i << "\n";
            nbBssFiles++;
         } // for vector
                if (nbBssFiles==0){
@@ -1027,8 +1007,6 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
        return;
     }  // if *
 
-    //std::string::size_type slash_position = name.find_last_of("/\\");
-
     // if name starts with a / or a . or contains : user is assumed to have passed a relative/absolute name
     // (not only a plain script name)
     // we trust him, and try to expland the directory name
@@ -1089,9 +1067,9 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
         // The following is *NOT* a debug time message :
         // It's a user intended message.
         // Please don't remove it.
-             bbtkMessage("Interpreter",2,
-                     "   [" <<fullPathScriptName <<"] : doesn't exist" 
-                     <<std::endl);
+           bbtkMessage("Interpreter",2,
+                       "   [" <<fullPathScriptName <<"] : doesn't exist" 
+                       <<std::endl);
           continue;  // try next path
         }
            bbtkMessage("Interpreter",2,
@@ -1123,38 +1101,15 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
 
 void Interpreter::SwitchToStream( std::stringstream* stream )
 {
-//std::cout << "== 1 Entry in Interpreter::SwitchToStream " << std::endl;
-
-       mFile.push_back(stream);
-    //std::cout << " mFile.size() " << mFile.size() << std::endl;
+    mFile.push_back(stream);
     std::ostringstream buffer_name;
     bufferNb++;
-    buffer_name << "buffer_" ; // << bufferNb;
-    
-//    std::cout << " mFile.size() "     << mFile.size() << std::endl;
-//    std::cout << " mFileName.size() " << mFileName.size() << std::endl;
-//    std::cout << " mLine.size() "     << mLine.size() << std::endl;
-   // std::vector<std::string>::iterator j = mFileName.begin();
-   //    std::cout << "  mFileName.begin() succeeded"  << std::endl;
-   //    std::cout << "  mFileName[0] " <<   mFileName[0] << std::endl;
-       //std::cout << "  mFileName.begin() " <<   mFileName.begin() << std::endl;
-/*
-    for( std::vector<std::string>::iterator i = mFileName.begin(); i!= mFileName.end(); ++i)
-    {
-
-       std::cout <<   "Interpreter::SwitchToStream : mFileName [" <<  *i << "]" << std::endl;
-    }
-*/
-  //  std::cout << " mLine.back() " << mLine.back() << std::endl;
-   // std::cout << " mFileName.back() " <<  mFileName.back() << std::endl;
+    buffer_name << "buffer_" ;
 
-    if (mFileName.size()>0 )// && (mFile.size()>0) )  // NO!!!
+    if (mFileName.size()>0 )
     {
-   // std::cout << "  mFileName.back() " <<  mFileName.back() << std::endl;
-   // std::cout << "  mLine.back() " <<  mLine.back() << std::endl;
        buffer_name << mFileName.back() << "_" << mLine.back();
     }
-//std::cout << "3 in Interpreter::SwitchToStream buffer_name :[" << buffer_name.str() << "]" << std::endl;
     mFileName.push_back(buffer_name.str());
     mIncludeFileName.push_back(buffer_name.str());
     mLine.push_back(0);