Ejemplo n.º 1
0
        public override Node VisitQueryGroupBy(QueryGroupBy groupby)
        {
            groupby.Source = this.VisitExpression(groupby.Source);
            Composer save    = this.contextComposer;
            Composer c       = this.contextComposer = this.GetComposer(groupby.Source);
            bool     savehcr = this.hasContextReference;

            this.hasContextReference = false;
            this.VisitExpressionList(groupby.GroupList);
            this.hasContextReference = false;
            groupby.Having           = this.VisitExpression(groupby.Having);
            this.contextComposer     = save;
            this.hasContextReference = savehcr;
            return(this.Compose(groupby, c));
        }
Ejemplo n.º 2
0
 public virtual Node VisitQueryGroupBy(QueryGroupBy groupby){
   if (groupby == null) return null;
   groupby.Source = this.VisitExpression(groupby.Source);
   groupby.GroupList = this.VisitExpressionList(groupby.GroupList);
   groupby.Having = this.VisitExpression(groupby.Having);
   return groupby;
 }
Ejemplo n.º 3
0
 public override Node VisitQueryGroupBy(QueryGroupBy qgb) {
   if (qgb == null) return null;
   Class cc = this.currentMethod.Scope.ClosureClass;
   qgb.Source = this.VisitExpression(qgb.Source);
   if (qgb.Source == null || qgb.Source.Type == null) return null;
   Cardinality card = this.typeSystem.GetCardinality(qgb.Source, this.TypeViewer);
   if (card != Cardinality.OneOrMore && card != Cardinality.ZeroOrMore) {
     this.HandleError(qgb.Source, Error.QueryNotStream);
     return null;
   }
   int nGroup = qgb.GroupList == null ? 0 : qgb.GroupList.Count;
   int nAgg = qgb.AggregateList == null ? 0 : qgb.AggregateList.Count;
   if (nGroup + nAgg == 0) {
     this.HandleError(qgb, Error.QueryBadGroupByList);
     return null;
   }
   for (int i = 0, n = qgb.GroupList.Count; i < n; i++) {
     Expression x = this.VisitExpression(qgb.GroupList[i]);
     if (x == null || x.Type == null) return null;
     card = this.typeSystem.GetCardinality(x, this.TypeViewer);
     if (card == Cardinality.OneOrMore || card == Cardinality.ZeroOrMore) {
       this.HandleError(x, Error.QueryNotScalar);
       return null;
     }
     qgb.GroupList[i] = x;
   }
   for (int i = 0, n = qgb.AggregateList.Count; i < n; i++) {
     QueryAggregate qa = qgb.AggregateList[i] as QueryAggregate;
     if (qa == null) continue;
     QueryDistinct qd = qa.Expression as QueryDistinct;
     if (qd != null) {
       qd.Source = this.VisitExpression(qd.Source);
       qa.Expression = this.CheckQueryDistinct(qd);
     } else {
       qa.Expression = this.VisitExpression(qa.Expression);
     }
     qa = this.CheckQueryAggregate(qa);
     if (qa == null) return null;
     qgb.AggregateList[i] = qa;
   }
   if (qgb.Having != null) {
     qgb.Having = this.VisitExpression(qgb.Having);
     if (qgb.Having == null) return null;
   }
   if (qgb.Type == null) return null;
   return qgb;
 }
