aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.c
blob: 3f9be2ee902472ae8ff43143eb22ae351f0bc3d6 (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 = infile_open(argv[1]);
    TokenArray* pp_tokens = preprocess(source);
    TokenArray* tokens = tokenize(pp_tokens);
    Program* prog = parse(tokens);
    codegen(prog);
}