Table of Contents

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

caseSensitive bool

Whether 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

text string

The input text to parse.

start int

The starting position in the text.

next int

When this method returns, contains the next position after the parsed token.

Returns

BooleanLiteral

A BooleanLiteral token if parsing succeeds; otherwise, null.