Documentation ¶
Index ¶
- Variables
- func NewLogger() *zap.SugaredLogger
- type FileUnit
- type KindRepr
- type LangType
- type Parser
- type Point
- type Query
- type Runner
- type Span
- type Unit
- func DebugDfs(unit *Unit, layer int) *Unit
- func FindAll(unit *Unit) []*Unit
- func FindAllByKindInParent(unit *Unit, kind KindRepr) []*Unit
- func FindAllByKindInSubs(unit *Unit, kind string) []*Unit
- func FindAllByKindInSubsWithBfs(unit *Unit, kind KindRepr) []*Unit
- func FindAllByKindInSubsWithDfs(unit *Unit, kind KindRepr) []*Unit
- func FindAllByKindsInSubs(unit *Unit, kinds ...string) []*Unit
- func FindAllByOneOfKindInParent(unit *Unit, kinds ...KindRepr) []*Unit
- func FindFirstByFieldInSubs(unit *Unit, fieldName string) *Unit
- func FindFirstByFieldInSubsWithBfs(unit *Unit, fieldName string) *Unit
- func FindFirstByFieldInSubsWithDfs(unit *Unit, fieldName string) *Unit
- func FindFirstByKindInParent(unit *Unit, kind KindRepr) *Unit
- func FindFirstByKindInSubsWithBfs(unit *Unit, kind KindRepr) *Unit
- func FindFirstByKindInSubsWithDfs(unit *Unit, kind KindRepr) *Unit
- func FindFirstByOneOfKindInParent(unit *Unit, kinds ...KindRepr) *Unit
Constants ¶
This section is empty.
Variables ¶
View Source
var Log = NewLogger()
View Source
var SupportedLangs = []LangType{ LangJava, LangGo, LangPython, }
Functions ¶
func NewLogger ¶
func NewLogger() *zap.SugaredLogger
Types ¶
type LangType ¶
type LangType string
func LangTypeValueOf ¶
func (LangType) GetFileSuffix ¶
func (LangType) GetLanguage ¶
func (LangType) IsSupported ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser
- get almost all the nodes - convert them to units
type Query ¶
type Query struct { IsDfs bool IsTop2Bottom bool Kinds []string FieldNames []string // contains filtered or unexported fields }
func (*Query) Bottom2Top ¶
func (*Query) MatchField ¶
func (*Query) Top2Bottom ¶
type Unit ¶
type Unit struct { Kind KindRepr `json:"kind"` Span Span `json:"span"` FieldName string `json:"fieldName"` Content string `json:"content"` // double linked ParentUnit *Unit SubUnits []*Unit }
Unit
almost a node, but with enough data for analyzer. no need to access raw byte data again
func FindAllByKindInParent ¶
func FindAllByKindInSubs ¶
func FindAllByKindsInSubs ¶
func FindFirstByFieldInSubs ¶
func FindFirstByKindInParent ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.