diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-07-31 21:59:48 -0400 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-07-31 21:59:48 -0400 |
commit | f1c02ce1c731d3b7cbe505764352012b7ab83887 (patch) | |
tree | 71d7d400e6f4d16ce4d25cbde4510d7ef184e26d | |
parent | a7d28593769b094d52407c92b8e5554a3e9cd178 (diff) |
WIP Start dealing with semantic checking of ids
Current bugs:
Checks id during var assignment
-rw-r--r-- | pc.y | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -102,21 +102,27 @@ program id_list :ID { + /*TODO remove check_ids*/ + node *tmp; check_id(cur_scope, $1); - $$ = scope_insert(cur_scope, $1); + tmp = scope_insert(cur_scope, $1); + $$ = mkid(tmp); } |id_list ',' ID { - check_id(cur_scope, $3); + node *tmp; - $$ = mktree(LIST, $1, scope_insert(cur_scope, $3)); + check_id(cur_scope, $3); + tmp = scope_insert(cur_scope, $3); + $$ = mktree(LIST, $1, mkid(tmp)); } ; var_declarations :var_declarations VAR id_list ':' type ';' { + /*CHECK IDS HERE*/ ptree *tmp; for(tmp = $3; tmp; tmp = tmp->l) { tmp->type = $5; |