codegen

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropCaps

func DropCaps(rule string) string

func GoName added in v0.14.0

func GoName(rule string) string

func GoTypeName

func GoTypeName(rule string) string

func IdentName

func IdentName(name string) string

func Write

func Write(w io.Writer, data TemplateData) error

Types

type GoNode added in v0.21.0

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

func MakeGrammarString

func MakeGrammarString(g parser.Grammar) *GoNode

func (*GoNode) Add added in v0.21.0

func (g *GoNode) Add(n GoNode)

func (*GoNode) String added in v0.21.0

func (g *GoNode) String() string

type GrammarType added in v0.21.0

type GrammarType interface {
	TypeName() string
	Ident() string
	String() string
	Children() []GrammarType
	CallbackData() *callbackData
}

type IdentsWriter

type IdentsWriter struct {
	wbnf.GrammarNode
}

func (IdentsWriter) String

func (i IdentsWriter) String() string

type TemplateData

type TemplateData struct {
	CommandLine string
	PackageName string

	StartRule         string
	StartRuleTypeName string

	Grammar *GoNode

	MiddleSection []fmt.Stringer
}

type TypeMap

type TypeMap map[string]GrammarType

type TypesData

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

func MakeTypes

func MakeTypes(node wbnf.GrammarNode) *TypesData

func (*TypesData) Get

func (d *TypesData) Get() []fmt.Stringer

func (*TypesData) Types

func (d *TypesData) Types() map[string]GrammarType

type VisitorWriter

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

func GetVisitorWriter

func GetVisitorWriter(types map[string]GrammarType, startRule string) VisitorWriter

func (VisitorWriter) String

func (w VisitorWriter) String() string

Jump to

Keyboard shortcuts

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