diff options
-rw-r--r-- | main.c | 3 | ||||
-rw-r--r-- | node.c | 4 | ||||
-rw-r--r-- | pc.h | 3 | ||||
-rw-r--r-- | scope.c | 5 | ||||
-rw-r--r-- | scope.h | 2 | ||||
-rw-r--r-- | sem_check.c | 6 | ||||
-rw-r--r-- | sem_check.h | 3 | ||||
-rw-r--r-- | tree.c | 8 | ||||
-rw-r--r-- | tree.h | 2 |
9 files changed, 23 insertions, 13 deletions
@@ -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; @@ -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; @@ -1,5 +1,8 @@ #ifndef PC_H #define PC_H + +#include "y.tab.h" + char* pretty_type(int); void debug_print(int, union YYSTYPE*); @@ -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; @@ -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*); @@ -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) @@ -1,6 +1,8 @@ #ifndef TREE_H #define TREE_H +#include "node.h" + typedef struct parse_tree { int type; union { |