From 274ea767a2821012132d9365e4e42237b3a006cd Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Tue, 1 Jun 2021 15:18:09 +0200 Subject: [PATCH] Added plumbing for code generation --- source/tlang/compiler/codegen/core.d | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 source/tlang/compiler/codegen/core.d diff --git a/source/tlang/compiler/codegen/core.d b/source/tlang/compiler/codegen/core.d new file mode 100644 index 0000000..ef3da41 --- /dev/null +++ b/source/tlang/compiler/codegen/core.d @@ -0,0 +1,32 @@ +module compiler.codegen.core; + +import compiler.symbols.data; + +/** +* TODO: Perhaps have an interface that can emit(Context/Parent, Statement) +*/ + +/* TODO: Module linking (general overhaul required) */ + +public class CodeGenerator +{ + /* The Module */ + Module modulle; + + this(Module modulle) + { + this.modulle = modulle; + } +} + +public import compiler.codegen.dgen; + +/** +* Emittable +* +* All structures that can emit code go under here +*/ +public interface Emittable +{ + public string emit(); +} \ No newline at end of file