Documentation ¶
Overview ¶
Package ir (intermediate representation) transforms nodes in the go/ast format into a more workable "IR" format.
Index ¶
- func FuncGoIdent(fn *Func) string
- func IdentExprIsExported(expr ast.Expr) bool
- func IdentIsInternal(modNames UniqueModuleNames, id Ident) bool
- func ModulePathIsInternal(modNames UniqueModuleNames, p string) bool
- func ParamsToIdents(modNames UniqueModuleNames, file *File, fl *ast.FieldList) (idents []NamedIdent, substImports []*File, err error)
- type File
- type Func
- type IR
- type Ident
- type Interface
- type NamedIdent
- type Struct
- type UniqueModuleNames
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FuncGoIdent ¶
func IdentExprIsExported ¶
func IdentIsInternal ¶
func IdentIsInternal(modNames UniqueModuleNames, id Ident) bool
func ModulePathIsInternal ¶
func ModulePathIsInternal(modNames UniqueModuleNames, p string) bool
func ParamsToIdents ¶
func ParamsToIdents(modNames UniqueModuleNames, file *File, fl *ast.FieldList) (idents []NamedIdent, substImports []*File, err error)
Types ¶
type File ¶
type Func ¶
type Func struct { Name Ident Recv *Ident // non-nil for methods Params []NamedIdent Results []NamedIdent File *File }
type IR ¶
type IR struct { Funcs map[string]*Func Interfaces map[string]*Interface Structs map[string]*Struct Typedefs map[string]Ident Values map[string]NamedIdent // consts and vars }
func (*IR) ResolveInheritancesAndMethods ¶
func (ir *IR) ResolveInheritancesAndMethods(modNames UniqueModuleNames) error
Resolves interface, struct, and method inheritance
type Ident ¶
func (*Ident) GetReferencedPackage ¶
func (id *Ident) GetReferencedPackage(modNames UniqueModuleNames, file *File) (*File, bool)
Returns *SelectorExpr referenced *File, true. If id is not *SelectorExpr, returns nil, false.
type Interface ¶
func NewInterface ¶
func NewInterface(modNames UniqueModuleNames, file *File, name *ast.Ident, ifaceTyp *ast.InterfaceType) (*Interface, error)
type NamedIdent ¶
type Struct ¶
type Struct struct { Name Ident Fields []NamedIdent Methods map[string]*Func Inherits []Ident }
func NewStruct ¶
func NewStruct(modNames UniqueModuleNames, file *File, name *ast.Ident, structTyp *ast.StructType) (*Struct, error)
type UniqueModuleNames ¶
Module path to globally unique name.
Click to show internal directories.
Click to hide internal directories.