chibicc/main.c

16 lines
287 B
C
Raw Normal View History

2020-10-07 14:11:16 +03:00
#include "chibicc.h"
2019-08-03 09:36:43 +03:00
int main(int argc, char **argv) {
if (argc != 2)
error("%s: invalid number of arguments", argv[0]);
// Tokenize and parse.
2020-10-07 14:11:16 +03:00
Token *tok = tokenize(argv[1]);
Obj *prog = parse(tok);
2020-10-07 14:12:19 +03:00
// Traverse the AST to emit assembly.
codegen(prog);
return 0;
}