diff options
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 |