2010-06-28 17:20:45 +00:00
|
|
|
#ifndef INTERPRETER_RUNTIME_H_INCLUDED
|
|
|
|
#define INTERPRETER_RUNTIME_H_INCLUDED
|
|
|
|
|
|
|
|
#include "types.hpp"
|
|
|
|
|
|
|
|
namespace Interpreter
|
|
|
|
{
|
|
|
|
class Context;
|
|
|
|
|
|
|
|
/// Runtime data and engine interface
|
|
|
|
|
|
|
|
class Runtime
|
|
|
|
{
|
|
|
|
Context& mContext;
|
2010-06-28 18:46:15 +00:00
|
|
|
const Type_Code *mCode;
|
2010-06-28 17:20:45 +00:00
|
|
|
int mCodeSize;
|
2010-06-28 18:46:15 +00:00
|
|
|
int mPC;
|
2010-06-28 17:20:45 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
Runtime (Context& context);
|
|
|
|
|
2010-06-28 18:46:15 +00:00
|
|
|
int getPC() const;
|
|
|
|
///< return program counter.
|
|
|
|
|
2010-06-28 17:20:45 +00:00
|
|
|
void configure (const Interpreter::Type_Code *code, int codeSize);
|
|
|
|
///< \a context and \a code must exist as least until either configure, clear or
|
|
|
|
/// the destructor is called. \a codeSize is given in 32-bit words.
|
|
|
|
|
|
|
|
void clear();
|
2010-06-28 18:46:15 +00:00
|
|
|
|
|
|
|
void setPC (int PC);
|
|
|
|
///< set program counter.
|
2010-06-28 17:20:45 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|