diff options
Diffstat (limited to 'ast.c')
-rw-r--r-- | ast.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -16,3 +16,30 @@ ast_node* create_program_node(ast_node* previous_node, ast_node* current_node) { return node; } + +ast_node* create_type_node(char* type) { + ast_node* node = malloc(sizeof(ast_node)); + node->type = TYPE_NODE; + + ast_node_data* data = malloc(sizeof(ast_node_data)); + data->value = type; + node->data = data; + + printf("type:: %s\n", type); + + return node; +} + +ast_node* create_argument_node(char* identifier, ast_node* type) { + ast_node* node = malloc(sizeof(ast_node)); + node->type = ARGUMENT_NODE; + + ast_node_data* data = malloc(sizeof(ast_node_data)); + data->value = identifier; + data->type = type; + node->data = data; + + printf("argument:: %s -- %s\n", identifier, type->data->value); + + return node; +} |