From 3ddc6c61c8cd42b89758d9d5527c00a023b511b2 Mon Sep 17 00:00:00 2001 From: Luna Date: Wed, 13 Nov 2019 20:27:39 -0300 Subject: [PATCH] add basic x86 struct --- src/x86.zig | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/x86.zig diff --git a/src/x86.zig b/src/x86.zig new file mode 100644 index 0000000..d1e6713 --- /dev/null +++ b/src/x86.zig @@ -0,0 +1,27 @@ +const std = @import("std"); +const ast = @import("ast.zig"); +const comp = @import("comp_ctx.zig"); + +pub const CompileError = error{ + EmitError, + TypeError, + Invalid, +}; + +pub const Codegenx86 = struct { + allocator: *std.mem.Allocator, + ctx: *comp.CompilationContext, + + current_function_name: ?[]const u8 = null, + + pub fn init(allocator: *std.mem.Allocator, ctx: *comp.CompilationContext) Codegen { + return Codegen{ + .allocator = allocator, + .ctx = ctx, + }; + } + + // TODO + + pub fn gen(self: *Codegen, root: *ast.Node) !void {} +};