walker

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(ast common.INode, simple bool)

func RunGobRegister

func RunGobRegister()

func RunReturnable added in v0.7.1

func RunReturnable(tree common.INode) common.INode

func RunTemplateGenerator added in v0.7.1

func RunTemplateGenerator(tree common.INode, templates *Templates)

func RunTemplateLoader added in v0.7.2

func RunTemplateLoader(tree common.INode, templates *Templates)

func RunTemplateParse added in v0.7.1

func RunTemplateParse(file *common.File, templates *Templates)

func RunTemplateReplace added in v0.7.2

func RunTemplateReplace(tree common.INode, typeSrc []string, typeDest []string) common.INode

func RunTemplateUsage added in v0.7.1

func RunTemplateUsage(file *common.File, templates *Templates)

func TypeCheck

func TypeCheck(ast common.INode)

Types

type AstWalker

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

func (*AstWalker) Trigger

func (this *AstWalker) Trigger(arg reflect.Value, parentField reflect.Value, parentNode common.INode) (reflect.Value, bool)

func (*AstWalker) Walk

func (this *AstWalker) Walk(tree common.INode) common.INode

type Desugar

type Desugar struct {
	Templates *Templates
}

func NewDesugar

func NewDesugar() *Desugar

func (*Desugar) Run added in v0.7.1

func (this *Desugar) Run(files []*common.File)

type FuncSig

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

func NewFuncSig

func NewFuncSig() *FuncSig

type Printer

type Printer struct {
	AstWalker
	Simple bool
	// contains filtered or unexported fields
}

func (*Printer) After

func (this *Printer) After(n common.INode)

func (*Printer) Before

func (this *Printer) Before(n common.INode)

func (*Printer) Each

func (this *Printer) Each(n common.INode) common.INode

type Returnable added in v0.7.1

type Returnable struct {
	AstWalker
	Root common.INode
}

func (*Returnable) Function added in v0.7.1

func (this *Returnable) Function(n common.INode) common.INode

func (*Returnable) VarDecl added in v0.7.1

func (this *Returnable) VarDecl(n common.INode) common.INode

type Scope

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

func NewScope

func NewScope() *Scope

type Stack

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

func (*Stack) AddFunc

func (this *Stack) AddFunc(name string, f *FuncSig) bool

func (*Stack) AddVar

func (this *Stack) AddVar(name, t string) bool

func (*Stack) GetFunc

func (this *Stack) GetFunc(name string) *FuncSig

func (*Stack) GetVar

func (this *Stack) GetVar(name string) (string, bool)

func (*Stack) PopScope

func (this *Stack) PopScope()

func (*Stack) PushScope

func (this *Stack) PushScope()

type Template

type Template struct {
	Name         string
	Pack         string
	Types        []string
	UsedFor      [][]string
	GeneratedFor map[string][]string
	Node         common.INode
}

func NewTemplate added in v0.7.1

func NewTemplate(name, pack string, types []string, node common.INode) *Template

func (*Template) AddGeneratedFor added in v0.7.1

func (this *Template) AddGeneratedFor(types []string, packageName string)

func (*Template) AddUsedFor added in v0.7.1

func (this *Template) AddUsedFor(types []string)

func (*Template) IsGeneratedFor added in v0.7.1

func (this *Template) IsGeneratedFor(types []string, packageName string) bool

type TemplateGenerator added in v0.7.1

type TemplateGenerator struct {
	Root common.INode
}

func (*TemplateGenerator) GenerateStruct added in v0.7.1

func (this *TemplateGenerator) GenerateStruct(template *Template)

func (*TemplateGenerator) GenerateTemplates added in v0.7.2

func (this *TemplateGenerator) GenerateTemplates(templates *Templates)

func (*TemplateGenerator) GenerateTopFns added in v0.7.1

func (this *TemplateGenerator) GenerateTopFns(template *Template)

type TemplateParse added in v0.7.1

type TemplateParse struct {
	AstWalker
	Root       common.INode
	Package    string
	Templates  *Templates
	ImportName string
}

func (*TemplateParse) Signature added in v0.7.1

func (this *TemplateParse) Signature(n common.INode) common.INode

func (*TemplateParse) StructType added in v0.7.1

func (this *TemplateParse) StructType(n common.INode) common.INode

type TemplateReplace added in v0.7.2

type TemplateReplace struct {
	AstWalker
	// contains filtered or unexported fields
}

func (*TemplateReplace) Type added in v0.7.2

func (this *TemplateReplace) Type(n common.INode) common.INode

type TemplateSerie added in v0.7.2

type TemplateSerie struct {
	Name     string
	Template *Template
}

type TemplateUsage added in v0.7.1

type TemplateUsage struct {
	AstWalker
	File      *common.File
	Root      common.INode
	Package   string
	Templates *Templates
}

func (*TemplateUsage) Arguments added in v0.7.1

func (this *TemplateUsage) Arguments(n common.INode) common.INode

func (*TemplateUsage) CompositeLit added in v0.7.1

func (this *TemplateUsage) CompositeLit(n common.INode) common.INode

type Templates

type Templates struct {
	Names     []string
	Packages  []string
	Templates []*Template
}

func NewTemplates added in v0.7.1

func NewTemplates() *Templates

func (*Templates) Add

func (this *Templates) Add(name, pack string, template *Template)

func (*Templates) Decode added in v0.7.2

func (this *Templates) Decode(content []byte)

func (*Templates) Encode added in v0.7.2

func (this *Templates) Encode(arr []*Template) []byte

func (*Templates) Get

func (this *Templates) Get(name, pack string) *Template

func (Templates) ResetUsedFor added in v0.7.1

func (this Templates) ResetUsedFor()

func (Templates) Store added in v0.7.2

func (this Templates) Store()

type TypeChecker

type TypeChecker struct {
	AstWalker
	// contains filtered or unexported fields
}

func (*TypeChecker) AfterBlock

func (this *TypeChecker) AfterBlock(n common.INode)

func (*TypeChecker) Assignment

func (this *TypeChecker) Assignment(n common.INode) common.INode

func (*TypeChecker) BeforeBlock

func (this *TypeChecker) BeforeBlock(n common.INode)

func (*TypeChecker) Each

func (this *TypeChecker) Each(n common.INode) common.INode

func (*TypeChecker) VarSpec

func (this *TypeChecker) VarSpec(n common.INode) common.INode

Jump to

Keyboard shortcuts

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