C# Класс GSF.Parsing.BooleanExpression

Represents a boolean expression that can be parsed and executed at runtime.
Binary operators have the same level of precedence and are evaluated from right to left.
Показать файл Открыть проект

Открытые методы

Метод Описание
BooleanExpression ( string expressionText ) : System

Creates a new instance of the BooleanExpression class.

The default comparer for identifiers is StringComparer.OrdinalIgnoreCase.

BooleanExpression ( string expressionText, IEqualityComparer identifierComparer ) : System

Creates a new instance of the BooleanExpression class.

Evaluate ( ) : bool

Evaluates the expression using the current values of the variables.

TryGetVariable ( string identifier, Variable &variable ) : bool

Attempts to get the variable identified by the given identifier.

this ( string identifier ) : Variable

Gets the variable identified by the given identifier.

Приватные методы

Метод Описание
ParseExpression ( StringBuilder builder ) : Expression
ParseIdentifier ( StringBuilder builder ) : Expression
ParseSubexpression ( StringBuilder builder ) : Expression
ShedWhitespace ( StringBuilder builder ) : void

Описание методов

BooleanExpression() публичный Метод

Creates a new instance of the BooleanExpression class.
The default comparer for identifiers is StringComparer.OrdinalIgnoreCase.
public BooleanExpression ( string expressionText ) : System
expressionText string The expression text to be parsed as a boolean expression.
Результат System

BooleanExpression() публичный Метод

Creates a new instance of the BooleanExpression class.
public BooleanExpression ( string expressionText, IEqualityComparer identifierComparer ) : System
expressionText string The expression text to be parsed as a boolean expression.
identifierComparer IEqualityComparer Comparer used to compare identifiers.
Результат System

Evaluate() публичный Метод

Evaluates the expression using the current values of the variables.
public Evaluate ( ) : bool
Результат bool

TryGetVariable() публичный Метод

Attempts to get the variable identified by the given identifier.
public TryGetVariable ( string identifier, Variable &variable ) : bool
identifier string The identifier used to refer to the variable.
variable Variable The variable identified by the given identifier.
Результат bool

this() публичный Метод

Gets the variable identified by the given identifier.
public this ( string identifier ) : Variable
identifier string The identifier used to refer to the variable.
Результат Variable