From 3b5de0beed36c10798f96972ec9c9eeb142561c2 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Tue, 25 Jun 2024 00:19:17 -0400 Subject: Start work on ast gen --- tnslc/compile/generator.tnsl | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'tnslc/compile/generator.tnsl') diff --git a/tnslc/compile/generator.tnsl b/tnslc/compile/generator.tnsl index eedc552..10c75f8 100644 --- a/tnslc/compile/generator.tnsl +++ b/tnslc/compile/generator.tnsl @@ -1,25 +1,11 @@ -~uint8 TOKEN_COUNT = "Token count: %d\n\0" /; generate (~utils.File fin, fout) - utils.Vector tokens = tokenize(fin) - - _print_num(TOKEN_COUNT, tokens.count) - - fout`.create() - - /; loop (int i = 0; i < tokens.count) [i++] - ~Token tok = tokens.get(i) - ~uint8 buf = tok`.sprint() - fout`.write_cstr(buf) - fout`.write('\n') - _delete(buf) - ;/ - - fout`.close() - - free_token_list(~tokens) + Node root + root.init(NT_MODULE, NULL) + build_file(fin, ~root) + root.end() ;/ -- cgit v1.2.3