From 9c6c1af62993bdb2474ddde4384215f95fede85f Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Sat, 3 Aug 2019 21:40:54 -0400 Subject: Fix print_tree placement in parse tree --- pc.y | 3 ++- tree.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pc.y b/pc.y index 8e0130c..d63d8fc 100644 --- a/pc.y +++ b/pc.y @@ -92,6 +92,7 @@ program compound_statement '.' { + print_tree($9); } ; @@ -157,6 +158,7 @@ sub_prog_declaration sub_prog_declarations compound_statement { + print_tree($4); pop_scope(&cur_scope); } ; @@ -201,7 +203,6 @@ compound_statement :BEG opt_statements END { $$ = $2; - print_tree($$); } ; diff --git a/tree.c b/tree.c index 0e27d16..8a2c3bf 100644 --- a/tree.c +++ b/tree.c @@ -86,6 +86,8 @@ ptree *t; fprintf(stderr, "\n\nTREE\n" "==========================================================\n"); aux_tree_print(t, 0); + fprintf(stderr, + "**********************************************************\n"); return; } -- cgit v1.1