Class BooleanLiteralFactory
- Namespace
- Albatross.Expression.Parsing
- Assembly
- Albatross.Expression.dll
Factory class that parses boolean literal expressions from text input. Recognizes "true" and "false" values with optional case-sensitivity.
public class BooleanLiteralFactory : IExpressionFactory<BooleanLiteral>
- Inheritance
-
BooleanLiteralFactory
- Implements
- Inherited Members
- Extension Methods
Constructors
BooleanLiteralFactory(bool)
Initializes a new instance of the BooleanLiteralFactory class.
public BooleanLiteralFactory(bool caseSensitive = false)
Parameters
caseSensitiveboolWhether to perform case-sensitive matching for boolean literals.
Methods
Parse(string, int, out int)
Attempts to parse a boolean literal from the specified position in the text. Matches "true" or "false" strings and creates a corresponding BooleanLiteral token.
public BooleanLiteral? Parse(string text, int start, out int next)
Parameters
textstringThe input text to parse.
startintThe starting position in the text.
nextintWhen this method returns, contains the next position after the parsed token.
Returns
- BooleanLiteral
A BooleanLiteral token if parsing succeeds; otherwise, null.