kmgen

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Generators []Generator

Generators is a list of all generators available and registered by RegisterGenerator

Functions

func RegisterGenerator

func RegisterGenerator(g Generator)

RegisterGenerator register the given Generator. You should use it on `init` function.

Types

type AssemblyScript

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

func (*AssemblyScript) Extensions

func (gen *AssemblyScript) Extensions() []string

func (*AssemblyScript) Finish

func (*AssemblyScript) Finish(output io.Writer, buffer io.Reader) error

func (*AssemblyScript) Language

func (gen *AssemblyScript) Language() string

func (*AssemblyScript) Options

func (gen *AssemblyScript) Options() map[string]string

func (*AssemblyScript) Start

func (gen *AssemblyScript) Start(file *kmparser.Content) (compiler Compiler, err error)

type C

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

func (*C) Extensions

func (gen *C) Extensions() []string

func (*C) Finish

func (*C) Finish(output io.Writer, buffer io.Reader) error

func (*C) Language

func (gen *C) Language() string

func (*C) Options

func (gen *C) Options() map[string]string

func (*C) Start

func (gen *C) Start(file *kmparser.Content) (compiler Compiler, err error)

type Compiler

type Compiler struct {
	Template []*template.Template
	Modules  []string
}

func NewTemplate

func NewTemplate(modules []string, funcs TemplateFunctions, pattern ...string) (compiler Compiler)

type DotNet

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

func (*DotNet) Extensions

func (gen *DotNet) Extensions() []string

func (*DotNet) Finish

func (*DotNet) Finish(output io.Writer, buffer io.Reader) error

func (*DotNet) Language

func (gen *DotNet) Language() string

func (*DotNet) Options

func (gen *DotNet) Options() map[string]string

func (*DotNet) Start

func (gen *DotNet) Start(file *kmparser.Content) (compiler Compiler, err error)

type Generator

type Generator interface {
	Start(file *kmparser.Content) (compiler Compiler, err error)
	Options() map[string]string
	Extensions() []string
	Language() string
	Finish(output io.Writer, buffer io.Reader) (err error)
}

func AssemblyScriptGenerator

func AssemblyScriptGenerator() Generator

func CGenerator

func CGenerator() Generator

func DotNetGenerator

func DotNetGenerator() Generator

func GolangGenerator

func GolangGenerator() Generator

func OdinGenerator

func OdinGenerator() Generator

func SwiftGenerator

func SwiftGenerator() Generator

func ZigGenerator

func ZigGenerator() Generator

type Golang

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

func (*Golang) Extensions

func (gen *Golang) Extensions() []string

func (*Golang) Finish

func (gen *Golang) Finish(output io.Writer, buffer io.Reader) error

func (*Golang) Language

func (gen *Golang) Language() string

func (*Golang) Options

func (gen *Golang) Options() map[string]string

func (*Golang) Start

func (gen *Golang) Start(file *kmparser.Content) (compiler Compiler, err error)

type Odin

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

func (*Odin) Extensions

func (gen *Odin) Extensions() []string

func (*Odin) Finish

func (*Odin) Finish(output io.Writer, buffer io.Reader) error

func (*Odin) Language

func (gen *Odin) Language() string

func (*Odin) Options

func (gen *Odin) Options() map[string]string

func (*Odin) Start

func (gen *Odin) Start(file *kmparser.Content) (compiler Compiler, err error)

type Swift

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

func (*Swift) Extensions

func (gen *Swift) Extensions() []string

func (*Swift) Finish

func (*Swift) Finish(output io.Writer, buffer io.Reader) error

func (*Swift) Language

func (gen *Swift) Language() string

func (*Swift) Options

func (gen *Swift) Options() map[string]string

func (*Swift) Start

func (gen *Swift) Start(file *kmparser.Content) (compiler Compiler, err error)

type TemplateData

type TemplateData struct {
	*kmparser.Content
}

type TemplateFunctions

type TemplateFunctions struct {
	FromTags func(s string) string

	ToDefault       func(typ kmparser.Type) string
	ToPlainDefault  func(typ kmparser.Type) string
	ToType          func(typ kmparser.Type) string
	ToPlainType     func(typ kmparser.Type) string
	ToTypeView      func(typ kmparser.Type) string
	ToPlainTypeView func(typ kmparser.Type) string
}

func NewTemplateFunctions

func NewTemplateFunctions(gen Generator, content *kmparser.Content) TemplateFunctions

type Zig

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

func (*Zig) Extensions

func (gen *Zig) Extensions() []string

func (*Zig) Finish

func (*Zig) Finish(output io.Writer, buffer io.Reader) error

func (*Zig) Language

func (gen *Zig) Language() string

func (*Zig) Options

func (gen *Zig) Options() map[string]string

func (*Zig) Start

func (gen *Zig) Start(file *kmparser.Content) (compiler Compiler, err error)

Jump to

Keyboard shortcuts

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