diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-02-04 15:23:59 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-02-04 15:23:59 -0500 |
| commit | 98f0c51119f9d42d733f44cb516b1c2bcd9061af (patch) | |
| tree | 39ab4fa635f858b76b9a8bbf84701c2788d5f498 /nextlang.c | |
Initial commit
Diffstat (limited to 'nextlang.c')
| -rw-r--r-- | nextlang.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/nextlang.c b/nextlang.c new file mode 100644 index 00000000..617adc98 --- /dev/null +++ b/nextlang.c @@ -0,0 +1,23 @@ +#include <stdio.h> +#include <stdlib.h> +#include <gc.h> +#include <gc/cord.h> + +#include "ast.h" +#include "parse.h" +#include "compile.h" + +int main(int argc, char *argv[]) +{ + if (argc < 2) return 1; + + sss_file_t *f = sss_load_file(argv[1]); + ast_t *ast = parse_file(f, NULL); + const char *s = ast_to_str(ast); + puts(s); + CORD c = compile(ast); + CORD_put(c, stdout); + return 0; +} + +// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 |
