aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-08-18 18:31:36 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-08-18 18:31:36 -0400
commit3f1cee416602070225b81deb8c2222a5324f8204 (patch)
treeaa9578558d176ea5bebd796503fcb1944f82e0ca
parentb4d095d8616c8a5f2d85f8dc91b8429b0a7108a3 (diff)
Fix clean up header includes
-rw-r--r--main.c3
-rw-r--r--node.c4
-rw-r--r--pc.h3
-rw-r--r--scope.c5
-rw-r--r--scope.h2
-rw-r--r--sem_check.c6
-rw-r--r--sem_check.h3
-rw-r--r--tree.c8
-rw-r--r--tree.h2
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 <stdio.h>
#include <stdlib.h>
#include <assert.h>
@@ -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 <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
-#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 <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
-#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 <assert.h>
#include <stdio.h>
-#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 <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
-#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 {