Documentation

Overview

    Package flow provides access to control flow graph computation and analysis for Go programs.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    This section is empty.

    Types

    type Computation

    type Computation interface {
    	Init(ast.Node)
    	Transfer(ast.Node)
    	Join(ast.Node, ast.Node) bool
    }

    type Graph

    type Graph struct {
    	FileSet *token.FileSet
    	Start   ast.Node
    	End     ast.Node
    	Follow  map[ast.Node][]ast.Node
    }

    func Build

    func Build(fset *token.FileSet, body *ast.BlockStmt, interesting func(ast.Node) bool) *Graph

      Build constructs a control flow graph, filtered to include only interesting nodes.

      func (*Graph) Dataflow

      func (g *Graph) Dataflow(compute Computation)

      func (*Graph) Dot

      func (g *Graph) Dot(edge func(src, dst ast.Node) string) []byte

      Source Files