OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
interpreter.hpp
Go to the documentation of this file.
1 #ifndef INTERPRETER_INTERPRETER_H_INCLUDED
2 #define INTERPRETER_INTERPRETER_H_INCLUDED
3 
4 #include <map>
5 #include <stack>
6 
7 #include "runtime.hpp"
8 #include "types.hpp"
9 
10 namespace Interpreter
11 {
12  class Opcode0;
13  class Opcode1;
14  class Opcode2;
15 
17  {
18  std::stack<Runtime> mCallstack;
19  bool mRunning;
21  std::map<int, Opcode1 *> mSegment0;
22  std::map<int, Opcode2 *> mSegment1;
23  std::map<int, Opcode1 *> mSegment2;
24  std::map<int, Opcode1 *> mSegment3;
25  std::map<int, Opcode2 *> mSegment4;
26  std::map<int, Opcode0 *> mSegment5;
27 
28  // not implemented
29  Interpreter (const Interpreter&);
30  Interpreter& operator= (const Interpreter&);
31 
32  void execute (Type_Code code);
33 
34  void abortUnknownCode (int segment, int opcode);
35 
36  void abortUnknownSegment (Type_Code code);
37 
38  void begin();
39 
40  void end();
41 
42  public:
43 
44  Interpreter();
45 
46  ~Interpreter();
47 
48  void installSegment0 (int code, Opcode1 *opcode);
50 
51  void installSegment1 (int code, Opcode2 *opcode);
53 
54  void installSegment2 (int code, Opcode1 *opcode);
56 
57  void installSegment3 (int code, Opcode1 *opcode);
59 
60  void installSegment4 (int code, Opcode2 *opcode);
62 
63  void installSegment5 (int code, Opcode0 *opcode);
65 
66  void run (const Type_Code *code, int codeSize, Context& context);
67  };
68 }
69 
70 #endif
std::map< int, Opcode2 * > mSegment4
Definition: interpreter.hpp:25
std::stack< Runtime > mCallstack
Definition: interpreter.hpp:18
std::map< int, Opcode0 * > mSegment5
Definition: interpreter.hpp:26
Runtime data and engine interface.
Definition: runtime.hpp:15
std::map< int, Opcode2 * > mSegment1
Definition: interpreter.hpp:22
opcode for 0 arguments
Definition: opcodes.hpp:9
Definition: interpreter.hpp:16
std::map< int, Opcode1 * > mSegment3
Definition: interpreter.hpp:24
Definition: context.hpp:9
bool mRunning
Definition: interpreter.hpp:19
unsigned int Type_Code
Definition: types.hpp:8
opcode for 2 arguments
Definition: opcodes.hpp:29
std::map< int, Opcode1 * > mSegment0
Definition: interpreter.hpp:21
int code
Definition: crashcatcher.cpp:70
std::map< int, Opcode1 * > mSegment2
Definition: interpreter.hpp:23
Runtime mRuntime
Definition: interpreter.hpp:20
opcode for 1 argument
Definition: opcodes.hpp:19