From d8f19b2f532d0a0d7131c1141ca481fa2d08b946 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Thu, 12 Sep 2019 19:56:21 -0400 Subject: Add some debug print methods to pc.y --- pc.y | 7 +++++++ scope.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/pc.y b/pc.y index 26d766f..790610b 100644 --- a/pc.y +++ b/pc.y @@ -97,6 +97,10 @@ program { set_ret_type($9); print_tree($9); +#ifdef DEBUG + print_scope(cur_scope); +#endif + pop_scope(&cur_scope); } ; @@ -164,6 +168,9 @@ sub_prog_declaration { set_ret_type($4); print_tree($4); +#ifdef DEBUG + print_scope(cur_scope); +#endif pop_scope(&cur_scope); } ; diff --git a/scope.h b/scope.h index 8a809fb..4fbe9ca 100644 --- a/scope.h +++ b/scope.h @@ -24,6 +24,8 @@ node* scope_search_all(scope*, char*); node* scope_search(scope*, char*); node* scope_safe_search(scope*, char*); +void print_scope(scope *); + /*hash function*/ int hashpjw(char*); #endif -- cgit v1.1