blob: d567f88c60d8bdda6dd1d33753df3d285cc35b48 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#include "all.h"
#include "str.h"
int main(void) {
str input = {0};
str_append_fread(&input, stdin);
lexer_t lexer = lex_init(&input);
lex_run(&lexer);
parser_t p = parser_init(&lexer);
ast_node_t *ast = parse_program(&p);
str c_code = gen_code(ast);
ast_free(ast);
printf("%s", c_code.data);
free_str(&input);
return 0;
}
|