Documentation ¶
Index ¶
- func CallMember(recName, fieldName, methodName string, args ...ast.Expr) *ast.CallExpr
- func CloneFuncSig(f *ast.Func) *ast.Func
- func FieldByName(f ast.Node, name string) *ast.Field
- func File(n ast.Node) *ast.File
- func FindImplementations(ctx ast.Node, iface ast.Name) []*ast.Struct
- func FindMod(name token.String, prj *ast.Prj) (*ast.Mod, error)
- func FindPkg(mod *ast.Mod, pkgPath string) *ast.Pkg
- func FullQualifiedName(n ast.NamedType) string
- func LastPathSegment(path string) string
- func MakeTypeDecl(t *adl.TypeDecl) ast.TypeDecl
- func MethodByName(f ast.Node, name string) *ast.Func
- func MkFile(pkg *ast.Pkg, name string) *ast.File
- func MkMod(prj *ast.Prj, modName string) *ast.Mod
- func MkPkg(mod *ast.Mod, pkgPath string) *ast.Pkg
- func Mod(n ast.Node) *ast.Mod
- func Pkg(n ast.Node) *ast.Pkg
- func Resolve(ctx ast.Node, name string) ast.Node
- func ResolveLocal(ctx ast.Node, name string) ast.Node
- func TypeDecl(n ast.NamedType) ast.TypeDecl
- func UseTypeDeclIn(what ast.TypeDecl, where *ast.Pkg) ast.TypeDecl
- func WrapNode(n ast.Node) token.Position
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallMember ¶
func FindImplementations ¶
FindImplementations traverses the entire module to find structs which implement the given interface. Note that other types implementing an interface are (not yet) supported.
func FullQualifiedName ¶
FullQualifiedName tries to resolve and return the full qualified name (<package>.<Identifier>).
func LastPathSegment ¶
func MakeTypeDecl ¶
MakeTypeDecl converts the more unspecific and generic adl type description into the ast model.
func Resolve ¶
Resolve takes the name and walks until it finds whatever declares it. Returns nil if not found.
func UseTypeDeclIn ¶
UseTypeDeclIn does a quite complex job. It looks up the different parts of 'what' and creates a new TypeDecl to be used in another package ('where'). In languages with cycles, import definitions (and qualified names) may even interchange - per generic declaration!
Types ¶
This section is empty.