示例#1
0
        public override bool Cover(
            OperationNode patternOp, CoveringInfo coveringInfo)
        {
            bool result = false;

            if (IsCoverableWith(patternOp)) {

                UnaryOperationNode unaryPatternOp = (UnaryOperationNode) patternOp;

                if (OperandValue.Cover(unaryPatternOp.OperandValue, coveringInfo)) {
                    coveringInfo.CoveredOperations.Add(this);
                    result = true;
                }
            }

            return result;
        }
示例#2
0
 public abstract bool Cover(
     OperationNode patternOp, CoveringInfo coveringInfo);
示例#3
0
 public virtual bool IsCoverableWith(OperationNode patternOp)
 {
     return this.OperationType == patternOp.OperationType;
 }
示例#4
0
        public override bool Cover(
            OperationNode patternOp, CoveringInfo coveringInfo)
        {
            bool result = false;

            if (IsCoverableWith(patternOp)) {

                BinaryOperationNode binaryPatternOp =
                    (BinaryOperationNode) patternOp;

                if (LeftOperandValue.Cover(binaryPatternOp.LeftOperandValue,
                                           coveringInfo) &&
                    RightOperandValue.Cover(binaryPatternOp.RightOperandValue,
                                            coveringInfo)) {

                    coveringInfo.CoveredOperations.Add(this);
                    result = true;
                }
            }

            return result;
        }