Program: bbtk
Module: $RCSfile: bbtkInterpreter.cxx,v $ $
Language: C++
- Date: $Date: 2008/01/28 10:50:54 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2008/01/28 15:08:53 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
info.help = "Executes the black box of name <box> (and connected boxes if needed). If the special keyword 'freeze' is given then freezes any further execution command. 'unfreeze' reverts to normal execution mode.";
mCommandDict[info.keyword] = info;
+ info.keyword = "package";
+ info.argmin = 1;
+ info.argmax = 1;
+ info.code = cPackage;
+ info.syntax = "package <name>";
+ info.help = "Begins the definition of a package.";
+ mCommandDict[info.keyword] = info;
+
+ info.keyword = "endpackage";
+ info.argmin = 0;
+ info.argmax = 0;
+ info.code = cEndPackage;
+ info.syntax = "endpackage";
+ info.help = "Ends the definition of a package.";
+ mCommandDict[info.keyword] = info;
+
info.keyword = "define";
info.argmin = 1;
info.argmax = 2;
mExecuter->Connect(left,right,left2,right2);
break;
+ case cPackage :
+ mExecuter->BeginPackage(words[1]);
+ break;
+
+ case cEndPackage :
+ mExecuter->EndPackage();
+ break;
+
case cDefine :
if (mFileName.size()>0)
{
}
if (words.size()==2)
{
- mExecuter->Define(words[1],"user",filename);
+ mExecuter->Define(words[1],"",filename);
}
else
{
//
bbtkDebugMessageInc("Interpreter",9,"Interpreter::SwitchToFile( \""
<<name<<"\")"<<std::endl);
-
+verbose = true;
std::vector<std::string> script_paths;
std::string libname; // full path library name
std::string pkgname; // e.g. <scriptname>.bbs
bool foundFile = false;
std::string::size_type slash_position = name.find_last_of("/\\");
- if (slash_position != std::string::npos)
+ if (false) //slash_position != std::string::npos)
{ // ------------------------------------- check user supplied location
fullnameGiven = true;
libname = Utilities::ExpandLibName(name, verbose);
path = currentDir;
}
- libname = Utilities::MakePkgnameFromPath(path, pkgname);
+ libname = Utilities::MakePkgnameFromPath(path, name); //pkgname);
// Check if library exists
if ( ! Utilities::FileExists(libname) )
{