aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-09-05 18:15:32 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-09-05 18:15:32 -0400
commit3a9747434de494fa189cf02ac31f6a4cff7fc761 (patch)
tree02fe1e9412f02f652f0f07e8d5dd20b4ed0f3515
parent1300aa3672d7ae27963465fa6d8d2a6ebe8a71d2 (diff)
Add procedure argument types
-rw-r--r--pc.y14
1 files changed, 13 insertions, 1 deletions
diff --git a/pc.y b/pc.y
index dc7b704..72e9b6a 100644
--- a/pc.y
+++ b/pc.y
@@ -195,8 +195,20 @@ sub_prog_head
}
|PROC ID arguments ';'
{
+ node *tmp;
+ int i = 0;
+
check_id(cur_scope->prev, $2);
- scope_insert(cur_scope->prev, $2);
+ tmp = scope_insert(cur_scope->prev, $2);
+
+ i = count_args($3);
+
+ tmp->func_info = malloc(sizeof(struct fi));
+ assert(tmp->func_info);
+ tmp->func_info->argc = i;
+ assert(tmp->func_info->argv = malloc(i * sizeof(int)));
+
+ assert(!set_func_types($3, tmp->func_info->argv, i));
}
;