repos / gbc

GBC - Go B Compiler
git clone https://github.com/xplshn/gbc.git

gbc / pkg / codegen
xplshn  ·  2025-09-10

backend.go

Go
 1package codegen
 2
 3import (
 4	"bytes"
 5	"github.com/xplshn/gbc/pkg/config"
 6	"github.com/xplshn/gbc/pkg/ir"
 7)
 8
 9// Backend is an interface for code generation backends
10type Backend interface {
11	Generate(prog *ir.Program, cfg *config.Config) (*bytes.Buffer, error)
12	GenerateIR(prog *ir.Program, cfg *config.Config) (string, error)
13}