From 3f1cee416602070225b81deb8c2222a5324f8204 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Sun, 18 Aug 2019 18:31:36 -0400 Subject: Fix clean up header includes --- main.c | 3 ++- node.c | 4 ++-- pc.h | 3 +++ scope.c | 5 +++-- scope.h | 2 ++ sem_check.c | 6 ++---- sem_check.h | 3 +++ tree.c | 8 ++++---- tree.h | 2 ++ 9 files changed, 23 insertions(+), 13 deletions(-) diff --git a/main.c b/main.c index da597eb..34acd52 100644 --- a/main.c +++ b/main.c @@ -1,3 +1,5 @@ +#include "pc.h" + #include #include #include @@ -5,7 +7,6 @@ #include "node.h" #include "scope.h" #include "y.tab.h" -#include "pc.h" extern char *yytext; extern int line_num; diff --git a/node.c b/node.c index 0e87370..d8d5276 100644 --- a/node.c +++ b/node.c @@ -1,10 +1,10 @@ +#include "node.h" + #include #include #include #include -#include "node.h" - /*constructor*/ node* mknode(str) char *str; diff --git a/pc.h b/pc.h index 7a8be68..e13c481 100644 --- a/pc.h +++ b/pc.h @@ -1,5 +1,8 @@ #ifndef PC_H #define PC_H + +#include "y.tab.h" + char* pretty_type(int); void debug_print(int, union YYSTYPE*); diff --git a/scope.c b/scope.c index f093b82..00e2417 100644 --- a/scope.c +++ b/scope.c @@ -1,12 +1,13 @@ +#include "scope.h" + #include #include #include #include -#include "node.h" -#include "scope.h" #include "pc.h" + scope* mkscope() { int i; diff --git a/scope.h b/scope.h index 0a07a26..f233d78 100644 --- a/scope.h +++ b/scope.h @@ -1,6 +1,8 @@ #ifndef SCOPE_H #define SCOPE_H +#include "node.h" + #define HASH_SIZE 211 typedef struct hash { diff --git a/sem_check.c b/sem_check.c index c6f4c4e..3d42996 100644 --- a/sem_check.c +++ b/sem_check.c @@ -1,12 +1,10 @@ +#include "sem_check.h" + #include #include -#include "node.h" -#include "scope.h" -#include "tree.h" #include "y.tab.h" #include "pc.h" -#include "sem_check.h" void check_id(s, n) scope *s; diff --git a/sem_check.h b/sem_check.h index 71ec715..ce7d7fb 100644 --- a/sem_check.h +++ b/sem_check.h @@ -1,6 +1,9 @@ #ifndef SEMCHECK_H #define SEMCHECK_H +#include "scope.h" +#include "tree.h" + void check_id(scope*, char*); node* check_exists(scope*, char*); diff --git a/tree.c b/tree.c index daad71f..1874712 100644 --- a/tree.c +++ b/tree.c @@ -1,14 +1,14 @@ +#include "tree.h" + #include #include #include #include -#include "node.h" -#include "tree.h" -#include "scope.h" -#include "sem_check.h" #include "y.tab.h" +#include "scope.h" #include "pc.h" +#include "sem_check.h" /* parse tree funcs */ ptree* mktree(type, l, r) diff --git a/tree.h b/tree.h index 94ccb7d..23edf8f 100644 --- a/tree.h +++ b/tree.h @@ -1,6 +1,8 @@ #ifndef TREE_H #define TREE_H +#include "node.h" + typedef struct parse_tree { int type; union { -- cgit v1.1