blob: dbf4ae2d1df130d13b30151a7006ef82647c5e1b [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package codegen
import (
"io"
"text/template"
"go.fuchsia.dev/fuchsia/tools/fidl/lib/fidlgen"
)
var syzDotTxtTmpl = func() *template.Template {
tmpls := template.New("SyzkallerTemplates")
template.Must(tmpls.Parse(syscallDescriptionTmpl))
template.Must(tmpls.Parse(protocolTmpl))
template.Must(tmpls.Parse(structTmpl))
template.Must(tmpls.Parse(unionTmpl))
return tmpls.Lookup("GenerateSyscallDescription")
}()
func Compile(w io.Writer, root fidlgen.Root) error {
return syzDotTxtTmpl.Execute(w, compile(root))
}