compiler

package
v0.0.0-...-23c868e Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compiler

type Compiler interface {
	// Parse parses source into an intermediate representation.
	Parse(source []byte) (IR, error)

	// ParseString is a convenience wrapper for string input.
	ParseString(source string) (IR, error)

	// Compile compiles an already-parsed IR into a Query.
	Compile(ir IR) (*Query, error)
}

Compiler turns query sources into DBSP circuits.

type IR

type IR interface {
	IRKind() string
}

IR is a compiler intermediate representation. Implementations are compiler-specific but share this marker interface.

type Query

type Query struct {
	// Circuit is the DBSP circuit implementing the query.
	Circuit *circuit.Circuit

	// InputMap maps external input names/topics to circuit input node IDs.
	InputMap map[string]string

	// InputLogicalMap maps external input names/topics to internal logical names
	// used by the compiler inside expressions. If a name is missing, it is
	// treated as identity (external == logical).
	InputLogicalMap map[string]string

	// OutputMap maps external output names/topics to circuit output node IDs.
	OutputMap map[string]string

	// OutputLogicalMap maps external output names/topics to internal logical
	// output names. If a name is missing, it is treated as identity.
	OutputLogicalMap map[string]string
}

Query is the result of compiling a query source into a DBSP circuit.

func (*Query) InputLogicalName

func (q *Query) InputLogicalName(name string) string

InputLogicalName returns the internal logical name for an external input name/topic.

func (*Query) InputNames

func (q *Query) InputNames() []string

InputNames returns the logical input names in sorted order.

func (*Query) OutputLogicalName

func (q *Query) OutputLogicalName(name string) string

OutputLogicalName returns the internal logical name for an external output name/topic.

func (*Query) OutputNames

func (q *Query) OutputNames() []string

OutputNames returns the logical output names in sorted order.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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