Beispiel #1
0
        /// <summary>
        /// Resolve a constraint that has been recognized by applying
        /// any pending operators and returning the resulting Constraint.
        /// </summary>
        /// <returns>A constraint that incorporates all pending operators</returns>
        private Constraint Resolve(Constraint constraint)
        {
            while (ops.Count > 0)
            {
                switch ((Op)ops.Pop())
                {
                case Op.Not:
                    constraint = new NotConstraint(constraint);
                    break;

                case Op.All:
                    constraint = new AllItemsConstraint(constraint);
                    break;

                case Op.Some:
                    constraint = new SomeItemsConstraint(constraint);
                    break;

                case Op.None:
                    constraint = new NoItemConstraint(constraint);
                    break;

#if NOT_PFX
                case Op.Prop:
                    constraint = new PropertyConstraint((string)opnds.Pop(), constraint);
                    break;
#endif
                }
            }

            return(constraint);
        }
Beispiel #2
0
        /// <summary>
        /// Resolve a constraint that has been recognized by applying
        /// any pending operators and returning the resulting Constraint.
        /// </summary>
        /// <returns>A constraint that incorporates all pending operators</returns>
        private Constraint Resolve(Constraint constraint)
        {
            while (ops.Count > 0)
                switch ((Op)ops.Pop())
                {
                    case Op.Not:
                        constraint = new NotConstraint(constraint);
                        break;
                    case Op.All:
                        constraint = new AllItemsConstraint(constraint);
                        break;
					case Op.Some:
						constraint = new SomeItemsConstraint(constraint);
						break;
					case Op.None:
						constraint = new NoItemConstraint(constraint);
						break;
					case Op.Prop:
						constraint = new PropertyConstraint( (string)opnds.Pop(), constraint );
						break;
                }

            return constraint;
        }