Help us shape the future of Go! Take the 2026 Go Developer Survey

graph

package
v0.0.0-...-e56422a Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterEntities

func FilterEntities(node []*Node, query parser.Query) bool

func GenerateMethodID

func GenerateMethodID(methodName string, parameters []string, sourceFile string) string

func GenerateSha256

func GenerateSha256(input string) string

func QueryEntities

func QueryEntities(graph *CodeGraph, query parser.Query) (nodes [][]*Node, output [][]string)

func ReplacePredicateVariables

func ReplacePredicateVariables(query parser.Query) string

Types

type CodeGraph

type CodeGraph struct {
	Nodes map[string]*Node
	Edges []*Edge
}

func Initialize

func Initialize(directory string) *CodeGraph

func NewCodeGraph

func NewCodeGraph() *CodeGraph

func (*CodeGraph) AddEdge

func (g *CodeGraph) AddEdge(from, to *Node)

func (*CodeGraph) AddNode

func (g *CodeGraph) AddNode(node *Node)

func (*CodeGraph) FindNodesByType

func (g *CodeGraph) FindNodesByType(nodeType string) []*Node

FindNodesByType finds all nodes of a given type.

type Edge

type Edge struct {
	From *Node
	To   *Node
}

type Env

type Env struct {
	Node *Node
}

func (*Env) GetAnnotations

func (env *Env) GetAnnotations() []string

func (*Env) GetArgumentNames

func (env *Env) GetArgumentNames() []string

func (*Env) GetArgumentTypes

func (env *Env) GetArgumentTypes() []string

func (*Env) GetBinaryExpr

func (env *Env) GetBinaryExpr() *model.BinaryExpr

func (*Env) GetDoc

func (env *Env) GetDoc() *model.Javadoc

func (*Env) GetInterfaces

func (env *Env) GetInterfaces() []string

func (*Env) GetLeftOperand

func (env *Env) GetLeftOperand() string

func (*Env) GetName

func (env *Env) GetName() string

func (*Env) GetReturnType

func (env *Env) GetReturnType() string

func (*Env) GetRightOperand

func (env *Env) GetRightOperand() string

func (*Env) GetScope

func (env *Env) GetScope() string

func (*Env) GetSuperClass

func (env *Env) GetSuperClass() string

func (*Env) GetThrowsTypes

func (env *Env) GetThrowsTypes() []string

func (*Env) GetVariableDataType

func (env *Env) GetVariableDataType() string

func (*Env) GetVariableValue

func (env *Env) GetVariableValue() string

func (*Env) GetVisibility

func (env *Env) GetVisibility() string

func (*Env) HasAccess

func (env *Env) HasAccess() bool

func (*Env) IsJavaSourceFile

func (env *Env) IsJavaSourceFile() bool

func (*Env) ToString

func (env *Env) ToString() string

type Node

type Node struct {
	ID                   string
	Type                 string
	Name                 string
	CodeSnippet          string
	LineNumber           uint32
	OutgoingEdges        []*Edge
	IsExternal           bool
	Modifier             string
	ReturnType           string
	MethodArgumentsType  []string
	MethodArgumentsValue []string
	PackageName          string
	ImportPackage        []string
	SuperClass           string
	Interface            []string
	DataType             string
	Scope                string
	VariableValue        string

	File string

	ThrowsExceptions []string
	Annotation       []string
	JavaDoc          *model.Javadoc
	BinaryExpr       *model.BinaryExpr
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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