Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallstackOfColoredFunctions ¶
type CallstackOfColoredFunctions struct {
// Stack is functions placed in order, only colored functions.
Stack Nodes
// ColorsChain is blended colors of stacked functions, one-by-one.
ColorsChain []palette.Color
// IndexSet is quick index for Contains(), has the same elements as stack.
IndexSet map[*Node]struct{}
// ColorsMask is mask of all ColorsChain.
ColorsMasks palette.ColorMasks
}
CallstackOfColoredFunctions is a structure for storing a stack of called colored functions with a quick check for the presence of a certain node.
func NewCallstackOfColoredFunctions ¶
func NewCallstackOfColoredFunctions() *CallstackOfColoredFunctions
NewCallstackOfColoredFunctions creates a new callstack.
func (*CallstackOfColoredFunctions) Append ¶
func (c *CallstackOfColoredFunctions) Append(fun *Node)
Append adds the passed node onto the stack.
func (*CallstackOfColoredFunctions) AsVector ¶
func (c *CallstackOfColoredFunctions) AsVector() Nodes
AsVector returns a slice of the functions that are on the stack.
func (*CallstackOfColoredFunctions) Contains ¶
func (c *CallstackOfColoredFunctions) Contains(fun *Node) bool
Contains checks for the existence of the passed node.
func (*CallstackOfColoredFunctions) PopBack ¶
func (c *CallstackOfColoredFunctions) PopBack()
PopBack removes the last function from the stack.
func (*CallstackOfColoredFunctions) Size ¶
func (c *CallstackOfColoredFunctions) Size() int
Size returns the number of functions.
type Graph ¶
Graph is a structure for storing the complete call graph, as well as the functions that are included in it.
type Node ¶
type Node struct {
Function *symbols.Function
// Next is an array of functions that are called from the current one.
// Prev is an array of functions that call the current one.
//
// All functions are always contained here, in contrast to Graph,
// where some functions can be deleted.
// Use these fields only if you need to know if there is a connection,
// but for other, use the Graph.
Next Nodes
Prev Nodes
// Pointer to a slice containing the
// following nodes that have colors.
NextWithColors *Nodes
}
Node is a structure for storing information about the functions that call the function, the functions in which the function is called, and the reachable colored functions from the function.