compiler

package
v0.0.0-...-a1a1282 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 2 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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