]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkInterpreter.cxx
no message
[bbtk.git] / kernel / src / bbtkInterpreter.cxx
index 961b42ed87f7efbc1c0567080a3bbda5f248858f..6771d7788013d12bed23d9d1b85aac56b953a004 100644 (file)
@@ -2,8 +2,8 @@
   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 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -867,7 +867,38 @@ namespace bbtk
                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);
+
+    }
+       
        
        
   //=======================================================================  
@@ -929,21 +960,24 @@ namespace bbtk
     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;
       }
@@ -974,12 +1008,14 @@ namespace bbtk
                      <<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;
@@ -1088,7 +1124,7 @@ namespace bbtk
 
       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;
 
@@ -1098,7 +1134,7 @@ namespace bbtk
         break;
 
       case cNewGUI :
-               NewGUI(words[1],words[2]);
+               commandNewGUI(words[1],words[2]);
         break;
 
       case cCategory :
@@ -1108,11 +1144,11 @@ namespace bbtk
 
       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 :
@@ -1121,20 +1157,20 @@ namespace bbtk
         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 :  
@@ -1164,10 +1200,9 @@ namespace bbtk
 //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
@@ -1231,7 +1266,7 @@ namespace bbtk
 
 
   //=======================================================================
-  void Interpreter::Reset()
+  void Interpreter::commandReset()
   {
     // Cannot close all files if the reset command is read from a file !
     CloseAllFiles();
@@ -1748,7 +1783,7 @@ void Interpreter::SwitchToStream( std::stringstream* stream )
 
   //=======================================================================
   /// 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;
 
@@ -1848,7 +1883,7 @@ void Interpreter::Help(const std::vector<std::string>& words)
 
    //===================================================================    
   /// Displays the Configuration
-  void Interpreter::Config() const
+  void Interpreter::commandConfig() const
   {
     ConfigurationFile::GetInstance().GetHelp(1);
   }  
@@ -2193,7 +2228,7 @@ void Interpreter::Help(const std::vector<std::string>& words)
   }
 
 //=======================================================================
-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;
@@ -2238,7 +2273,7 @@ void Interpreter::Graph(const std::vector<std::string>& words)
 
 
 //=======================================================================
-void  Interpreter::Index(const std::string& filename, 
+void  Interpreter::commandIndex(const std::string& filename, 
                         const std::string& type)
 {
   Factory::IndexEntryType t;
@@ -2253,7 +2288,7 @@ void  Interpreter::Index(const std::string& filename,
 
 
 //=======================================================================
-void  Interpreter::NewGUI(const std::string& boxname,
+void  Interpreter::commandNewGUI(const std::string& boxname,
                             const std::string& instanceName)
 {
   if (mRealExecuter.expired())
@@ -2430,7 +2465,7 @@ void  Interpreter::NewGUI(const std::string& boxname,
 
 
  //==========================================================================
-  void Interpreter::Debug(const std::string& name)
+  void Interpreter::commandDebug(const std::string& name)
   {
     if ((name.length()==2)&&(name[0]=='-'))
       {