codegens

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(gen Generator, nodes []parser.Node) string

Types

type Generator

type Generator interface {
	File() string
	Lang() GeneratorLanguage
	GenHeader(stmt *parser.HeaderStmt) string
	GenStruct(ctrDeclarations []string, stmt *parser.CtrStmt) string
	GenReservedIds(stmt *parser.CtrStmt) string
	GenSize(stmt *parser.CtrStmt) string
	GenMarshal(stmt *parser.CtrStmt) string
	GenUnmarshal(stmt *parser.CtrStmt) string
	GenSizePlain(stmt *parser.CtrStmt) string
	GenMarshalPlain(stmt *parser.CtrStmt) string
	GenUnmarshalPlain(stmt *parser.CtrStmt) string
}

func NewGenerator

func NewGenerator(lang GeneratorLanguage, file string) Generator

type GeneratorLanguage

type GeneratorLanguage string
const (
	GenGolang GeneratorLanguage = "go"
)

func (GeneratorLanguage) String

func (lang GeneratorLanguage) String() string

type GoGenerator

type GoGenerator struct {
	// contains filtered or unexported fields
}

func NewGoGenerator

func NewGoGenerator(file string) *GoGenerator

func (GoGenerator) File

func (gg GoGenerator) File() string

func (GoGenerator) GenHeader

func (gen GoGenerator) GenHeader(stmt *parser.HeaderStmt) string

func (GoGenerator) GenMarshal

func (gen GoGenerator) GenMarshal(stmt *parser.CtrStmt) string

func (GoGenerator) GenMarshalPlain

func (gen GoGenerator) GenMarshalPlain(stmt *parser.CtrStmt) string

func (GoGenerator) GenReservedIds

func (gen GoGenerator) GenReservedIds(stmt *parser.CtrStmt) string

func (GoGenerator) GenSize

func (gen GoGenerator) GenSize(stmt *parser.CtrStmt) string

func (GoGenerator) GenSizePlain

func (gen GoGenerator) GenSizePlain(stmt *parser.CtrStmt) string

func (GoGenerator) GenStruct

func (gen GoGenerator) GenStruct(ctrDeclarations []string, stmt *parser.CtrStmt) string

func (GoGenerator) GenUnmarshal

func (gen GoGenerator) GenUnmarshal(stmt *parser.CtrStmt) string

func (GoGenerator) GenUnmarshalPlain

func (gen GoGenerator) GenUnmarshalPlain(stmt *parser.CtrStmt) string

func (GoGenerator) Lang

func (gg GoGenerator) Lang() GeneratorLanguage

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL