public virtual Differences VisitQueryIntersection(QueryIntersection intersection1, QueryIntersection intersection2){
      Differences differences = new Differences(intersection1, intersection2);
      if (intersection1 == null || intersection2 == null){
        if (intersection1 != intersection2) differences.NumberOfDifferences++; else differences.NumberOfSimilarities++;
        return differences;
      }
      QueryIntersection changes = (QueryIntersection)intersection2.Clone();
      QueryIntersection deletions = (QueryIntersection)intersection2.Clone();
      QueryIntersection insertions = (QueryIntersection)intersection2.Clone();

      //      intersection1.LeftSource;
      //      intersection1.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 VisitQueryIntersection(QueryIntersection intersection, QueryIntersection changes, QueryIntersection deletions, QueryIntersection insertions){
   this.UpdateSourceContext(intersection, changes);
   if (intersection == null) return changes;
   if (changes != null){
     if (deletions == null || insertions == null)
       Debug.Assert(false);
     else{
     }
   }else if (deletions != null)
     return null;
   return intersection;
 }
Example #3
0
 public override Node VisitQueryIntersection(QueryIntersection qi) {
   if (qi == null) return null;
   qi.LeftSource = this.VisitExpression(qi.LeftSource);
   qi.RightSource = this.VisitExpression(qi.RightSource);
   if (qi.LeftSource == null || qi.LeftSource.Type == null ||
     qi.RightSource == null || qi.RightSource.Type == null) return null;
   Cardinality card = this.typeSystem.GetCardinality(qi.LeftSource, this.TypeViewer);
   if (card != Cardinality.OneOrMore && card != Cardinality.ZeroOrMore) {
     this.HandleError(qi.LeftSource, Error.QueryNotStream);
     return null;
   }
   card = this.typeSystem.GetCardinality(qi.RightSource, this.TypeViewer);
   if (card != Cardinality.OneOrMore && card != Cardinality.ZeroOrMore) {
     this.HandleError(qi.RightSource, Error.QueryNotStream);
     return null;
   }
   if (qi.LeftSource.Type.UniqueKey != qi.RightSource.Type.UniqueKey) {
     this.HandleError(qi, Error.QueryBadIntersectionTypes, this.GetTypeName(qi.LeftSource.Type), this.GetTypeName(qi.RightSource.Type));
     return null;
   }
   if (qi.Type == null) return null;
   this.HandleError(qi, Error.QueryNotSupported);
   return null;
 }
Example #4
0
 public virtual Node VisitQueryIntersection(QueryIntersection intersection){
   if (intersection == null) return intersection;
   intersection.LeftSource = this.VisitExpression(intersection.LeftSource);
   intersection.RightSource = this.VisitExpression(intersection.RightSource);
   intersection.Type = intersection.LeftSource == null ? null : intersection.LeftSource.Type;
   return intersection;
 }
Example #5
0
 public virtual void VisitQueryIntersection(QueryIntersection intersection){
   if (intersection == null) return;
   this.VisitExpression(intersection.LeftSource);
   this.VisitExpression(intersection.RightSource);
 }
Example #6
0
 public override Node VisitQueryIntersection(QueryIntersection intersection){
   if (intersection == null) return null;
   intersection.LeftSource = this.VisitExpression(intersection.LeftSource);
   intersection.RightSource = this.VisitExpression(intersection.RightSource);
   if (intersection.LeftSource != null && intersection.RightSource != null &&
     intersection.LeftSource.Type != null && intersection.RightSource.Type != null){
     intersection.Type = intersection.LeftSource.Type;
   }
   return intersection;
 }
Example #7
0
 public override Node VisitQueryIntersection(QueryIntersection intersection){
   if (intersection == null) return intersection;
   return base.VisitQueryIntersection((QueryIntersection)intersection.Clone());
 }
Example #8
0
 public virtual Node VisitQueryIntersection(QueryIntersection intersection1, QueryIntersection intersection2){
   if (intersection1 == null) return null;
   if (intersection2 == null){
     intersection1.LeftSource = this.VisitExpression(intersection1.LeftSource, null);
     intersection1.RightSource = this.VisitExpression(intersection1.RightSource, null);
     intersection1.Type = intersection1.LeftSource == null ? null : intersection1.LeftSource.Type;
   }else{
     intersection1.LeftSource = this.VisitExpression(intersection1.LeftSource, intersection2.LeftSource);
     intersection1.RightSource = this.VisitExpression(intersection1.RightSource, intersection2.RightSource);
     intersection1.Type = intersection1.LeftSource == null ? null : intersection1.LeftSource.Type;
   }
   return intersection1;
 }
Example #9
0
 public override Node VisitQueryIntersection(QueryIntersection inter) {
   base.VisitQueryIntersection(inter);
   return this.Compose(inter, this.GetComposer(inter.LeftSource), this.GetComposer(inter.RightSource));
 }
Example #10
0
 public override Node VisitQueryIntersection(QueryIntersection inter)
 {
     base.VisitQueryIntersection(inter);
     return(this.Compose(inter, this.GetComposer(inter.LeftSource), this.GetComposer(inter.RightSource)));
 }
 public EventingVisitor(Action<QueryIntersection> visitQueryIntersection) { VisitedQueryIntersection += visitQueryIntersection; } public event Action<QueryIntersection> VisitedQueryIntersection; public override Node VisitQueryIntersection(QueryIntersection intersection) { if (VisitedQueryIntersection != null) VisitedQueryIntersection(intersection); return base.VisitQueryIntersection(intersection); }