Index

Package: Evaluators

Description

package Expressions.Evaluators is

Classes

Evaluator

type Evaluator is new Limited_Object with private;

Ancestors:

Primitive operations:

Delete (overriding Objects.Delete)
Objects.Construct (Inherited)
Objects.To_String (Inherited)
An Evaluator can parse and evaluate scripts and expressions. Currently only expressions are supported for evaluation. Symbols in expressions are resolved by an object implementing the Symbol_Resolver interface. The Evaluator can be reused to perform multiple evaluations on different input and it is recommended that objects not be created and deleted for every evaluation, to limit overhead.

Types

A_Evaluator

type A_Evaluator is access all Evaluator'Class;

Subprograms & Entries

Create_Evaluator

function Create_Evaluator return A_Evaluator;
Creates a new Evaluator to evaluate text script/expressions.

Evaluate

procedure Evaluate
( this: not null access Evaluator'Class;
expression: String;
resolver: A_Symbol_Resolver;
result: in out A_Value );
Evaluates the text of 'expression' and returns 'result'. Specify 'resolver' to resolve symbols by name during evaluation. If the expression couldn't be evaluated due to a runtime error, null will be returned. (For example, a variable couldn't be resolved or a value type mismatch occured.) If a parsing error occurs then Parse_Exception will be raised.

Delete

procedure Delete
( this: in out A_Evaluator );
Deletes the Evaluator.