codegen

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 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 MakeGrammarString

func MakeGrammarString(g parser.Grammar) *goNode

func MakeTypesFromGrammar

func MakeTypesFromGrammar(g parser.Grammar) map[string]grammarType

func Write

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

Types

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