Table of Contents

Interface IParsedExpression<TArg, TResult>

Namespace
LfrlAnvil.Computable.Expressions
Assembly
LfrlAnvil.Computable.Expressions.dll

Represents a parsed expression.

public interface IParsedExpression<TArg, out TResult>

Type Parameters

TArg

Argument type.

TResult

Result type.

Properties

Body

Body node of this expression.

Expression Body { get; }

Property Value

Expression

BoundArguments

Collection of bound arguments.

ParsedExpressionBoundArguments<TArg> BoundArguments { get; }

Property Value

ParsedExpressionBoundArguments<TArg>

DiscardedArguments

Collection of discarded arguments.

ParsedExpressionDiscardedArguments DiscardedArguments { get; }

Property Value

ParsedExpressionDiscardedArguments

Input

Original input that created this expression.

string Input { get; }

Property Value

string

Parameter

Parameter node of this expression.

ParameterExpression Parameter { get; }

Property Value

ParameterExpression

UnboundArguments

Collection of named unbound arguments. Values for those arguments must be provided during delegate invocation.

ParsedExpressionUnboundArguments UnboundArguments { get; }

Property Value

ParsedExpressionUnboundArguments

Methods

BindArguments(IEnumerable<KeyValuePair<StringSegment, TArg?>>)

Creates a new IParsedExpression<TArg, TResult> instance with bound arguments.

[Pure]
IParsedExpression<TArg, out TResult> BindArguments(IEnumerable<KeyValuePair<StringSegment, TArg?>> arguments)

Parameters

arguments IEnumerable<KeyValuePair<StringSegment, TArg>>

Collection of arguments to bind.

Returns

IParsedExpression<TArg, TResult>

New IParsedExpression<TArg, TResult> instance.

Exceptions

ParsedExpressionArgumentBindingException

When an unbound argument does not exist.

ParsedExpressionCreationException

When expression could not be parsed.

BindArguments(IEnumerable<KeyValuePair<int, TArg?>>)

Creates a new IParsedExpression<TArg, TResult> instance with bound arguments.

[Pure]
IParsedExpression<TArg, out TResult> BindArguments(IEnumerable<KeyValuePair<int, TArg?>> arguments)

Parameters

arguments IEnumerable<KeyValuePair<int, TArg>>

Collection of arguments to bind.

Returns

IParsedExpression<TArg, TResult>

New IParsedExpression<TArg, TResult> instance.

Exceptions

IndexOutOfRangeException

When an argument index is invalid.

ParsedExpressionCreationException

When expression could not be parsed.

BindArguments(IEnumerable<KeyValuePair<string, TArg?>>)

Creates a new IParsedExpression<TArg, TResult> instance with bound arguments.

[Pure]
IParsedExpression<TArg, out TResult> BindArguments(IEnumerable<KeyValuePair<string, TArg?>> arguments)

Parameters

arguments IEnumerable<KeyValuePair<string, TArg>>

Collection of arguments to bind.

Returns

IParsedExpression<TArg, TResult>

New IParsedExpression<TArg, TResult> instance.

Exceptions

ParsedExpressionArgumentBindingException

When an unbound argument does not exist.

ParsedExpressionCreationException

When expression could not be parsed.

BindArguments(params KeyValuePair<StringSegment, TArg?>[])

Creates a new IParsedExpression<TArg, TResult> instance with bound arguments.

[Pure]
IParsedExpression<TArg, out TResult> BindArguments(params KeyValuePair<StringSegment, TArg?>[] arguments)

Parameters

arguments KeyValuePair<StringSegment, TArg>[]

Collection of arguments to bind.

Returns

IParsedExpression<TArg, TResult>

New IParsedExpression<TArg, TResult> instance.

Exceptions

ParsedExpressionArgumentBindingException

When an unbound argument does not exist.

ParsedExpressionCreationException

When expression could not be parsed.

BindArguments(params KeyValuePair<int, TArg?>[])

Creates a new IParsedExpression<TArg, TResult> instance with bound arguments.

[Pure]
IParsedExpression<TArg, out TResult> BindArguments(params KeyValuePair<int, TArg?>[] arguments)

Parameters

arguments KeyValuePair<int, TArg>[]

Collection of arguments to bind.

Returns

IParsedExpression<TArg, TResult>

New IParsedExpression<TArg, TResult> instance.

Exceptions

IndexOutOfRangeException

When an argument index is invalid.

ParsedExpressionCreationException

When expression could not be parsed.

BindArguments(params KeyValuePair<string, TArg?>[])

Creates a new IParsedExpression<TArg, TResult> instance with bound arguments.

[Pure]
IParsedExpression<TArg, out TResult> BindArguments(params KeyValuePair<string, TArg?>[] arguments)

Parameters

arguments KeyValuePair<string, TArg>[]

Collection of arguments to bind.

Returns

IParsedExpression<TArg, TResult>

New IParsedExpression<TArg, TResult> instance.

Exceptions

ParsedExpressionArgumentBindingException

When an unbound argument does not exist.

ParsedExpressionCreationException

When expression could not be parsed.

Compile()

Compiles this expression.

[Pure]
IParsedExpressionDelegate<TArg, out TResult> Compile()

Returns

IParsedExpressionDelegate<TArg, TResult>

New IParsedExpressionDelegate<TArg, TResult> instance.