X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkInterpreter.cxx;h=d563f1989422be408919d81226e9280d42c23d6c;hb=487dbfe275c2c6fa7454a000503082bfca54396b;hp=c572234691dbe69bb29dea3c1a2779d03f736467;hpb=6b48f0355f01967bcbb5905116edcda8d261f6a5;p=bbtk.git diff --git a/kernel/src/bbtkInterpreter.cxx b/kernel/src/bbtkInterpreter.cxx index c572234..d563f19 100644 --- a/kernel/src/bbtkInterpreter.cxx +++ b/kernel/src/bbtkInterpreter.cxx @@ -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()" <& { if (mExecuter->GetNoExecMode()) return; - bbtkDebugMessageInc("Interpreter",9,"Interpreter::SplitLine(\""< trouver un nom unique : # commande + // InterpretLine("new Print _P_") + // InterpretLine("connect _C_.Out _P_.In") + // int num = 1 + std::vector chains; std::string delimiters("$"); @@ -693,14 +703,21 @@ void Interpreter::SplitLine ( const std::string& str, std::vector& { // 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& 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::iterator i; for (i= chains.begin(); i!=chains.end(); ++i) {