Ejemplo n.º 4
0
 public override Node VisitQueryGroupBy(QueryGroupBy groupby){
   if (groupby == null) return null;
   groupby.Source = this.VisitExpression(groupby.Source);
   if (groupby.Source == null || groupby.Source.Type == null) return groupby;
   TypeNode sourceElementType = this.typeSystem.GetStreamElementType(groupby.Source, this.TypeViewer);
   groupby.GroupContext = this.contextScope = new ContextScope(this.contextScope, sourceElementType);
   groupby.GroupList = this.VisitExpressionList(groupby.GroupList);
   this.contextScope = this.contextScope.Previous;
   // create result type
   FieldList fields = new FieldList();
   int cn = 0;
   for (int i = 0, n = groupby.GroupList.Count; i < n; i++){
     Expression x = groupby.GroupList[i];
     if (x != null && x.Type != null){
       Identifier name = this.GetExpressionName(x);
       Field f = new Field(null, new AttributeList(1), FieldFlags.Public, name, x.Type, null);
       if (name == null || name == Identifier.Empty){
         f.Name = Identifier.For("Item"+cn); cn++;
         f.Attributes.Add(new AttributeNode(new MemberBinding(null, SystemTypes.AnonymousAttribute.GetConstructor()), null));
       }
       fields.Add(f);
     }
   }
   for (int i = 0, n = groupby.AggregateList.Count; i < n; i++){
     QueryAggregate qa = groupby.AggregateList[i] as QueryAggregate;
     if (qa != null){
       qa.Group = groupby;
       this.contextScope = groupby.GroupContext;
       TypeNode aggType = null;
       QueryDistinct qd = qa.Expression as QueryDistinct;
       if (qd != null){
         qd.Group = groupby;
         qd.Source = this.VisitExpression(qd.Source);
         if (qd.Source == null) continue;
         qd.Type = this.GetResultType(qd.Source, null, Cardinality.ZeroOrMore);
         aggType = this.GetAggregateSubType(qa.AggregateType, this.typeSystem.GetStreamElementType(qd.Source, this.TypeViewer));
       }
       else{
         qa.Expression = this.VisitExpression(qa.Expression);
         if (qa.Expression == null) continue;
         aggType = this.GetAggregateSubType(qa.AggregateType, this.typeSystem.GetStreamElementType(qa.Expression, this.TypeViewer));
       }
       this.contextScope = this.contextScope.Previous;
       if (aggType == null) continue;
       qa.AggregateType = aggType;
       Method mgetval = this.GetTypeView(aggType).GetMethod(StandardIds.GetValue);
       if (mgetval != null){
         qa.Type = mgetval.ReturnType;
       }
       Identifier name = Identifier.For("Item"+cn); cn++;
       Field f = new Field(null, new AttributeList(1), FieldFlags.Public, name, qa.Type, null);
       f.Attributes.Add(new AttributeNode(new MemberBinding(null, SystemTypes.AnonymousAttribute.GetConstructor()), null));
       fields.Add(f);
     }
   }
   if (fields.Count == groupby.GroupList.Count + groupby.AggregateList.Count){
     TypeNode groupType = TupleType.For(fields, this.currentType);
     if (groupby.Having != null){
       groupby.HavingContext = this.contextScope = new ContextScope(this.contextScope, groupType);
       groupby.Having = this.VisitExpression(groupby.Having);
       this.contextScope = this.contextScope.Previous;
     }
     groupby.Type = this.GetResultType(groupby.Source, groupType, Cardinality.One);
   }
   return groupby;
 }
Ejemplo n.º 5
0
 public virtual void VisitQueryGroupBy(QueryGroupBy groupby){
   if (groupby == null) return;
   this.VisitExpression(groupby.Source);
   this.VisitExpressionList(groupby.GroupList);
   this.VisitExpression(groupby.Having);
 }
Ejemplo n.º 6
0
 public override Node VisitQueryGroupBy(QueryGroupBy groupby){
   if (groupby == null) return null;
   return base.VisitQueryGroupBy((QueryGroupBy)groupby.Clone());
 }
Ejemplo n.º 7
0
 public virtual Node VisitQueryGroupBy(QueryGroupBy groupby1, QueryGroupBy groupby2){
   if (groupby1 == null) return null;
   if (groupby2 == null){
     groupby1.Source = this.VisitExpression(groupby1.Source, null);
     groupby1.GroupList = this.VisitExpressionList(groupby1.GroupList, null);
     groupby1.Having = this.VisitExpression(groupby1.Having, null);
   }else{
     groupby1.Source = this.VisitExpression(groupby1.Source, groupby2.Source);
     groupby1.GroupList = this.VisitExpressionList(groupby1.GroupList, groupby2.GroupList);
     groupby1.Having = this.VisitExpression(groupby1.Having, groupby2.Having);
   }
   return groupby1;
 }
Ejemplo n.º 8
0
 public override Node VisitQuerySelect( QuerySelect select ){
   Scope savedScope = this.scope;
   Scope scope = this.scope = new QueryScope(savedScope);
   this.AddToAllScopes(this.scope);
   QueryGroupBy saveGroup = this.currentGroup;
   this.currentGroup = null;
   select.Source = (Expression) this.Visit( select.Source );
   this.currentGroup = saveGroup;
   this.scope = savedScope;
   return select;
 }
