generate the instruction table

This commit is contained in:
Michael McLoughlin
2018-11-24 13:47:30 -08:00
parent f1e1da6387
commit 70dcf2b611
8 changed files with 25542 additions and 11 deletions

View File

@@ -5,15 +5,17 @@ import (
)
type godata struct {
cfg Config
}
func NewGoData() Interface {
return GoFmt(godata{})
func NewGoData(cfg Config) Interface {
return GoFmt(godata{cfg: cfg})
}
func (g godata) Generate(is []*inst.Instruction) ([]byte, error) {
p := &printer{}
p.Printf("// %s\n\n", g.cfg.GeneratedWarning())
p.Printf("package inst\n\n")
p.Printf("var Instructions = []Instruction{\n")