diff options
| author | Elis Eriksson <spelis@spelis.li> | 2026-06-13 17:40:25 +0200 |
|---|---|---|
| committer | Elis Eriksson <spelis@spelis.li> | 2026-06-13 17:40:25 +0200 |
| commit | 7ccae1c362a45b28f4fbf96da4f479730e4b382b (patch) | |
| tree | f59ba4d76221590901784464a03a6a871d774305 /src/bfc.c | |
| download | bfc-7ccae1c362a45b28f4fbf96da4f479730e4b382b.tar bfc-7ccae1c362a45b28f4fbf96da4f479730e4b382b.tar.gz bfc-7ccae1c362a45b28f4fbf96da4f479730e4b382b.tar.bz2 bfc-7ccae1c362a45b28f4fbf96da4f479730e4b382b.tar.lz bfc-7ccae1c362a45b28f4fbf96da4f479730e4b382b.tar.xz bfc-7ccae1c362a45b28f4fbf96da4f479730e4b382b.tar.zst bfc-7ccae1c362a45b28f4fbf96da4f479730e4b382b.zip | |
Initial Commit, probably needs heavy code cleanup
Diffstat (limited to 'src/bfc.c')
| -rw-r--r-- | src/bfc.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/bfc.c b/src/bfc.c new file mode 100644 index 0000000..2e369cf --- /dev/null +++ b/src/bfc.c @@ -0,0 +1,30 @@ +#include "all.h" +#include "str.h" +#include <stddef.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.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); + + // lex_free(&lexer); + // parser_free(&p); + + str c_code = gen_code(ast); + + ast_free(ast); + + printf("%s", c_code.data); + + free_str(&input); + return 0; +} |
