C# Класс PclUnit.Constraints.Pieces.ConstraintBuilder

ConstraintBuilder maintains the stacks that are used in processing a ConstraintExpression. An OperatorStack is used to hold operators that are waiting for their operands to be reognized. a ConstraintStack holds input constraints as well as the results of each operator applied.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Append ( Constraint constraint ) : void

Appends the specified constraint to the expresson by pushing it on the constraint stack.

Append ( ConstraintOperator op ) : void

Appends the specified operator to the expression by first reducing the operator stack and then pushing the new operator on the stack.

ConstraintBuilder ( ) : System

Initializes a new instance of the T:ConstraintBuilder class.

Resolve ( ) : Constraint

Resolves this instance, returning a Constraint. If the builder is not currently in a resolvable state, an exception is thrown.

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

Метод Описание
ReduceOperatorStack ( int targetPrecedence ) : void

Reduces the operator stack until the topmost item precedence is greater than or equal to the target precedence.

SetTopOperatorRightContext ( object rightContext ) : void

Sets the top operator right context.

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

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

Appends the specified constraint to the expresson by pushing it on the constraint stack.
public Append ( Constraint constraint ) : void
constraint Constraint The constraint to push.
Результат void

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

Appends the specified operator to the expression by first reducing the operator stack and then pushing the new operator on the stack.
public Append ( ConstraintOperator op ) : void
op ConstraintOperator The operator to push.
Результат void

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

Initializes a new instance of the T:ConstraintBuilder class.
public ConstraintBuilder ( ) : System
Результат System

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

Resolves this instance, returning a Constraint. If the builder is not currently in a resolvable state, an exception is thrown.
public Resolve ( ) : Constraint
Результат Constraint