interpreter

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorInterpreSymbolFailure       = errors.New("have symbol not consumed")
	ErrorInterpretVariable           = errors.New("error when interpret variable values")
	ErrorInternalInterpreterOutdated = errors.New("interpreter not update as the ast grows")
)

Functions

func Interpret

func Interpret(node ast.JsonNode, variables map[string]interface{}) (string, error)

func NewInterpreter

func NewInterpreter(variables map[string]interface{}) *standardVisitor

Types

type JsonVisitor

type JsonVisitor interface {
	VisitStringNode(node *ast.JsonStringNode) error
	VisitNumberNode(node *ast.JsonNumberNode) error
	VisitBooleanNode(node *ast.JsonBooleanNode) error
	VisitNullNode(node *ast.JsonNullNode) error
	VisitArrayNode(node *ast.JsonArrayNode) error
	VisitKeyValuePairNode(node *ast.JsonKeyValuePairNode) error
	VisitObjectNode(node *ast.JsonObjectNode) error
	VisitVariableNode(node *ast.JsonExtendedVariableNode) error
	VisitStringWithVariableNode(node *ast.JsonExtendedStringWIthVariableNode) error
}

Jump to

Keyboard shortcuts

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