aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2022-04-18 16:27:21 -0300
committerBad Diode <bd@badd10de.dev>2022-04-18 16:27:21 -0300
commit3da041f2e17fdeb69bf345aadf89c5fcc1814260 (patch)
treec1979ffee13f45f757712a61304a3edba89a80f5 /src/main.c
parentdcd3192e50d7b4ea333ecf57a7e8b325af145547 (diff)
downloadbdl-3da041f2e17fdeb69bf345aadf89c5fcc1814260.tar.gz
bdl-3da041f2e17fdeb69bf345aadf89c5fcc1814260.zip
Move semantic analysis to separate file
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 863d9d1..cdf4167 100644
--- a/src/main.c
+++ b/src/main.c
@@ -9,6 +9,7 @@
9#include "lexer.c" 9#include "lexer.c"
10#include "nodes.c" 10#include "nodes.c"
11#include "parser.c" 11#include "parser.c"
12#include "semantic.c"
12#include "viz.c" 13#include "viz.c"
13 14
14void 15void
@@ -29,9 +30,13 @@ process_source(const StringView *source, const char *file_name) {
29 // print_tokens(tokens); 30 // print_tokens(tokens);
30 31
31 // Parser. 32 // Parser.
32 ParseTree *parse_tree = parse(tokens); 33 Root *roots = parse(tokens);
33 check_errors(file_name); 34 check_errors(file_name);
34 viz_ast(parse_tree); 35 // viz_ast(roots);
36
37 // Symbol table generation and type checking.
38 ParseTree *parse_tree = semantic_analysis(roots);
39 viz_ast(parse_tree->roots);
35} 40}
36 41
37void 42void