astx

package
v0.8.13 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package astx implements utility functions for generating abstract syntax trees of Graphviz DOT graphs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendAttr

func AppendAttr(list, attr interface{}) ([]*ast.Attr, error)

AppendAttr appends attr to the given attribute list.

func AppendAttrList

func AppendAttrList(optList, optAttrs interface{}) ([]*ast.Attr, error)

AppendAttrList appends the optional attrs to the given optional attribute list.

func AppendGraph

func AppendGraph(file, graph interface{}) (*ast.File, error)

AppendGraph appends graph to the given file.

func AppendStmt

func AppendStmt(list, stmt interface{}) ([]ast.Stmt, error)

AppendStmt appends stmt to the given statement list.

func NewAttr

func NewAttr(key, val interface{}) (*ast.Attr, error)

NewAttr returns a new attribute based on the given key-value pair.

func NewAttrList

func NewAttrList(attr interface{}) ([]*ast.Attr, error)

NewAttrList returns a new attribute list based on the given attribute.

func NewAttrStmt

func NewAttrStmt(kind, optAttrs interface{}) (*ast.AttrStmt, error)

NewAttrStmt returns a new attribute statement based on the given graph component kind and attributes.

func NewEdge

func NewEdge(directed, vertex, optTo interface{}) (*ast.Edge, error)

NewEdge returns a new edge based on the given edge direction, destination vertex and optional outgoing edge.

func NewEdgeStmt

func NewEdgeStmt(from, to, optAttrs interface{}) (*ast.EdgeStmt, error)

NewEdgeStmt returns a new edge statement based on the given source vertex, outgoing edge and optional attributes.

func NewFile

func NewFile(graph interface{}) (*ast.File, error)

NewFile returns a new file based on the given graph.

func NewGraph

func NewGraph(strict, directed, optID, optStmts interface{}) (*ast.Graph, error)

NewGraph returns a new graph based on the given graph strictness, direction, optional ID and optional statements.

func NewID

func NewID(id interface{}) (string, error)

NewID returns a new identifier based on the given ID token.

func NewNode

func NewNode(id, optPort interface{}) (*ast.Node, error)

NewNode returns a new node based on the given node id and optional port.

func NewNodeStmt

func NewNodeStmt(node, optAttrs interface{}) (*ast.NodeStmt, error)

NewNodeStmt returns a new node statement based on the given node and optional attributes.

func NewPort

func NewPort(id, optCompassPoint interface{}) (*ast.Port, error)

NewPort returns a new port based on the given id and optional compass point.

func NewStmtList

func NewStmtList(stmt interface{}) ([]ast.Stmt, error)

NewStmtList returns a new statement list based on the given statement.

func NewSubgraph

func NewSubgraph(optID, optStmts interface{}) (*ast.Subgraph, error)

NewSubgraph returns a new subgraph based on the given optional subgraph ID and optional statements.

Types

This section is empty.

Jump to

Keyboard shortcuts

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