roza/lib/tysy.h

26 lines
672 B
C

#ifndef RZ_TYSY_H
#define RZ_TYSY_H
#include "commons.h"
#include "value.h"
typedef struct {
type_t* types[RZ_MAX_TYPES];
char* names[RZ_MAX_TYPES];
size_t size;
} tysy_t;
void tysy_init(tysy_t* tysy);
void tysy_free(tysy_t* tysy);
void tysy_register_new_type(tysy_t* tysy, char* name, type_t* type);
type_t* tysy_try_find_type(tysy_t* tysy, char* name);
value_t* tysy_new_num(tysy_t* tysy, double value, int line);
value_t* tysy_new_bool(tysy_t* tysy, int value, int line);
value_t* tysy_new_str(tysy_t* tysy, char* value, int line);
value_t* tysy_new_fun(tysy_t* tysy, fun_t* fun, int line);
value_t* tysy_new_ref(tysy_t* tysy, size_t ref, int line);
#endif