mirror of
https://github.com/iritmaximus/ttk91-compiler.git
synced 2026-10-12 19:13:40 +03:00
implemented free's for all ast types
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
#include "expr.h"
|
||||
|
||||
int program_print(struct expr *program);
|
||||
void program_free(struct expr *program);
|
||||
+1
-1
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user