blob: 4307dbab618a2fbb366576be5951df112d8145a5 (
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]);
TokenArray* pp_tokens = preprocess(source);
TokenArray* tokens = tokenize(pp_tokens);
Program* prog = parse(tokens);
codegen(prog);
}
|