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
funcFunc<IPrefixExpression>Function that creates instances of the prefix expression.
caseSensitiveboolWhether 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
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
- IPrefixExpression
The parsed token if successful; otherwise, null.