evaluator

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package evaluator is responsible for evaluating expressions in OpenGL ES Shading Language programs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Evaluate

func Evaluate(expr ast.Expression, res func(sym ast.ValueSymbol) ast.Value,
	lang ast.Language) (val ast.Value, err []error)

Evaluate evaluates an expression in a GLES Shading Language program. It assumes the expression has already been typed and statically checked for correctness by the sema package. This function is suitable to be passed as the evaluator argument to the sema.Analyze function. Its arguments are:

- expr the expression to evaluate

- res a function resolving Symbols occuring in the expressions to values

- lang the language whose semantics to employ during evaluation

The function returns the value obtained by evaluating the expression. If the evaluation fails, the second result shall contain a list of errors.

func EvaluatePreprocessorExpression

func EvaluatePreprocessorExpression(e ast.Expression) (val ast.IntValue, err []error)

EvaluatePreprocessorExpression is a wrapper around Evaluate, which adapts it to processing preprocessor expressions. This function is suitable to be passed as the evaluator argument to parse.Parse function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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