Modules/Objects/public/interpreter/interpreter.h
2024-03-22 16:13:42 +03:00

29 lines
No EOL
831 B
C++

#pragma once
#include "operandsstack.h"
#include "scopestack.h"
#include "callstack.h"
namespace obj {
struct Interpreter {
OperandStack mOperandsStack;
ScopeStack mScopeStack;
CallStack mCallStack;
obj::Object* mLastParent = nullptr;
bool mIsTypeMethod = false;
const TypeMethod* mTypeMethod = nullptr;
typedef struct { obj::Object* obj; std::string id; } GlobalDef;
void exec(obj::MethodObject* method, obj::ClassObject* self = nullptr, obj::DictObject* globals = nullptr, tp::InitialierList<GlobalDef> globals2 = {});
void stepBytecode();
void stepBytecodeIn();
void stepBytecodeOut();
bool finished();
void execAll(obj::MethodObject* method, obj::ClassObject* self = nullptr, obj::DictObject* globals = nullptr, tp::InitialierList<GlobalDef> globals2 = {});
};
};