implemented free's for all ast types

This commit is contained in:
Aaro Koivukangas
2024-08-16 14:48:53 +02:00
parent c7795bb0e4
commit dc37278588
18 changed files with 170 additions and 25 deletions
+2
View File
@@ -9,4 +9,6 @@ struct comment {
struct comment * comment_create(char *text);
int comment_print(struct comment *c);
void comment_free(struct comment *c);
#endif
+2
View File
@@ -37,4 +37,6 @@ struct expr *expr_create_compiler_instruction(struct label *l, struct oper *o, s
struct expr *expr_create_compiler_instruction_raw_label_oper_value(char* label, char *o, int value);
struct expr *expr_create_comment(struct comment *c);
int expr_free(struct expr *e);
#endif
+2
View File
@@ -21,4 +21,6 @@ struct label * label_create_const(char* name);
struct label * label_create_const_sys(char* name);
struct label * label_create_tag(char* name);
void label_free(struct label *l);
#endif
+2
View File
@@ -29,4 +29,6 @@ struct oper * oper_create_stack(char* oper_name);
struct oper * oper_create_sys(char* oper_name);
struct oper * oper_create_compiler(char* oper_name);
void oper_free(struct oper *o);
#endif
+4
View File
@@ -0,0 +1,4 @@
#include "expr.h"
int program_print(struct expr *program);
void program_free(struct expr *program);
+1 -1
View File
@@ -81,7 +81,7 @@ extern int yydebug;
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{
#line 40 "src/parser.bison"
#line 47 "src/parser.bison"
struct expr *expr;
struct oper *oper;
+2
View File
@@ -19,4 +19,6 @@ struct ttk_register * ttk_register_create_stack_register(char* name);
int ttk_register_print(struct ttk_register *ttk_reg);
void ttk_register_free(struct ttk_register *ttk_reg);
#endif
+4
View File
@@ -52,4 +52,8 @@ struct pure_value * pure_value_create(value_t kind, struct ttk_register *ttk_reg
addr_mode_t parse_addr_mode(char addr_mode);
int value_print(struct value *v);
void value_free(struct value *v);
void pure_value_free(struct pure_value *p_v);
#endif