languagecomponents

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependency

type Dependency struct {
	FromPackage *Package
	FromFile    *File
	FromObject  *Object
	FromFunc    *Function

	ToPackage *Package
	ToFile    *File
	ToObject  *Object
	ToFunc    *Function
}

func NewDependency

func NewDependency(fromPackage *Package, fromFile *File, fromObject *Object, fromFunc *Function, toPackage *Package, toFile *File, toObject *Object, toFunc *Function) *Dependency

func (*Dependency) String

func (d *Dependency) String() string

type DependencyList

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

func NewDependencyList

func NewDependencyList(pkgs Packages) *DependencyList

func (*DependencyList) Aggregate

func (d *DependencyList) Aggregate() Packages

func (*DependencyList) Files

func (d *DependencyList) Files(pkg *Package) []*File

func (*DependencyList) List

func (d *DependencyList) List() []*Dependency

func (*DependencyList) Methods

func (d *DependencyList) Methods(obj *Object) []*Function

func (DependencyList) Objects

func (d DependencyList) Objects(file *File) []*Object

func (*DependencyList) String

func (d *DependencyList) String() string

func (*DependencyList) TopologicalSort

func (d *DependencyList) TopologicalSort() *DependencyList

type File

type File struct {
	Name        string
	Dir         string
	PackageName string
	Objects     []*Object
	Interfaces  []*Interface
	Funcs       []*Function
	// contains filtered or unexported fields
}

func NewFile

func NewFile(name string, syntax *ast.File, fset *token.FileSet) *File

func (*File) Analyze

func (f *File) Analyze(pkgs Packages) (*DependencyList, error)

func (*File) AnalyzeGenDecls

func (f *File) AnalyzeGenDecls(pkgs Packages) Packages

func (*File) String

func (f *File) String() string

type Function

type Function struct {
	Name string
	Pos  token.Pos
}

func NewFunction

func NewFunction(name string, pos token.Pos) *Function

func (*Function) String

func (f *Function) String() string

type Interface

type Interface struct {
	Name    string
	Package *Package
	File    *File
	Methods []*Function
	Pos     token.Pos
}

func NewInterface

func NewInterface(name string, methods []*Function, pkg *Package, file *File, pos token.Pos) *Interface

type Object

type Object struct {
	Name               string
	Type               string
	Pos                token.Pos
	Methods            []*Function
	ImplementInterface *Interface
	// contains filtered or unexported fields
}

func NewObject

func NewObject(name, t string, pos token.Pos, obj types.Object) *Object

func (*Object) IsInterface

func (o *Object) IsInterface() bool

func (*Object) IsStruct

func (o *Object) IsStruct() bool

func (*Object) String

func (o *Object) String() string

type Package

type Package struct {
	Name  string
	Files []*File
	// contains filtered or unexported fields
}

func NewPackage

func NewPackage(name string, pkg *packages.Package) *Package

func (*Package) String

func (p *Package) String() string

type Packages

type Packages []*Package

func (Packages) Analyze

func (p Packages) Analyze() (*DependencyList, error)

func (Packages) FindPackageByPath

func (p Packages) FindPackageByPath(path string) *Package

func (Packages) FindReciverDeclarationByField

func (p Packages) FindReciverDeclarationByField(field *ast.Field) types.Object

func (Packages) Packages

func (p Packages) Packages() []*packages.Package

func (Packages) Unique

func (p Packages) Unique() Packages

type Project

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

func NewProject

func NewProject(program *ssa.Program, ssaPacakge []*ssa.Package, packages []*packages.Package) *Project

func (*Project) Analyze

func (p *Project) Analyze() (Packages, *DependencyList, error)

Jump to

Keyboard shortcuts

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