diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2024-06-25 00:19:17 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2024-06-25 00:19:17 -0400 |
commit | 3b5de0beed36c10798f96972ec9c9eeb142561c2 (patch) | |
tree | d3d02830118992d229717e4657ff87d77ff01c1e /tnslc/compile/generator.tnsl | |
parent | c4c595fe22bc76aa4d27f2383ec68a0aa74da37c (diff) |
Start work on ast gen
Diffstat (limited to 'tnslc/compile/generator.tnsl')
-rw-r--r-- | tnslc/compile/generator.tnsl | 22 |
1 files changed, 4 insertions, 18 deletions
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() ;/ |