/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2009.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: sgx/include/sgx/scripting/scriptingengine.hpp

*/

#ifndef SGX_SCRIPTING_SCRIPTING_ENGINE_HPP
#define SGX_SCRIPTING_SCRIPTING_ENGINE_HPP	1

#include "sgx/core/types/types.hpp"
#include "sgx/core/helpers/trace.hpp"
#include "sgx/scripting/scriptingengine.hpp"

class CScriptingEngine;

class CScriptState {
public:
	CScriptState(CScriptingEngine *);
	virtual ~CScriptState();

	virtual	tBOOL	process(const sgxString &filename);

	virtual	tBOOL	reset();
	virtual	tBOOL	run();
	virtual	tBOOL	step();
	virtual	tBOOL	evaluate(const sgxString &code);

	virtual	tBOOL	openLibrary(const sgxString &libname);
	virtual	tBOOL	openStandardLibraries();

protected:
	CScriptingEngine	*m_pEngine;
private:
	CScriptState() { sgxError("Ctor must be called with the engine pointer"); }
};


class CScriptingEngine {
public:
	virtual	CScriptState *initialise();
	virtual	tBOOL		openLibrary(CScriptState *pState, const sgxString &libname);
	virtual	tBOOL		openStandardLibraries(CScriptState *pState);
};

#endif /* SGX_SCRIPTING_SCRIPTING_ENGINE_HPP */
