compiler

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package compiler provides the GraphCompiler that transforms a GraphDefinition into a CompiledGraph with static analysis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatWarnings

func FormatWarnings(ws []Warning) string

FormatWarnings returns a human-readable string of all warnings.

func ValidateGraphDef deprecated

func ValidateGraphDef(d *graph.GraphDefinition) error

ValidateGraphDef validates a GraphDefinition.

Deprecated: Use def.Validate() directly. This wrapper exists only for backward compatibility with existing callers. Removed in v0.2.0.

Types

type BuildOptions

type BuildOptions struct{}

BuildOptions configures how the compiler processes a graph definition.

type CompiledGraph

type CompiledGraph struct {
	Graph    *graph.RawGraph
	NodeDefs []graph.NodeDefinition
	EdgeDefs []graph.EdgeDefinition
	Warnings []Warning
	Metadata graph.GraphMeta
}

CompiledGraph is the result of compilation, containing the raw graph structure and analysis metadata. Nodes in RawGraph are passthrough placeholders; actual node construction is deferred to downstream Assemble + NodeFactory.

type Compiler

type Compiler struct{}

Compiler transforms GraphDefinition into a CompiledGraph with static analysis. It is purely static — no runtime node instances are constructed.

func NewCompiler

func NewCompiler(opts ...CompilerOption) *Compiler

NewCompiler creates a new Compiler with the given options.

func (*Compiler) Compile

func (c *Compiler) Compile(def *graph.GraphDefinition, opts ...BuildOptions) (*CompiledGraph, error)

Compile transforms a GraphDefinition into a CompiledGraph. All nodes are represented as passthrough placeholders; the original definitions are preserved in NodeDefs/EdgeDefs for downstream NodeFactory construction.

type CompilerOption

type CompilerOption func(*Compiler)

CompilerOption configures the Compiler.

type Warning

type Warning struct {
	Code    string   `json:"code"`
	Message string   `json:"message"`
	NodeIDs []string `json:"node_ids,omitempty"`
}

Warning represents a non-fatal issue found during compilation.

func CheckPortCompatibility

func CheckPortCompatibility(g *graph.RawGraph) []Warning

CheckPortCompatibility checks if connected nodes have compatible port types.

Jump to

Keyboard shortcuts

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