OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
runtime.hpp
Go to the documentation of this file.
1 #ifndef INTERPRETER_RUNTIME_H_INCLUDED
2 #define INTERPRETER_RUNTIME_H_INCLUDED
3 
4 #include <vector>
5 #include <string>
6 
7 #include "types.hpp"
8 
9 namespace Interpreter
10 {
11  class Context;
12 
14 
15  class Runtime
16  {
18  const Type_Code *mCode;
19  int mCodeSize;
20  int mPC;
21  std::vector<Data> mStack;
22 
23  public:
24 
25  Runtime ();
26 
27  int getPC() const;
29 
30  int getIntegerLiteral (int index) const;
31 
32  float getFloatLiteral (int index) const;
33 
34  std::string getStringLiteral (int index) const;
35 
36  void configure (const Type_Code *code, int codeSize, Context& context);
39 
40  void clear();
41 
42  void setPC (int PC);
44 
45  void push (const Data& data);
47 
48  void push (Type_Integer value);
50 
51  void push (Type_Float value);
53 
54  void pop();
56 
57  Data& operator[] (int Index);
59 
61  };
62 }
63 
64 #endif
void clear()
Definition: runtime.cpp:62
const Type_Code * mCode
Definition: runtime.hpp:18
void pop()
pop stack
Definition: runtime.cpp:94
Definition: types.hpp:18
void push(const Data &data)
push data on stack
Definition: runtime.cpp:75
std::string getStringLiteral(int index) const
Definition: runtime.cpp:34
Runtime data and engine interface.
Definition: runtime.hpp:15
Context * mContext
Definition: runtime.hpp:17
void configure(const Type_Code *code, int codeSize, Context &context)
Definition: runtime.cpp:52
int mCodeSize
Definition: runtime.hpp:19
float getFloatLiteral(int index) const
Definition: runtime.cpp:25
int mPC
Definition: runtime.hpp:20
Data & operator[](int Index)
Access stack member, counted from the top.
Definition: runtime.cpp:102
Definition: context.hpp:9
unsigned int Type_Code
Definition: types.hpp:8
int getPC() const
return program counter.
Definition: runtime.cpp:11
std::vector< Data > mStack
Definition: runtime.hpp:21
int getIntegerLiteral(int index) const
Definition: runtime.cpp:16
Context & getContext()
Definition: runtime.cpp:110
void setPC(int PC)
set program counter.
Definition: runtime.cpp:70
int code
Definition: crashcatcher.cpp:70
float Type_Float
Definition: types.hpp:16
Runtime()
Definition: runtime.cpp:9