aboutsummaryrefslogtreecommitdiff
path: root/pc.y
diff options
context:
space:
mode:
Diffstat (limited to 'pc.y')
-rw-r--r--pc.y14
1 files changed, 14 insertions, 0 deletions
diff --git a/pc.y b/pc.y
index 8363428..7e4ca78 100644
--- a/pc.y
+++ b/pc.y
@@ -101,7 +101,9 @@ program
'.'
{
set_ret_type($9);
+#ifdef DEBUG
print_tree($9);
+#endif
free_tree($9);
free_tree($4);
#ifdef DEBUG
@@ -175,7 +177,9 @@ sub_prog_declaration
compound_statement
{
set_ret_type($4);
+#ifdef DEBUG
print_tree($4);
+#endif
free_tree($4);
#ifdef DEBUG
print_scope(cur_scope);
@@ -351,6 +355,7 @@ var
:ID
{
$$ = mkid(scope_safe_search(cur_scope,$1));
+ free($1);
}
|ID '[' expr ']'
{
@@ -359,6 +364,7 @@ var
$$ = mktree(ARRAY_ACCESS, mkid(tmp), $3);
$$->attr.nval = $$->l->attr.nval;
+ free($1);
}
;
@@ -369,6 +375,7 @@ proc_statement
tmp = check_exists(cur_scope, $1);
$$ = mktree(PCALL, mkid(tmp), NULL);
+ free($1);
}
|ID '(' expr_list ')'
{
@@ -376,6 +383,8 @@ proc_statement
tmp = check_exists(cur_scope, $1);
$$ = mktree(PCALL, mkid(tmp), $3);
+
+ free($1);
}
/*calls checked with proc_statement*/
;
@@ -431,6 +440,7 @@ factor
tmp = check_exists(cur_scope, $1);
$$ = mkid(tmp);
+ free($1);
}
|ID '[' expr ']'
{
@@ -438,6 +448,8 @@ factor
tmp = check_exists(cur_scope, $1);
$$ = mktree(ARRAY_ACCESS, mkid(tmp), $3);
+
+ free($1);
}
|ID '(' expr_list ')'
{
@@ -446,6 +458,8 @@ factor
tmp = check_exists(cur_scope, $1);
$$ = mktree(FCALL, mkid(tmp), $3);
check_call($$);
+
+ free($1);
}
|INUM
{