Table of Contents

Interface IParser

Namespace
Albatross.Expression
Assembly
Albatross.Expression.dll

Defines the core expression parsing functionality for tokenizing, converting, and building expression trees.

public interface IParser
Extension Methods

Properties

CaseSensitive

Indicates whether this parser performs case-sensitive matching for keywords and identifiers.

bool CaseSensitive { get; }

Property Value

bool

Methods

BuildPostfixStack(Queue<IToken>)

Converts a token queue from infix notation to postfix (reverse Polish) notation using the shunting-yard algorithm.

Stack<IToken> BuildPostfixStack(Queue<IToken> queue)

Parameters

queue Queue<IToken>

The token queue in infix notation.

Returns

Stack<IToken>

A stack of tokens in postfix notation for tree construction.

CreateTree(Stack<IToken>)

Constructs an abstract syntax tree from a postfix token stack.

IExpression CreateTree(Stack<IToken> postfix)

Parameters

postfix Stack<IToken>

The token stack in postfix notation.

Returns

IExpression

The root expression node of the constructed syntax tree.

Tokenize(string)

Parses an expression string from left to right and produces a queue of tokens in infix notation.

Queue<IToken> Tokenize(string expression)

Parameters

expression string

The expression string to tokenize.

Returns

Queue<IToken>

A queue of tokens in the order they appear in the expression.