/* Copyright 1996-2003 Simon Whiteside This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "skInterpreter.h" #include "skRValueArray.h" #include "skParseException.h" #include "skRuntimeException.h" #include "skExecutableIterator.h" #include "skXMLParseException.h" #include "skMSXMLExecutable.h" #include "skTracer.h" #include "Test.h" // Load the COM libraries struct StartOle { StartOle( ) { CoInitialize( NULL ); }; ~StartOle( ) { CoUninitialize(); }; } _inst_StartOle; // define some string constants skLITERAL(Test); skLITERAL(main); /* *This program loads XML or TreeNode files containing Simkin script. *
The program calls the "main" method on each script it loads. *
The script names are passed on the command line. */ /* * Entry point for the ScriptLoader application. It expects to have an argument giving the filename of an XML or TreeNode file to be loaded. *
An {@link skXMLExecutable skXMLExecutable} or {@link skScriptedExecutable skScriptedExecutable} object is created, passed the file, and then the method "main" is called
*/
int main(int argc,Char * argv[]){
if (argc>1){
// Set up global interpreter
skInterpreter interpreter;
// set up an executable context
skExecutableContext ctxt(&interpreter);
// create global variable of class "Test" - we can use this in scripts to create instances of test,
// using the "createObject" method
interpreter.addGlobalVariable(s_Test,new skTest());
for (int i=1;i