add more parses and fix minor memory leak

This commit is contained in:
2025-05-31 20:03:06 +01:00
parent d18ff96f8f
commit a614eab8fc
16 changed files with 188 additions and 50 deletions

View File

@@ -0,0 +1,12 @@
#include "translator.h"
#include "../dynamic_array/darray.h"
#include <stdlib.h>
#include <stdint.h>
Translated * init_translator() {
Translated *translated = malloc(sizeof(Translated));
if (!translated) return NULL;
darray_init(&translated->bytecode, sizeof(uint8_t));
return translated;
}

View File

@@ -0,0 +1,18 @@
#ifndef TRANSLATOR_H
#define TRANSLATOR_H
#include <stddef.h>
#include "../dynamic_array/darray.h"
typedef enum {
OP_INIT_STRING
} OperationType;
typedef struct {
size_t registerCount;
DArray bytecode;
} Translated;
#endif