package interpret

import "github.com/purpleidea/mgmt/lang/interpret"

Package interpret contains the implementation of the actual interpret function that takes an AST and returns a resource graph.

Index

Types

type Interpreter

type Interpreter struct {
	// Debug represents if we're running in debug mode or not.
	Debug bool

	// Logf is a logger which should be used.
	Logf func(format string, v ...interface{})
	// contains filtered or unexported fields
}

Interpreter is a base struct for handling the Interpret operation. There is nothing stateful here, you don't need to preserve this between runs.

func (*Interpreter) Interpret

func (obj *Interpreter) Interpret(ast interfaces.Stmt, table map[interfaces.Func]types.Value) (*pgraph.Graph, error)

Interpret runs the program and outputs a generated resource graph. It requires an AST, and the table of values required to populate that AST. Type unification, and earlier steps should obviously be run first so that you can actually get a useful resource graph out of this instead of an error!

Source Files

interpret.go

Version
v0.0.0-20250405210053-9c1c587f7bc2 (latest)
Published
Apr 5, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
2 days ago

Tools for package owners.