Пример #1
0
 protected override void Visit(PredicateNode visitedNode)
 {
     //get left and right and make a stringy lookup of the enum and put that in the middle
     _sqlBuilder.Append($"`{visitedNode.Left}` ");
     _sqlBuilder.Append(visitedNode.Condition.ToSQL()).Append(" ");
     _sqlBuilder.Append($"'{visitedNode.Right}'");
 }
Пример #2
0
 protected override void Visit(PredicateNode visitedNode)
 {
     //get left and right and make a stringy lookup of the enum and put that in the middle
     //_xmindTree.Append('\t', _depth+1).AppendLine(visitedNode.Condition.ToString());
     //_xmindTree.Append('\t', _depth + 2).AppendLine(visitedNode.Left);
     //_xmindTree.Append('\t', _depth + 2).AppendLine(visitedNode.Right.ToString());
     _xmindTree.Append('\t', _depth + 1).Append(visitedNode.Left).Append(visitedNode.Condition.ToSQL()).AppendLine(visitedNode.Right.ToString());
 }
Пример #3
0
 protected override void Visit(PredicateNode visitedNode)
 {
     _position++;
     if (_position == _cutPoint)
     {
         _cutNode = visitedNode;
         _done    = true;
     }
 }
Пример #4
0
        private int _countOccurrences(PredicateNode p1, List <PredicateNode> nodelist)
        {
            var count = 0;

            foreach (var node in nodelist)
            {
                //The left of the predicate node is the column
                if (node.Left == p1.Left)
                {
                    count++;
                }
            }
            return(count);
        }
Пример #5
0
        protected override Node Visit(PredicateNode node)
        {
            var columnName = node.Left;

            columnCounts.TryGetValue(columnName, out int count);
            columnCounts[columnName] = ++count;
            if (count > maxDuplication)
            {
                return(null);
            }
            else
            {
                return(node);
            }
        }
Пример #6
0
 protected override void Visit(PredicateNode visitedNode)
 {
     if (_mutatePoint <= 1)
     {
         _done = true;
         _tree = visitedNode;
         return;
     }
     _position++;
     if (_position == _mutatePoint)
     {
         _replaceMeNode   = visitedNode;
         _replaceWithNode = visitedNode.Mutate();
         _done            = true;
     }
 }
Пример #7
0
 protected override void Visit(PredicateNode visitedNode)
 {
     if (visitedNode == null)
     {
         throw new ArgumentNullException(nameof(visitedNode));
     }
     if (_cutPoint == 0)
     {
         _crossNode = visitedNode;
         return;
     }
     _position += 1;
     if (_position == _cutPoint)
     {
         _crossNode = visitedNode;
     }
 }
Пример #8
0
 protected override void Visit(PredicateNode visitedNode)
 {
     _position++;
     if (_columnCounter.ContainsKey(visitedNode.Left))
     {
         if (_columnCounter[visitedNode.Left] >= _componentRestrictions)
         {
             _deleteMeNode = visitedNode;
             return;
         }
         _columnCounter[visitedNode.Left]++;
     }
     else
     {
         _columnCounter[visitedNode.Left] = 1;
     }
 }
Пример #9
0
 virtual protected void Visit(PredicateNode visitedNode)
 {
 }
Пример #10
0
 private PredicateNode _nodeDuplicator(PredicateNode oldNode) => new PredicateNode(new List <string> {
     oldNode.Left
 }, x => new List <object> {
     oldNode.Right
 }, oldNode.Condition);
 private int _countOccurrences(PredicateNode p1, List <PredicateNode> nodelist)
 {
     return(default);
Пример #12
0
 private Boolean _isSame(PredicateNode p1, PredicateNode p2)
 {
     throw new NotImplementedException();
 }
Пример #13
0
 protected abstract T Visit(PredicateNode node);