symbols

package
v0.0.0-...-9dcd13a Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mangle

func Mangle(pkgPath string, name string) string

Mangle returns a Emacs-style public symbol name. Mangle("pkg", "name") => "goism-pkg.name".

func MangleMethod

func MangleMethod(pkgPath string, recv string, name string) string

MangleMethod is like Mangle, but intended to be used for method names. MangleMethod("pkg", "recv", "name") => "goism-pkg.recv.name"

func ManglePriv

func ManglePriv(pkgPath string, name string) string

ManglePriv returns a Emacs-style private symbol name. Used for symbols that are automatically generated by the goism. ManglePriv("pkg", "name") => "goism--pkg.name".

Types

type Env

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

func NewEnv

func NewEnv(pkgPath string) *Env

func (*Env) ContainsVar

func (env *Env) ContainsVar(name string) bool

func (*Env) InternVar

func (env *Env) InternVar(pkg *types.Package, name string) string

type FuncTable

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

FuncTable contains all functions that are used in a package that is being translated.

func NewFuncTable

func NewFuncTable(masterPkg *types.Package) *FuncTable

NewFuncTable creates initialized function table.

func (*FuncTable) Inserter

func (ftab *FuncTable) Inserter() *FuncTableInserter

Inserter returns FuncTableInserter that can be used to add function table entries.

func (*FuncTable) LookupFunc

func (ftab *FuncTable) LookupFunc(p *types.Package, name string) *sexp.Func

LookupFunc returns stored function or nil if no entry is found.

func (*FuncTable) LookupMethod

func (ftab *FuncTable) LookupMethod(recv *types.TypeName, name string) *sexp.Func

LookupMethod returns stored method or nil if no entry is found.

func (*FuncTable) MasterPkg

func (ftab *FuncTable) MasterPkg() *types.Package

MasterPkg returns function table bound package.

type FuncTableInserter

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

FuncTableInserter collects functions to fill FunctionTable.

func (*FuncTableInserter) Func

func (ins *FuncTableInserter) Func(p *types.Package, name string, fn *sexp.Func)

Func inserts a new function into table.

func (*FuncTableInserter) GetAllFuncs

func (ins *FuncTableInserter) GetAllFuncs() []*sexp.Func

GetAllFuncs returns all functons ever inserted into function table. Returned slice elements are sorted with in-source declaration order.

func (*FuncTableInserter) GetMasterFuncs

func (ins *FuncTableInserter) GetMasterFuncs() []*sexp.Func

GetMasterFuncs returns functions that are defined inside master package. Returned slice elements are sorted with in-source declaration order.

func (*FuncTableInserter) Method

func (ins *FuncTableInserter) Method(recv *types.TypeName, name string, fn *sexp.Func)

Method inserts a new method into table.

type Itab

type Itab struct {
	Name     string // Symbol name
	ImplName string // Implementation type name
	Iface    *types.Interface
}

Itab contains information about interface table variable.

type ItabEnv

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

ItabEnv used to store interface dynamic type info.

func NewItabEnv

func NewItabEnv(masterPkg *types.Package) *ItabEnv

func (*ItabEnv) GetMasterItabs

func (env *ItabEnv) GetMasterItabs() []Itab

func (*ItabEnv) Intern

func (env *ItabEnv) Intern(implTyp, ifaceTyp *types.Named) string

Intern returns itab variable name.

Jump to

Keyboard shortcuts

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