X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkInterpreter.cxx;h=ced11fa92b8f849e14231a4f293fb75c624e1ff8;hb=66a4f54ebee938164be7a0ff849832dd4ae1cd48;hp=35572dfaf3f4f0be5a58c8e10ac55ba1b0f7b9c8;hpb=a27f0e31cdca2d167c01323443eac3397a0c6fea;p=bbtk.git diff --git a/kernel/src/bbtkInterpreter.cxx b/kernel/src/bbtkInterpreter.cxx index 35572df..ced11fa 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/02/14 11:26:43 $ - Version: $Revision: 1.31 $ + Date: $Date: 2008/02/18 10:41:02 $ + Version: $Revision: 1.33 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -26,6 +26,7 @@ #include "bbtkWxConsole.h" #include "bbtkUtilities.h" #include +#include #ifdef CMAKE_HAVE_TERMIOS_H #include #define BBTK_USE_TERMIOS_BASED_PROMPT @@ -52,10 +53,12 @@ Interpreter* Interpreter::mGlobalInterpreter = NULL; mGlobalInterpreter = this; - // mFactory = new bbtk::Factory(); mExecuter = new bbtk::Executer(); + + // For the time being, comment out previous line, and + // uncomment next line to check Transcriptor + //mExecuter = new bbtk::Transcriptor("GeneratedProgram.txt"); - //mExecuter->SetFactory(mFactory); // Builds the commands dict CommandInfoType info; @@ -305,8 +308,11 @@ Interpreter* Interpreter::mGlobalInterpreter = NULL; bool exm = mCommandLine; mCommandLine = false; + try { +printf("EED: Interpreter::InterpretFile 01\n"); +InterpretLine("message ALL 9", exm); SwitchToFile(filename, use_configuration_file); bool insideComment = false; // for multiline comment while (mFile.size()>0) @@ -364,6 +370,7 @@ Interpreter* Interpreter::mGlobalInterpreter = NULL; bbtkDecTab("Interpreter",9); mCommandLine = exm; + printf("EED: Interpreter::InterpretFile 02\n"); } //======================================================================= @@ -536,7 +543,7 @@ void Interpreter::InterpretLine( const std::string& line, bool &insideComment ) case cMessage : if (words.size()<3) { - bbtk::MessageManager::PrintInfo(); + bbtk::MessageManager::PrintInfo(); } else { @@ -582,6 +589,7 @@ void Interpreter::InterpretLine( const std::string& line, bool &insideComment ) break; case cQuit : + delete mExecuter; throw QuitException(); break; @@ -786,7 +794,7 @@ void Interpreter::SplitLine ( const std::string& str, std::vector& std::string path; std::vector::iterator i; std::string fullDirectoryName; - for (i=script_paths.begin();i!=script_paths.end();++i)// ==== relative name, iterate + load all .bbs files + for (i=script_paths.begin();i!=script_paths.end();i++)// ==== relative name, iterate + load all .bbs files { path = *i; @@ -800,8 +808,12 @@ void Interpreter::SplitLine ( const std::string& str, std::vector& fullDirectoryName = Utilities::MakePkgnameFromPath(path, upath, false); + //EED 18 Fev 2008 + // without last slash "\" + std::string fullDirectoryNameClean = fullDirectoryName.substr(0,fullDirectoryName.size()-1); + // Check if library exists - if ( ! Utilities::IsDirectory(fullDirectoryName) ) + if ( ! Utilities::IsDirectory( fullDirectoryNameClean ) ) { // The following is *NOT* a debug time message : // It's a user intended message. @@ -818,7 +830,6 @@ void Interpreter::SplitLine ( const std::string& str, std::vector& nbBssFiles = 0; for (std::vector::iterator i = Filenames.begin(); i!= Filenames.end(); ++i) { - if ((*i).substr((*i).size()-4, 4) != ".bbs") continue; // ignore non .bbs files LoadScript(*i,name);