model

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const CURRENT_VERSION = "5"

Variables

This section is empty.

Functions

This section is empty.

Types

type CallGraph

type CallGraph struct {
	Nodes   map[string]*Node
	Version string
}

func NewCallGraph

func NewCallGraph() *CallGraph

func (*CallGraph) AddEdge

func (cg *CallGraph) AddEdge(parent, child *Node, callLine int)

func (*CallGraph) AddNode

func (cg *CallGraph) AddNode(filename, name, symbol string, IsApplicationNode, IsStdLibNode bool, lineStart, lineEnd int) *Node

func (*CallGraph) EdgeCount

func (cg *CallGraph) EdgeCount() int

func (*CallGraph) GetNode

func (cg *CallGraph) GetNode(symbol string) *Node

func (*CallGraph) NodeCount

func (cg *CallGraph) NodeCount() int

func (*CallGraph) ToBytes

func (cg *CallGraph) ToBytes() ([]byte, error)

type Edge

type Edge struct {
	Parent   *Node
	CallLine int
}

type Node

type Node struct {
	Filename          string
	Name              string
	Symbol            string
	IsApplicationNode bool
	IsStdLibNode      bool
	LineStart         int
	LineEnd           int
	Parents           []Edge
}

We store the graph in reverse, so child -> parent. This increases the speed of the graph traversal.

func (*Node) ToBytes

func (n *Node) ToBytes() []byte

Jump to

Keyboard shortcuts

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