~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/QueryExpression.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
ļ»æ// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team
 
2
// 
 
3
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
 
4
// software and associated documentation files (the "Software"), to deal in the Software
 
5
// without restriction, including without limitation the rights to use, copy, modify, merge,
 
6
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
 
7
// to whom the Software is furnished to do so, subject to the following conditions:
 
8
// 
 
9
// The above copyright notice and this permission notice shall be included in all copies or
 
10
// substantial portions of the Software.
 
11
// 
 
12
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
 
13
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 
14
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
 
15
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
 
16
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 
17
// DEALINGS IN THE SOFTWARE.
 
18
 
 
19
using System;
 
20
using System.Collections.Generic;
 
21
using System.Linq;
 
22
namespace ICSharpCode.NRefactory.CSharp
 
23
{
 
24
        public class QueryExpression : Expression
 
25
        {
 
26
                public static readonly Role<QueryClause> ClauseRole = new Role<QueryClause>("Clause");
 
27
                
 
28
                #region Null
 
29
                public new static readonly QueryExpression Null = new NullQueryExpression ();
 
30
                
 
31
                sealed class NullQueryExpression : QueryExpression
 
32
                {
 
33
                        public override bool IsNull {
 
34
                                get {
 
35
                                        return true;
 
36
                                }
 
37
                        }
 
38
                        
 
39
                        public override void AcceptVisitor (IAstVisitor visitor)
 
40
                        {
 
41
                        }
 
42
                                
 
43
                        public override T AcceptVisitor<T> (IAstVisitor<T> visitor)
 
44
                        {
 
45
                                return default (T);
 
46
                        }
 
47
                
 
48
                        public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
 
49
                        {
 
50
                                return default (S);
 
51
                        }
 
52
                        
 
53
                        protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
 
54
                        {
 
55
                                return other == null || other.IsNull;
 
56
                        }
 
57
                }
 
58
                #endregion
 
59
                
 
60
                public AstNodeCollection<QueryClause> Clauses {
 
61
                        get { return GetChildrenByRole(ClauseRole); }
 
62
                }
 
63
                
 
64
                public override void AcceptVisitor (IAstVisitor visitor)
 
65
                {
 
66
                        visitor.VisitQueryExpression (this);
 
67
                }
 
68
                        
 
69
                public override T AcceptVisitor<T> (IAstVisitor<T> visitor)
 
70
                {
 
71
                        return visitor.VisitQueryExpression (this);
 
72
                }
 
73
                
 
74
                public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
 
75
                {
 
76
                        return visitor.VisitQueryExpression (this, data);
 
77
                }
 
78
                
 
79
                protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
 
80
                {
 
81
                        QueryExpression o = other as QueryExpression;
 
82
                        return o != null && !o.IsNull && this.Clauses.DoMatch(o.Clauses, match);
 
83
                }
 
84
        }
 
85
        
 
86
        public abstract class QueryClause : AstNode
 
87
        {
 
88
                public override NodeType NodeType {
 
89
                        get { return NodeType.QueryClause; }
 
90
                }
 
91
        }
 
92
        
 
93
        /// <summary>
 
94
        /// Represents a query continuation.
 
95
        /// "(from .. select ..) into Identifier" or "(from .. group .. by ..) into Identifier"
 
96
        /// Note that "join .. into .." is not a query continuation!
 
97
        /// 
 
98
        /// This is always the first(!!) clause in a query expression.
 
99
        /// The tree for "from a in b select c into d select e" looks like this:
 
100
        /// new QueryExpression {
 
101
        ///     new QueryContinuationClause {
 
102
        ///             PrecedingQuery = new QueryExpression {
 
103
        ///                     new QueryFromClause(a in b),
 
104
        ///                     new QuerySelectClause(c)
 
105
        ///             },
 
106
        ///             Identifier = d
 
107
        ///     },
 
108
        ///     new QuerySelectClause(e)
 
109
        /// }
 
110
        /// </summary>
 
111
        public class QueryContinuationClause : QueryClause
 
112
        {
 
113
                public static readonly Role<QueryExpression> PrecedingQueryRole = new Role<QueryExpression>("PrecedingQuery", QueryExpression.Null);
 
114
                public static readonly TokenRole IntoKeywordRole = new TokenRole ("into");
 
115
                
 
116
                public QueryExpression PrecedingQuery {
 
117
                        get { return GetChildByRole(PrecedingQueryRole); }
 
118
                        set { SetChildByRole(PrecedingQueryRole, value); }
 
119
                }
 
120
                
 
121
                public CSharpTokenNode IntoKeyword {
 
122
                        get { return GetChildByRole (IntoKeywordRole); }
 
123
                }
 
124
 
 
125
                public string Identifier {
 
126
                        get {
 
127
                                return GetChildByRole (Roles.Identifier).Name;
 
128
                        }
 
129
                        set {
 
130
                                SetChildByRole(Roles.Identifier, CSharp.Identifier.CreateĀ (value));
 
131
                        }
 
132
                }
 
133
                
 
134
                public Identifier IdentifierToken {
 
135
                        get { return GetChildByRole (Roles.Identifier); }
 
136
                }
 
137
                
 
138
                public override void AcceptVisitor (IAstVisitor visitor)
 
139
                {
 
140
                        visitor.VisitQueryContinuationClause (this);
 
141
                }
 
142
                        
 
143
                public override T AcceptVisitor<T> (IAstVisitor<T> visitor)
 
144
                {
 
145
                        return visitor.VisitQueryContinuationClause (this);
 
146
                }
 
147
                
 
148
                public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
 
149
                {
 
150
                        return visitor.VisitQueryContinuationClause (this, data);
 
151
                }
 
152
                
 
153
                protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
 
154
                {
 
155
                        QueryContinuationClause o = other as QueryContinuationClause;
 
156
                        return o != null && MatchString(this.Identifier, o.Identifier) && this.PrecedingQuery.DoMatch(o.PrecedingQuery, match);
 
157
                }
 
158
        }
 
159
        
 
160
        public class QueryFromClause : QueryClause
 
161
        {
 
162
                public static readonly TokenRole FromKeywordRole =  new TokenRole ("from");
 
163
                public static readonly TokenRole InKeywordRole =  new TokenRole ("in");
 
164
                
 
165
                public CSharpTokenNode FromKeyword {
 
166
                        get { return GetChildByRole (FromKeywordRole); }
 
167
                }
 
168
 
 
169
                public AstType Type {
 
170
                        get { return GetChildByRole (Roles.Type); }
 
171
                        set { SetChildByRole (Roles.Type, value); }
 
172
                }
 
173
                
 
174
                public string Identifier {
 
175
                        get {
 
176
                                return GetChildByRole (Roles.Identifier).Name;
 
177
                        }
 
178
                        set {
 
179
                                SetChildByRole(Roles.Identifier, CSharp.Identifier.CreateĀ (value));
 
180
                        }
 
181
                }
 
182
                
 
183
                public Identifier IdentifierToken {
 
184
                        get { return GetChildByRole(Roles.Identifier); }
 
185
                }
 
186
                
 
187
                public CSharpTokenNode InKeyword {
 
188
                        get { return GetChildByRole (InKeywordRole); }
 
189
                }
 
190
 
 
191
                public Expression Expression {
 
192
                        get { return GetChildByRole (Roles.Expression); }
 
193
                        set { SetChildByRole (Roles.Expression, value); }
 
194
                }
 
195
                
 
196
                public override void AcceptVisitor (IAstVisitor visitor)
 
197
                {
 
198
                        visitor.VisitQueryFromClause (this);
 
199
                }
 
200
                        
 
201
                public override T AcceptVisitor<T> (IAstVisitor<T> visitor)
 
202
                {
 
203
                        return visitor.VisitQueryFromClause (this);
 
204
                }
 
205
                
 
206
                public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
 
207
                {
 
208
                        return visitor.VisitQueryFromClause (this, data);
 
209
                }
 
210
                
 
211
                protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
 
212
                {
 
213
                        QueryFromClause o = other as QueryFromClause;
 
214
                        return o != null && this.Type.DoMatch(o.Type, match) && MatchString(this.Identifier, o.Identifier)
 
215
                                && this.Expression.DoMatch(o.Expression, match);
 
216
                }
 
217
        }
 
218
        
 
219
        public class QueryLetClause : QueryClause
 
220
        {
 
221
                public readonly static TokenRole LetKeywordRole = new TokenRole ("let");
 
222
                
 
223
                public CSharpTokenNode LetKeyword {
 
224
                        get { return GetChildByRole(LetKeywordRole); }
 
225
                }
 
226
                
 
227
                public string Identifier {
 
228
                        get {
 
229
                                return GetChildByRole(Roles.Identifier).Name;
 
230
                        }
 
231
                        set {
 
232
                                SetChildByRole(Roles.Identifier, CSharp.Identifier.CreateĀ (value));
 
233
                        }
 
234
                }
 
235
                
 
236
                public Identifier IdentifierToken {
 
237
                        get { return GetChildByRole(Roles.Identifier); }
 
238
                }
 
239
                
 
240
                public CSharpTokenNode AssignToken {
 
241
                        get { return GetChildByRole(Roles.Assign); }
 
242
                }
 
243
                
 
244
                public Expression Expression {
 
245
                        get { return GetChildByRole(Roles.Expression); }
 
246
                        set { SetChildByRole(Roles.Expression, value); }
 
247
                }
 
248
                
 
249
                public override void AcceptVisitor (IAstVisitor visitor)
 
250
                {
 
251
                        visitor.VisitQueryLetClause (this);
 
252
                }
 
253
                        
 
254
                public override T AcceptVisitor<T> (IAstVisitor<T> visitor)
 
255
                {
 
256
                        return visitor.VisitQueryLetClause (this);
 
257
                }
 
258
                
 
259
                public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
 
260
                {
 
261
                        return visitor.VisitQueryLetClause (this, data);
 
262
                }
 
263
                
 
264
                protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
 
265
                {
 
266
                        QueryLetClause o = other as QueryLetClause;
 
267
                        return o != null && MatchString(this.Identifier, o.Identifier) && this.Expression.DoMatch(o.Expression, match);
 
268
                }
 
269
        }
 
270
        
 
271
        
 
272
        public class QueryWhereClause : QueryClause
 
273
        {
 
274
                public readonly static TokenRole WhereKeywordRole = new TokenRole ("where");
 
275
 
 
276
                public CSharpTokenNode WhereKeyword {
 
277
                        get { return GetChildByRole (WhereKeywordRole); }
 
278
                }
 
279
                
 
280
                public Expression Condition {
 
281
                        get { return GetChildByRole (Roles.Condition); }
 
282
                        set { SetChildByRole (Roles.Condition, value); }
 
283
                }
 
284
                
 
285
                public override void AcceptVisitor (IAstVisitor visitor)
 
286
                {
 
287
                        visitor.VisitQueryWhereClause (this);
 
288
                }
 
289
                        
 
290
                public override T AcceptVisitor<T> (IAstVisitor<T> visitor)
 
291
                {
 
292
                        return visitor.VisitQueryWhereClause (this);
 
293
                }
 
294
                
 
295
                public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
 
296
                {
 
297
                        return visitor.VisitQueryWhereClause (this, data);
 
298
                }
 
299
                
 
300
                protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
 
301
                {
 
302
                        QueryWhereClause o = other as QueryWhereClause;
 
303
                        return o != null && this.Condition.DoMatch(o.Condition, match);
 
304
                }
 
305
        }
 
306
        
 
307
        /// <summary>
 
308
        /// Represents a join or group join clause.
 
309
        /// </summary>
 
310
        public class QueryJoinClause : QueryClause
 
311
        {
 
312
                public static readonly TokenRole JoinKeywordRole = new TokenRole ("join");
 
313
                public static readonly Role<AstType> TypeRole = Roles.Type;
 
314
                public static readonly Role<Identifier> JoinIdentifierRole = Roles.Identifier;
 
315
                public static readonly TokenRole InKeywordRole =  new TokenRole ("in");
 
316
                public static readonly Role<Expression> InExpressionRole = Roles.Expression;
 
317
                public static readonly TokenRole OnKeywordRole =  new TokenRole ("on");
 
318
                public static readonly Role<Expression> OnExpressionRole = new Role<Expression>("OnExpression", Expression.Null);
 
319
                public static readonly TokenRole EqualsKeywordRole =  new TokenRole ("equals");
 
320
                public static readonly Role<Expression> EqualsExpressionRole = new Role<Expression>("EqualsExpression", Expression.Null);
 
321
                public static readonly TokenRole IntoKeywordRole =  new TokenRole ("into");
 
322
                public static readonly Role<Identifier> IntoIdentifierRole = new Role<Identifier>("IntoIdentifier", Identifier.Null);
 
323
                
 
324
                public bool IsGroupJoin {
 
325
                        get { return !string.IsNullOrEmpty(this.IntoIdentifier); }
 
326
                }
 
327
                
 
328
                public CSharpTokenNode JoinKeyword {
 
329
                        get { return GetChildByRole (JoinKeywordRole); }
 
330
                }
 
331
                
 
332
                public AstType Type {
 
333
                        get { return GetChildByRole (TypeRole); }
 
334
                        set { SetChildByRole (TypeRole, value); }
 
335
                }
 
336
                
 
337
                public string JoinIdentifier {
 
338
                        get {
 
339
                                return GetChildByRole(JoinIdentifierRole).Name;
 
340
                        }
 
341
                        set {
 
342
                                SetChildByRole(JoinIdentifierRole, Identifier.CreateĀ (value));
 
343
                        }
 
344
                }
 
345
                
 
346
                public Identifier JoinIdentifierToken {
 
347
                        get { return GetChildByRole(JoinIdentifierRole); }
 
348
                }
 
349
                
 
350
                public CSharpTokenNode InKeyword {
 
351
                        get { return GetChildByRole (InKeywordRole); }
 
352
                }
 
353
                
 
354
                public Expression InExpression {
 
355
                        get { return GetChildByRole (InExpressionRole); }
 
356
                        set { SetChildByRole (InExpressionRole, value); }
 
357
                }
 
358
                
 
359
                public CSharpTokenNode OnKeyword {
 
360
                        get { return GetChildByRole (OnKeywordRole); }
 
361
                }
 
362
                
 
363
                public Expression OnExpression {
 
364
                        get { return GetChildByRole (OnExpressionRole); }
 
365
                        set { SetChildByRole (OnExpressionRole, value); }
 
366
                }
 
367
                
 
368
                public CSharpTokenNode EqualsKeyword {
 
369
                        get { return GetChildByRole (EqualsKeywordRole); }
 
370
                }
 
371
                
 
372
                public Expression EqualsExpression {
 
373
                        get { return GetChildByRole (EqualsExpressionRole); }
 
374
                        set { SetChildByRole (EqualsExpressionRole, value); }
 
375
                }
 
376
                
 
377
                public CSharpTokenNode IntoKeyword {
 
378
                        get { return GetChildByRole (IntoKeywordRole); }
 
379
                }
 
380
                
 
381
                public string IntoIdentifier {
 
382
                        get {
 
383
                                return GetChildByRole (IntoIdentifierRole).Name;
 
384
                        }
 
385
                        set {
 
386
                                SetChildByRole(IntoIdentifierRole, Identifier.CreateĀ (value));
 
387
                        }
 
388
                }
 
389
                
 
390
                public Identifier IntoIdentifierToken {
 
391
                        get { return GetChildByRole(IntoIdentifierRole); }
 
392
                }
 
393
                
 
394
                public override void AcceptVisitor (IAstVisitor visitor)
 
395
                {
 
396
                        visitor.VisitQueryJoinClause (this);
 
397
                }
 
398
                        
 
399
                public override T AcceptVisitor<T> (IAstVisitor<T> visitor)
 
400
                {
 
401
                        return visitor.VisitQueryJoinClause (this);
 
402
                }
 
403
                
 
404
                public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
 
405
                {
 
406
                        return visitor.VisitQueryJoinClause (this, data);
 
407
                }
 
408
                
 
409
                protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
 
410
                {
 
411
                        QueryJoinClause o = other as QueryJoinClause;
 
412
                        return o != null && this.IsGroupJoin == o.IsGroupJoin
 
413
                                && this.Type.DoMatch(o.Type, match) && MatchString(this.JoinIdentifier, o.JoinIdentifier)
 
414
                                && this.InExpression.DoMatch(o.InExpression, match) && this.OnExpression.DoMatch(o.OnExpression, match)
 
415
                                && this.EqualsExpression.DoMatch(o.EqualsExpression, match)
 
416
                                && MatchString(this.IntoIdentifier, o.IntoIdentifier);
 
417
                }
 
418
        }
 
419
        
 
420
        public class QueryOrderClause : QueryClause
 
421
        {
 
422
                public static readonly TokenRole OrderbyKeywordRole = new TokenRole ("orderby");
 
423
                public static readonly Role<QueryOrdering> OrderingRole = new Role<QueryOrdering>("Ordering");
 
424
                
 
425
                public CSharpTokenNode OrderbyToken {
 
426
                        get { return GetChildByRole (OrderbyKeywordRole); }
 
427
                }
 
428
                
 
429
                public AstNodeCollection<QueryOrdering> Orderings {
 
430
                        get { return GetChildrenByRole (OrderingRole); }
 
431
                }
 
432
                
 
433
                public override void AcceptVisitor (IAstVisitor visitor)
 
434
                {
 
435
                        visitor.VisitQueryOrderClause (this);
 
436
                }
 
437
                        
 
438
                public override T AcceptVisitor<T> (IAstVisitor<T> visitor)
 
439
                {
 
440
                        return visitor.VisitQueryOrderClause (this);
 
441
                }
 
442
                
 
443
                public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
 
444
                {
 
445
                        return visitor.VisitQueryOrderClause (this, data);
 
446
                }
 
447
                
 
448
                protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
 
449
                {
 
450
                        QueryOrderClause o = other as QueryOrderClause;
 
451
                        return o != null && this.Orderings.DoMatch(o.Orderings, match);
 
452
                }
 
453
        }
 
454
        
 
455
        public class QueryOrdering : AstNode
 
456
        {
 
457
                public readonly static TokenRole AscendingKeywordRole = new TokenRole ("ascending");
 
458
                public readonly static TokenRole DescendingKeywordRole = new TokenRole ("descending");
 
459
 
 
460
                public override NodeType NodeType {
 
461
                        get { return NodeType.Unknown; }
 
462
                }
 
463
                
 
464
                public Expression Expression {
 
465
                        get { return GetChildByRole (Roles.Expression); }
 
466
                        set { SetChildByRole (Roles.Expression, value); }
 
467
                }
 
468
                
 
469
                public QueryOrderingDirection Direction {
 
470
                        get;
 
471
                        set;
 
472
                }
 
473
                
 
474
                public CSharpTokenNode DirectionToken {
 
475
                        get { return Direction == QueryOrderingDirection.Ascending ? GetChildByRole (AscendingKeywordRole) : GetChildByRole (DescendingKeywordRole); }
 
476
                }
 
477
                
 
478
                public override void AcceptVisitor (IAstVisitor visitor)
 
479
                {
 
480
                        visitor.VisitQueryOrdering (this);
 
481
                }
 
482
                        
 
483
                public override T AcceptVisitor<T> (IAstVisitor<T> visitor)
 
484
                {
 
485
                        return visitor.VisitQueryOrdering (this);
 
486
                }
 
487
                
 
488
                public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
 
489
                {
 
490
                        return visitor.VisitQueryOrdering (this, data);
 
491
                }
 
492
                
 
493
                protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
 
494
                {
 
495
                        QueryOrdering o = other as QueryOrdering;
 
496
                        return o != null && this.Direction == o.Direction && this.Expression.DoMatch(o.Expression, match);
 
497
                }
 
498
        }
 
499
        
 
500
        public enum QueryOrderingDirection
 
501
        {
 
502
                None,
 
503
                Ascending,
 
504
                Descending
 
505
        }
 
506
        
 
507
        public class QuerySelectClause : QueryClause
 
508
        {
 
509
                public readonly static TokenRole SelectKeywordRole = new TokenRole ("select");
 
510
 
 
511
                public CSharpTokenNode SelectKeyword {
 
512
                        get { return GetChildByRole (SelectKeywordRole); }
 
513
                }
 
514
                
 
515
                public Expression Expression {
 
516
                        get { return GetChildByRole (Roles.Expression); }
 
517
                        set { SetChildByRole (Roles.Expression, value); }
 
518
                }
 
519
                
 
520
                public override void AcceptVisitor (IAstVisitor visitor)
 
521
                {
 
522
                        visitor.VisitQuerySelectClause (this);
 
523
                }
 
524
                        
 
525
                public override T AcceptVisitor<T> (IAstVisitor<T> visitor)
 
526
                {
 
527
                        return visitor.VisitQuerySelectClause (this);
 
528
                }
 
529
                
 
530
                public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
 
531
                {
 
532
                        return visitor.VisitQuerySelectClause (this, data);
 
533
                }
 
534
                
 
535
                protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
 
536
                {
 
537
                        QuerySelectClause o = other as QuerySelectClause;
 
538
                        return o != null && this.Expression.DoMatch(o.Expression, match);
 
539
                }
 
540
        }
 
541
        
 
542
        public class QueryGroupClause : QueryClause
 
543
        {
 
544
                public static readonly TokenRole GroupKeywordRole = new TokenRole ("group");
 
545
                public static readonly Role<Expression> ProjectionRole = new Role<Expression>("Projection", Expression.Null);
 
546
                public static readonly TokenRole ByKeywordRole = new TokenRole ("by");
 
547
                public static readonly Role<Expression> KeyRole = new Role<Expression>("Key", Expression.Null);
 
548
                
 
549
                public CSharpTokenNode GroupKeyword {
 
550
                        get { return GetChildByRole (GroupKeywordRole); }
 
551
                }
 
552
                
 
553
                public Expression Projection {
 
554
                        get { return GetChildByRole (ProjectionRole); }
 
555
                        set { SetChildByRole (ProjectionRole, value); }
 
556
                }
 
557
                
 
558
                public CSharpTokenNode ByKeyword {
 
559
                        get { return GetChildByRole (ByKeywordRole); }
 
560
                }
 
561
                
 
562
                public Expression Key {
 
563
                        get { return GetChildByRole (KeyRole); }
 
564
                        set { SetChildByRole (KeyRole, value); }
 
565
                }
 
566
                
 
567
                public override void AcceptVisitor (IAstVisitor visitor)
 
568
                {
 
569
                        visitor.VisitQueryGroupClause (this);
 
570
                }
 
571
                        
 
572
                public override T AcceptVisitor<T> (IAstVisitor<T> visitor)
 
573
                {
 
574
                        return visitor.VisitQueryGroupClause (this);
 
575
                }
 
576
                
 
577
                public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
 
578
                {
 
579
                        return visitor.VisitQueryGroupClause (this, data);
 
580
                }
 
581
                
 
582
                protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
 
583
                {
 
584
                        QueryGroupClause o = other as QueryGroupClause;
 
585
                        return o != null && this.Projection.DoMatch(o.Projection, match) && this.Key.DoMatch(o.Key, match);
 
586
                }
 
587
        }
 
588
}
 
 
b'\\ No newline at end of file'