add basic x86 struct

This commit is contained in:
Luna 2019-11-13 20:27:39 -03:00
parent c743c804be
commit 3ddc6c61c8

27
src/x86.zig Normal file
View file

@ -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 {}
};