func check(file *ast.File) error {
	for _, graph := range file.Graphs {
		if err := checkGraph(graph); err != nil {
			return err
		}
	}
	return nil
}
check validates the semantics of the given DOT file.
package dot
import (
	"fmt"
	"gonum.org/v1/gonum/graph/formats/dot/ast"
)