Table of Contents

Class InfixExpressionFactory<T>

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

Generic factory for creating infix expression instances by matching their operator tokens.

public class InfixExpressionFactory<T> : IExpressionFactory<T> where T : class, IInfixExpression, new()

Type Parameters

T

The type of infix expression to create.

Inheritance
InfixExpressionFactory<T>
Implements
Inherited Members
Extension Methods

Constructors

InfixExpressionFactory(bool)

Initializes a new instance of the InfixExpressionFactory<T> class.

public InfixExpressionFactory(bool caseSensitive)

Parameters

caseSensitive bool

Whether operator 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 T? 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

T

The parsed token if successful; otherwise, null.