OpenMW
components/interpreter/runtime.hpp
Go to the documentation of this file.
00001 #ifndef INTERPRETER_RUNTIME_H_INCLUDED
00002 #define INTERPRETER_RUNTIME_H_INCLUDED
00003 
00004 #include <vector>
00005 #include <string>
00006 
00007 #include "types.hpp"
00008 
00009 namespace Interpreter
00010 {
00011     class Context;
00012 
00014 
00015     class Runtime
00016     {
00017             Context *mContext;
00018             const Type_Code *mCode;
00019             int mCodeSize;
00020             int mPC;
00021             std::vector<Data> mStack;
00022 
00023         public:
00024 
00025             Runtime ();
00026 
00027             int getPC() const;
00029 
00030             int getIntegerLiteral (int index) const;
00031 
00032             float getFloatLiteral (int index) const;
00033 
00034             std::string getStringLiteral (int index) const;
00035 
00036             void configure (const Type_Code *code, int codeSize, Context& context);
00039 
00040             void clear();
00041 
00042             void setPC (int PC);
00044 
00045             void push (const Data& data);
00047 
00048             void push (Type_Integer value);
00050 
00051             void push (Type_Float value);
00053 
00054             void pop();
00056 
00057             Data& operator[] (int Index);
00059 
00060             Context& getContext();
00061     };
00062 }
00063 
00064 #endif