#ifndef SCRIPT_H #define SCRIPT_H #include #include "vm/Allocator.h" #include "vm/ByteCode.h" #include "vm/Object.h" #define SCRIPT_STACK_SIZE 1000 #define SCRIPT_ERROR_SIZE 256 typedef struct { char error[SCRIPT_ERROR_SIZE]; ByteCode* code; int readIndex; Object returnValue; Object stack[SCRIPT_STACK_SIZE]; int stackIndex; int stackVarIndex; int line; Allocator allocator; } Script; Script* sInit(ByteCode* code); void sDelete(Script* sc); void sRun(Script* sc); typedef bool (*ObjectPrinter)(Object*); void sSetPrinter(ObjectPrinter p); void sCollectGarbage(Script* sc); #endif