Ejemplo n.º 1
0
    public virtual Differences VisitQueryPosition(QueryPosition position1, QueryPosition position2){
      Differences differences = new Differences(position1, position2);
      if (position1 == null || position2 == null){
        if (position1 != position2) differences.NumberOfDifferences++; else differences.NumberOfSimilarities++;
        return differences;
      }
      QueryPosition changes = (QueryPosition)position2.Clone();
      QueryPosition deletions = (QueryPosition)position2.Clone();
      QueryPosition insertions = (QueryPosition)position2.Clone();

      //position1.Context;

      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;
    }
Ejemplo n.º 2
0
 public virtual Node VisitQueryPosition(QueryPosition position, QueryPosition changes, QueryPosition deletions, QueryPosition insertions){
   this.UpdateSourceContext(position, changes);
   if (position == null) return changes;
   if (changes != null){
     if (deletions == null || insertions == null)
       Debug.Assert(false);
     else{
     }
   }else if (deletions != null)
     return null;
   return position;
 }
Ejemplo n.º 3
0
 public override Node VisitQueryPosition(QueryPosition position){
   this.hasContextReference = true;
   return position;
 }
Ejemplo n.º 4
0
 public virtual Node VisitQueryPosition(QueryPosition position){
   return position;
 }
Ejemplo n.º 5
0
 public override Node VisitQueryPosition(QueryPosition position){
   if (position == null) return null;
   return base.VisitQueryPosition((QueryPosition)position.Clone());
 }
Ejemplo n.º 6
0
 public virtual void VisitQueryPosition(QueryPosition position){
 }
Ejemplo n.º 7
0
 public virtual Node VisitQueryPosition(QueryPosition position1, QueryPosition position2){
   return position1;
 }
Ejemplo n.º 8
0
 public override Node VisitQueryPosition(QueryPosition qp) {
   if (qp.Context != null) {
     if (qp.Context.Position == null && qp.Context.PreFilter != null && qp.Context.PostFilter != null) {
       qp.Context.Position = this.NewClosureLocal(SystemTypes.Int32, this.currentMethod.Body.Scope);
       qp.Context.PreFilter.Statements.Add(new AssignmentStatement(qp.Context.Position, Literal.Int32Zero));
       BinaryExpression badd = new BinaryExpression(qp.Context.Position, Literal.Int32One, NodeType.Add);
       badd.Type = SystemTypes.Int32;
       qp.Context.PostFilter.Statements.Add(new AssignmentStatement(qp.Context.Position, badd));
     }
     return this.VisitExpression(qp.Context.Position);
   }
   return Literal.Int32Zero;
 }
Ejemplo n.º 9
0
 public override Node VisitQueryPosition(QueryPosition position) {
   this.hasContextReference = true;
   return this.Compose(position, this.GetComposer(position));
 }
Ejemplo n.º 10
0
 public override Node VisitQueryPosition(QueryPosition position)
 {
     this.hasContextReference = true;
     return(this.Compose(position, this.GetComposer(position)));
 }
Ejemplo n.º 11
0
 public EventingVisitor(Action<QueryPosition> visitQueryPosition) { VisitedQueryPosition += visitQueryPosition; } public event Action<QueryPosition> VisitedQueryPosition; public override Node VisitQueryPosition(QueryPosition position) { if (VisitedQueryPosition != null) VisitedQueryPosition(position); return base.VisitQueryPosition(position); }