diff options
author | 2021-07-22 01:09:11 -0700 | |
---|---|---|
committer | 2021-07-22 01:09:11 -0700 | |
commit | 50473e5ab573d85b1a555874332f6aecdd36f659 (patch) | |
tree | 4371889b4ee894a8cb9413def9726896f53e45e2 /clox/src/vm.h | |
parent | 7fe0c7f639ca15312f2ed5a77beddfdb0ada1ae6 (diff) | |
download | crafting-interpreters-50473e5ab573d85b1a555874332f6aecdd36f659.tar.gz crafting-interpreters-50473e5ab573d85b1a555874332f6aecdd36f659.zip |
Chapter 15.1
Diffstat (limited to 'clox/src/vm.h')
-rw-r--r-- | clox/src/vm.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/clox/src/vm.h b/clox/src/vm.h new file mode 100644 index 0000000..d11ae70 --- /dev/null +++ b/clox/src/vm.h @@ -0,0 +1,21 @@ +#ifndef clox_vm_h +#define clox_vm_h + +#include "chunk.h" + +typedef struct { + Chunk *chunk; + uint8_t *ip; +} VM; + +typedef enum { + INTERPRET_OK, + INTERPRET_COMPILE_ERROR, + INTERPRET_RUNTIME_ERROR +} InterpretResult; + +void initVM(); +void freeVM(); +InterpretResult interpret(Chunk *chunk); + +#endif |