Program: bbtk
Module: $RCSfile: bbtkInterpreter.cxx,v $
Language: C++
- Date: $Date: 2010/09/14 07:18:46 $
- Version: $Revision: 1.88 $
+ Date: $Date: 2010/09/15 14:17:17 $
+ Version: $Revision: 1.89 $
=========================================================================*/
/* ---------------------------------------------------------------------
GetExecuter()->UnLoadPackage(packageName);
}
- //ups2 EED Borrame
+ void Interpreter::commandBreak()
+ {
+ /*
+ std::cout << "BreakException("
+ <<in_script<<","
+ <<file<<","
+ <<line<<")"<<std::endl;
+ */
+ bbtkError("break");//,in_script,file,line);
+ // throw BreakException(in_script,file,line);
+ }
+
+ void Interpreter::commandQuit()
+ {
+ bbtkError("quit");//,in_script,file,line);
+ //throw QuitException(in_script,file,line);
+ }
+
+ void Interpreter::commandMessage()
+ {
+ mVirtualExecuter->HelpMessages();
+ }
+
+//ups2 EED Borrame
+ void Interpreter::commandMessage(std::string kind, std::string levelstr)
+ {
+ int level=0;
+ sscanf(levelstr.c_str(),"%d",&level);
+ mVirtualExecuter->SetMessageLevel(kind,level);
+
+ }
+
//=======================================================================
bbtkDebugMessage("interpreter",9,
"Command='"<<command.keyword
<<"' code="<<command.code<<std::endl);
- int level=0;
+
std::string left,right,left2,right2;
std::string filename;
+//ups1 EED borrame
// message command
if (command.code==cMessage)
{
if (words.size()<3)
{
- mVirtualExecuter->HelpMessages();
+ commandMessage();
+//EED Borrame mVirtualExecuter->HelpMessages();
}
else
{
- sscanf(words[2].c_str(),"%d",&level);
- mVirtualExecuter->SetMessageLevel(words[1],level);
+ commandMessage(words[1],words[2]);
+//EED Borrame sscanf(words[2].c_str(),"%d",&level);
+//EED Borrame mVirtualExecuter->SetMessageLevel(words[1],level);
}
return;
}
<<file<<","
<<line<<")"<<std::endl;
*/
- bbtkError("break");//,in_script,file,line);
+ commandBreak();
+//EED Borrame bbtkError("break");//,in_script,file,line);
// throw BreakException(in_script,file,line);
}
else
{
- bbtkError("quit");//,in_script,file,line);
+ commandQuit();
+//EED Borrame bbtkError("quit");//,in_script,file,line);
//throw QuitException(in_script,file,line);
}
return;
case cSet :
Utilities::SplitAroundFirstDot(words[1],left,right);
- commandSet(left,right,words[1]);
+ commandSet(left,right,words[2]);
//EED Borrame mVirtualExecuter->Set(left,right,words[2]);
break;
break;
case cNewGUI :
- NewGUI(words[1],words[2]);
+ commandNewGUI(words[1],words[2]);
break;
case cCategory :
case cIndex :
if (words.size()==1)
- Index("tmp_index.html");
+ commandIndex("tmp_index.html");
else if (words.size()==2)
- Index(words[1]);
+ commandIndex(words[1]);
else if (words.size()==3)
- Index(words[1],words[2]);
+ commandIndex(words[1],words[2]);
break;
case cDescription :
break;
case cHelp :
- Help(words);
+ commandHelp(words);
break;
case cGraph :
- Graph(words);
+ commandGraph(words);
break;
case cConfig :
- Config();
+ commandConfig();
break;
case cReset :
- Reset();
+ commandReset();
break;
case cClear :
//EED Borrame GetExecuter()->UnLoadPackage(words[1]);
break;
- //ups1 EED borrame
case cDebug :
- if (words.size()==2) Debug(words[1]);
- else Debug("");
+ if (words.size()==2) commandDebug(words[1]);
+ else commandDebug("");
break;
/* obsolete
//=======================================================================
- void Interpreter::Reset()
+ void Interpreter::commandReset()
{
// Cannot close all files if the reset command is read from a file !
CloseAllFiles();
//=======================================================================
/// Displays help on all the commands
-void Interpreter::Help(const std::vector<std::string>& words)
+void Interpreter::commandHelp(const std::vector<std::string>& words)
{
unsigned int nbarg = words.size()-1;
//===================================================================
/// Displays the Configuration
- void Interpreter::Config() const
+ void Interpreter::commandConfig() const
{
ConfigurationFile::GetInstance().GetHelp(1);
}
}
//=======================================================================
-void Interpreter::Graph(const std::vector<std::string>& words)
+void Interpreter::commandGraph(const std::vector<std::string>& words)
{
std::string page;
bool system_display = true;
//=======================================================================
-void Interpreter::Index(const std::string& filename,
+void Interpreter::commandIndex(const std::string& filename,
const std::string& type)
{
Factory::IndexEntryType t;
//=======================================================================
-void Interpreter::NewGUI(const std::string& boxname,
+void Interpreter::commandNewGUI(const std::string& boxname,
const std::string& instanceName)
{
if (mRealExecuter.expired())
//==========================================================================
- void Interpreter::Debug(const std::string& name)
+ void Interpreter::commandDebug(const std::string& name)
{
if ((name.length()==2)&&(name[0]=='-'))
{
Program: bbtk
Module: $RCSfile: bbtkInterpreter.h,v $
Language: C++
- Date: $Date: 2010/09/14 07:18:47 $
- Version: $Revision: 1.41 $
+ Date: $Date: 2010/09/15 14:17:17 $
+ Version: $Revision: 1.42 $
=========================================================================*/
/* ---------------------------------------------------------------------
void CloseAllFiles();
/// Resets all
- void Reset();
+ void commandReset();
/// Displays help (entry point of any help)
- void Help(const std::vector<std::string>& words);
+ void commandHelp(const std::vector<std::string>& words);
/// Displays help on all the commands
void HelpCommands();
void HelpCommand( const std::string& command );
///
- void Graph(const std::vector<std::string>& words);
+ void commandGraph(const std::vector<std::string>& words);
///
- void Config() const;
+ void commandConfig() const;
///
// void Print(const std::string&);
- void Index(const std::string& filename,
+ void commandIndex(const std::string& filename,
const std::string& type = "Initials");
///
void FindCommandsWithPrefix( char* buf,
/// Define it as a complex box type with name instanceName+"Type"
/// The instance is called instanceName
/// and connected to the existing pipeline
- void NewGUI(const std::string& box,
- const std::string& instanceName);
-
- void Debug(const std::string& arg);
-
+ void commandNewGUI(const std::string& box,const std::string& instanceName);
+ void commandDebug(const std::string& arg);
void commandNew(std::string boxType, std::string boxName);
void commandDelete(std::string boxName);
void commandConnection(std::string nodeFrom, std::string outputLabel, std::string nodeTo, std::string inputLabel);
void commandInclude(std::string word, bool ok);
void commandLoad(std::string packageName);
void commandUnload(std::string packageName);
-
+ void commandBreak();
+ void commandQuit();
+ void commandMessage();
+ void commandMessage(std::string kind, std::string levelstr);
+
/// Constructor
Interpreter(const std::string& cpp_file = "");