ellyn_ast

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

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 10 Imported by: 1

README

ast遍历框架

封装go应用程序ast遍历逻辑

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

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

type DefaultProcessor

type DefaultProcessor struct {
}

func (DefaultProcessor) FilterFile

func (d DefaultProcessor) FilterFile(progCtx *ProgramContext, pkg Package, file fs.FileInfo) bool

func (DefaultProcessor) FilterPackage

func (d DefaultProcessor) FilterPackage(progCtx *ProgramContext, pkg Package) bool

func (DefaultProcessor) HandleFile

func (d DefaultProcessor) HandleFile(progCtx *ProgramContext, pkg Package, file fs.FileInfo, content []byte)

type GoFunc

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

type Package

type Package struct {
	// Dir pkg在本地文件系统的绝对路径
	Dir string
	// Name pkg名,如ellyn
	Name string
	// Path Pkg全路径,即写代码时的Import path. 如:github.com/lvyahui8/ellyn
	Path string
}

func NewPackage

func NewPackage(dir, path string) Package

type Processor

type Processor interface {
	FilterPackage(progCtx *ProgramContext, pkg Package) bool
	FilterFile(progCtx *ProgramContext, pkg Package, file fs.FileInfo) bool
	HandleFile(progCtx *ProgramContext, pkg Package, file fs.FileInfo, content []byte)
}

type Program

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

func NewProgram

func NewProgram(mainPkgDir string, processor Processor) *Program

func (*Program) Visit

func (p *Program) Visit()

Visit 触发项目扫描处理动作

type ProgramContext

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

func (*ProgramContext) RootPkgPath

func (p *ProgramContext) RootPkgPath() string

Jump to

Keyboard shortcuts

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