Table of Contents

Class Variable

Namespace
Albatross.Expression.Nodes
Assembly
Albatross.Expression.dll

Represents a variable reference in an expression that gets resolved during evaluation. Variable names follow C# naming conventions and support dot notation for nested property access (e.g., "field.property").

public class Variable : ValueToken, IValueToken, IExpression, IToken
Inheritance
Variable
Implements
Inherited Members
Extension Methods

Constructors

Variable(string)

Initializes a new instance of the Variable class.

public Variable(string value)

Parameters

value string

The variable name.

Methods

Eval(Func<string, object>)

Evaluates the expression synchronously using the provided context function.

public object Eval(Func<string, object> context)

Parameters

context Func<string, object>

A function that resolves variable names to their values.

Returns

object

The result of evaluating the expression.

EvalAsync(Func<string, Task<object>>)

Evaluates the expression asynchronously using the provided context function.

public Task<object> EvalAsync(Func<string, Task<object>> context)

Parameters

context Func<string, Task<object>>

A function that asynchronously resolves variable names to their values.

Returns

Task<object>

A task containing the result of evaluating the expression.