Table of Contents

Class PrefixExpressionFactory

Namespace
Albatross.Expression.Parsing
Assembly
Albatross.Expression.dll

Factory for creating prefix expressions using a provided factory function.

public class PrefixExpressionFactory : IExpressionFactory<IPrefixExpression>
Inheritance
PrefixExpressionFactory
Implements
Derived
Inherited Members
Extension Methods

Constructors

PrefixExpressionFactory(Func<IPrefixExpression>, bool)

Initializes a new instance of the PrefixExpressionFactory class.

public PrefixExpressionFactory(Func<IPrefixExpression> func, bool caseSensitive = false)

Parameters

func Func<IPrefixExpression>

Function that creates instances of the prefix expression.

caseSensitive bool

Whether function name matching should be case-sensitive.

Methods

Parse(string, int, out int)

Attempts to parse a token from the given text starting at the specified position.

public IPrefixExpression? Parse(string text, int start, out int next)

Parameters

text string

The expression text to parse.

start int

The starting position in the text to begin parsing.

next int

When this method returns, contains the position after the parsed token, or the original start position if parsing failed.

Returns

IPrefixExpression

The parsed token if successful; otherwise, null.