summaryrefslogtreecommitdiff
path: root/ast.c
diff options
context:
space:
mode:
Diffstat (limited to 'ast.c')
-rw-r--r--ast.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/ast.c b/ast.c
index d2b8782..2287b5c 100644
--- a/ast.c
+++ b/ast.c
@@ -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;
+}