summaryrefslogtreecommitdiff
path: root/tnslc/compile/codegen.tnsl
diff options
context:
space:
mode:
authorKai Gunger <kgunger12@gmail.com>2025-11-28 23:54:11 -0500
committerKai Gunger <kgunger12@gmail.com>2025-11-28 23:54:11 -0500
commit51854e5db46033712b5dbbf78d769ea500eca14f (patch)
treef0a10a0538dadc4b67ad25608382a13fc0299f4f /tnslc/compile/codegen.tnsl
parent72ff4422208b096e7374768ae49f050b8457f361 (diff)
Update module building code
Diffstat (limited to 'tnslc/compile/codegen.tnsl')
-rw-r--r--tnslc/compile/codegen.tnsl30
1 files changed, 26 insertions, 4 deletions
diff --git a/tnslc/compile/codegen.tnsl b/tnslc/compile/codegen.tnsl
index caaafb7..ccb6b06 100644
--- a/tnslc/compile/codegen.tnsl
+++ b/tnslc/compile/codegen.tnsl
@@ -1,8 +1,30 @@
/; generate (~utils.File fin, fout)
- parse.Node ast = parse.generate_ast(fin)
- ast.update_children()
- parse.print_ast(~ast)
- ast.end()
+ # Parse files into AST
+ parse.Node ast = parse.generate_ast(fin)
+ ast.update_children()
+ parse.print_ast(~ast)
+
+ # Create output buffer
+ CompBuf buffer
+ buffer.init()
+
+ # Transform into a module tree
+ # Module mod
+ # mod.init(~ast)
+ # mod.update_children()
+
+ # Compile code
+ # mod.compile(~buffer)
+
+ # Write assembly to output file
+ # fout.create()
+ # buffer.write_to(fout)
+ # fout.close()
+
+ # Free all structs
+ # mod.end()
+ buffer.end()
+ ast.end()
;/