graphcoll

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEdgeListShouldHaveEvenLength = errors.New(`flat edge list should have an even length: [0, 1, 2, 3]`)
	ErrNodeAlreadyInGraph           = errors.New("node is already in the graph")
	ErrNodeNotInGraph               = errors.New("node is not in the graph")
)

Functions

This section is empty.

Types

type Graph

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

func NewGraph

func NewGraph(ctx *core.Context, nodeData *core.List, edges *core.List) *Graph

func (*Graph) Connect

func (g *Graph) Connect(ctx *core.Context, from, to *GraphNode)

func (*Graph) Equal

func (g *Graph) Equal(ctx *core.Context, other core.Value, alreadyCompared map[uintptr]uintptr, depth int) bool

func (*Graph) GetGoMethod

func (f *Graph) GetGoMethod(name string) (*core.GoFunction, bool)

func (*Graph) InsertNode

func (g *Graph) InsertNode(ctx *core.Context, v core.Value) *GraphNode

func (*Graph) IsMutable

func (g *Graph) IsMutable() bool

func (*Graph) Iterator

func (g *Graph) Iterator(ctx *core.Context, config core.IteratorConfiguration) core.Iterator

func (*Graph) PrettyPrint

func (g *Graph) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, parentIndentCount int)

func (*Graph) Prop

func (g *Graph) Prop(ctx *core.Context, name string) core.Value

func (*Graph) PropertyNames

func (*Graph) PropertyNames(ctx *core.Context) []string

func (*Graph) RemoveNode

func (g *Graph) RemoveNode(ctx *core.Context, node *GraphNode)

func (*Graph) SetProp

func (*Graph) SetProp(ctx *core.Context, name string, value core.Value) error

func (*Graph) ToSymbolicValue

func (g *Graph) ToSymbolicValue(ctx *core.Context, encountered map[uintptr]symbolic.Value) (symbolic.Value, error)

func (*Graph) Walker

func (g *Graph) Walker(*core.Context) (core.Walker, error)

type GraphNode

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

func (*GraphNode) Equal

func (n *GraphNode) Equal(ctx *core.Context, other core.Value, alreadyCompared map[uintptr]uintptr, depth int) bool

func (*GraphNode) GetGoMethod

func (n *GraphNode) GetGoMethod(name string) (*core.GoFunction, bool)

func (*GraphNode) IsMutable

func (n *GraphNode) IsMutable() bool

func (*GraphNode) PrettyPrint

func (n *GraphNode) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, parentIndentCount int)

func (*GraphNode) Prop

func (n *GraphNode) Prop(ctx *core.Context, name string) core.Value

func (*GraphNode) PropertyNames

func (*GraphNode) PropertyNames(ctx *core.Context) []string

func (*GraphNode) SetProp

func (*GraphNode) SetProp(ctx *core.Context, name string, value core.Value) error

func (*GraphNode) ToSymbolicValue

func (n *GraphNode) ToSymbolicValue(ctx *core.Context, encountered map[uintptr]symbolic.Value) (symbolic.Value, error)

type GraphWalker

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

func (*GraphWalker) Equal

func (wk *GraphWalker) Equal(ctx *core.Context, other core.Value, alreadyCompared map[uintptr]uintptr, depth int) bool

func (*GraphWalker) HasNext

func (wk *GraphWalker) HasNext(ctx *core.Context) bool

func (*GraphWalker) IsMutable

func (wk *GraphWalker) IsMutable() bool

func (*GraphWalker) Key

func (wk *GraphWalker) Key(ctx *core.Context) core.Value

func (*GraphWalker) Next

func (wk *GraphWalker) Next(ctx *core.Context) bool

func (*GraphWalker) NodeMeta

func (wk *GraphWalker) NodeMeta(*core.Context) core.WalkableNodeMeta

func (*GraphWalker) PrettyPrint

func (wk *GraphWalker) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, parentIndentCount int)

func (*GraphWalker) Prune

func (wk *GraphWalker) Prune(ctx *core.Context)

func (*GraphWalker) ToSymbolicValue

func (it *GraphWalker) ToSymbolicValue(ctx *core.Context, encountered map[uintptr]symbolic.Value) (symbolic.Value, error)

func (*GraphWalker) Value

func (wk *GraphWalker) Value(ctx *core.Context) core.Value

Jump to

Keyboard shortcuts

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