Ejemplo n.º 9
0
 public override Node VisitQueryOrderBy( QueryOrderBy qob ){
   if (qob == null) return null;
   qob.Source = this.VisitExpression(qob.Source);
   QueryGroupBy save = this.currentGroup;
   this.currentGroup = this.GetGroupBySource(qob.Source);
   if (this.currentGroup == null){
     this.currentGroup = new QueryGroupBy();
   }
   this.VisitExpressionList(qob.OrderList);
   if (this.currentGroup.Source == null && this.currentGroup.AggregateList.Count > 0){
     qob.Source = this.InjectGroupBy(qob.Source, this.currentGroup);
   }
   this.currentGroup = save;
   return qob;
 }
Ejemplo n.º 10
0
 public override Node VisitQueryProject( QueryProject qp ){
   if (qp == null) return null;
   qp.Source = this.VisitExpression(qp.Source);
   QueryGroupBy save = this.currentGroup;
   this.currentGroup = this.GetGroupBySource(qp.Source);
   if (this.currentGroup == null){
     this.currentGroup = new QueryGroupBy();
   }
   this.VisitExpressionList(qp.ProjectionList);
   if (this.currentGroup.Source == null && this.currentGroup.AggregateList.Count > 0){
     qp.Source = this.InjectGroupBy(qp.Source, this.currentGroup);
   }
   this.currentGroup = save;
   if (qp.ProjectedType != null){
     qp.ProjectedType = this.VisitTypeReference(qp.ProjectedType);
   }
   return qp;
 }
Ejemplo n.º 11
0
 public virtual Expression InjectGroupBy(Expression source, QueryGroupBy gb){
   if (source == null || gb == null) return null;
   switch (source.NodeType){
     case NodeType.QueryOrderBy:
       QueryOrderBy ob = (QueryOrderBy)source;
       ob.Source = this.InjectGroupBy(ob.Source, gb);
       return ob;
     case NodeType.QueryProject: 
       QueryProject qp = (QueryProject)source;
       qp.Source = this.InjectGroupBy(qp.Source, gb);
       return qp;
     case NodeType.QueryDistinct:
       QueryDistinct qd = (QueryDistinct)source;
       qd.Source = this.InjectGroupBy(qd.Source, gb);
       return qd;
     case NodeType.QuerySingleton:
       QuerySingleton qs = (QuerySingleton)source;
       qs.Source = this.InjectGroupBy(qs.Source, gb);
       return qs;
     default:
       gb.Source = source;
       return gb;
   }
 }
Ejemplo n.º 12
0
 public override Node VisitQueryGroupBy( QueryGroupBy qgb ){
   if (qgb == null) return null;
   qgb.Source = this.VisitExpression(qgb.Source);
   this.VisitExpressionList(qgb.GroupList);
   if (qgb.Having != null){
     QueryGroupBy save = this.currentGroup;
     this.currentGroup = qgb;
     qgb.Having = this.VisitExpression(qgb.Having);
     this.currentGroup = save;
   }
   return qgb;
 }
Ejemplo n.º 13
0
 public override Node VisitQueryGroupBy(QueryGroupBy groupby) {
   groupby.Source = this.VisitExpression(groupby.Source);
   Composer save = this.contextComposer;
   Composer c = this.contextComposer = this.GetComposer(groupby.Source);
   bool savehcr = this.hasContextReference;
   this.hasContextReference = false;
   this.VisitExpressionList(groupby.GroupList);
   this.hasContextReference = false;
   groupby.Having = this.VisitExpression(groupby.Having);
   this.contextComposer = save;
   this.hasContextReference = savehcr;
   return this.Compose(groupby, c);
 }
Ejemplo n.º 14
0
    public virtual Differences VisitQueryGroupBy(QueryGroupBy groupby1, QueryGroupBy groupby2){
      Differences differences = new Differences(groupby1, groupby2);
      if (groupby1 == null || groupby2 == null){
        if (groupby1 != groupby2) differences.NumberOfDifferences++; else differences.NumberOfSimilarities++;
        return differences;
      }
      QueryGroupBy changes = (QueryGroupBy)groupby2.Clone();
      QueryGroupBy deletions = (QueryGroupBy)groupby2.Clone();
      QueryGroupBy insertions = (QueryGroupBy)groupby2.Clone();

      //      groupby1.AggregateList;
      //      groupby1.GroupContext;
      //      groupby1.GroupList;
      //      groupby1.Having;
      //      groupby1.HavingContext;
      //      groupby1.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;
    }
