From 98f0c51119f9d42d733f44cb516b1c2bcd9061af Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 4 Feb 2024 15:23:59 -0500 Subject: Initial commit --- nextlang.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 nextlang.c (limited to 'nextlang.c') 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 +#include +#include +#include + +#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 -- cgit v1.2.3