]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkInterpreterVirtual.cxx
no message
[bbtk.git] / kernel / src / bbtkInterpreterVirtual.cxx
index 85354e69d2162611b35f6ec9442831a19ed26ed4..88e8f52e3d1dcabbb47e7271071910550ca543ce 100644 (file)
@@ -578,7 +578,9 @@ namespace bbtk
   //=======================================================================
   InterpreterVirtual::ExitStatus InterpreterVirtual::InterpretFile( const std::string& filename, bool source )
   {
-    bbtkDebugMessage("interpreter",4,"==> InterpreterVirtual::InterpretFile(\""<<filename<<"\")"<<std::endl);
+
+         printf("EED InterpreterVirtual::InterpretFile 1\n");
+         bbtkDebugMessage("interpreter",4,"==> InterpreterVirtual::InterpretFile(\""<<filename<<"\")"<<std::endl);
 
     bool exm = mCommandLine;
     mCommandLine = false;
@@ -598,7 +600,9 @@ namespace bbtk
 
 
     mCommandLine = exm;
-    
+
+         printf("EED InterpreterVirtual::InterpretFile 2\n");
+
     return mStatus;
   }
   //=======================================================================
@@ -691,8 +695,9 @@ namespace bbtk
   }
   //=======================================================================  
   
-       void InterpreterVirtual::commandNew(std::string boxType, std::string boxName)
+       void InterpreterVirtual::commandNew(std::string boxType, std::string boxName) // virtual 
     {
+               printf("EED %p InterpreterVirtual::commandNew 1  %s %s\n", this,  boxType.c_str(),boxName.c_str() );            
     }
        
        void InterpreterVirtual::commandDelete(std::string boxName)
@@ -799,11 +804,17 @@ namespace bbtk
   //=======================================================================  
   void InterpreterVirtual::DoInterpretLine( const std::string& line )
   {
+         
+         printf("EED %p InterpreterVirtual::DoInterpretLine 0 \n", this);        
+         printf("EED %p InterpreterVirtual::DoInterpretLine line=%s \n", this, line.c_str() );   
     bbtkDebugMessage("interpreter",6,"==> InterpreterVirtual::DoInterpretLine(\""
                     <<line<<"\")"<<std::endl);
     std::vector<std::string> words;
     SplitLine(line,words);
 
+printf("EED %p InterpreterVirtual::DoInterpretLine word.size %d \n", this, (int)words.size() );          
+         
+         
     // Empty line
     if (words.size()<1) 
     {
@@ -847,6 +858,8 @@ namespace bbtk
        bbtkMessage("interpreter",9,"Multiline Comment"<<std::endl);
        return;
     }
+         
+printf("EED %p InterpreterVirtual::DoInterpretLine word.size %d \n", this,  (int)words.size() );         
 
     // Command 
     CommandInfoType command;
@@ -918,9 +931,12 @@ namespace bbtk
 //std::cout<<" mVirtualExecuter->Create(words[1],words[2]); "<<line<<std::endl;
     // other cammands
 
+printf("EED %p InterpreterVirtual::DoInterpretLine 4  command.code=%d\n", this, (int)command.code);      
+         
     switch (command.code) 
       {
       case cNew :
+printf("EED %p InterpreterVirtual::DoInterpretLine 5  %s %s\n", this,  words[1].c_str() , words[2].c_str() );    
                commandNew(words[1],words[2]);
 //EED Borrame        mVirtualExecuter->Create(words[1],words[2]);
         break;
@@ -1120,6 +1136,9 @@ namespace bbtk
     bbtkDebugMessage("interpreter",6,"<== InterpreterVirtual::DoInterpretLine(\""
                     <<line<<"\")"<<std::endl);
     
+printf("EED %p InterpreterVirtual::DoInterpretLine 10\n", this);         
+
+         
   }
   //=======================================================================  
 
@@ -1249,6 +1268,9 @@ namespace bbtk
   // =========================================================================
   void InterpreterVirtual::SwitchToFile( const std::string& name , bool source )
   {
+         printf("EED InterpreterVirtual::SwitchToFile 1\n");
+         printf("EED InterpreterVirtual::SwitchToFile name=%s\n", name.c_str() );
+         
   // Note : in the following :
   // name : the user supplied name 
   //      - abreviated name    e.g.       scr   scr.bbs
@@ -1291,7 +1313,9 @@ namespace bbtk
 
        std::stringstream* stream = new std::stringstream;
        //if (upath.size()!=0) // avoid troubles for "*"
-       
+
+printf("EED InterpreterVirtual::SwitchToFile 2\n");
+                 
        // ==== no path provided : look in root bbs path
        if (upath.size()==0)
          {
@@ -1352,7 +1376,8 @@ namespace bbtk
              }
          }
        
-       
+printf("EED InterpreterVirtual::SwitchToFile 3\n");
+
        // === search paths list complete : now explore it
        int nbBssFiles = 0;     
        // ==== relative name, iterate + load all .bbs/.bbp files
@@ -1527,6 +1552,9 @@ namespace bbtk
 //EED Borrame    if (source) GetExecuter()->SetCurrentFileName(fullPathScriptName);
                if (source) SetCurrentFileName(fullPathScriptName);
        }    
+         
+printf("EED InterpreterVirtual::SwitchToFile 4\n");
+         
     return;
   }
   //=======================================================================
@@ -1534,12 +1562,15 @@ namespace bbtk
        //=======================================================================
        void InterpreterVirtual::SetCurrentFileName(std::string fullPathScriptName)  // virtual 
        {
+               printf("EED InterpreterVirtual::SetCurrentFileName 1\n");
        }       
        //=======================================================================
        
   //=======================================================================
 void InterpreterVirtual::SwitchToStream( std::stringstream* stream )
 {
+printf("EED InterpreterVirtual::SwitchToStream 1\n");
+       
   bbtkDebugMessage("interpreter",4,"==> InterpreterVirtual::SwitchToStream()"
                   <<std::endl);
    mFile.push_back(stream);
@@ -1650,12 +1681,15 @@ void InterpreterVirtual::SwitchToStream( std::stringstream* stream )
   void InterpreterVirtual::InterpretCommand( const std::vector<std::string>& words,
                                       CommandInfoType& info )
   {
+         
+       printf("EED InterpreterVirtual::InterpretCommand  1 \n");
     bbtkDebugMessage("interpreter",9,"==> InterpreterVirtual::InterpretCommand(...)"<<std::endl);
 
     // searches the command keyword
     CommandDictType::iterator c;
     c = mCommandDict.find(words[0]);
     if ( c == mCommandDict.end() ) {
+printf("EED InterpreterVirtual::InterpretCommand  2 \n");
       bbtkError(words[0]<<" : unknown command");
     }
 
@@ -1666,12 +1700,14 @@ void InterpreterVirtual::SwitchToStream( std::stringstream* stream )
                
 //EED       HelpCommand(words[0]);
                commandHelp(words[0]);
+printf("EED InterpreterVirtual::InterpretCommand  3 \n");
                
        bbtkError(words[0]<<" : wrong number of arguments");
     }
 //std::cout<<"InterpreterVirtual::InterpretCommand( const std::vector<std::string>& words,"<<std::endl;
     info = c->second;
 
+printf("EED InterpreterVirtual::InterpretCommand  4 \n"  );
     bbtkDebugMessage("interpreter",9,"<== InterpreterVirtual::InterpretCommand(...)"<<std::endl);
 
   }