public virtual Differences VisitQueryDifference(QueryDifference diff1, QueryDifference diff2){
      Differences differences = new Differences(diff1, diff2);
      if (diff1 == null || diff2 == null){
        if (diff1 != diff2) differences.NumberOfDifferences++; else differences.NumberOfSimilarities++;
        return differences;
      }
      QueryDifference changes = (QueryDifference)diff2.Clone();
      QueryDifference deletions = (QueryDifference)diff2.Clone();
      QueryDifference insertions = (QueryDifference)diff2.Clone();

      //      diff1.LeftSource;
      //      diff1.RightSource;

      if (differences.NumberOfDifferences == 0){
        differences.Changes = null;
        differences.Deletions = null;
        differences.Insertions = null;
      }else{
        differences.Changes = changes;
        differences.Deletions = deletions;
        differences.Insertions = insertions;
      }
      return differences;
    }
Example #2
0
 public virtual Node VisitQueryDifference(QueryDifference diff, QueryDifference changes, QueryDifference deletions, QueryDifference insertions){
   this.UpdateSourceContext(diff, changes);
   if (diff == null) return changes;
   return diff;
 }
Example #3
0
 public override Node VisitQueryDifference(QueryDifference qd) {
   if (qd == null) return null;
   qd.LeftSource = this.VisitExpression(qd.LeftSource);
   qd.RightSource = this.VisitExpression(qd.RightSource);
   if (qd.LeftSource == null || qd.LeftSource.Type == null ||
     qd.RightSource == null || qd.RightSource.Type == null) return null;
   Cardinality card = this.typeSystem.GetCardinality(qd.LeftSource, this.TypeViewer);
   if (card != Cardinality.OneOrMore && card != Cardinality.ZeroOrMore) {
     this.HandleError(qd.LeftSource, Error.QueryNotStream);
     return null;
   }
   card = this.typeSystem.GetCardinality(qd.RightSource, this.TypeViewer);
   if (card != Cardinality.OneOrMore && card != Cardinality.ZeroOrMore) {
     this.HandleError(qd.RightSource, Error.QueryNotStream);
     return null;
   }
   if (qd.LeftSource.Type.UniqueKey != qd.RightSource.Type.UniqueKey) {
     this.HandleError(qd, Error.QueryBadDifferenceTypes, this.GetTypeName(qd.LeftSource.Type), this.GetTypeName(qd.RightSource.Type));
     return null;
   }
   if (qd.Type == null) return null;
   this.HandleError(qd, Error.QueryNotSupported);
   return null;
 }
Example #4
0
 public virtual Node VisitQueryDifference(QueryDifference diff){
   if (diff == null) return null;
   diff.LeftSource = this.VisitExpression(diff.LeftSource);
   diff.RightSource = this.VisitExpression(diff.RightSource);
   return diff;
 }
Example #5
0
 public virtual void VisitQueryDifference(QueryDifference diff){
   if (diff == null) return;
   this.VisitExpression(diff.LeftSource);
   this.VisitExpression(diff.RightSource);
 }
Example #6
0
 public override Node VisitQueryDifference(QueryDifference diff){
   if (diff == null) return null;
   diff.LeftSource = this.VisitExpression(diff.LeftSource);
   diff.RightSource = this.VisitExpression(diff.RightSource);
   if (diff.LeftSource != null && diff.RightSource != null &&
     diff.LeftSource.Type != null && diff.RightSource.Type != null ){
     diff.Type = diff.LeftSource.Type; // hack for now
   }
   return diff;
 }
Example #7
0
 public override Node VisitQueryDifference(QueryDifference diff){
   if (diff == null) return null;
   return base.VisitQueryDifference((QueryDifference)diff.Clone());
 }
Example #8
0
 public virtual Node VisitQueryDifference(QueryDifference diff1, QueryDifference diff2){
   if (diff1 == null) return null;
   if (diff2 == null){
     diff1.LeftSource = this.VisitExpression(diff1.LeftSource, null);
     diff1.RightSource = this.VisitExpression(diff1.RightSource, null);
   }else{
     diff1.LeftSource = this.VisitExpression(diff1.LeftSource, diff2.LeftSource);
     diff1.RightSource = this.VisitExpression(diff1.RightSource, diff2.RightSource);
   }
   return diff1;
 }
Example #9
0
 public override Node VisitQueryDifference(QueryDifference diff) {
   base.VisitQueryDifference(diff);
   return this.Compose(diff, this.GetComposer(diff.LeftSource), this.GetComposer(diff.RightSource));
 }
Example #10
0
 public override Node VisitQueryDifference(QueryDifference diff)
 {
     base.VisitQueryDifference(diff);
     return(this.Compose(diff, this.GetComposer(diff.LeftSource), this.GetComposer(diff.RightSource)));
 }
 public EventingVisitor(Action<QueryDifference> visitQueryDifference) { VisitedQueryDifference += visitQueryDifference; } public event Action<QueryDifference> VisitedQueryDifference; public override Node VisitQueryDifference(QueryDifference diff) { if (VisitedQueryDifference != null) VisitedQueryDifference(diff); return base.VisitQueryDifference(diff); }