Пример #1
0
 public virtual Node VisitQuerySingleton(QuerySingleton singleton, QuerySingleton changes, QuerySingleton deletions, QuerySingleton insertions){
   this.UpdateSourceContext(singleton, changes);
   if (singleton == null) return changes;
   if (changes != null){
     if (deletions == null || insertions == null)
       Debug.Assert(false);
     else{
     }
   }else if (deletions != null)
     return null;
   return singleton;
 }
Пример #2
0
 public virtual Node VisitQuerySingleton(QuerySingleton singleton){
   if (singleton == null) return null;
   singleton.Source = this.VisitExpression(singleton.Source);
   return singleton;
 }
Пример #3
0
    public virtual Differences VisitQuerySingleton(QuerySingleton singleton1, QuerySingleton singleton2){
      Differences differences = new Differences(singleton1, singleton2);
      if (singleton1 == null || singleton2 == null){
        if (singleton1 != singleton2) differences.NumberOfDifferences++; else differences.NumberOfSimilarities++;
        return differences;
      }
      QuerySingleton changes = (QuerySingleton)singleton2.Clone();
      QuerySingleton deletions = (QuerySingleton)singleton2.Clone();
      QuerySingleton insertions = (QuerySingleton)singleton2.Clone();

      //singleton1.Source;

      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;
    }
Пример #4
0
 public override Node VisitQuerySingleton( QuerySingleton singleton ){
   if (singleton == null) return null;
   singleton.Source = (Expression) this.Visit(singleton.Source);
   if (singleton.Source != null && singleton.Source.Type != null){
     singleton.Type = this.typeSystem.GetStreamElementType(singleton.Source, this.TypeViewer);
   }
   return singleton;
 }
Пример #5
0
 public override Node VisitQuerySingleton(QuerySingleton qs) {
   if (qs == null) return null;
   qs.Source = this.VisitExpression(qs.Source);
   if (qs.Type == null || qs.Source == null || qs.Source.Type == null) return null;
   return qs;
 }
Пример #6
0
 public override Node VisitQuerySingleton(QuerySingleton singleton){
   if (singleton == null) return null;
   return base.VisitQuerySingleton((QuerySingleton)singleton.Clone());
 }
Пример #7
0
 public virtual void VisitQuerySingleton(QuerySingleton singleton){
   if (singleton == null) return;
   this.VisitExpression(singleton.Source);
 }
Пример #8
0
 public virtual Node VisitQuerySingleton(QuerySingleton singleton1, QuerySingleton singleton2){
   if (singleton1 == null) return null;
   if (singleton2 == null)
     singleton1.Source = this.VisitExpression(singleton1.Source, null);
   else
     singleton1.Source = this.VisitExpression(singleton1.Source, singleton2.Source);
   return singleton1;
 }
Пример #9
0
 public override Node VisitQuerySingleton(QuerySingleton qs) {
   Block block = new Block(new StatementList(4));
   Expression feTarget = null;
   Block inner = null;
   BlockScope scope = this.currentMethod.Body.Scope;
   Expression result = new Local(qs.Type);
   Expression hasOne = new Local(SystemTypes.Boolean);
   Block brError = new Block();
   Block brReturn = new Block();
   block.Statements.Add(new AssignmentStatement(hasOne, Literal.False));
   block.Statements.Add(this.BuildClosureForEach(qs.Source, ref feTarget, out inner, scope));
   inner.Statements.Add(new Branch(hasOne, brError));
   inner.Statements.Add(new AssignmentStatement(result, feTarget));
   inner.Statements.Add(new AssignmentStatement(hasOne, Literal.True));
   block.Statements.Add(new Branch(hasOne, brReturn));
   block.Statements.Add(brError);
   Construct cons = new Construct();
   cons.Constructor = new MemberBinding(null, SystemTypes.StreamNotSingletonException.GetConstructor());
   block.Statements.Add(new Throw(cons));
   block.Statements.Add(brReturn);
   block.Statements.Add(new ExpressionStatement(result));
   return this.VisitBlockExpression(new BlockExpression(block, result.Type));
 }
Пример #10
0
 public override Node VisitQuerySingleton( QuerySingleton singleton ) {
   base.VisitQuerySingleton(singleton);
   return this.Compose(singleton, this.GetComposer(singleton.Source));
 }    
Пример #11
0
 public override Node VisitQuerySingleton(QuerySingleton singleton)
 {
     base.VisitQuerySingleton(singleton);
     return(this.Compose(singleton, this.GetComposer(singleton.Source)));
 }
Пример #12
0
 public EventingVisitor(Action<QuerySingleton> visitQuerySingleton) { VisitedQuerySingleton += visitQuerySingleton; } public event Action<QuerySingleton> VisitedQuerySingleton; public override Node VisitQuerySingleton(QuerySingleton singleton) { if (VisitedQuerySingleton != null) VisitedQuerySingleton(singleton); return base.VisitQuerySingleton(singleton); }