C# Class 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.
Afficher le fichier Open project: jbtule/PclUnit Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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.

Method Details

Append() public méthode

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.
Résultat void

Append() public méthode

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.
Résultat void

ConstraintBuilder() public méthode

Initializes a new instance of the T:ConstraintBuilder class.
public ConstraintBuilder ( ) : System
Résultat System

Resolve() public méthode

Resolves this instance, returning a Constraint. If the builder is not currently in a resolvable state, an exception is thrown.
public Resolve ( ) : Constraint
Résultat Constraint