*/
-
}
//=======================================================================
//=======================================================================
void InterpreterVirtual::CatchUnknownException()
{
+printf("EED InterpreterVirtual::CatchUnknownException Start\n");
//EED Borrame if (GetExecuter()->GetNoErrorMode())
//EED Borrame {
//EED Borrame std::string file("?");
CloseAllFiles();
std::cerr << mess.str();
}
+printf("EED InterpreterVirtual::CatchUnknownException End\n");
}
//=======================================================================
//=======================================================================
-#define CATCH_MACRO \
- catch (InterpreterException e) \
- { \
- CatchInterpreterException(e); \
- } \
+#define CATCH_MACRO \
+ catch (InterpreterException e) \
+ { \
+ CatchInterpreterException(e); \
+ } \
catch (bbtk::Exception e) \
- { \
- CatchBbtkException(e); \
- } \
+ { \
+ CatchBbtkException(e); \
+ } \
catch (std::exception& e) \
- { \
+ { \
CatchStdException(e); \
- } \
- catch (...) \
- { \
- CatchUnknownException(); \
+ } \
+ catch (...) \
+ { \
+ CatchUnknownException(); \
}
//=======================================================================
//=======================================================================
- InterpreterVirtual::ExitStatus
- InterpreterVirtual::InterpretBuffer( std::stringstream* buffer )
+ InterpreterVirtual::ExitStatus InterpreterVirtual::InterpretBuffer( std::stringstream* buffer )
{
bbtkDebugMessage("interpreter",4,"==> InterpreterVirtual::InterpretBuffer()"<<std::endl);
mCommandLine = exm;
+
return mStatus;
}
//=======================================================================
//=======================================================================
void InterpreterVirtual::DoInterpretLine( const std::string& line )
- {
-
+ {
bbtkDebugMessage("interpreter",6,"==> InterpreterVirtual::DoInterpretLine(\""
<<line<<"\")"<<std::endl);
std::vector<std::string> words;
// break and quit commands
if ((command.code==cBreak) || (command.code==cQuit))
- {
- bool in_script = false;
- std::string file("");
- int line = 0;
-
- if (mFileName.size())
- {
- std::ifstream* fs = dynamic_cast<std::ifstream*>(mFile.back());
- if (fs!=0) in_script = true;
- file = mFileName.back();
- line = mLine.back();
- }
- if (command.code==cBreak)
+ {
+//EED-Borrame bool in_script = false;
+//EED-Borrame std::string file("");
+//EED-Borrame int line = 0;
+
+//EED-Borrame if (mFileName.size())
+//EED-Borrame {
+//EED-Borrame std::ifstream* fs = dynamic_cast<std::ifstream*>(mFile.back());
+//EED-Borrame if (fs!=0) in_script = true;
+//EED-Borrame file = mFileName.back();
+//EED-Borrame line = mLine.back();
+//EED-Borrame }
+ if (command.code==cBreak)
{
/*
std::cout << "BreakException("
commandBreak();
//EED Borrame bbtkError("break");//,in_script,file,line);
// throw BreakException(in_script,file,line);
- }
- else
- {
+ } else {
commandQuit();
//EED Borrame bbtkError("quit");//,in_script,file,line);
//throw QuitException(in_script,file,line);
- }
- return;
- }
+ } // cBreak
+ return;
+ } // cBreak cQuit
//std::cout<<" mVirtualExecuter->Create(words[1],words[2]); "<<line<<std::endl;
// other cammands
bbtkDebugMessage("interpreter",6,"<== InterpreterVirtual::DoInterpretLine(\""
<<line<<"\")"<<std::endl);
-
+
}
//=======================================================================
i++)
{
std::string full_path(*i);
-printf("EED InterpreterVirtual::SwitchToFile 1. >>%s\n", full_path.c_str() );
// we *really* want '.' to be the current working directory
if (full_path == ".")
{
std::vector<std::string>::iterator i;
for (i=script_paths.begin();i!=script_paths.end();i++)
{
-
-printf("EED InterpreterVirtual::SwitchToFile jaja >> %s\n", (*i).c_str() );
bbtkMessage("interpreter",1,
"--> Looking in '" << *i << "'" << std::endl);
for (std::vector<std::string>::iterator j = Filenames.begin();
j!= Filenames.end(); ++j)
{
-
-printf("EED InterpreterVirtual::SwitchToFile kkkkk >> %s\n", (*j).c_str() );
-
int lgr = (*j).size();
if (lgr < 5) continue;
// ignore non .bbp file
bbtkError("No ["<<pkgname<<".bbs/.bbp] script found");
return;
} else {
-//EED printf("EED D. SwitchToFile %s\n", fullPathScriptName.c_str() );
LoadScript(fullPathScriptName,name);
-//EED Borrame if (source) GetExecuter()->SetCurrentFileName(fullPathScriptName);
if (source)
{
// Over writing the fullpath of the bbp file.