aboutsummaryrefslogtreecommitdiffstats
path: root/clox/src/vm.h
diff options
context:
space:
mode:
authorGravatar Tom Willemse2021-07-27 22:21:40 -0700
committerGravatar Tom Willemse2021-07-27 22:21:40 -0700
commit73dfe7efa53b5ed58b9e1e94dceec14ec19d6308 (patch)
treecae36513c903b13b4dd68f802bd622585c622b7f /clox/src/vm.h
parent79c1056553e5150cbdb12e52a19603fd33c3e517 (diff)
downloadcrafting-interpreters-73dfe7efa53b5ed58b9e1e94dceec14ec19d6308.tar.gz
crafting-interpreters-73dfe7efa53b5ed58b9e1e94dceec14ec19d6308.zip
Chapter 15.2
Diffstat (limited to 'clox/src/vm.h')
-rw-r--r--clox/src/vm.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/clox/src/vm.h b/clox/src/vm.h
index d11ae70..2585bd2 100644
--- a/clox/src/vm.h
+++ b/clox/src/vm.h
@@ -2,10 +2,15 @@
#define clox_vm_h
#include "chunk.h"
+#include "value.h"
+
+#define STACK_MAX 256
typedef struct {
Chunk *chunk;
uint8_t *ip;
+ Value stack[STACK_MAX];
+ Value* stackTop;
} VM;
typedef enum {
@@ -17,5 +22,7 @@ typedef enum {
void initVM();
void freeVM();
InterpretResult interpret(Chunk *chunk);
+void push(Value value);
+Value pop();
#endif