Add store into abstract machine struct

This commit is contained in:
2025-08-10 15:21:24 +01:00
parent b20a6749f7
commit d8e51b0aa0
18 changed files with 129 additions and 141 deletions

View File

@@ -8,14 +8,13 @@
#include <stdint.h>
struct am;
struct store;
typedef struct {
char buf[MAX_SYMBOL_LEN];
size_t len;
} symbol_t;
typedef void (*prim_proc_t)(struct am *am, struct store *store);
typedef void (*prim_proc_t)(struct am *am);
typedef enum {
ATOM_TYPE_EMPTY_LIST,
@@ -47,11 +46,11 @@ typedef struct expr {
};
} expr_t;
expr_t *expr_integer(struct store *store, int64_t value);
expr_t *expr_symbol(struct store *store, const symbol_t *symbol);
expr_t *expr_str_symbol(struct store *store, const char *str);
expr_t *expr_empty_list(struct store *store);
expr_t *expr_pair(struct store *store, expr_t *car, expr_t *cdr);
expr_t *expr_prim_proc(struct store *store, prim_proc_t prim_proc);
expr_t *expr_integer(struct am *am, int64_t value);
expr_t *expr_symbol(struct am *am, const symbol_t *symbol);
expr_t *expr_str_symbol(struct am *am, const char *str);
expr_t *expr_empty_list(struct am *am);
expr_t *expr_pair(struct am *am, expr_t *car, expr_t *cdr);
expr_t *expr_prim_proc(struct am *am, prim_proc_t prim_proc);
#endif