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.
Show file Open project: jbtule/PclUnit Class Usage Examples

Public Methods

Method 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

Method 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 method

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.
return void

Append() public method

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.
return void

ConstraintBuilder() public method

Initializes a new instance of the T:ConstraintBuilder class.
public ConstraintBuilder ( ) : System
return System

Resolve() public method

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