My implementation of Clox, the programming language constructed in the book 'Crafting Interpreters'
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
425 B

#ifndef _VM_H
#define _VM_H
#include "chunk.h"
#define MAX_STACK 256
typedef struct {
Chunk* chunk;
uint8_t* ip;
Value stack[MAX_STACK];
Value* sp;
} VM;
typedef enum {
} InterpretResult;
void initVM( VM* vm );
void freeVM( VM* vm );
InterpretResult interpret( VM* vm, const char* src );
void push( VM* vm, Value val );
Value pop( VM* vm );