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
// 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;
*/
Interpreter::~Interpreter()
{
+
+std::cout << "=========================================~Interpreter()" << std::endl;
bbtkDebugMessageInc("Interpreter",9,"Interpreter::~Interpreter()" <<std::endl);
delete mExecuter;
//delete mFactory;
break;
case cPrint :
- Print(words[1]); /// \todo use mExecuter
+ Print(words[1]); /// \todo use generate command
break;
case cExec :
{
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("$");
{
// 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);
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)
{