summaryrefslogtreecommitdiff
path: root/vm.h
diff options
context:
space:
mode:
Diffstat (limited to 'vm.h')
-rw-r--r--vm.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/vm.h b/vm.h
new file mode 100644
index 0000000..3db064b
--- /dev/null
+++ b/vm.h
@@ -0,0 +1,20 @@
+#pragma once
+#include <stdint.h>
+
+typedef struct {
+ uint8_t *ip;
+} VM;
+
+typedef struct {
+} Chunk;
+
+typedef enum {
+ INTERPRET_OK,
+ INTERPRET_COMPILE_ERROR,
+ INTERPRET_RUNTIME_ERROR
+} InterpretResult;
+
+void initVM();
+void freeVM();
+InterpretResult interpret(Chunk* chunk);
+