add basic x86 struct
This commit is contained in:
parent
c743c804be
commit
3ddc6c61c8
1 changed files with 27 additions and 0 deletions
27
src/x86.zig
Normal file
27
src/x86.zig
Normal 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 {}
|
||||||
|
};
|
Loading…
Reference in a new issue