From d1a31ddde4f7c491a8e03a9a8fde30799b591ee8 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Tue, 8 Oct 2019 23:57:31 -0400 Subject: Add macro to control generation of code --- pc.h | 2 ++ pc.y | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/pc.h b/pc.h index e49d665..3614796 100644 --- a/pc.h +++ b/pc.h @@ -15,5 +15,7 @@ int set_func_types(ptree*, int*, int); int get_call_types(ptree*, int*, int); #define OFFSET_SIZE 8 + #endif +#define GENERATE_CODE diff --git a/pc.y b/pc.y index 9c942bd..d891260 100644 --- a/pc.y +++ b/pc.y @@ -108,7 +108,10 @@ program #ifdef DEBUG print_tree($9); #endif + +#ifdef GENERATE_CODE gen_code($9, $2); +#endif free_tree($9); #ifdef DEBUG @@ -203,7 +206,9 @@ sub_prog_declaration #ifdef DEBUG print_tree($4); #endif +#ifdef GENERATE_CODE gen_code($4, name); +#endif free_tree($4); #ifdef DEBUG -- cgit v1.1