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
TThe 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
caseSensitiveboolWhether 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
textstringThe expression text to parse.
startintThe starting position in the text to begin parsing.
nextintWhen 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.