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/20 11:58:32 $
+ Version: $Revision: 1.35 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "bbtkWxConsole.h"
#include "bbtkUtilities.h"
#include <sys/stat.h>
+#include <algorithm>
#ifdef CMAKE_HAVE_TERMIOS_H
#include <termios.h>
#define BBTK_USE_TERMIOS_BASED_PROMPT
mGlobalInterpreter = this;
- // mFactory = new bbtk::Factory();
mExecuter = new bbtk::Executer();
- //mExecuter = new bbtk::Transcriptor("GeneratedProgram.txt");
- //mExecuter->SetFactory(mFactory);
+
+ // For the time being, comment out previous line, and
+ // uncomment next line to check Transcriptor
+
+ // mExecuter = new bbtk::Transcriptor("GeneratedProgram.txt");
// Builds the commands dict
CommandInfoType info;
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)
bbtkDecTab("Interpreter",9);
mCommandLine = exm;
+ printf("EED: Interpreter::InterpretFile 02\n");
}
//=======================================================================
case cMessage :
if (words.size()<3)
{
- bbtk::MessageManager::PrintInfo();
+ bbtk::MessageManager::PrintInfo();
}
else
{
break;
case cQuit :
+ delete mExecuter;
throw QuitException();
break;
std::string path;
std::vector<std::string>::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;
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.
nbBssFiles = 0;
for (std::vector<std::string>::iterator i = Filenames.begin(); i!= Filenames.end(); ++i)
{
-
if ((*i).substr((*i).size()-4, 4) != ".bbs")
continue; // ignore non .bbs files
LoadScript(*i,name);