aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.c
blob: 733f6c1a1e3270f7df1396533d4b436fc945dec3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Currently the source code depends on the #include order.
// clang-format off
#include "std.h"
#include "common.c"
#include "io.c"
#include "sys.c"
#include "preprocess.c"
#include "tokenize.c"
#include "ast.c"
#include "parse.c"
#include "codegen.c"
// clang-format on

int main(int argc, char** argv) {
    if (argc == 1) {
        fatal_error("usage: ducc <FILE>");
    }
    InFile* source = read_all(argv[1]);
    Token* pp_tokens = preprocess(source);
    Token* tokens = tokenize(pp_tokens);
    Program* prog = parse(tokens);
    codegen(prog);
}