]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkInterpreter.cxx
Premiere phase resolution du pb 'Print'
[bbtk.git] / kernel / src / bbtkInterpreter.cxx
index c572234691dbe69bb29dea3c1a2779d03f736467..d563f1989422be408919d81226e9280d42c23d6c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.cxx,v $ $
   Language:  C++
-  Date:      $Date: 2008/03/03 08:06:36 $
-  Version:   $Revision: 1.37 $
+  Date:      $Date: 2008/03/03 11:43:52 $
+  Version:   $Revision: 1.38 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -58,7 +58,7 @@ Interpreter* Interpreter::mGlobalInterpreter = NULL;
     // For the time being, comment out previous line, and
     // uncomment next line to check Transcriptor
 
-   // mExecuter = new bbtk::Transcriptor("GeneratedProgram.txt");
+    //mExecuter = new bbtk::Transcriptor("GeneratedProgram.txt");
 
     // Builds the commands dict
     CommandInfoType info;
@@ -287,6 +287,8 @@ Interpreter* Interpreter::mGlobalInterpreter = NULL;
    */
   Interpreter::~Interpreter()
   {
+
+std::cout << "=========================================~Interpreter()" << std::endl;
     bbtkDebugMessageInc("Interpreter",9,"Interpreter::~Interpreter()" <<std::endl);
     delete mExecuter;
     //delete mFactory;
@@ -483,7 +485,7 @@ void Interpreter::InterpretLine( const std::string& line, bool &insideComment )
         break;
 
       case cPrint :
-        Print(words[1]); /// \todo use mExecuter 
+        Print(words[1]); /// \todo use generate command 
         break;
         
       case cExec :
@@ -674,7 +676,15 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
   {
     if (mExecuter->GetNoExecMode()) return;
 
-    bbtkDebugMessageInc("Interpreter",9,"Interpreter::SplitLine(\""<<str<<"\")"<<std::endl);
+    bbtkDebugMessageInc("Interpreter",9,"Interpreter::Print(\""<<str<<"\")"<<std::endl);
+
+ // TO DO :
+ // InterpretLine ("load std")
+ // InterpretLine("new ConcatStrings _C_ ") -> trouver un nom unique : # commande 
+ // InterpretLine("new Print _P_") 
+ // InterpretLine("connect _C_.Out _P_.In")
+ // int num = 1
 
     std::vector<std::string> chains;
     std::string delimiters("$");
@@ -693,14 +703,21 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
        {
           // Found a text token, add it to the vector.
           chains.push_back(str.substr(lastPos, pos - lastPos));
+ // std::string token = str.substr(lastPos, pos - lastPos)
+ // InterpretLine("set _C_.In%num% %token%")
        }
        else 
        {
+
        // is an output (between $$) : decode 
          std::string tok,box,output;
          tok = str.substr(lastPos, pos - lastPos);
          Utilities::SplitAroundFirstDot(tok,box,output);
          chains.push_back( mExecuter->Get(box,output) );
+
+// InterpretLine("connect %tok% _C_.In%num%") 
+
        }
         // Skip delimiters.  Note the "not_of"
        lastPos = str.find_first_not_of(delimiters, pos);
@@ -708,7 +725,11 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
        pos = str.find_first_of(delimiters, lastPos);
     //
        is_text = !is_text;
+// num ++;
      }
+// InterpretLine("exec _P_")
+// if (IS_IN_WORKSPACE) InterpretLine("delete _C_; delete _P_");
+
      std::vector<std::string>::iterator i;
      for (i= chains.begin(); i!=chains.end(); ++i) 
      {