Ejemplo n.º 15
0
 public override Node VisitQueryGroupBy(QueryGroupBy gb) {
   TypeNode groupType = this.typeSystem.GetStreamElementType(gb, this.TypeViewer);
   Block block = null;
   Node closure = this.StartQueryClosure(groupType, "groupby", out block);
   BlockScope scope = block.Scope;
   Expression target = null;
   Block inner = null;
   Statement fe = this.BuildClosureForEach(gb.Source, ref target, out inner, scope);
   gb.GroupContext.Target = target;
   // build comparer for grouping fields
   int nGroupers = (gb.GroupList != null ? gb.GroupList.Count : 0);
   MemberList members = this.typeSystem.GetDataMembers(groupType);
   // create key type
   FieldList keyFields = new FieldList();
   for (int i = 0; i < nGroupers; i++) {
     keyFields.Add((Field)members[i]);
   }
   for (int i = 0; i < gb.AggregateList.Count; i++) {
     QueryAggregate qa = gb.AggregateList[i] as QueryAggregate;
     if (qa == null) continue;
     Field f = new Field(null, null, FieldFlags.Public, Identifier.For("Agg"+i), qa.AggregateType, null);
     keyFields.Add(f);
     if (qa.Expression is QueryDistinct) {
       Field fhash = new Field(null, null, FieldFlags.Public, Identifier.For("Hash"+i), SystemTypes.Hashtable, null);
       keyFields.Add(fhash);
     }
   }
   TypeNode keyType = TupleType.For(keyFields, this.currentType);
   MemberList keyMembers = this.typeSystem.GetDataMembers(keyType);
   Local locTable = null;
   // create the grouping hashtable if we have items expressions to group by
   if (nGroupers > 0) {
     TypeNode comparerType = this.BuildComparer(keyType, keyMembers, null, nGroupers);
     block.Statements.Add(new QueryGeneratedType(comparerType));
     // create hashtable instance before source iteration
     locTable = new Local(SystemTypes.Hashtable);
     Construct ccons = new Construct();
     ccons.Constructor = new MemberBinding(null, this.GetTypeView(comparerType).GetConstructor());
     ccons.Type = comparerType;
     Construct tcons = new Construct();
     InstanceInitializer ii = SystemTypes.Hashtable.GetConstructor(SystemTypes.IHashCodeProvider, SystemTypes.IComparer);
     tcons.Constructor = new MemberBinding(null, ii);
     tcons.Operands = new ExpressionList(ccons, new Expression(NodeType.Dup, ccons.Type));
     tcons.Type = SystemTypes.Hashtable;
     block.Statements.Add(new AssignmentStatement(locTable, tcons));
   }
   // iterate over source items
   block.Statements.Add(fe);
   // compute key values based on group expression
   Expression locKey = new Local(keyType);
   if (locTable != null) {
     Expression locBlank = new Local(keyType);
     inner.Statements.Add(new AssignmentStatement(locKey, locBlank));
   }
   for( int i = 0; i < nGroupers; i++ ) {
     Member m = keyMembers[i];
     Expression x = gb.GroupList[i];
     inner.Statements.Add(new AssignmentStatement(new MemberBinding(locKey, m), x));
   }
   Expression locResult = new Local(SystemTypes.Object);
   Expression locNotFirst = new Local(SystemTypes.Boolean);
   Block brUpdate = new Block();
   Block brNew = new Block();
   if (locTable != null) {
     // locResult = ht[locGroup]
     Method mget = SystemTypes.Hashtable.GetMethod(StandardIds.getItem, SystemTypes.Object);
     MethodCall mcget = new MethodCall(new MemberBinding(locTable, mget), new ExpressionList(this.Box(locKey)));
     mcget.Type = mget.ReturnType;
     inner.Statements.Add(new AssignmentStatement(locResult, mcget));
     // if (locResult == null) goto brNew
     inner.Statements.Add(new Branch(new BinaryExpression(locResult, Literal.Null, NodeType.Eq), brNew));
     // locKey = (keyType)locResult
     inner.Statements.Add(new AssignmentStatement(locKey, this.Unbox(locResult, keyType)));
     inner.Statements.Add(new Branch(null, brUpdate));
   }
   else {
     locNotFirst = new Local(SystemTypes.Boolean);
     inner.Statements.Add(new Branch(locNotFirst, brUpdate));
   }
   // brNew
   inner.Statements.Add(brNew);
   // initialize aggregates
   for (int i = 0, n = gb.AggregateList.Count, k = nGroupers; i < n; i++, k++) {
     Field fAgg = keyMembers[k] as Field;
     QueryAggregate qa = gb.AggregateList[i] as QueryAggregate;
     if (fAgg == null || qa == null) continue;
     if (!qa.AggregateType.IsValueType) {
       Construct cons = new Construct();
       cons.Constructor = new MemberBinding(null, this.GetTypeView(qa.AggregateType).GetConstructor());
       cons.Type = qa.AggregateType;
       MemberBinding mbAgg = new MemberBinding(locKey, fAgg);
       mbAgg.Type = fAgg.Type;
       inner.Statements.Add(new AssignmentStatement(mbAgg, cons));
     }
     if (qa.Expression is QueryDistinct) {
       k++;
       Field fHash = keyMembers[k] as Field;
       Construct cons = new Construct();
       cons.Constructor = new MemberBinding(null, SystemTypes.Hashtable.GetConstructor());
       cons.Type = SystemTypes.Hashtable;
       MemberBinding mbHash = new MemberBinding(locKey, fHash);
       mbHash.Type = fHash.Type;
       inner.Statements.Add(new AssignmentStatement(mbHash, cons));
     }
   }
   // brUpdate
   inner.Statements.Add(brUpdate);
   // add aggregate values to aggregates
   Local locBoxedValue = new Local(SystemTypes.Object);
   for (int i = 0, n = gb.AggregateList.Count, k = nGroupers; i < n; i++, k++) {
     Field fAgg = keyMembers[k] as Field;
     QueryAggregate qa = gb.AggregateList[i] as QueryAggregate;
     if (fAgg == null || qa == null) continue;
     MemberBinding mbAgg = new MemberBinding(locKey, fAgg); mbAgg.Type = fAgg.Type;
     Method madd = this.GetTypeView(qa.AggregateType).GetMembersNamed(StandardIds.Add)[0] as Method;
     TypeNode paramType = madd.Parameters[0].Type;
     // add value to aggregate
     QueryDistinct qd = qa.Expression as QueryDistinct;
     if (qd != null) {
       k++;
       Field fHash = keyMembers[k] as Field;
       if (fHash == null) continue;
       Local locValue = new Local(paramType);
       MemberBinding mbHash = new MemberBinding(locKey, fHash); mbHash.Type = fHash.Type;
       Block brSkip = new Block();
       Block inner2 = new Block(new StatementList());
       inner.Statements.Add(this.IfNotNull(qd.Source, inner2));
       inner2.Statements.Add(new AssignmentStatement(locValue, this.typeSystem.ExplicitCoercion(qd.Source, paramType, this.TypeViewer)));
       inner2.Statements.Add(new AssignmentStatement(locBoxedValue, this.Box(locValue)));
       Method mcontains = SystemTypes.Hashtable.GetMethod(Identifier.For("Contains"), SystemTypes.Object);
       MethodCall mccontains = new MethodCall(new MemberBinding(mbHash, mcontains), new ExpressionList(locBoxedValue));
       mccontains.Type = mcontains.ReturnType;
       // if (hash.Contains(locBoxedValue)) goto brSkip;
       inner2.Statements.Add(new Branch(mccontains, brSkip));
       Method mhashset = SystemTypes.Hashtable.GetMethod(Identifier.For("set_Item"), SystemTypes.Object, SystemTypes.Object);
       MethodCall mchashset = new MethodCall(new MemberBinding(mbHash, mhashset), new ExpressionList(locBoxedValue, locBoxedValue));
       mchashset.Type = mhashset.ReturnType;
       // hash[locBoxedValue] = locBoxedValue;
       inner2.Statements.Add(new ExpressionStatement(mchashset));
       // aggregate.Add(locValue);
       MethodCall mcadd = new MethodCall(new MemberBinding(mbAgg, madd), new ExpressionList(locValue));
       mcadd.Type = madd.ReturnType;
       inner2.Statements.Add(new ExpressionStatement(mcadd));
       inner.Statements.Add(brSkip);
     }
     else {
       // aggregate.Add(value);
       MethodCall mcadd = new MethodCall(new MemberBinding(mbAgg, madd), new ExpressionList(this.typeSystem.ExplicitCoercion(qa.Expression, paramType, this.TypeViewer)));
       mcadd.Type = madd.ReturnType;
       inner.Statements.Add(this.IfNotNull(qa.Expression, new ExpressionStatement(mcadd)));
     }
   }
   Local locGroup = new Local(groupType);
   if (locTable != null) {
     // ht[locKey] = locKey;
     inner.Statements.Add(new AssignmentStatement(locResult, this.Box(locKey)));
     Method mset = SystemTypes.Hashtable.GetMethod(Identifier.For("set_Item"), SystemTypes.Object, SystemTypes.Object);
     MethodCall mcset = new MethodCall(new MemberBinding(locTable, mset), new ExpressionList(locResult, locResult));
     mcset.Type = mset.ReturnType;
     inner.Statements.Add(new ExpressionStatement(mcset));
     // iterate over all items in the hashtable
     Method getvals = SystemTypes.Hashtable.GetMethod(Identifier.For("get_Values"), null);
     MethodCall mcgetvals = new MethodCall(new MemberBinding(locTable, getvals), null);
     mcgetvals.Type = getvals.ReturnType;
     block.Statements.Add(this.BuildClosureForEach(mcgetvals, ref locResult, out inner, scope));
     inner.Statements.Add(new AssignmentStatement(locKey, this.Unbox(locResult, keyType)));
   }
   else {
     inner.Statements.Add(new AssignmentStatement(locNotFirst, Literal.True));
     inner = block;
   }
   // copy key results to return element
   for (int i = 0; i < nGroupers; i++) {
     Field keyField = keyMembers[i] as Field;
     Field groupField = members[i] as Field;
     if (keyField == null || groupField == null) continue;
     MemberBinding mbKey = new MemberBinding(locKey, keyField); mbKey.Type = keyField.Type;
     MemberBinding mbGroup = new MemberBinding(locGroup, groupField); mbGroup.Type = groupField.Type;
     inner.Statements.Add(new AssignmentStatement(mbGroup, mbKey));
   }
   for (int i = 0, n = gb.AggregateList.Count, k = nGroupers; i < n; i++, k++) {
     QueryAggregate qa = gb.AggregateList[i] as QueryAggregate;
     Field aggField = keyMembers[k] as Field;
     Field groupField = members[i + nGroupers] as Field;
     if (qa == null || aggField == null || groupField == null) continue;
     if (qa.Expression is QueryDistinct) k++;
     MemberBinding mbAgg = new MemberBinding(locKey, aggField); mbAgg.Type = aggField.Type;
     MemberBinding mbGroup = new MemberBinding(locGroup, groupField); mbGroup.Type = groupField.Type;
     Method mgetval = this.GetTypeView(qa.AggregateType).GetMethod(StandardIds.GetValue);
     MethodCall mcgetval = new MethodCall(new MemberBinding(mbAgg, mgetval), null);
     mcgetval.Type = mgetval.ReturnType;
     inner.Statements.Add(new AssignmentStatement(mbGroup, mcgetval));
   }
   // do having test
   if (gb.Having != null) {
     gb.HavingContext.Target = locGroup;
     Block brEndHaving = new Block();
     inner.Statements.Add(new Branch(new UnaryExpression(gb.Having, NodeType.LogicalNot), brEndHaving));
     inner.Statements.Add(new Yield(locGroup));
     inner.Statements.Add(brEndHaving);
   }
   else {
     inner.Statements.Add(new Yield(locGroup));
   }
   // normalize 
   return this.EndQueryClosure(closure, gb.Type);
 }
Ejemplo n.º 16
0
 public virtual Node VisitQueryGroupBy(QueryGroupBy groupby, QueryGroupBy changes, QueryGroupBy deletions, QueryGroupBy insertions){
   this.UpdateSourceContext(groupby, changes);
   if (groupby == null) return changes;
   if (changes != null){
     if (deletions == null || insertions == null)
       Debug.Assert(false);
     else{
     }
   }else if (deletions != null)
     return null;
   return groupby;
 }
Ejemplo n.º 17
0
 public EventingVisitor(Action<QueryGroupBy> visitQueryGroupBy) { VisitedQueryGroupBy += visitQueryGroupBy; } public event Action<QueryGroupBy> VisitedQueryGroupBy; public override Node VisitQueryGroupBy(QueryGroupBy groupby) { if (VisitedQueryGroupBy != null) VisitedQueryGroupBy(groupby); return base.VisitQueryGroupBy(groupby); }