Program: bbtk
Module: $RCSfile: bbtkInterpreter.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:13 $
- Version: $Revision: 1.77 $
+ Date: $Date: 2008/12/12 12:11:21 $
+ Version: $Revision: 1.79 $
=========================================================================*/
/* ---------------------------------------------------------------------
info.help = "Deletes the black box of name <box>";
mCommandDict[info.keyword] = info;
+ info.keyword = "clear";
+ info.argmin = 0;
+ info.argmax = 0;
+ info.code = cClear;
+ info.syntax = "clear";
+ info.help = "Clears the currently defined complex box (deletes all its boxes and connections)";
+ mCommandDict[info.keyword] = info;
+
info.keyword = "newgui";
info.argmin = 2;
info.argmax = 2;
mScriptLine(script_line)
{
}
+ //=======================================================================
+ void Interpreter::CatchInterpreterException( const InterpreterError& e )
+ {
+ if (mThrow)
+ {
+ CloseAllFiles();
+ throw InterpreterError(e);
+ }
+ else
+ {
+ std::stringstream mess;
+ mess << "* ERROR : "<<e.GetErrorMessage()<<std::endl;
+ if (e.IsInScriptFile())
+ {
+ mess << "* FILE : \""<<e.GetScriptFile()<<"\""<<std::endl;
+ mess << "* LINE : "<<e.GetScriptLine()<<std::endl;
+ }
+ std::cerr << mess.str();
+ }
+ }
+ //=======================================================================
+
//=======================================================================
void Interpreter::CatchBbtkException( const bbtk::Exception& e )
{
status = Interpreter_QUIT; \
if (mThrow) throw QuitException(); \
} \
+ catch (InterpreterError e) \
+ { \
+ status = Interpreter_ERROR; \
+ CatchInterpreterException(e); \
+ } \
catch (bbtk::Exception e) \
{ \
status = Interpreter_ERROR; \
Reset();
break;
+ case cClear :
+ mVirtualExecuter->Clear();
+ break;
+
case cInclude :
// if 'source' was given (words.size()==3) then tell to set the
// source file name of the current complex box with the full file name included