Program: bbtk
Module: $RCSfile: bbtkInterpreter.cxx,v $ $
Language: C++
- Date: $Date: 2008/03/20 09:51:28 $
- Version: $Revision: 1.48 $
+ Date: $Date: 2008/03/20 11:04:57 $
+ Version: $Revision: 1.49 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
try
{
SwitchToFile(filename);
+
bool insideComment = false; // for multiline comment
while (mFile.size()>0)
{
if(pkgname == "*") // =========================================== load all boxes (e.g. std/boxes/*)
{
-// std::cout << "JPR================== * found, load all boxes " << std::endl;
int nbBssFiles;
std::stringstream* stream = new std::stringstream;
if (upath[0]=='/' || upath[1] == ':' ) // ==== absolute name, load all .bbs files
{
-// std::cout << "JPR================== absolute name, load all .bbs files " << std::endl;
int nbFiles = Utilities::Explore(upath, false, Filenames);
nbBssFiles = 0;
for (std::vector<std::string>::iterator i = Filenames.begin(); i!= Filenames.end(); ++i)
{
-// std::cout << "JPR================== iterate [" << *i << "]" << std::endl;
int lgr = (*i).size();
if (lgr < 5)
continue; // ignore non .bbs file
if ((*i).substr(lgr-4, 4) != ".bbs")
continue;
- /*
- if (lgr > 10) // 10 -> '-appli.bbs'
- {
- if ((*i).substr(lgr-10, 10) == "-appli.bbs")
- continue; // ignore '-appli.bbs' files
- }
- */
- (*stream) << "include " << *i << "\n";
-//EED InterpretFile(*i);
+ (*stream) << "include " << *i << "\n";
nbBssFiles++;
} // for vector
nbBssFiles = 0;
for (std::vector<std::string>::iterator i = Filenames.begin(); i!= Filenames.end(); ++i)
{
-// std::cout << "JPR================== iterate [" << *i << "]" << std::endl;
int lgr = (*i).size();
if (lgr < 5)
continue; // ignore non .bbs file
if ((*i).substr(lgr-4, 4) != ".bbs")
continue;
- /*
- if (lgr > 10) // 10 -> '-appli.bbs'
- {
- if ((*i).substr(lgr-10, 10) == "-appli.bbs")
- continue; // ignore '-appli.bbs' files
- }
- */
-
- (*stream) << "include " << *i << "\n";
-//EED InterpretFile(*i);
+ (*stream) << "include " << *i << "\n";
nbBssFiles++;
} // for vector
if (nbBssFiles==0){
return;
} // if *
- //std::string::size_type slash_position = name.find_last_of("/\\");
-
// if name starts with a / or a . or contains : user is assumed to have passed a relative/absolute name
// (not only a plain script name)
// we trust him, and try to expland the directory name
// The following is *NOT* a debug time message :
// It's a user intended message.
// Please don't remove it.
- bbtkMessage("Interpreter",2,
- " [" <<fullPathScriptName <<"] : doesn't exist"
- <<std::endl);
+ bbtkMessage("Interpreter",2,
+ " [" <<fullPathScriptName <<"] : doesn't exist"
+ <<std::endl);
continue; // try next path
}
bbtkMessage("Interpreter",2,
void Interpreter::SwitchToStream( std::stringstream* stream )
{
-//std::cout << "== 1 Entry in Interpreter::SwitchToStream " << std::endl;
-
- mFile.push_back(stream);
- //std::cout << " mFile.size() " << mFile.size() << std::endl;
+ mFile.push_back(stream);
std::ostringstream buffer_name;
bufferNb++;
- buffer_name << "buffer_" ; // << bufferNb;
-
-// std::cout << " mFile.size() " << mFile.size() << std::endl;
-// std::cout << " mFileName.size() " << mFileName.size() << std::endl;
-// std::cout << " mLine.size() " << mLine.size() << std::endl;
- // std::vector<std::string>::iterator j = mFileName.begin();
- // std::cout << " mFileName.begin() succeeded" << std::endl;
- // std::cout << " mFileName[0] " << mFileName[0] << std::endl;
- //std::cout << " mFileName.begin() " << mFileName.begin() << std::endl;
-/*
- for( std::vector<std::string>::iterator i = mFileName.begin(); i!= mFileName.end(); ++i)
- {
-
- std::cout << "Interpreter::SwitchToStream : mFileName [" << *i << "]" << std::endl;
- }
-*/
- // std::cout << " mLine.back() " << mLine.back() << std::endl;
- // std::cout << " mFileName.back() " << mFileName.back() << std::endl;
+ buffer_name << "buffer_" ;
- if (mFileName.size()>0 )// && (mFile.size()>0) ) // NO!!!
+ if (mFileName.size()>0 )
{
- // std::cout << " mFileName.back() " << mFileName.back() << std::endl;
- // std::cout << " mLine.back() " << mLine.back() << std::endl;
buffer_name << mFileName.back() << "_" << mLine.back();
}
-//std::cout << "3 in Interpreter::SwitchToStream buffer_name :[" << buffer_name.str() << "]" << std::endl;
mFileName.push_back(buffer_name.str());
mIncludeFileName.push_back(buffer_name.str());
mLine.push_back(0);
Program: bbtk
Module: $RCSfile: bbtkWxGUIConsole.cxx,v $
Language: C++
- Date: $Date: 2008/03/20 09:51:29 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2008/03/20 11:04:57 $
+ Version: $Revision: 1.2 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//================================================================
void WxGUIConsole::OnButtonRun(wxCommandEvent& WXUNUSED(event))
{
- std::string filename = wx2std(mWxGUIHtmlBrowser->GetCurrentPage());
+// wxString temp = mWxGUIHtmlBrowser->GetCurrentPage();
+ std::string filename = mWxGUIHtmlBrowser->GetCurrentPage();//wx2std(temp);
size_t s = filename.length();
Interpreter* I = new Interpreter;
&& (filename[s-3]=='b')
&& (filename[s-4]=='.'))
{
- SetStatusText(_T("Executing ")+filename);
+ std::string tmp("Executing ");
+ tmp += filename;
+ SetStatusText(std2wx(tmp));
I->InterpretFile(filename);
}
else