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

« back to all changes in this revision

Viewing changes to contrib/NRefactory/Project/Src/Ast/Generated.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
 
//------------------------------------------------------------------------------
2
 
// <auto-generated>
3
 
//     This code was generated by a tool.
4
 
//     Runtime Version:2.0.50727.3053
5
 
//
6
 
//     Changes to this file may cause incorrect behavior and will be lost if
7
 
//     the code is regenerated.
8
 
// </auto-generated>
9
 
//------------------------------------------------------------------------------
10
 
 
11
 
namespace ICSharpCode.OldNRefactory.Ast {
12
 
        using System;
13
 
        using System.Collections.Generic;
14
 
        
15
 
        
16
 
        public class AddHandlerStatement : Statement {
17
 
                
18
 
                Expression eventExpression;
19
 
                
20
 
                Expression handlerExpression;
21
 
                
22
 
                public Expression EventExpression {
23
 
                        get {
24
 
                                return eventExpression;
25
 
                        }
26
 
                        set {
27
 
                                eventExpression = value ?? Expression.Null;
28
 
                                if (!eventExpression.IsNull) eventExpression.Parent = this;
29
 
                        }
30
 
                }
31
 
                
32
 
                public Expression HandlerExpression {
33
 
                        get {
34
 
                                return handlerExpression;
35
 
                        }
36
 
                        set {
37
 
                                handlerExpression = value ?? Expression.Null;
38
 
                                if (!handlerExpression.IsNull) handlerExpression.Parent = this;
39
 
                        }
40
 
                }
41
 
                
42
 
                public AddHandlerStatement(Expression eventExpression, Expression handlerExpression) {
43
 
                        EventExpression = eventExpression;
44
 
                        HandlerExpression = handlerExpression;
45
 
                }
46
 
                
47
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
48
 
                        return visitor.VisitAddHandlerStatement(this, data);
49
 
                }
50
 
                
51
 
                public override string ToString() {
52
 
                        return string.Format("[AddHandlerStatement EventExpression={0} HandlerExpression={1}]", EventExpression, HandlerExpression);
53
 
                }
54
 
        }
55
 
        
56
 
        public class AddressOfExpression : Expression {
57
 
                
58
 
                Expression expression;
59
 
                
60
 
                public Expression Expression {
61
 
                        get {
62
 
                                return expression;
63
 
                        }
64
 
                        set {
65
 
                                expression = value ?? Expression.Null;
66
 
                                if (!expression.IsNull) expression.Parent = this;
67
 
                        }
68
 
                }
69
 
                
70
 
                public AddressOfExpression(Expression expression) {
71
 
                        Expression = expression;
72
 
                }
73
 
                
74
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
75
 
                        return visitor.VisitAddressOfExpression(this, data);
76
 
                }
77
 
                
78
 
                public override string ToString() {
79
 
                        return string.Format("[AddressOfExpression Expression={0}]", Expression);
80
 
                }
81
 
        }
82
 
        
83
 
        public class AnonymousMethodExpression : Expression {
84
 
                
85
 
                List<ParameterDeclarationExpression> parameters;
86
 
                
87
 
                BlockStatement body;
88
 
                
89
 
                bool hasParameterList;
90
 
                
91
 
                public List<ParameterDeclarationExpression> Parameters {
92
 
                        get {
93
 
                                return parameters;
94
 
                        }
95
 
                        set {
96
 
                                parameters = value ?? new List<ParameterDeclarationExpression>();
97
 
                        }
98
 
                }
99
 
                
100
 
                public BlockStatement Body {
101
 
                        get {
102
 
                                return body;
103
 
                        }
104
 
                        set {
105
 
                                body = value ?? BlockStatement.Null;
106
 
                                if (!body.IsNull) body.Parent = this;
107
 
                        }
108
 
                }
109
 
                
110
 
                public bool HasParameterList {
111
 
                        get {
112
 
                                return hasParameterList;
113
 
                        }
114
 
                        set {
115
 
                                hasParameterList = value;
116
 
                        }
117
 
                }
118
 
                
119
 
                public AnonymousMethodExpression() {
120
 
                        parameters = new List<ParameterDeclarationExpression>();
121
 
                        body = BlockStatement.Null;
122
 
                }
123
 
                
124
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
125
 
                        return visitor.VisitAnonymousMethodExpression(this, data);
126
 
                }
127
 
                
128
 
                public override string ToString() {
129
 
                        return string.Format("[AnonymousMethodExpression Parameters={0} Body={1} HasParameterList={2}]", GetCollectionString(Parameters), Body, HasParameterList);
130
 
                }
131
 
        }
132
 
        
133
 
        public class ArrayCreateExpression : Expression {
134
 
                
135
 
                TypeReference createType;
136
 
                
137
 
                List<Expression> arguments;
138
 
                
139
 
                CollectionInitializerExpression arrayInitializer;
140
 
                
141
 
                public TypeReference CreateType {
142
 
                        get {
143
 
                                return createType;
144
 
                        }
145
 
                        set {
146
 
                                createType = value ?? TypeReference.Null;
147
 
                                if (!createType.IsNull) createType.Parent = this;
148
 
                        }
149
 
                }
150
 
                
151
 
                public List<Expression> Arguments {
152
 
                        get {
153
 
                                return arguments;
154
 
                        }
155
 
                        set {
156
 
                                arguments = value ?? new List<Expression>();
157
 
                        }
158
 
                }
159
 
                
160
 
                public CollectionInitializerExpression ArrayInitializer {
161
 
                        get {
162
 
                                return arrayInitializer;
163
 
                        }
164
 
                        set {
165
 
                                arrayInitializer = value ?? CollectionInitializerExpression.Null;
166
 
                                if (!arrayInitializer.IsNull) arrayInitializer.Parent = this;
167
 
                        }
168
 
                }
169
 
                
170
 
                public ArrayCreateExpression(TypeReference createType) {
171
 
                        CreateType = createType;
172
 
                        arguments = new List<Expression>();
173
 
                        arrayInitializer = CollectionInitializerExpression.Null;
174
 
                }
175
 
                
176
 
                public ArrayCreateExpression(TypeReference createType, List<Expression> arguments) {
177
 
                        CreateType = createType;
178
 
                        Arguments = arguments;
179
 
                        arrayInitializer = CollectionInitializerExpression.Null;
180
 
                }
181
 
                
182
 
                public ArrayCreateExpression(TypeReference createType, CollectionInitializerExpression arrayInitializer) {
183
 
                        CreateType = createType;
184
 
                        ArrayInitializer = arrayInitializer;
185
 
                        arguments = new List<Expression>();
186
 
                }
187
 
                
188
 
                public bool IsImplicitlyTyped {
189
 
                        get {
190
 
                                return createType.IsNull || string.IsNullOrEmpty(createType.Type);
191
 
                        }
192
 
                }
193
 
                
194
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
195
 
                        return visitor.VisitArrayCreateExpression(this, data);
196
 
                }
197
 
                
198
 
                public override string ToString() {
199
 
                        return string.Format("[ArrayCreateExpression CreateType={0} Arguments={1} ArrayInitializer={2}]", CreateType, GetCollectionString(Arguments), ArrayInitializer);
200
 
                }
201
 
        }
202
 
        
203
 
        public class AssignmentExpression : Expression {
204
 
                
205
 
                Expression left;
206
 
                
207
 
                AssignmentOperatorType op;
208
 
                
209
 
                Expression right;
210
 
                
211
 
                public Expression Left {
212
 
                        get {
213
 
                                return left;
214
 
                        }
215
 
                        set {
216
 
                                left = value ?? Expression.Null;
217
 
                                if (!left.IsNull) left.Parent = this;
218
 
                        }
219
 
                }
220
 
                
221
 
                public AssignmentOperatorType Op {
222
 
                        get {
223
 
                                return op;
224
 
                        }
225
 
                        set {
226
 
                                op = value;
227
 
                        }
228
 
                }
229
 
                
230
 
                public Expression Right {
231
 
                        get {
232
 
                                return right;
233
 
                        }
234
 
                        set {
235
 
                                right = value ?? Expression.Null;
236
 
                                if (!right.IsNull) right.Parent = this;
237
 
                        }
238
 
                }
239
 
                
240
 
                public AssignmentExpression(Expression left, AssignmentOperatorType op, Expression right) {
241
 
                        Left = left;
242
 
                        Op = op;
243
 
                        Right = right;
244
 
                }
245
 
                
246
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
247
 
                        return visitor.VisitAssignmentExpression(this, data);
248
 
                }
249
 
                
250
 
                public override string ToString() {
251
 
                        return string.Format("[AssignmentExpression Left={0} Op={1} Right={2}]", Left, Op, Right);
252
 
                }
253
 
        }
254
 
        
255
 
        public class Attribute : AbstractNode {
256
 
                
257
 
                string name;
258
 
                
259
 
                List<Expression> positionalArguments;
260
 
                
261
 
                List<NamedArgumentExpression> namedArguments;
262
 
                public bool IsEmptyCall {
263
 
                        get;
264
 
                        set;
265
 
                }
266
 
                public string Name {
267
 
                        get {
268
 
                                return name;
269
 
                        }
270
 
                        set {
271
 
                                name = value ?? "";
272
 
                        }
273
 
                }
274
 
                
275
 
                public List<Expression> PositionalArguments {
276
 
                        get {
277
 
                                return positionalArguments;
278
 
                        }
279
 
                        set {
280
 
                                positionalArguments = value ?? new List<Expression>();
281
 
                        }
282
 
                }
283
 
                
284
 
                public List<NamedArgumentExpression> NamedArguments {
285
 
                        get {
286
 
                                return namedArguments;
287
 
                        }
288
 
                        set {
289
 
                                namedArguments = value ?? new List<NamedArgumentExpression>();
290
 
                        }
291
 
                }
292
 
                
293
 
                public Attribute() {
294
 
                        name = "";
295
 
                        positionalArguments = new List<Expression>();
296
 
                        namedArguments = new List<NamedArgumentExpression>();
297
 
                }
298
 
                
299
 
                public Attribute (string name, List<Expression> positionalArguments, List<NamedArgumentExpression> namedArguments)
300
 
                {
301
 
                        Name = name;
302
 
                        IsEmptyCall = positionalArguments == null && namedArguments == null;
303
 
                        PositionalArguments = positionalArguments;
304
 
                        NamedArguments = namedArguments;
305
 
                }
306
 
                
307
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
308
 
                        return visitor.VisitAttribute(this, data);
309
 
                }
310
 
                
311
 
                public override string ToString() {
312
 
                        return string.Format("[Attribute Name={0} PositionalArguments={1} NamedArguments={2}]", Name, GetCollectionString(PositionalArguments), GetCollectionString(NamedArguments));
313
 
                }
314
 
        }
315
 
        
316
 
        public abstract class AttributedNode : AbstractNode {
317
 
                
318
 
                List<AttributeSection> attributes;
319
 
                
320
 
                Modifiers modifier;
321
 
                
322
 
                public List<AttributeSection> Attributes {
323
 
                        get {
324
 
                                return attributes;
325
 
                        }
326
 
                        set {
327
 
                                attributes = value ?? new List<AttributeSection>();
328
 
                        }
329
 
                }
330
 
                
331
 
                public Modifiers Modifier {
332
 
                        get {
333
 
                                return modifier;
334
 
                        }
335
 
                        set {
336
 
                                modifier = value;
337
 
                        }
338
 
                }
339
 
                
340
 
                protected AttributedNode() {
341
 
                        attributes = new List<AttributeSection>();
342
 
                }
343
 
                
344
 
                protected AttributedNode(List<AttributeSection> attributes) {
345
 
                        Attributes = attributes;
346
 
                }
347
 
                
348
 
                protected AttributedNode(Modifiers modifier, List<AttributeSection> attributes) {
349
 
                        Modifier = modifier;
350
 
                        Attributes = attributes;
351
 
                }
352
 
        }
353
 
        
354
 
        public class AttributeSection : AbstractNode {
355
 
                
356
 
                string attributeTarget;
357
 
                
358
 
                List<ICSharpCode.OldNRefactory.Ast.Attribute> attributes;
359
 
                
360
 
                public string AttributeTarget {
361
 
                        get {
362
 
                                return attributeTarget;
363
 
                        }
364
 
                        set {
365
 
                                attributeTarget = value ?? "";
366
 
                        }
367
 
                }
368
 
                
369
 
                public List<ICSharpCode.OldNRefactory.Ast.Attribute> Attributes {
370
 
                        get {
371
 
                                return attributes;
372
 
                        }
373
 
                        set {
374
 
                                attributes = value ?? new List<Attribute>();
375
 
                        }
376
 
                }
377
 
                
378
 
                public AttributeSection() {
379
 
                        attributeTarget = "";
380
 
                        attributes = new List<Attribute>();
381
 
                }
382
 
                
383
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
384
 
                        return visitor.VisitAttributeSection(this, data);
385
 
                }
386
 
                
387
 
                public override string ToString() {
388
 
                        return string.Format("[AttributeSection AttributeTarget={0} Attributes={1}]", AttributeTarget, GetCollectionString(Attributes));
389
 
                }
390
 
        }
391
 
        
392
 
        public class BaseReferenceExpression : Expression {
393
 
                
394
 
                public BaseReferenceExpression() {
395
 
                }
396
 
                
397
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
398
 
                        return visitor.VisitBaseReferenceExpression(this, data);
399
 
                }
400
 
                
401
 
                public override string ToString() {
402
 
                        return "[BaseReferenceExpression]";
403
 
                }
404
 
        }
405
 
        
406
 
        public class BinaryOperatorExpression : Expression {
407
 
                
408
 
                Expression left;
409
 
                
410
 
                BinaryOperatorType op;
411
 
                
412
 
                Expression right;
413
 
                
414
 
                public Expression Left {
415
 
                        get {
416
 
                                return left;
417
 
                        }
418
 
                        set {
419
 
                                left = value ?? Expression.Null;
420
 
                                if (!left.IsNull) left.Parent = this;
421
 
                        }
422
 
                }
423
 
                
424
 
                public BinaryOperatorType Op {
425
 
                        get {
426
 
                                return op;
427
 
                        }
428
 
                        set {
429
 
                                op = value;
430
 
                        }
431
 
                }
432
 
                
433
 
                public Expression Right {
434
 
                        get {
435
 
                                return right;
436
 
                        }
437
 
                        set {
438
 
                                right = value ?? Expression.Null;
439
 
                                if (!right.IsNull) right.Parent = this;
440
 
                        }
441
 
                }
442
 
                
443
 
                public BinaryOperatorExpression() {
444
 
                        left = Expression.Null;
445
 
                        right = Expression.Null;
446
 
                }
447
 
                
448
 
                public BinaryOperatorExpression(Expression left, BinaryOperatorType op, Expression right) {
449
 
                        Left = left;
450
 
                        Op = op;
451
 
                        Right = right;
452
 
                }
453
 
                
454
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
455
 
                        return visitor.VisitBinaryOperatorExpression(this, data);
456
 
                }
457
 
                
458
 
                public override string ToString() {
459
 
                        return string.Format("[BinaryOperatorExpression Left={0} Op={1} Right={2}]", Left, Op, Right);
460
 
                }
461
 
        }
462
 
        
463
 
        public class BreakStatement : Statement {
464
 
                
465
 
                public BreakStatement() {
466
 
                }
467
 
                
468
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
469
 
                        return visitor.VisitBreakStatement(this, data);
470
 
                }
471
 
                
472
 
                public override string ToString() {
473
 
                        return "[BreakStatement]";
474
 
                }
475
 
        }
476
 
        
477
 
        public class CaseLabel : AbstractNode {
478
 
                
479
 
                Expression label;
480
 
                
481
 
                BinaryOperatorType binaryOperatorType;
482
 
                
483
 
                Expression toExpression;
484
 
                
485
 
                public Expression Label {
486
 
                        get {
487
 
                                return label;
488
 
                        }
489
 
                        set {
490
 
                                label = value ?? Expression.Null;
491
 
                                if (!label.IsNull) label.Parent = this;
492
 
                        }
493
 
                }
494
 
                
495
 
                public BinaryOperatorType BinaryOperatorType {
496
 
                        get {
497
 
                                return binaryOperatorType;
498
 
                        }
499
 
                        set {
500
 
                                binaryOperatorType = value;
501
 
                        }
502
 
                }
503
 
                
504
 
                public Expression ToExpression {
505
 
                        get {
506
 
                                return toExpression;
507
 
                        }
508
 
                        set {
509
 
                                toExpression = value ?? Expression.Null;
510
 
                                if (!toExpression.IsNull) toExpression.Parent = this;
511
 
                        }
512
 
                }
513
 
                
514
 
                public CaseLabel() {
515
 
                        label = Expression.Null;
516
 
                        toExpression = Expression.Null;
517
 
                }
518
 
                
519
 
                public CaseLabel(Expression label) {
520
 
                        Label = label;
521
 
                        toExpression = Expression.Null;
522
 
                }
523
 
                
524
 
                public CaseLabel(Expression label, Expression toExpression) {
525
 
                        Label = label;
526
 
                        ToExpression = toExpression;
527
 
                }
528
 
                
529
 
                public CaseLabel(BinaryOperatorType binaryOperatorType, Expression label) {
530
 
                        BinaryOperatorType = binaryOperatorType;
531
 
                        Label = label;
532
 
                        toExpression = Expression.Null;
533
 
                }
534
 
                
535
 
                public bool IsDefault {
536
 
                        get {
537
 
                                return label.IsNull;
538
 
                        }
539
 
                }
540
 
                
541
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
542
 
                        return visitor.VisitCaseLabel(this, data);
543
 
                }
544
 
                
545
 
                public override string ToString() {
546
 
                        return string.Format("[CaseLabel Label={0} BinaryOperatorType={1} ToExpression={2}]", Label, BinaryOperatorType, ToExpression);
547
 
                }
548
 
        }
549
 
        
550
 
        public class CastExpression : Expression {
551
 
                
552
 
                TypeReference castTo;
553
 
                
554
 
                Expression expression;
555
 
                
556
 
                CastType castType;
557
 
                
558
 
                public TypeReference CastTo {
559
 
                        get {
560
 
                                return castTo;
561
 
                        }
562
 
                        set {
563
 
                                castTo = value ?? TypeReference.Null;
564
 
                                if (!castTo.IsNull) castTo.Parent = this;
565
 
                        }
566
 
                }
567
 
                
568
 
                public Expression Expression {
569
 
                        get {
570
 
                                return expression;
571
 
                        }
572
 
                        set {
573
 
                                expression = value ?? Expression.Null;
574
 
                                if (!expression.IsNull) expression.Parent = this;
575
 
                        }
576
 
                }
577
 
                
578
 
                public CastType CastType {
579
 
                        get {
580
 
                                return castType;
581
 
                        }
582
 
                        set {
583
 
                                castType = value;
584
 
                        }
585
 
                }
586
 
                
587
 
                public CastExpression(TypeReference castTo) {
588
 
                        CastTo = castTo;
589
 
                        expression = Expression.Null;
590
 
                }
591
 
                
592
 
                public CastExpression(TypeReference castTo, Expression expression, CastType castType) {
593
 
                        CastTo = castTo;
594
 
                        Expression = expression;
595
 
                        CastType = castType;
596
 
                }
597
 
                
598
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
599
 
                        return visitor.VisitCastExpression(this, data);
600
 
                }
601
 
                
602
 
                public override string ToString() {
603
 
                        return string.Format("[CastExpression CastTo={0} Expression={1} CastType={2}]", CastTo, Expression, CastType);
604
 
                }
605
 
        }
606
 
        
607
 
        public class CatchClause : AbstractNode {
608
 
                
609
 
                TypeReference typeReference;
610
 
                
611
 
                string variableName;
612
 
                
613
 
                Statement statementBlock;
614
 
                
615
 
                Expression condition;
616
 
                
617
 
                public TypeReference TypeReference {
618
 
                        get {
619
 
                                return typeReference;
620
 
                        }
621
 
                        set {
622
 
                                typeReference = value ?? TypeReference.Null;
623
 
                                if (!typeReference.IsNull) typeReference.Parent = this;
624
 
                        }
625
 
                }
626
 
                
627
 
                public string VariableName {
628
 
                        get {
629
 
                                return variableName;
630
 
                        }
631
 
                        set {
632
 
                                variableName = value ?? "";
633
 
                        }
634
 
                }
635
 
                
636
 
                public Statement StatementBlock {
637
 
                        get {
638
 
                                return statementBlock;
639
 
                        }
640
 
                        set {
641
 
                                statementBlock = value ?? Statement.Null;
642
 
                                if (!statementBlock.IsNull) statementBlock.Parent = this;
643
 
                        }
644
 
                }
645
 
                
646
 
                public Expression Condition {
647
 
                        get {
648
 
                                return condition;
649
 
                        }
650
 
                        set {
651
 
                                condition = value ?? Expression.Null;
652
 
                                if (!condition.IsNull) condition.Parent = this;
653
 
                        }
654
 
                }
655
 
                
656
 
                public CatchClause(TypeReference typeReference, string variableName, Statement statementBlock) {
657
 
                        TypeReference = typeReference;
658
 
                        VariableName = variableName;
659
 
                        StatementBlock = statementBlock;
660
 
                        condition = Expression.Null;
661
 
                }
662
 
                
663
 
                public CatchClause(TypeReference typeReference, string variableName, Statement statementBlock, Expression condition) {
664
 
                        TypeReference = typeReference;
665
 
                        VariableName = variableName;
666
 
                        StatementBlock = statementBlock;
667
 
                        Condition = condition;
668
 
                }
669
 
                
670
 
                public CatchClause(Statement statementBlock) {
671
 
                        StatementBlock = statementBlock;
672
 
                        typeReference = TypeReference.Null;
673
 
                        variableName = "";
674
 
                        condition = Expression.Null;
675
 
                }
676
 
                
677
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
678
 
                        return visitor.VisitCatchClause(this, data);
679
 
                }
680
 
                
681
 
                public override string ToString() {
682
 
                        return string.Format("[CatchClause TypeReference={0} VariableName={1} StatementBlock={2} Condition={3}]" +
683
 
                                        "", TypeReference, VariableName, StatementBlock, Condition);
684
 
                }
685
 
        }
686
 
        
687
 
        public class CheckedExpression : Expression {
688
 
                
689
 
                Expression expression;
690
 
                
691
 
                public Expression Expression {
692
 
                        get {
693
 
                                return expression;
694
 
                        }
695
 
                        set {
696
 
                                expression = value ?? Expression.Null;
697
 
                                if (!expression.IsNull) expression.Parent = this;
698
 
                        }
699
 
                }
700
 
                
701
 
                public CheckedExpression(Expression expression) {
702
 
                        Expression = expression;
703
 
                }
704
 
                
705
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
706
 
                        return visitor.VisitCheckedExpression(this, data);
707
 
                }
708
 
                
709
 
                public override string ToString() {
710
 
                        return string.Format("[CheckedExpression Expression={0}]", Expression);
711
 
                }
712
 
        }
713
 
        
714
 
        public class CheckedStatement : Statement {
715
 
                
716
 
                Statement block;
717
 
                
718
 
                public Statement Block {
719
 
                        get {
720
 
                                return block;
721
 
                        }
722
 
                        set {
723
 
                                block = value ?? Statement.Null;
724
 
                                if (!block.IsNull) block.Parent = this;
725
 
                        }
726
 
                }
727
 
                
728
 
                public CheckedStatement(Statement block) {
729
 
                        Block = block;
730
 
                }
731
 
                
732
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
733
 
                        return visitor.VisitCheckedStatement(this, data);
734
 
                }
735
 
                
736
 
                public override string ToString() {
737
 
                        return string.Format("[CheckedStatement Block={0}]", Block);
738
 
                }
739
 
        }
740
 
        
741
 
        public class ClassReferenceExpression : Expression {
742
 
                
743
 
                public ClassReferenceExpression() {
744
 
                }
745
 
                
746
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
747
 
                        return visitor.VisitClassReferenceExpression(this, data);
748
 
                }
749
 
                
750
 
                public override string ToString() {
751
 
                        return "[ClassReferenceExpression]";
752
 
                }
753
 
        }
754
 
        
755
 
        public class CollectionInitializerExpression : Expression {
756
 
                
757
 
                List<Expression> createExpressions;
758
 
                
759
 
                public List<Expression> CreateExpressions {
760
 
                        get {
761
 
                                return createExpressions;
762
 
                        }
763
 
                        set {
764
 
                                createExpressions = value ?? new List<Expression>();
765
 
                        }
766
 
                }
767
 
                
768
 
                public CollectionInitializerExpression() {
769
 
                        createExpressions = new List<Expression>();
770
 
                }
771
 
                
772
 
                public CollectionInitializerExpression(List<Expression> createExpressions) {
773
 
                        CreateExpressions = createExpressions;
774
 
                }
775
 
                
776
 
                public new static CollectionInitializerExpression Null {
777
 
                        get {
778
 
                                return NullCollectionInitializerExpression.Instance;
779
 
                        }
780
 
                }
781
 
                
782
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
783
 
                        return visitor.VisitCollectionInitializerExpression(this, data);
784
 
                }
785
 
                
786
 
                public override string ToString() {
787
 
                        return string.Format("[CollectionInitializerExpression CreateExpressions={0}]", GetCollectionString(CreateExpressions));
788
 
                }
789
 
        }
790
 
        
791
 
        internal sealed class NullCollectionInitializerExpression : CollectionInitializerExpression {
792
 
                
793
 
                internal static NullCollectionInitializerExpression Instance = new NullCollectionInitializerExpression();
794
 
                
795
 
                public override bool IsNull {
796
 
                        get {
797
 
                                return true;
798
 
                        }
799
 
                }
800
 
                
801
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
802
 
                        return null;
803
 
                }
804
 
                
805
 
                public override string ToString() {
806
 
                        return "[NullCollectionInitializerExpression]";
807
 
                }
808
 
        }
809
 
        
810
 
        public class ConditionalExpression : Expression {
811
 
                
812
 
                Expression condition;
813
 
                
814
 
                Expression trueExpression;
815
 
                
816
 
                Expression falseExpression;
817
 
                
818
 
                public Expression Condition {
819
 
                        get {
820
 
                                return condition;
821
 
                        }
822
 
                        set {
823
 
                                condition = value ?? Expression.Null;
824
 
                                if (!condition.IsNull) condition.Parent = this;
825
 
                        }
826
 
                }
827
 
                
828
 
                public Expression TrueExpression {
829
 
                        get {
830
 
                                return trueExpression;
831
 
                        }
832
 
                        set {
833
 
                                trueExpression = value ?? Expression.Null;
834
 
                                if (!trueExpression.IsNull) trueExpression.Parent = this;
835
 
                        }
836
 
                }
837
 
                
838
 
                public Expression FalseExpression {
839
 
                        get {
840
 
                                return falseExpression;
841
 
                        }
842
 
                        set {
843
 
                                falseExpression = value ?? Expression.Null;
844
 
                                if (!falseExpression.IsNull) falseExpression.Parent = this;
845
 
                        }
846
 
                }
847
 
                
848
 
                public ConditionalExpression() {
849
 
                        condition = Expression.Null;
850
 
                        trueExpression = Expression.Null;
851
 
                        falseExpression = Expression.Null;
852
 
                }
853
 
                
854
 
                public ConditionalExpression(Expression condition, Expression trueExpression, Expression falseExpression) {
855
 
                        Condition = condition;
856
 
                        TrueExpression = trueExpression;
857
 
                        FalseExpression = falseExpression;
858
 
                }
859
 
                
860
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
861
 
                        return visitor.VisitConditionalExpression(this, data);
862
 
                }
863
 
                
864
 
                public override string ToString() {
865
 
                        return string.Format("[ConditionalExpression Condition={0} TrueExpression={1} FalseExpression={2}]", Condition, TrueExpression, FalseExpression);
866
 
                }
867
 
        }
868
 
        
869
 
        public class ConstructorDeclaration : ParametrizedNode {
870
 
                
871
 
                ConstructorInitializer constructorInitializer;
872
 
                
873
 
                BlockStatement body;
874
 
                
875
 
                public ConstructorInitializer ConstructorInitializer {
876
 
                        get {
877
 
                                return constructorInitializer;
878
 
                        }
879
 
                        set {
880
 
                                constructorInitializer = value ?? ConstructorInitializer.Null;
881
 
                                if (!constructorInitializer.IsNull) constructorInitializer.Parent = this;
882
 
                        }
883
 
                }
884
 
                
885
 
                public BlockStatement Body {
886
 
                        get {
887
 
                                return body;
888
 
                        }
889
 
                        set {
890
 
                                body = value ?? BlockStatement.Null;
891
 
                                if (!body.IsNull) body.Parent = this;
892
 
                        }
893
 
                }
894
 
                
895
 
                public ConstructorDeclaration(string name, Modifiers modifier, List<ParameterDeclarationExpression> parameters, List<AttributeSection> attributes) {
896
 
                        Name = name;
897
 
                        Modifier = modifier;
898
 
                        Parameters = parameters;
899
 
                        Attributes = attributes;
900
 
                        constructorInitializer = ConstructorInitializer.Null;
901
 
                        body = BlockStatement.Null;
902
 
                }
903
 
                
904
 
                public ConstructorDeclaration(string name, Modifiers modifier, List<ParameterDeclarationExpression> parameters, ConstructorInitializer constructorInitializer, List<AttributeSection> attributes) {
905
 
                        Name = name;
906
 
                        Modifier = modifier;
907
 
                        Parameters = parameters;
908
 
                        ConstructorInitializer = constructorInitializer;
909
 
                        Attributes = attributes;
910
 
                        body = BlockStatement.Null;
911
 
                }
912
 
                
913
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
914
 
                        return visitor.VisitConstructorDeclaration(this, data);
915
 
                }
916
 
                
917
 
                public override string ToString() {
918
 
                        return string.Format("[ConstructorDeclaration ConstructorInitializer={0} Body={1} Name={2} Parameters={" +
919
 
                                        "3} Attributes={4} Modifier={5}]", ConstructorInitializer, Body, Name, GetCollectionString(Parameters), GetCollectionString(Attributes), Modifier);
920
 
                }
921
 
        }
922
 
        
923
 
        public class ConstructorInitializer : AbstractNode, INullable {
924
 
                
925
 
                ConstructorInitializerType constructorInitializerType;
926
 
                
927
 
                List<Expression> arguments;
928
 
                
929
 
                public ConstructorInitializerType ConstructorInitializerType {
930
 
                        get {
931
 
                                return constructorInitializerType;
932
 
                        }
933
 
                        set {
934
 
                                constructorInitializerType = value;
935
 
                        }
936
 
                }
937
 
                
938
 
                public List<Expression> Arguments {
939
 
                        get {
940
 
                                return arguments;
941
 
                        }
942
 
                        set {
943
 
                                arguments = value ?? new List<Expression>();
944
 
                        }
945
 
                }
946
 
                
947
 
                public ConstructorInitializer() {
948
 
                        arguments = new List<Expression>();
949
 
                }
950
 
                
951
 
                public virtual bool IsNull {
952
 
                        get {
953
 
                                return false;
954
 
                        }
955
 
                }
956
 
                
957
 
                public static ConstructorInitializer Null {
958
 
                        get {
959
 
                                return NullConstructorInitializer.Instance;
960
 
                        }
961
 
                }
962
 
                
963
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
964
 
                        return visitor.VisitConstructorInitializer(this, data);
965
 
                }
966
 
                
967
 
                public override string ToString() {
968
 
                        return string.Format("[ConstructorInitializer ConstructorInitializerType={0} Arguments={1}]", ConstructorInitializerType, GetCollectionString(Arguments));
969
 
                }
970
 
        }
971
 
        
972
 
        internal sealed class NullConstructorInitializer : ConstructorInitializer {
973
 
                
974
 
                internal static NullConstructorInitializer Instance = new NullConstructorInitializer();
975
 
                
976
 
                public override bool IsNull {
977
 
                        get {
978
 
                                return true;
979
 
                        }
980
 
                }
981
 
                
982
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
983
 
                        return null;
984
 
                }
985
 
                
986
 
                public override string ToString() {
987
 
                        return "[NullConstructorInitializer]";
988
 
                }
989
 
        }
990
 
        
991
 
        public class ContinueStatement : Statement {
992
 
                
993
 
                ContinueType continueType;
994
 
                
995
 
                public ContinueType ContinueType {
996
 
                        get {
997
 
                                return continueType;
998
 
                        }
999
 
                        set {
1000
 
                                continueType = value;
1001
 
                        }
1002
 
                }
1003
 
                
1004
 
                public ContinueStatement() {
1005
 
                }
1006
 
                
1007
 
                public ContinueStatement(ContinueType continueType) {
1008
 
                        ContinueType = continueType;
1009
 
                }
1010
 
                
1011
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1012
 
                        return visitor.VisitContinueStatement(this, data);
1013
 
                }
1014
 
                
1015
 
                public override string ToString() {
1016
 
                        return string.Format("[ContinueStatement ContinueType={0}]", ContinueType);
1017
 
                }
1018
 
        }
1019
 
        
1020
 
        public class DeclareDeclaration : ParametrizedNode {
1021
 
                
1022
 
                string alias;
1023
 
                
1024
 
                string library;
1025
 
                
1026
 
                CharsetModifier charset;
1027
 
                
1028
 
                TypeReference typeReference;
1029
 
                
1030
 
                public string Alias {
1031
 
                        get {
1032
 
                                return alias;
1033
 
                        }
1034
 
                        set {
1035
 
                                alias = value ?? "";
1036
 
                        }
1037
 
                }
1038
 
                
1039
 
                public string Library {
1040
 
                        get {
1041
 
                                return library;
1042
 
                        }
1043
 
                        set {
1044
 
                                library = value ?? "";
1045
 
                        }
1046
 
                }
1047
 
                
1048
 
                public CharsetModifier Charset {
1049
 
                        get {
1050
 
                                return charset;
1051
 
                        }
1052
 
                        set {
1053
 
                                charset = value;
1054
 
                        }
1055
 
                }
1056
 
                
1057
 
                public TypeReference TypeReference {
1058
 
                        get {
1059
 
                                return typeReference;
1060
 
                        }
1061
 
                        set {
1062
 
                                typeReference = value ?? TypeReference.Null;
1063
 
                                if (!typeReference.IsNull) typeReference.Parent = this;
1064
 
                        }
1065
 
                }
1066
 
                
1067
 
                public DeclareDeclaration(string name, Modifiers modifier, TypeReference typeReference, List<ParameterDeclarationExpression> parameters, List<AttributeSection> attributes, string library, string alias, CharsetModifier charset) {
1068
 
                        Name = name;
1069
 
                        Modifier = modifier;
1070
 
                        TypeReference = typeReference;
1071
 
                        Parameters = parameters;
1072
 
                        Attributes = attributes;
1073
 
                        Library = library;
1074
 
                        Alias = alias;
1075
 
                        Charset = charset;
1076
 
                }
1077
 
                
1078
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1079
 
                        return visitor.VisitDeclareDeclaration(this, data);
1080
 
                }
1081
 
                
1082
 
                public override string ToString() {
1083
 
                        return string.Format("[DeclareDeclaration Alias={0} Library={1} Charset={2} TypeReference={3} Name={4} " +
1084
 
                                        "Parameters={5} Attributes={6} Modifier={7}]", Alias, Library, Charset, TypeReference, Name, GetCollectionString(Parameters), GetCollectionString(Attributes), Modifier);
1085
 
                }
1086
 
        }
1087
 
        
1088
 
        public class DefaultValueExpression : Expression {
1089
 
                
1090
 
                TypeReference typeReference;
1091
 
                
1092
 
                public TypeReference TypeReference {
1093
 
                        get {
1094
 
                                return typeReference;
1095
 
                        }
1096
 
                        set {
1097
 
                                typeReference = value ?? TypeReference.Null;
1098
 
                                if (!typeReference.IsNull) typeReference.Parent = this;
1099
 
                        }
1100
 
                }
1101
 
                
1102
 
                public DefaultValueExpression(TypeReference typeReference) {
1103
 
                        TypeReference = typeReference;
1104
 
                }
1105
 
                
1106
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1107
 
                        return visitor.VisitDefaultValueExpression(this, data);
1108
 
                }
1109
 
                
1110
 
                public override string ToString() {
1111
 
                        return string.Format("[DefaultValueExpression TypeReference={0}]", TypeReference);
1112
 
                }
1113
 
        }
1114
 
        
1115
 
        public class DelegateDeclaration : AttributedNode {
1116
 
                
1117
 
                string name;
1118
 
                
1119
 
                TypeReference returnType;
1120
 
                
1121
 
                List<ParameterDeclarationExpression> parameters;
1122
 
                
1123
 
                List<TemplateDefinition> templates;
1124
 
                
1125
 
                public string Name {
1126
 
                        get {
1127
 
                                return name;
1128
 
                        }
1129
 
                        set {
1130
 
                                name = string.IsNullOrEmpty(value) ? "?" : value;
1131
 
                        }
1132
 
                }
1133
 
                
1134
 
                public TypeReference ReturnType {
1135
 
                        get {
1136
 
                                return returnType;
1137
 
                        }
1138
 
                        set {
1139
 
                                returnType = value ?? TypeReference.Null;
1140
 
                                if (!returnType.IsNull) returnType.Parent = this;
1141
 
                        }
1142
 
                }
1143
 
                
1144
 
                public List<ParameterDeclarationExpression> Parameters {
1145
 
                        get {
1146
 
                                return parameters;
1147
 
                        }
1148
 
                        set {
1149
 
                                parameters = value ?? new List<ParameterDeclarationExpression>();
1150
 
                        }
1151
 
                }
1152
 
                
1153
 
                public List<TemplateDefinition> Templates {
1154
 
                        get {
1155
 
                                return templates;
1156
 
                        }
1157
 
                        set {
1158
 
                                templates = value ?? new List<TemplateDefinition>();
1159
 
                        }
1160
 
                }
1161
 
                
1162
 
                public DelegateDeclaration(Modifiers modifier, List<AttributeSection> attributes) {
1163
 
                        Modifier = modifier;
1164
 
                        Attributes = attributes;
1165
 
                        name = "?";
1166
 
                        returnType = TypeReference.Null;
1167
 
                        parameters = new List<ParameterDeclarationExpression>();
1168
 
                        templates = new List<TemplateDefinition>();
1169
 
                }
1170
 
                
1171
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1172
 
                        return visitor.VisitDelegateDeclaration(this, data);
1173
 
                }
1174
 
                
1175
 
                public override string ToString() {
1176
 
                        return string.Format("[DelegateDeclaration Name={0} ReturnType={1} Parameters={2} Templates={3} Attribu" +
1177
 
                                        "tes={4} Modifier={5}]", Name, ReturnType, GetCollectionString(Parameters), GetCollectionString(Templates), GetCollectionString(Attributes), Modifier);
1178
 
                }
1179
 
        }
1180
 
        
1181
 
        public class DestructorDeclaration : AttributedNode {
1182
 
                
1183
 
                string name;
1184
 
                
1185
 
                BlockStatement body;
1186
 
                
1187
 
                public string Name {
1188
 
                        get {
1189
 
                                return name;
1190
 
                        }
1191
 
                        set {
1192
 
                                name = value ?? "";
1193
 
                        }
1194
 
                }
1195
 
                
1196
 
                public BlockStatement Body {
1197
 
                        get {
1198
 
                                return body;
1199
 
                        }
1200
 
                        set {
1201
 
                                body = value ?? BlockStatement.Null;
1202
 
                                if (!body.IsNull) body.Parent = this;
1203
 
                        }
1204
 
                }
1205
 
                
1206
 
                public DestructorDeclaration(string name, Modifiers modifier, List<AttributeSection> attributes) {
1207
 
                        Name = name;
1208
 
                        Modifier = modifier;
1209
 
                        Attributes = attributes;
1210
 
                        body = BlockStatement.Null;
1211
 
                }
1212
 
                
1213
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1214
 
                        return visitor.VisitDestructorDeclaration(this, data);
1215
 
                }
1216
 
                
1217
 
                public override string ToString() {
1218
 
                        return string.Format("[DestructorDeclaration Name={0} Body={1} Attributes={2} Modifier={3}]", Name, Body, GetCollectionString(Attributes), Modifier);
1219
 
                }
1220
 
        }
1221
 
        
1222
 
        public class DirectionExpression : Expression {
1223
 
                
1224
 
                FieldDirection fieldDirection;
1225
 
                
1226
 
                Expression expression;
1227
 
                
1228
 
                public FieldDirection FieldDirection {
1229
 
                        get {
1230
 
                                return fieldDirection;
1231
 
                        }
1232
 
                        set {
1233
 
                                fieldDirection = value;
1234
 
                        }
1235
 
                }
1236
 
                
1237
 
                public Expression Expression {
1238
 
                        get {
1239
 
                                return expression;
1240
 
                        }
1241
 
                        set {
1242
 
                                expression = value ?? Expression.Null;
1243
 
                                if (!expression.IsNull) expression.Parent = this;
1244
 
                        }
1245
 
                }
1246
 
                
1247
 
                public DirectionExpression(FieldDirection fieldDirection, Expression expression) {
1248
 
                        FieldDirection = fieldDirection;
1249
 
                        Expression = expression;
1250
 
                }
1251
 
                
1252
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1253
 
                        return visitor.VisitDirectionExpression(this, data);
1254
 
                }
1255
 
                
1256
 
                public override string ToString() {
1257
 
                        return string.Format("[DirectionExpression FieldDirection={0} Expression={1}]", FieldDirection, Expression);
1258
 
                }
1259
 
        }
1260
 
        
1261
 
        public class DoLoopStatement : StatementWithEmbeddedStatement {
1262
 
                
1263
 
                Expression condition;
1264
 
                
1265
 
                ConditionType conditionType;
1266
 
                
1267
 
                ConditionPosition conditionPosition;
1268
 
                
1269
 
                public Expression Condition {
1270
 
                        get {
1271
 
                                return condition;
1272
 
                        }
1273
 
                        set {
1274
 
                                condition = value ?? Expression.Null;
1275
 
                                if (!condition.IsNull) condition.Parent = this;
1276
 
                        }
1277
 
                }
1278
 
                
1279
 
                public ConditionType ConditionType {
1280
 
                        get {
1281
 
                                return conditionType;
1282
 
                        }
1283
 
                        set {
1284
 
                                conditionType = value;
1285
 
                        }
1286
 
                }
1287
 
                
1288
 
                public ConditionPosition ConditionPosition {
1289
 
                        get {
1290
 
                                return conditionPosition;
1291
 
                        }
1292
 
                        set {
1293
 
                                conditionPosition = value;
1294
 
                        }
1295
 
                }
1296
 
                
1297
 
                public DoLoopStatement(Expression condition, Statement embeddedStatement, ConditionType conditionType, ConditionPosition conditionPosition) {
1298
 
                        Condition = condition;
1299
 
                        EmbeddedStatement = embeddedStatement;
1300
 
                        ConditionType = conditionType;
1301
 
                        ConditionPosition = conditionPosition;
1302
 
                }
1303
 
                
1304
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1305
 
                        return visitor.VisitDoLoopStatement(this, data);
1306
 
                }
1307
 
                
1308
 
                public override string ToString() {
1309
 
                        return string.Format("[DoLoopStatement Condition={0} ConditionType={1} ConditionPosition={2} EmbeddedSt" +
1310
 
                                        "atement={3}]", Condition, ConditionType, ConditionPosition, EmbeddedStatement);
1311
 
                }
1312
 
        }
1313
 
        
1314
 
        public class ElseIfSection : StatementWithEmbeddedStatement {
1315
 
                
1316
 
                Expression condition;
1317
 
                
1318
 
                public Expression Condition {
1319
 
                        get {
1320
 
                                return condition;
1321
 
                        }
1322
 
                        set {
1323
 
                                condition = value ?? Expression.Null;
1324
 
                                if (!condition.IsNull) condition.Parent = this;
1325
 
                        }
1326
 
                }
1327
 
                
1328
 
                public ElseIfSection(Expression condition, Statement embeddedStatement) {
1329
 
                        Condition = condition;
1330
 
                        EmbeddedStatement = embeddedStatement;
1331
 
                }
1332
 
                
1333
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1334
 
                        return visitor.VisitElseIfSection(this, data);
1335
 
                }
1336
 
                
1337
 
                public override string ToString() {
1338
 
                        return string.Format("[ElseIfSection Condition={0} EmbeddedStatement={1}]", Condition, EmbeddedStatement);
1339
 
                }
1340
 
        }
1341
 
        
1342
 
        public class EmptyStatement : Statement {
1343
 
                
1344
 
                public EmptyStatement() {
1345
 
                }
1346
 
                
1347
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1348
 
                        return visitor.VisitEmptyStatement(this, data);
1349
 
                }
1350
 
                
1351
 
                public override string ToString() {
1352
 
                        return "[EmptyStatement]";
1353
 
                }
1354
 
        }
1355
 
        
1356
 
        public class EndStatement : Statement {
1357
 
                
1358
 
                public EndStatement() {
1359
 
                }
1360
 
                
1361
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1362
 
                        return visitor.VisitEndStatement(this, data);
1363
 
                }
1364
 
                
1365
 
                public override string ToString() {
1366
 
                        return "[EndStatement]";
1367
 
                }
1368
 
        }
1369
 
        
1370
 
        public class EraseStatement : Statement {
1371
 
                
1372
 
                List<Expression> expressions;
1373
 
                
1374
 
                public List<Expression> Expressions {
1375
 
                        get {
1376
 
                                return expressions;
1377
 
                        }
1378
 
                        set {
1379
 
                                expressions = value ?? new List<Expression>();
1380
 
                        }
1381
 
                }
1382
 
                
1383
 
                public EraseStatement() {
1384
 
                        expressions = new List<Expression>();
1385
 
                }
1386
 
                
1387
 
                public EraseStatement(List<Expression> expressions) {
1388
 
                        Expressions = expressions;
1389
 
                }
1390
 
                
1391
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1392
 
                        return visitor.VisitEraseStatement(this, data);
1393
 
                }
1394
 
                
1395
 
                public override string ToString() {
1396
 
                        return string.Format("[EraseStatement Expressions={0}]", GetCollectionString(Expressions));
1397
 
                }
1398
 
        }
1399
 
        
1400
 
        public class ErrorStatement : Statement {
1401
 
                
1402
 
                Expression expression;
1403
 
                
1404
 
                public Expression Expression {
1405
 
                        get {
1406
 
                                return expression;
1407
 
                        }
1408
 
                        set {
1409
 
                                expression = value ?? Expression.Null;
1410
 
                                if (!expression.IsNull) expression.Parent = this;
1411
 
                        }
1412
 
                }
1413
 
                
1414
 
                public ErrorStatement(Expression expression) {
1415
 
                        Expression = expression;
1416
 
                }
1417
 
                
1418
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1419
 
                        return visitor.VisitErrorStatement(this, data);
1420
 
                }
1421
 
                
1422
 
                public override string ToString() {
1423
 
                        return string.Format("[ErrorStatement Expression={0}]", Expression);
1424
 
                }
1425
 
        }
1426
 
        
1427
 
        public class EventAddRegion : EventAddRemoveRegion {
1428
 
                
1429
 
                public EventAddRegion(List<AttributeSection> attributes) : 
1430
 
                                base(attributes) {
1431
 
                }
1432
 
                
1433
 
                public static EventAddRegion Null {
1434
 
                        get {
1435
 
                                return NullEventAddRegion.Instance;
1436
 
                        }
1437
 
                }
1438
 
                
1439
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1440
 
                        return visitor.VisitEventAddRegion(this, data);
1441
 
                }
1442
 
                
1443
 
                public override string ToString() {
1444
 
                        return string.Format("[EventAddRegion Block={0} Parameters={1} Attributes={2} Modifier={3}]", Block, GetCollectionString(Parameters), GetCollectionString(Attributes), Modifier);
1445
 
                }
1446
 
        }
1447
 
        
1448
 
        internal sealed class NullEventAddRegion : EventAddRegion {
1449
 
                
1450
 
                private NullEventAddRegion() : 
1451
 
                                base(null) {
1452
 
                }
1453
 
                
1454
 
                internal static NullEventAddRegion Instance = new NullEventAddRegion();
1455
 
                
1456
 
                public override bool IsNull {
1457
 
                        get {
1458
 
                                return true;
1459
 
                        }
1460
 
                }
1461
 
                
1462
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1463
 
                        return null;
1464
 
                }
1465
 
                
1466
 
                public override string ToString() {
1467
 
                        return "[NullEventAddRegion]";
1468
 
                }
1469
 
        }
1470
 
        
1471
 
        public abstract class EventAddRemoveRegion : AttributedNode, INullable {
1472
 
                
1473
 
                BlockStatement block;
1474
 
                
1475
 
                List<ParameterDeclarationExpression> parameters;
1476
 
                
1477
 
                public BlockStatement Block {
1478
 
                        get {
1479
 
                                return block;
1480
 
                        }
1481
 
                        set {
1482
 
                                block = value ?? BlockStatement.Null;
1483
 
                                if (!block.IsNull) block.Parent = this;
1484
 
                        }
1485
 
                }
1486
 
                
1487
 
                public List<ParameterDeclarationExpression> Parameters {
1488
 
                        get {
1489
 
                                return parameters;
1490
 
                        }
1491
 
                        set {
1492
 
                                parameters = value ?? new List<ParameterDeclarationExpression>();
1493
 
                        }
1494
 
                }
1495
 
                
1496
 
                protected EventAddRemoveRegion(List<AttributeSection> attributes) {
1497
 
                        Attributes = attributes;
1498
 
                        block = BlockStatement.Null;
1499
 
                        parameters = new List<ParameterDeclarationExpression>();
1500
 
                }
1501
 
                
1502
 
                public virtual bool IsNull {
1503
 
                        get {
1504
 
                                return false;
1505
 
                        }
1506
 
                }
1507
 
        }
1508
 
        
1509
 
        public class EventDeclaration : MemberNode {
1510
 
                
1511
 
                EventAddRegion addRegion;
1512
 
                
1513
 
                EventRemoveRegion removeRegion;
1514
 
                
1515
 
                EventRaiseRegion raiseRegion;
1516
 
                
1517
 
                Location bodyStart;
1518
 
                
1519
 
                Location bodyEnd;
1520
 
                
1521
 
                Expression initializer;
1522
 
                
1523
 
                public EventAddRegion AddRegion {
1524
 
                        get {
1525
 
                                return addRegion;
1526
 
                        }
1527
 
                        set {
1528
 
                                addRegion = value ?? EventAddRegion.Null;
1529
 
                                if (!addRegion.IsNull) addRegion.Parent = this;
1530
 
                        }
1531
 
                }
1532
 
                
1533
 
                public EventRemoveRegion RemoveRegion {
1534
 
                        get {
1535
 
                                return removeRegion;
1536
 
                        }
1537
 
                        set {
1538
 
                                removeRegion = value ?? EventRemoveRegion.Null;
1539
 
                                if (!removeRegion.IsNull) removeRegion.Parent = this;
1540
 
                        }
1541
 
                }
1542
 
                
1543
 
                public EventRaiseRegion RaiseRegion {
1544
 
                        get {
1545
 
                                return raiseRegion;
1546
 
                        }
1547
 
                        set {
1548
 
                                raiseRegion = value ?? EventRaiseRegion.Null;
1549
 
                                if (!raiseRegion.IsNull) raiseRegion.Parent = this;
1550
 
                        }
1551
 
                }
1552
 
                
1553
 
                public Location BodyStart {
1554
 
                        get {
1555
 
                                return bodyStart;
1556
 
                        }
1557
 
                        set {
1558
 
                                bodyStart = value;
1559
 
                        }
1560
 
                }
1561
 
                
1562
 
                public Location BodyEnd {
1563
 
                        get {
1564
 
                                return bodyEnd;
1565
 
                        }
1566
 
                        set {
1567
 
                                bodyEnd = value;
1568
 
                        }
1569
 
                }
1570
 
                
1571
 
                public Expression Initializer {
1572
 
                        get {
1573
 
                                return initializer;
1574
 
                        }
1575
 
                        set {
1576
 
                                initializer = value ?? Expression.Null;
1577
 
                                if (!initializer.IsNull) initializer.Parent = this;
1578
 
                        }
1579
 
                }
1580
 
                
1581
 
                public EventDeclaration() {
1582
 
                        addRegion = EventAddRegion.Null;
1583
 
                        removeRegion = EventRemoveRegion.Null;
1584
 
                        raiseRegion = EventRaiseRegion.Null;
1585
 
                        bodyStart = Location.Empty;
1586
 
                        bodyEnd = Location.Empty;
1587
 
                        initializer = Expression.Null;
1588
 
                }
1589
 
                
1590
 
                public bool HasRemoveRegion {
1591
 
                        get {
1592
 
                                return !removeRegion.IsNull;
1593
 
                        }
1594
 
                }
1595
 
                
1596
 
                public bool HasRaiseRegion {
1597
 
                        get {
1598
 
                                return !raiseRegion.IsNull;
1599
 
                        }
1600
 
                }
1601
 
                
1602
 
                public bool HasAddRegion {
1603
 
                        get {
1604
 
                                return !addRegion.IsNull;
1605
 
                        }
1606
 
                }
1607
 
                
1608
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1609
 
                        return visitor.VisitEventDeclaration(this, data);
1610
 
                }
1611
 
                
1612
 
                public override string ToString() {
1613
 
                        return string.Format("[EventDeclaration AddRegion={0} RemoveRegion={1} RaiseRegion={2} BodyStart={3} Bo" +
1614
 
                                        "dyEnd={4} Initializer={5} InterfaceImplementations={6} TypeReference={7} Name={8" +
1615
 
                                        "} Parameters={9} Attributes={10} Modifier={11}]", AddRegion, RemoveRegion, RaiseRegion, BodyStart, BodyEnd, Initializer, GetCollectionString(InterfaceImplementations), TypeReference, Name, GetCollectionString(Parameters), GetCollectionString(Attributes), Modifier);
1616
 
                }
1617
 
        }
1618
 
        
1619
 
        public class EventRaiseRegion : EventAddRemoveRegion {
1620
 
                
1621
 
                public EventRaiseRegion(List<AttributeSection> attributes) : 
1622
 
                                base(attributes) {
1623
 
                }
1624
 
                
1625
 
                public static EventRaiseRegion Null {
1626
 
                        get {
1627
 
                                return NullEventRaiseRegion.Instance;
1628
 
                        }
1629
 
                }
1630
 
                
1631
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1632
 
                        return visitor.VisitEventRaiseRegion(this, data);
1633
 
                }
1634
 
                
1635
 
                public override string ToString() {
1636
 
                        return string.Format("[EventRaiseRegion Block={0} Parameters={1} Attributes={2} Modifier={3}]", Block, GetCollectionString(Parameters), GetCollectionString(Attributes), Modifier);
1637
 
                }
1638
 
        }
1639
 
        
1640
 
        internal sealed class NullEventRaiseRegion : EventRaiseRegion {
1641
 
                
1642
 
                private NullEventRaiseRegion() : 
1643
 
                                base(null) {
1644
 
                }
1645
 
                
1646
 
                internal static NullEventRaiseRegion Instance = new NullEventRaiseRegion();
1647
 
                
1648
 
                public override bool IsNull {
1649
 
                        get {
1650
 
                                return true;
1651
 
                        }
1652
 
                }
1653
 
                
1654
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1655
 
                        return null;
1656
 
                }
1657
 
                
1658
 
                public override string ToString() {
1659
 
                        return "[NullEventRaiseRegion]";
1660
 
                }
1661
 
        }
1662
 
        
1663
 
        public class EventRemoveRegion : EventAddRemoveRegion {
1664
 
                
1665
 
                public EventRemoveRegion(List<AttributeSection> attributes) : 
1666
 
                                base(attributes) {
1667
 
                }
1668
 
                
1669
 
                public static EventRemoveRegion Null {
1670
 
                        get {
1671
 
                                return NullEventRemoveRegion.Instance;
1672
 
                        }
1673
 
                }
1674
 
                
1675
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1676
 
                        return visitor.VisitEventRemoveRegion(this, data);
1677
 
                }
1678
 
                
1679
 
                public override string ToString() {
1680
 
                        return string.Format("[EventRemoveRegion Block={0} Parameters={1} Attributes={2} Modifier={3}]", Block, GetCollectionString(Parameters), GetCollectionString(Attributes), Modifier);
1681
 
                }
1682
 
        }
1683
 
        
1684
 
        internal sealed class NullEventRemoveRegion : EventRemoveRegion {
1685
 
                
1686
 
                private NullEventRemoveRegion() : 
1687
 
                                base(null) {
1688
 
                }
1689
 
                
1690
 
                internal static NullEventRemoveRegion Instance = new NullEventRemoveRegion();
1691
 
                
1692
 
                public override bool IsNull {
1693
 
                        get {
1694
 
                                return true;
1695
 
                        }
1696
 
                }
1697
 
                
1698
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1699
 
                        return null;
1700
 
                }
1701
 
                
1702
 
                public override string ToString() {
1703
 
                        return "[NullEventRemoveRegion]";
1704
 
                }
1705
 
        }
1706
 
        
1707
 
        public class ExitStatement : Statement {
1708
 
                
1709
 
                ExitType exitType;
1710
 
                
1711
 
                public ExitType ExitType {
1712
 
                        get {
1713
 
                                return exitType;
1714
 
                        }
1715
 
                        set {
1716
 
                                exitType = value;
1717
 
                        }
1718
 
                }
1719
 
                
1720
 
                public ExitStatement(ExitType exitType) {
1721
 
                        ExitType = exitType;
1722
 
                }
1723
 
                
1724
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1725
 
                        return visitor.VisitExitStatement(this, data);
1726
 
                }
1727
 
                
1728
 
                public override string ToString() {
1729
 
                        return string.Format("[ExitStatement ExitType={0}]", ExitType);
1730
 
                }
1731
 
        }
1732
 
        
1733
 
        public class ExpressionRangeVariable : AbstractNode, INullable {
1734
 
                
1735
 
                string identifier;
1736
 
                
1737
 
                Expression expression;
1738
 
                
1739
 
                TypeReference type;
1740
 
                
1741
 
                public string Identifier {
1742
 
                        get {
1743
 
                                return identifier;
1744
 
                        }
1745
 
                        set {
1746
 
                                identifier = value ?? "";
1747
 
                        }
1748
 
                }
1749
 
                
1750
 
                public Expression Expression {
1751
 
                        get {
1752
 
                                return expression;
1753
 
                        }
1754
 
                        set {
1755
 
                                expression = value ?? Expression.Null;
1756
 
                                if (!expression.IsNull) expression.Parent = this;
1757
 
                        }
1758
 
                }
1759
 
                
1760
 
                public TypeReference Type {
1761
 
                        get {
1762
 
                                return type;
1763
 
                        }
1764
 
                        set {
1765
 
                                type = value ?? TypeReference.Null;
1766
 
                                if (!type.IsNull) type.Parent = this;
1767
 
                        }
1768
 
                }
1769
 
                
1770
 
                public ExpressionRangeVariable() {
1771
 
                        identifier = "";
1772
 
                        expression = Expression.Null;
1773
 
                        type = TypeReference.Null;
1774
 
                }
1775
 
                
1776
 
                public virtual bool IsNull {
1777
 
                        get {
1778
 
                                return false;
1779
 
                        }
1780
 
                }
1781
 
                
1782
 
                public static ExpressionRangeVariable Null {
1783
 
                        get {
1784
 
                                return NullExpressionRangeVariable.Instance;
1785
 
                        }
1786
 
                }
1787
 
                
1788
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1789
 
                        return visitor.VisitExpressionRangeVariable(this, data);
1790
 
                }
1791
 
                
1792
 
                public override string ToString() {
1793
 
                        return string.Format("[ExpressionRangeVariable Identifier={0} Expression={1} Type={2}]", Identifier, Expression, Type);
1794
 
                }
1795
 
        }
1796
 
        
1797
 
        internal sealed class NullExpressionRangeVariable : ExpressionRangeVariable {
1798
 
                
1799
 
                internal static NullExpressionRangeVariable Instance = new NullExpressionRangeVariable();
1800
 
                
1801
 
                public override bool IsNull {
1802
 
                        get {
1803
 
                                return true;
1804
 
                        }
1805
 
                }
1806
 
                
1807
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1808
 
                        return null;
1809
 
                }
1810
 
                
1811
 
                public override string ToString() {
1812
 
                        return "[NullExpressionRangeVariable]";
1813
 
                }
1814
 
        }
1815
 
        
1816
 
        public class ExpressionStatement : Statement {
1817
 
                
1818
 
                Expression expression;
1819
 
                
1820
 
                public Expression Expression {
1821
 
                        get {
1822
 
                                return expression;
1823
 
                        }
1824
 
                        set {
1825
 
                                expression = value ?? Expression.Null;
1826
 
                                if (!expression.IsNull) expression.Parent = this;
1827
 
                        }
1828
 
                }
1829
 
                
1830
 
                public ExpressionStatement(Expression expression) {
1831
 
                        Expression = expression;
1832
 
                }
1833
 
                
1834
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1835
 
                        return visitor.VisitExpressionStatement(this, data);
1836
 
                }
1837
 
                
1838
 
                public override string ToString() {
1839
 
                        return string.Format("[ExpressionStatement Expression={0}]", Expression);
1840
 
                }
1841
 
        }
1842
 
        
1843
 
        public class ExternAliasDirective : AbstractNode {
1844
 
                
1845
 
                string name;
1846
 
                
1847
 
                public string Name {
1848
 
                        get {
1849
 
                                return name;
1850
 
                        }
1851
 
                        set {
1852
 
                                name = value ?? "";
1853
 
                        }
1854
 
                }
1855
 
                
1856
 
                public ExternAliasDirective() {
1857
 
                        name = "";
1858
 
                }
1859
 
                
1860
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1861
 
                        return visitor.VisitExternAliasDirective(this, data);
1862
 
                }
1863
 
                
1864
 
                public override string ToString() {
1865
 
                        return string.Format("[ExternAliasDirective Name={0}]", Name);
1866
 
                }
1867
 
        }
1868
 
        
1869
 
        public class FieldDeclaration : AttributedNode {
1870
 
                
1871
 
                TypeReference typeReference;
1872
 
                
1873
 
                List<VariableDeclaration> fields;
1874
 
                
1875
 
                public TypeReference TypeReference {
1876
 
                        get {
1877
 
                                return typeReference;
1878
 
                        }
1879
 
                        set {
1880
 
                                typeReference = value ?? TypeReference.Null;
1881
 
                                if (!typeReference.IsNull) typeReference.Parent = this;
1882
 
                        }
1883
 
                }
1884
 
                
1885
 
                public List<VariableDeclaration> Fields {
1886
 
                        get {
1887
 
                                return fields;
1888
 
                        }
1889
 
                        set {
1890
 
                                fields = value ?? new List<VariableDeclaration>();
1891
 
                        }
1892
 
                }
1893
 
                
1894
 
                public FieldDeclaration(List<AttributeSection> attributes) {
1895
 
                        Attributes = attributes;
1896
 
                        typeReference = TypeReference.Null;
1897
 
                        fields = new List<VariableDeclaration>();
1898
 
                }
1899
 
                
1900
 
                public FieldDeclaration(List<AttributeSection> attributes, TypeReference typeReference, Modifiers modifier) {
1901
 
                        Attributes = attributes;
1902
 
                        TypeReference = typeReference;
1903
 
                        Modifier = modifier;
1904
 
                        fields = new List<VariableDeclaration>();
1905
 
                }
1906
 
                
1907
 
 
1908
 
                public VariableDeclaration GetVariableDeclaration(string variableName)
1909
 
                {
1910
 
                        foreach (VariableDeclaration variableDeclaration in Fields) {
1911
 
                                if (variableDeclaration.Name == variableName) {
1912
 
                                        return variableDeclaration;
1913
 
                                }
1914
 
                        }
1915
 
                        return null;
1916
 
                }
1917
 
                
1918
 
 
1919
 
                public TypeReference GetTypeForField(int fieldIndex)
1920
 
                {
1921
 
                        if (!typeReference.IsNull) {
1922
 
                                return typeReference;
1923
 
                        }
1924
 
                        return ((VariableDeclaration)Fields[fieldIndex]).TypeReference;
1925
 
                }
1926
 
                
1927
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1928
 
                        return visitor.VisitFieldDeclaration(this, data);
1929
 
                }
1930
 
                
1931
 
                public override string ToString() {
1932
 
                        return string.Format("[FieldDeclaration TypeReference={0} Fields={1} Attributes={2} Modifier={3}]", TypeReference, GetCollectionString(Fields), GetCollectionString(Attributes), Modifier);
1933
 
                }
1934
 
        }
1935
 
        
1936
 
        public class FixedStatement : StatementWithEmbeddedStatement {
1937
 
                
1938
 
                Statement pointerDeclaration;
1939
 
                
1940
 
                public Statement PointerDeclaration {
1941
 
                        get {
1942
 
                                return pointerDeclaration;
1943
 
                        }
1944
 
                        set {
1945
 
                                pointerDeclaration = value ?? Statement.Null;
1946
 
                                if (!pointerDeclaration.IsNull) pointerDeclaration.Parent = this;
1947
 
                        }
1948
 
                }
1949
 
                
1950
 
                public FixedStatement(Statement pointerDeclaration, Statement embeddedStatement) {
1951
 
                        PointerDeclaration = pointerDeclaration;
1952
 
                        EmbeddedStatement = embeddedStatement;
1953
 
                }
1954
 
                
1955
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
1956
 
                        return visitor.VisitFixedStatement(this, data);
1957
 
                }
1958
 
                
1959
 
                public override string ToString() {
1960
 
                        return string.Format("[FixedStatement PointerDeclaration={0} EmbeddedStatement={1}]", PointerDeclaration, EmbeddedStatement);
1961
 
                }
1962
 
        }
1963
 
        
1964
 
        public class ForeachStatement : StatementWithEmbeddedStatement {
1965
 
                
1966
 
                TypeReference typeReference;
1967
 
                
1968
 
                string variableName;
1969
 
                
1970
 
                Expression expression;
1971
 
                
1972
 
                Expression nextExpression;
1973
 
                
1974
 
                public TypeReference TypeReference {
1975
 
                        get {
1976
 
                                return typeReference;
1977
 
                        }
1978
 
                        set {
1979
 
                                typeReference = value ?? TypeReference.Null;
1980
 
                                if (!typeReference.IsNull) typeReference.Parent = this;
1981
 
                        }
1982
 
                }
1983
 
                
1984
 
                public string VariableName {
1985
 
                        get {
1986
 
                                return variableName;
1987
 
                        }
1988
 
                        set {
1989
 
                                variableName = value ?? "";
1990
 
                        }
1991
 
                }
1992
 
                
1993
 
                public Expression Expression {
1994
 
                        get {
1995
 
                                return expression;
1996
 
                        }
1997
 
                        set {
1998
 
                                expression = value ?? Expression.Null;
1999
 
                                if (!expression.IsNull) expression.Parent = this;
2000
 
                        }
2001
 
                }
2002
 
                
2003
 
                public Expression NextExpression {
2004
 
                        get {
2005
 
                                return nextExpression;
2006
 
                        }
2007
 
                        set {
2008
 
                                nextExpression = value ?? Expression.Null;
2009
 
                                if (!nextExpression.IsNull) nextExpression.Parent = this;
2010
 
                        }
2011
 
                }
2012
 
                
2013
 
                public ForeachStatement(TypeReference typeReference, string variableName, Expression expression, Statement embeddedStatement) {
2014
 
                        TypeReference = typeReference;
2015
 
                        VariableName = variableName;
2016
 
                        Expression = expression;
2017
 
                        EmbeddedStatement = embeddedStatement;
2018
 
                        nextExpression = Expression.Null;
2019
 
                }
2020
 
                
2021
 
                public ForeachStatement(TypeReference typeReference, string variableName, Expression expression, Statement embeddedStatement, Expression nextExpression) {
2022
 
                        TypeReference = typeReference;
2023
 
                        VariableName = variableName;
2024
 
                        Expression = expression;
2025
 
                        EmbeddedStatement = embeddedStatement;
2026
 
                        NextExpression = nextExpression;
2027
 
                }
2028
 
                
2029
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2030
 
                        return visitor.VisitForeachStatement(this, data);
2031
 
                }
2032
 
                
2033
 
                public override string ToString() {
2034
 
                        return string.Format("[ForeachStatement TypeReference={0} VariableName={1} Expression={2} NextExpressio" +
2035
 
                                        "n={3} EmbeddedStatement={4}]", TypeReference, VariableName, Expression, NextExpression, EmbeddedStatement);
2036
 
                }
2037
 
        }
2038
 
        
2039
 
        public class ForNextStatement : StatementWithEmbeddedStatement {
2040
 
                
2041
 
                Expression start;
2042
 
                
2043
 
                Expression end;
2044
 
                
2045
 
                Expression step;
2046
 
                
2047
 
                List<Expression> nextExpressions;
2048
 
                
2049
 
                TypeReference typeReference;
2050
 
                
2051
 
                string variableName;
2052
 
                
2053
 
                Expression loopVariableExpression;
2054
 
                
2055
 
                public Expression Start {
2056
 
                        get {
2057
 
                                return start;
2058
 
                        }
2059
 
                        set {
2060
 
                                start = value ?? Expression.Null;
2061
 
                                if (!start.IsNull) start.Parent = this;
2062
 
                        }
2063
 
                }
2064
 
                
2065
 
                public Expression End {
2066
 
                        get {
2067
 
                                return end;
2068
 
                        }
2069
 
                        set {
2070
 
                                end = value ?? Expression.Null;
2071
 
                                if (!end.IsNull) end.Parent = this;
2072
 
                        }
2073
 
                }
2074
 
                
2075
 
                public Expression Step {
2076
 
                        get {
2077
 
                                return step;
2078
 
                        }
2079
 
                        set {
2080
 
                                step = value ?? Expression.Null;
2081
 
                                if (!step.IsNull) step.Parent = this;
2082
 
                        }
2083
 
                }
2084
 
                
2085
 
                public List<Expression> NextExpressions {
2086
 
                        get {
2087
 
                                return nextExpressions;
2088
 
                        }
2089
 
                        set {
2090
 
                                nextExpressions = value ?? new List<Expression>();
2091
 
                        }
2092
 
                }
2093
 
                
2094
 
                public TypeReference TypeReference {
2095
 
                        get {
2096
 
                                return typeReference;
2097
 
                        }
2098
 
                        set {
2099
 
                                typeReference = value ?? TypeReference.Null;
2100
 
                                if (!typeReference.IsNull) typeReference.Parent = this;
2101
 
                        }
2102
 
                }
2103
 
                
2104
 
                public string VariableName {
2105
 
                        get {
2106
 
                                return variableName;
2107
 
                        }
2108
 
                        set {
2109
 
                                variableName = value ?? "";
2110
 
                        }
2111
 
                }
2112
 
                
2113
 
                public Expression LoopVariableExpression {
2114
 
                        get {
2115
 
                                return loopVariableExpression;
2116
 
                        }
2117
 
                        set {
2118
 
                                loopVariableExpression = value ?? Expression.Null;
2119
 
                                if (!loopVariableExpression.IsNull) loopVariableExpression.Parent = this;
2120
 
                        }
2121
 
                }
2122
 
                
2123
 
                public ForNextStatement() {
2124
 
                        start = Expression.Null;
2125
 
                        end = Expression.Null;
2126
 
                        step = Expression.Null;
2127
 
                        nextExpressions = new List<Expression>();
2128
 
                        typeReference = TypeReference.Null;
2129
 
                        variableName = "";
2130
 
                        loopVariableExpression = Expression.Null;
2131
 
                }
2132
 
                
2133
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2134
 
                        return visitor.VisitForNextStatement(this, data);
2135
 
                }
2136
 
                
2137
 
                public override string ToString() {
2138
 
                        return string.Format("[ForNextStatement Start={0} End={1} Step={2} NextExpressions={3} TypeReference={4" +
2139
 
                                        "} VariableName={5} LoopVariableExpression={6} EmbeddedStatement={7}]", Start, End, Step, GetCollectionString(NextExpressions), TypeReference, VariableName, LoopVariableExpression, EmbeddedStatement);
2140
 
                }
2141
 
        }
2142
 
        
2143
 
        public class ForStatement : StatementWithEmbeddedStatement {
2144
 
                
2145
 
                List<Statement> initializers;
2146
 
                
2147
 
                Expression condition;
2148
 
                
2149
 
                List<Statement> iterator;
2150
 
                
2151
 
                public List<Statement> Initializers {
2152
 
                        get {
2153
 
                                return initializers;
2154
 
                        }
2155
 
                        set {
2156
 
                                initializers = value ?? new List<Statement>();
2157
 
                        }
2158
 
                }
2159
 
                
2160
 
                public Expression Condition {
2161
 
                        get {
2162
 
                                return condition;
2163
 
                        }
2164
 
                        set {
2165
 
                                condition = value ?? Expression.Null;
2166
 
                                if (!condition.IsNull) condition.Parent = this;
2167
 
                        }
2168
 
                }
2169
 
                
2170
 
                public List<Statement> Iterator {
2171
 
                        get {
2172
 
                                return iterator;
2173
 
                        }
2174
 
                        set {
2175
 
                                iterator = value ?? new List<Statement>();
2176
 
                        }
2177
 
                }
2178
 
                
2179
 
                public ForStatement(List<Statement> initializers, Expression condition, List<Statement> iterator, Statement embeddedStatement) {
2180
 
                        Initializers = initializers;
2181
 
                        Condition = condition;
2182
 
                        Iterator = iterator;
2183
 
                        EmbeddedStatement = embeddedStatement;
2184
 
                }
2185
 
                
2186
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2187
 
                        return visitor.VisitForStatement(this, data);
2188
 
                }
2189
 
                
2190
 
                public override string ToString() {
2191
 
                        return string.Format("[ForStatement Initializers={0} Condition={1} Iterator={2} EmbeddedStatement={3}]", GetCollectionString(Initializers), Condition, GetCollectionString(Iterator), EmbeddedStatement);
2192
 
                }
2193
 
        }
2194
 
        
2195
 
        public class GotoCaseStatement : Statement {
2196
 
                
2197
 
                Expression expression;
2198
 
                
2199
 
                public Expression Expression {
2200
 
                        get {
2201
 
                                return expression;
2202
 
                        }
2203
 
                        set {
2204
 
                                expression = value ?? Expression.Null;
2205
 
                                if (!expression.IsNull) expression.Parent = this;
2206
 
                        }
2207
 
                }
2208
 
                
2209
 
                public GotoCaseStatement(Expression expression) {
2210
 
                        Expression = expression;
2211
 
                }
2212
 
                
2213
 
                public bool IsDefaultCase {
2214
 
                        get {
2215
 
                                return expression.IsNull;
2216
 
                        }
2217
 
                }
2218
 
                
2219
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2220
 
                        return visitor.VisitGotoCaseStatement(this, data);
2221
 
                }
2222
 
                
2223
 
                public override string ToString() {
2224
 
                        return string.Format("[GotoCaseStatement Expression={0}]", Expression);
2225
 
                }
2226
 
        }
2227
 
        
2228
 
        public class GotoStatement : Statement {
2229
 
                
2230
 
                string label;
2231
 
                
2232
 
                public string Label {
2233
 
                        get {
2234
 
                                return label;
2235
 
                        }
2236
 
                        set {
2237
 
                                label = value ?? "";
2238
 
                        }
2239
 
                }
2240
 
                
2241
 
                public GotoStatement(string label) {
2242
 
                        Label = label;
2243
 
                }
2244
 
                
2245
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2246
 
                        return visitor.VisitGotoStatement(this, data);
2247
 
                }
2248
 
                
2249
 
                public override string ToString() {
2250
 
                        return string.Format("[GotoStatement Label={0}]", Label);
2251
 
                }
2252
 
        }
2253
 
        
2254
 
        public class IdentifierExpression : Expression {
2255
 
                
2256
 
                string identifier;
2257
 
                
2258
 
                List<TypeReference> typeArguments;
2259
 
                
2260
 
                public string Identifier {
2261
 
                        get {
2262
 
                                return identifier;
2263
 
                        }
2264
 
                        set {
2265
 
                                identifier = value ?? "";
2266
 
                        }
2267
 
                }
2268
 
                
2269
 
                public List<TypeReference> TypeArguments {
2270
 
                        get {
2271
 
                                return typeArguments;
2272
 
                        }
2273
 
                        set {
2274
 
                                typeArguments = value ?? new List<TypeReference>();
2275
 
                        }
2276
 
                }
2277
 
                
2278
 
                public IdentifierExpression(string identifier) {
2279
 
                        Identifier = identifier;
2280
 
                        typeArguments = new List<TypeReference>();
2281
 
                }
2282
 
                
2283
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2284
 
                        return visitor.VisitIdentifierExpression(this, data);
2285
 
                }
2286
 
                
2287
 
                public override string ToString() {
2288
 
                        return string.Format("[IdentifierExpression Identifier={0} TypeArguments={1}]", Identifier, GetCollectionString(TypeArguments));
2289
 
                }
2290
 
        }
2291
 
        
2292
 
        public class IfElseStatement : Statement {
2293
 
                
2294
 
                Expression condition;
2295
 
                
2296
 
                List<Statement> trueStatement;
2297
 
                
2298
 
                List<Statement> falseStatement;
2299
 
                
2300
 
                List<ElseIfSection> elseIfSections;
2301
 
                
2302
 
                public Expression Condition {
2303
 
                        get {
2304
 
                                return condition;
2305
 
                        }
2306
 
                        set {
2307
 
                                condition = value ?? Expression.Null;
2308
 
                                if (!condition.IsNull) condition.Parent = this;
2309
 
                        }
2310
 
                }
2311
 
                
2312
 
                public List<Statement> TrueStatement {
2313
 
                        get {
2314
 
                                return trueStatement;
2315
 
                        }
2316
 
                        set {
2317
 
                                trueStatement = value ?? new List<Statement>();
2318
 
                        }
2319
 
                }
2320
 
                
2321
 
                public List<Statement> FalseStatement {
2322
 
                        get {
2323
 
                                return falseStatement;
2324
 
                        }
2325
 
                        set {
2326
 
                                falseStatement = value ?? new List<Statement>();
2327
 
                        }
2328
 
                }
2329
 
                
2330
 
                public List<ElseIfSection> ElseIfSections {
2331
 
                        get {
2332
 
                                return elseIfSections;
2333
 
                        }
2334
 
                        set {
2335
 
                                elseIfSections = value ?? new List<ElseIfSection>();
2336
 
                        }
2337
 
                }
2338
 
                
2339
 
                public IfElseStatement(Expression condition) {
2340
 
                        Condition = condition;
2341
 
                        trueStatement = new List<Statement>();
2342
 
                        falseStatement = new List<Statement>();
2343
 
                        elseIfSections = new List<ElseIfSection>();
2344
 
                }
2345
 
                
2346
 
 
2347
 
                        public IfElseStatement(Expression condition, Statement trueStatement)
2348
 
                                : this(condition) {
2349
 
                                this.trueStatement.Add(Statement.CheckNull(trueStatement));
2350
 
                                if (trueStatement != null) trueStatement.Parent = this;
2351
 
                        }
2352
 
                
2353
 
 
2354
 
                        public IfElseStatement(Expression condition, Statement trueStatement, Statement falseStatement)
2355
 
                                : this(condition) {
2356
 
                                this.trueStatement.Add(Statement.CheckNull(trueStatement));
2357
 
                                this.falseStatement.Add(Statement.CheckNull(falseStatement));
2358
 
                                if (trueStatement != null) trueStatement.Parent = this;
2359
 
                                if (falseStatement != null) falseStatement.Parent = this;
2360
 
                        }
2361
 
                
2362
 
                public bool HasElseStatements {
2363
 
                        get {
2364
 
                                return falseStatement.Count > 0;
2365
 
                        }
2366
 
                }
2367
 
                
2368
 
                public bool HasElseIfSections {
2369
 
                        get {
2370
 
                                return elseIfSections.Count > 0;
2371
 
                        }
2372
 
                }
2373
 
                
2374
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2375
 
                        return visitor.VisitIfElseStatement(this, data);
2376
 
                }
2377
 
                
2378
 
                public override string ToString() {
2379
 
                        return string.Format("[IfElseStatement Condition={0} TrueStatement={1} FalseStatement={2} ElseIfSection" +
2380
 
                                        "s={3}]", Condition, GetCollectionString(TrueStatement), GetCollectionString(FalseStatement), GetCollectionString(ElseIfSections));
2381
 
                }
2382
 
        }
2383
 
        
2384
 
        public class IndexerDeclaration : AttributedNode {
2385
 
                
2386
 
                List<ParameterDeclarationExpression> parameters;
2387
 
                
2388
 
                List<InterfaceImplementation> interfaceImplementations;
2389
 
                
2390
 
                TypeReference typeReference;
2391
 
                
2392
 
                Location bodyStart;
2393
 
                
2394
 
                Location bodyEnd;
2395
 
                
2396
 
                PropertyGetRegion getRegion;
2397
 
                
2398
 
                PropertySetRegion setRegion;
2399
 
                
2400
 
                public List<ParameterDeclarationExpression> Parameters {
2401
 
                        get {
2402
 
                                return parameters;
2403
 
                        }
2404
 
                        set {
2405
 
                                parameters = value ?? new List<ParameterDeclarationExpression>();
2406
 
                        }
2407
 
                }
2408
 
                
2409
 
                public List<InterfaceImplementation> InterfaceImplementations {
2410
 
                        get {
2411
 
                                return interfaceImplementations;
2412
 
                        }
2413
 
                        set {
2414
 
                                interfaceImplementations = value ?? new List<InterfaceImplementation>();
2415
 
                        }
2416
 
                }
2417
 
                
2418
 
                public TypeReference TypeReference {
2419
 
                        get {
2420
 
                                return typeReference;
2421
 
                        }
2422
 
                        set {
2423
 
                                typeReference = value ?? TypeReference.Null;
2424
 
                                if (!typeReference.IsNull) typeReference.Parent = this;
2425
 
                        }
2426
 
                }
2427
 
                
2428
 
                public Location BodyStart {
2429
 
                        get {
2430
 
                                return bodyStart;
2431
 
                        }
2432
 
                        set {
2433
 
                                bodyStart = value;
2434
 
                        }
2435
 
                }
2436
 
                
2437
 
                public Location BodyEnd {
2438
 
                        get {
2439
 
                                return bodyEnd;
2440
 
                        }
2441
 
                        set {
2442
 
                                bodyEnd = value;
2443
 
                        }
2444
 
                }
2445
 
                
2446
 
                public PropertyGetRegion GetRegion {
2447
 
                        get {
2448
 
                                return getRegion;
2449
 
                        }
2450
 
                        set {
2451
 
                                getRegion = value ?? PropertyGetRegion.Null;
2452
 
                                if (!getRegion.IsNull) getRegion.Parent = this;
2453
 
                        }
2454
 
                }
2455
 
                
2456
 
                public PropertySetRegion SetRegion {
2457
 
                        get {
2458
 
                                return setRegion;
2459
 
                        }
2460
 
                        set {
2461
 
                                setRegion = value ?? PropertySetRegion.Null;
2462
 
                                if (!setRegion.IsNull) setRegion.Parent = this;
2463
 
                        }
2464
 
                }
2465
 
                
2466
 
                public IndexerDeclaration(Modifiers modifier, List<ParameterDeclarationExpression> parameters, List<AttributeSection> attributes) {
2467
 
                        Modifier = modifier;
2468
 
                        Parameters = parameters;
2469
 
                        Attributes = attributes;
2470
 
                        interfaceImplementations = new List<InterfaceImplementation>();
2471
 
                        typeReference = TypeReference.Null;
2472
 
                        bodyStart = Location.Empty;
2473
 
                        bodyEnd = Location.Empty;
2474
 
                        getRegion = PropertyGetRegion.Null;
2475
 
                        setRegion = PropertySetRegion.Null;
2476
 
                }
2477
 
                
2478
 
                public IndexerDeclaration(TypeReference typeReference, List<ParameterDeclarationExpression> parameters, Modifiers modifier, List<AttributeSection> attributes) {
2479
 
                        TypeReference = typeReference;
2480
 
                        Parameters = parameters;
2481
 
                        Modifier = modifier;
2482
 
                        Attributes = attributes;
2483
 
                        interfaceImplementations = new List<InterfaceImplementation>();
2484
 
                        bodyStart = Location.Empty;
2485
 
                        bodyEnd = Location.Empty;
2486
 
                        getRegion = PropertyGetRegion.Null;
2487
 
                        setRegion = PropertySetRegion.Null;
2488
 
                }
2489
 
                
2490
 
                public bool IsReadOnly {
2491
 
                        get {
2492
 
                                return HasGetRegion && !HasSetRegion;
2493
 
                        }
2494
 
                }
2495
 
                
2496
 
                public bool HasSetRegion {
2497
 
                        get {
2498
 
                                return !setRegion.IsNull;
2499
 
                        }
2500
 
                }
2501
 
                
2502
 
                public bool HasGetRegion {
2503
 
                        get {
2504
 
                                return !getRegion.IsNull;
2505
 
                        }
2506
 
                }
2507
 
                
2508
 
                public bool IsWriteOnly {
2509
 
                        get {
2510
 
                                return !HasGetRegion && HasSetRegion;
2511
 
                        }
2512
 
                }
2513
 
                
2514
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2515
 
                        return visitor.VisitIndexerDeclaration(this, data);
2516
 
                }
2517
 
                
2518
 
                public override string ToString() {
2519
 
                        return string.Format("[IndexerDeclaration Parameters={0} InterfaceImplementations={1} TypeReference={2}" +
2520
 
                                        " BodyStart={3} BodyEnd={4} GetRegion={5} SetRegion={6} Attributes={7} Modifier={" +
2521
 
                                        "8}]", GetCollectionString(Parameters), GetCollectionString(InterfaceImplementations), TypeReference, BodyStart, BodyEnd, GetRegion, SetRegion, GetCollectionString(Attributes), Modifier);
2522
 
                }
2523
 
        }
2524
 
        
2525
 
        public class IndexerExpression : Expression {
2526
 
                
2527
 
                Expression targetObject;
2528
 
                
2529
 
                List<Expression> indexes;
2530
 
                
2531
 
                public Expression TargetObject {
2532
 
                        get {
2533
 
                                return targetObject;
2534
 
                        }
2535
 
                        set {
2536
 
                                targetObject = value ?? Expression.Null;
2537
 
                                if (!targetObject.IsNull) targetObject.Parent = this;
2538
 
                        }
2539
 
                }
2540
 
                
2541
 
                public List<Expression> Indexes {
2542
 
                        get {
2543
 
                                return indexes;
2544
 
                        }
2545
 
                        set {
2546
 
                                indexes = value ?? new List<Expression>();
2547
 
                        }
2548
 
                }
2549
 
                
2550
 
                public IndexerExpression(Expression targetObject, List<Expression> indexes) {
2551
 
                        TargetObject = targetObject;
2552
 
                        Indexes = indexes;
2553
 
                }
2554
 
                
2555
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2556
 
                        return visitor.VisitIndexerExpression(this, data);
2557
 
                }
2558
 
                
2559
 
                public override string ToString() {
2560
 
                        return string.Format("[IndexerExpression TargetObject={0} Indexes={1}]", TargetObject, GetCollectionString(Indexes));
2561
 
                }
2562
 
        }
2563
 
        
2564
 
        public class InterfaceImplementation : AbstractNode {
2565
 
                
2566
 
                TypeReference interfaceType;
2567
 
                
2568
 
                string memberName;
2569
 
                
2570
 
                public TypeReference InterfaceType {
2571
 
                        get {
2572
 
                                return interfaceType;
2573
 
                        }
2574
 
                        set {
2575
 
                                interfaceType = value ?? TypeReference.Null;
2576
 
                                if (!interfaceType.IsNull) interfaceType.Parent = this;
2577
 
                        }
2578
 
                }
2579
 
                
2580
 
                public string MemberName {
2581
 
                        get {
2582
 
                                return memberName;
2583
 
                        }
2584
 
                        set {
2585
 
                                memberName = string.IsNullOrEmpty(value) ? "?" : value;
2586
 
                        }
2587
 
                }
2588
 
                
2589
 
                public InterfaceImplementation(TypeReference interfaceType, string memberName) {
2590
 
                        InterfaceType = interfaceType;
2591
 
                        MemberName = memberName;
2592
 
                }
2593
 
                
2594
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2595
 
                        return visitor.VisitInterfaceImplementation(this, data);
2596
 
                }
2597
 
                
2598
 
                public override string ToString() {
2599
 
                        return string.Format("[InterfaceImplementation InterfaceType={0} MemberName={1}]", InterfaceType, MemberName);
2600
 
                }
2601
 
        }
2602
 
        
2603
 
        public class InvocationExpression : Expression {
2604
 
                
2605
 
                Expression targetObject;
2606
 
                
2607
 
                List<Expression> arguments;
2608
 
                
2609
 
                public Expression TargetObject {
2610
 
                        get {
2611
 
                                return targetObject;
2612
 
                        }
2613
 
                        set {
2614
 
                                targetObject = value ?? Expression.Null;
2615
 
                                if (!targetObject.IsNull) targetObject.Parent = this;
2616
 
                        }
2617
 
                }
2618
 
                
2619
 
                public List<Expression> Arguments {
2620
 
                        get {
2621
 
                                return arguments;
2622
 
                        }
2623
 
                        set {
2624
 
                                arguments = value ?? new List<Expression>();
2625
 
                        }
2626
 
                }
2627
 
                
2628
 
                public InvocationExpression(Expression targetObject) {
2629
 
                        TargetObject = targetObject;
2630
 
                        arguments = new List<Expression>();
2631
 
                }
2632
 
                
2633
 
                public InvocationExpression(Expression targetObject, List<Expression> arguments) {
2634
 
                        TargetObject = targetObject;
2635
 
                        Arguments = arguments;
2636
 
                }
2637
 
                
2638
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2639
 
                        return visitor.VisitInvocationExpression(this, data);
2640
 
                }
2641
 
                
2642
 
                public override string ToString() {
2643
 
                        return string.Format("[InvocationExpression TargetObject={0} Arguments={1}]", TargetObject, GetCollectionString(Arguments));
2644
 
                }
2645
 
        }
2646
 
        
2647
 
        public class LabelStatement : Statement {
2648
 
                
2649
 
                string label;
2650
 
                
2651
 
                public string Label {
2652
 
                        get {
2653
 
                                return label;
2654
 
                        }
2655
 
                        set {
2656
 
                                label = value ?? "";
2657
 
                        }
2658
 
                }
2659
 
                
2660
 
                public LabelStatement(string label) {
2661
 
                        Label = label;
2662
 
                }
2663
 
                
2664
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2665
 
                        return visitor.VisitLabelStatement(this, data);
2666
 
                }
2667
 
                
2668
 
                public override string ToString() {
2669
 
                        return string.Format("[LabelStatement Label={0}]", Label);
2670
 
                }
2671
 
        }
2672
 
        
2673
 
        public class LambdaExpression : Expression {
2674
 
                
2675
 
                List<ParameterDeclarationExpression> parameters;
2676
 
                
2677
 
                BlockStatement statementBody;
2678
 
                
2679
 
                Expression expressionBody;
2680
 
                
2681
 
                public List<ParameterDeclarationExpression> Parameters {
2682
 
                        get {
2683
 
                                return parameters;
2684
 
                        }
2685
 
                        set {
2686
 
                                parameters = value ?? new List<ParameterDeclarationExpression>();
2687
 
                        }
2688
 
                }
2689
 
                
2690
 
                public BlockStatement StatementBody {
2691
 
                        get {
2692
 
                                return statementBody;
2693
 
                        }
2694
 
                        set {
2695
 
                                statementBody = value ?? BlockStatement.Null;
2696
 
                                if (!statementBody.IsNull) statementBody.Parent = this;
2697
 
                        }
2698
 
                }
2699
 
                
2700
 
                public Expression ExpressionBody {
2701
 
                        get {
2702
 
                                return expressionBody;
2703
 
                        }
2704
 
                        set {
2705
 
                                expressionBody = value ?? Expression.Null;
2706
 
                                if (!expressionBody.IsNull) expressionBody.Parent = this;
2707
 
                        }
2708
 
                }
2709
 
                
2710
 
                public LambdaExpression() {
2711
 
                        parameters = new List<ParameterDeclarationExpression>();
2712
 
                        statementBody = BlockStatement.Null;
2713
 
                        expressionBody = Expression.Null;
2714
 
                }
2715
 
                
2716
 
                public Location ExtendedEndLocation { get; set; }
2717
 
                
2718
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2719
 
                        return visitor.VisitLambdaExpression(this, data);
2720
 
                }
2721
 
                
2722
 
                public override string ToString() {
2723
 
                        return string.Format("[LambdaExpression Parameters={0} StatementBody={1} ExpressionBody={2}]", GetCollectionString(Parameters), StatementBody, ExpressionBody);
2724
 
                }
2725
 
        }
2726
 
        
2727
 
        public class LockStatement : StatementWithEmbeddedStatement {
2728
 
                
2729
 
                Expression lockExpression;
2730
 
                
2731
 
                public Expression LockExpression {
2732
 
                        get {
2733
 
                                return lockExpression;
2734
 
                        }
2735
 
                        set {
2736
 
                                lockExpression = value ?? Expression.Null;
2737
 
                                if (!lockExpression.IsNull) lockExpression.Parent = this;
2738
 
                        }
2739
 
                }
2740
 
                
2741
 
                public LockStatement(Expression lockExpression, Statement embeddedStatement) {
2742
 
                        LockExpression = lockExpression;
2743
 
                        EmbeddedStatement = embeddedStatement;
2744
 
                }
2745
 
                
2746
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2747
 
                        return visitor.VisitLockStatement(this, data);
2748
 
                }
2749
 
                
2750
 
                public override string ToString() {
2751
 
                        return string.Format("[LockStatement LockExpression={0} EmbeddedStatement={1}]", LockExpression, EmbeddedStatement);
2752
 
                }
2753
 
        }
2754
 
        
2755
 
        public abstract class MemberNode : ParametrizedNode {
2756
 
                
2757
 
                List<InterfaceImplementation> interfaceImplementations;
2758
 
                
2759
 
                TypeReference typeReference;
2760
 
                
2761
 
                public List<InterfaceImplementation> InterfaceImplementations {
2762
 
                        get {
2763
 
                                return interfaceImplementations;
2764
 
                        }
2765
 
                        set {
2766
 
                                interfaceImplementations = value ?? new List<InterfaceImplementation>();
2767
 
                        }
2768
 
                }
2769
 
                
2770
 
                public TypeReference TypeReference {
2771
 
                        get {
2772
 
                                return typeReference;
2773
 
                        }
2774
 
                        set {
2775
 
                                typeReference = value ?? TypeReference.Null;
2776
 
                                if (!typeReference.IsNull) typeReference.Parent = this;
2777
 
                        }
2778
 
                }
2779
 
                
2780
 
                protected MemberNode() {
2781
 
                        interfaceImplementations = new List<InterfaceImplementation>();
2782
 
                        typeReference = TypeReference.Null;
2783
 
                }
2784
 
                
2785
 
                protected MemberNode(Modifiers modifier, List<AttributeSection> attributes, string name, List<ParameterDeclarationExpression> parameters) {
2786
 
                        Modifier = modifier;
2787
 
                        Attributes = attributes;
2788
 
                        Name = name;
2789
 
                        Parameters = parameters;
2790
 
                        interfaceImplementations = new List<InterfaceImplementation>();
2791
 
                        typeReference = TypeReference.Null;
2792
 
                }
2793
 
        }
2794
 
        
2795
 
        public class MemberReferenceExpression : Expression {
2796
 
                
2797
 
                Expression targetObject;
2798
 
                
2799
 
                string memberName;
2800
 
                
2801
 
                List<TypeReference> typeArguments;
2802
 
                
2803
 
                public Expression TargetObject {
2804
 
                        get {
2805
 
                                return targetObject;
2806
 
                        }
2807
 
                        set {
2808
 
                                targetObject = value ?? Expression.Null;
2809
 
                                if (!targetObject.IsNull) targetObject.Parent = this;
2810
 
                        }
2811
 
                }
2812
 
                
2813
 
                public string MemberName {
2814
 
                        get {
2815
 
                                return memberName;
2816
 
                        }
2817
 
                        set {
2818
 
                                memberName = value ?? "";
2819
 
                        }
2820
 
                }
2821
 
                
2822
 
                public List<TypeReference> TypeArguments {
2823
 
                        get {
2824
 
                                return typeArguments;
2825
 
                        }
2826
 
                        set {
2827
 
                                typeArguments = value ?? new List<TypeReference>();
2828
 
                        }
2829
 
                }
2830
 
                
2831
 
                public MemberReferenceExpression(Expression targetObject, string memberName) {
2832
 
                        TargetObject = targetObject;
2833
 
                        MemberName = memberName;
2834
 
                        typeArguments = new List<TypeReference>();
2835
 
                }
2836
 
                
2837
 
[Obsolete] public string FieldName { get { return MemberName; } set { MemberName = value; } }
2838
 
                
2839
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2840
 
                        return visitor.VisitMemberReferenceExpression(this, data);
2841
 
                }
2842
 
                
2843
 
                public override string ToString() {
2844
 
                        return string.Format("[MemberReferenceExpression TargetObject={0} MemberName={1} TypeArguments={2}]", TargetObject, MemberName, GetCollectionString(TypeArguments));
2845
 
                }
2846
 
        }
2847
 
        
2848
 
        public class MethodDeclaration : MemberNode {
2849
 
                
2850
 
                BlockStatement body;
2851
 
                
2852
 
                List<string> handlesClause;
2853
 
                
2854
 
                List<TemplateDefinition> templates;
2855
 
                
2856
 
                bool isExtensionMethod;
2857
 
                
2858
 
                public BlockStatement Body {
2859
 
                        get {
2860
 
                                return body;
2861
 
                        }
2862
 
                        set {
2863
 
                                body = value ?? BlockStatement.Null;
2864
 
                                if (!body.IsNull) body.Parent = this;
2865
 
                        }
2866
 
                }
2867
 
                
2868
 
                public List<string> HandlesClause {
2869
 
                        get {
2870
 
                                return handlesClause;
2871
 
                        }
2872
 
                        set {
2873
 
                                handlesClause = value ?? new List<String>();
2874
 
                        }
2875
 
                }
2876
 
                
2877
 
                public List<TemplateDefinition> Templates {
2878
 
                        get {
2879
 
                                return templates;
2880
 
                        }
2881
 
                        set {
2882
 
                                templates = value ?? new List<TemplateDefinition>();
2883
 
                        }
2884
 
                }
2885
 
                
2886
 
                public bool IsExtensionMethod {
2887
 
                        get {
2888
 
                                return isExtensionMethod;
2889
 
                        }
2890
 
                        set {
2891
 
                                isExtensionMethod = value;
2892
 
                        }
2893
 
                }
2894
 
                
2895
 
                public MethodDeclaration() {
2896
 
                        body = BlockStatement.Null;
2897
 
                        handlesClause = new List<String>();
2898
 
                        templates = new List<TemplateDefinition>();
2899
 
                }
2900
 
                
2901
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2902
 
                        return visitor.VisitMethodDeclaration(this, data);
2903
 
                }
2904
 
                
2905
 
                public override string ToString() {
2906
 
                        return string.Format("[MethodDeclaration Body={0} HandlesClause={1} Templates={2} IsExtensionMethod={3}" +
2907
 
                                        " InterfaceImplementations={4} TypeReference={5} Name={6} Parameters={7} Attribut" +
2908
 
                                        "es={8} Modifier={9}]", Body, GetCollectionString(HandlesClause), GetCollectionString(Templates), IsExtensionMethod, GetCollectionString(InterfaceImplementations), TypeReference, Name, GetCollectionString(Parameters), GetCollectionString(Attributes), Modifier);
2909
 
                }
2910
 
        }
2911
 
        
2912
 
        public class NamedArgumentExpression : Expression {
2913
 
                
2914
 
                string name;
2915
 
                
2916
 
                Expression expression;
2917
 
                
2918
 
                public string Name {
2919
 
                        get {
2920
 
                                return name;
2921
 
                        }
2922
 
                        set {
2923
 
                                name = value ?? "";
2924
 
                        }
2925
 
                }
2926
 
                
2927
 
                public Expression Expression {
2928
 
                        get {
2929
 
                                return expression;
2930
 
                        }
2931
 
                        set {
2932
 
                                expression = value ?? Expression.Null;
2933
 
                                if (!expression.IsNull) expression.Parent = this;
2934
 
                        }
2935
 
                }
2936
 
                
2937
 
                public NamedArgumentExpression() {
2938
 
                        name = "";
2939
 
                        expression = Expression.Null;
2940
 
                }
2941
 
                
2942
 
                public NamedArgumentExpression(string name, Expression expression) {
2943
 
                        Name = name;
2944
 
                        Expression = expression;
2945
 
                }
2946
 
                
2947
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2948
 
                        return visitor.VisitNamedArgumentExpression(this, data);
2949
 
                }
2950
 
                
2951
 
                public override string ToString() {
2952
 
                        return string.Format("[NamedArgumentExpression Name={0} Expression={1}]", Name, Expression);
2953
 
                }
2954
 
        }
2955
 
        
2956
 
        public class NamespaceDeclaration : AbstractNode {
2957
 
                
2958
 
                string name;
2959
 
                
2960
 
                public string Name {
2961
 
                        get {
2962
 
                                return name;
2963
 
                        }
2964
 
                        set {
2965
 
                                name = value ?? "";
2966
 
                        }
2967
 
                }
2968
 
                
2969
 
                public NamespaceDeclaration(string name) {
2970
 
                        Name = name;
2971
 
                }
2972
 
                
2973
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
2974
 
                        return visitor.VisitNamespaceDeclaration(this, data);
2975
 
                }
2976
 
                
2977
 
                public override string ToString() {
2978
 
                        return string.Format("[NamespaceDeclaration Name={0}]", Name);
2979
 
                }
2980
 
        }
2981
 
        
2982
 
        public class ObjectCreateExpression : Expression {
2983
 
                
2984
 
                TypeReference createType;
2985
 
                
2986
 
                List<Expression> parameters;
2987
 
                
2988
 
                CollectionInitializerExpression objectInitializer;
2989
 
                
2990
 
                public TypeReference CreateType {
2991
 
                        get {
2992
 
                                return createType;
2993
 
                        }
2994
 
                        set {
2995
 
                                createType = value ?? TypeReference.Null;
2996
 
                                if (!createType.IsNull) createType.Parent = this;
2997
 
                        }
2998
 
                }
2999
 
                
3000
 
                public List<Expression> Parameters {
3001
 
                        get {
3002
 
                                return parameters;
3003
 
                        }
3004
 
                        set {
3005
 
                                parameters = value ?? new List<Expression>();
3006
 
                        }
3007
 
                }
3008
 
                
3009
 
                public CollectionInitializerExpression ObjectInitializer {
3010
 
                        get {
3011
 
                                return objectInitializer;
3012
 
                        }
3013
 
                        set {
3014
 
                                objectInitializer = value ?? CollectionInitializerExpression.Null;
3015
 
                                if (!objectInitializer.IsNull) objectInitializer.Parent = this;
3016
 
                        }
3017
 
                }
3018
 
                
3019
 
                public ObjectCreateExpression(TypeReference createType, List<Expression> parameters) {
3020
 
                        CreateType = createType;
3021
 
                        Parameters = parameters;
3022
 
                        objectInitializer = CollectionInitializerExpression.Null;
3023
 
                }
3024
 
                
3025
 
                public bool IsAnonymousType {
3026
 
                        get {
3027
 
                                return createType.IsNull || string.IsNullOrEmpty(createType.Type);
3028
 
                        }
3029
 
                }
3030
 
                
3031
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3032
 
                        return visitor.VisitObjectCreateExpression(this, data);
3033
 
                }
3034
 
                
3035
 
                public override string ToString() {
3036
 
                        return string.Format("[ObjectCreateExpression CreateType={0} Parameters={1} ObjectInitializer={2}]", CreateType, GetCollectionString(Parameters), ObjectInitializer);
3037
 
                }
3038
 
        }
3039
 
        
3040
 
        public class OnErrorStatement : StatementWithEmbeddedStatement {
3041
 
                
3042
 
                public OnErrorStatement(Statement embeddedStatement) {
3043
 
                        EmbeddedStatement = embeddedStatement;
3044
 
                }
3045
 
                
3046
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3047
 
                        return visitor.VisitOnErrorStatement(this, data);
3048
 
                }
3049
 
                
3050
 
                public override string ToString() {
3051
 
                        return string.Format("[OnErrorStatement EmbeddedStatement={0}]", EmbeddedStatement);
3052
 
                }
3053
 
        }
3054
 
        
3055
 
        public class OperatorDeclaration : MethodDeclaration {
3056
 
                
3057
 
                ConversionType conversionType;
3058
 
                
3059
 
                List<AttributeSection> returnTypeAttributes;
3060
 
                
3061
 
                OverloadableOperatorType overloadableOperator;
3062
 
                
3063
 
                public ConversionType ConversionType {
3064
 
                        get {
3065
 
                                return conversionType;
3066
 
                        }
3067
 
                        set {
3068
 
                                conversionType = value;
3069
 
                        }
3070
 
                }
3071
 
                
3072
 
                public List<AttributeSection> ReturnTypeAttributes {
3073
 
                        get {
3074
 
                                return returnTypeAttributes;
3075
 
                        }
3076
 
                        set {
3077
 
                                returnTypeAttributes = value ?? new List<AttributeSection>();
3078
 
                        }
3079
 
                }
3080
 
                
3081
 
                public OverloadableOperatorType OverloadableOperator {
3082
 
                        get {
3083
 
                                return overloadableOperator;
3084
 
                        }
3085
 
                        set {
3086
 
                                overloadableOperator = value;
3087
 
                        }
3088
 
                }
3089
 
                
3090
 
                public OperatorDeclaration() {
3091
 
                        returnTypeAttributes = new List<AttributeSection>();
3092
 
                }
3093
 
                
3094
 
                public bool IsConversionOperator {
3095
 
                        get {
3096
 
                                return conversionType != ConversionType.None;
3097
 
                        }
3098
 
                }
3099
 
                
3100
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3101
 
                        return visitor.VisitOperatorDeclaration(this, data);
3102
 
                }
3103
 
                
3104
 
                public override string ToString() {
3105
 
                        return string.Format("[OperatorDeclaration ConversionType={0} ReturnTypeAttributes={1} OverloadableOper" +
3106
 
                                        "ator={2} Body={3} HandlesClause={4} Templates={5} IsExtensionMethod={6} Interfac" +
3107
 
                                        "eImplementations={7} TypeReference={8} Name={9} Parameters={10} Attributes={11} " +
3108
 
                                        "Modifier={12}]", ConversionType, GetCollectionString(ReturnTypeAttributes), OverloadableOperator, Body, GetCollectionString(HandlesClause), GetCollectionString(Templates), IsExtensionMethod, GetCollectionString(InterfaceImplementations), TypeReference, Name, GetCollectionString(Parameters), GetCollectionString(Attributes), Modifier);
3109
 
                }
3110
 
        }
3111
 
        
3112
 
        public class OptionDeclaration : AbstractNode {
3113
 
                
3114
 
                OptionType optionType;
3115
 
                
3116
 
                bool optionValue;
3117
 
                
3118
 
                public OptionType OptionType {
3119
 
                        get {
3120
 
                                return optionType;
3121
 
                        }
3122
 
                        set {
3123
 
                                optionType = value;
3124
 
                        }
3125
 
                }
3126
 
                
3127
 
                public bool OptionValue {
3128
 
                        get {
3129
 
                                return optionValue;
3130
 
                        }
3131
 
                        set {
3132
 
                                optionValue = value;
3133
 
                        }
3134
 
                }
3135
 
                
3136
 
                public OptionDeclaration(OptionType optionType, bool optionValue) {
3137
 
                        OptionType = optionType;
3138
 
                        OptionValue = optionValue;
3139
 
                }
3140
 
                
3141
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3142
 
                        return visitor.VisitOptionDeclaration(this, data);
3143
 
                }
3144
 
                
3145
 
                public override string ToString() {
3146
 
                        return string.Format("[OptionDeclaration OptionType={0} OptionValue={1}]", OptionType, OptionValue);
3147
 
                }
3148
 
        }
3149
 
        
3150
 
        public class ParameterDeclarationExpression : Expression {
3151
 
                
3152
 
                List<AttributeSection> attributes;
3153
 
                
3154
 
                string parameterName;
3155
 
                
3156
 
                TypeReference typeReference;
3157
 
                
3158
 
                ParameterModifiers paramModifier;
3159
 
                
3160
 
                Expression defaultValue;
3161
 
                
3162
 
                public List<AttributeSection> Attributes {
3163
 
                        get {
3164
 
                                return attributes;
3165
 
                        }
3166
 
                        set {
3167
 
                                attributes = value ?? new List<AttributeSection>();
3168
 
                        }
3169
 
                }
3170
 
                
3171
 
                public string ParameterName {
3172
 
                        get {
3173
 
                                return parameterName;
3174
 
                        }
3175
 
                        set {
3176
 
                                parameterName = string.IsNullOrEmpty(value) ? "?" : value;
3177
 
                        }
3178
 
                }
3179
 
                
3180
 
                public TypeReference TypeReference {
3181
 
                        get {
3182
 
                                return typeReference;
3183
 
                        }
3184
 
                        set {
3185
 
                                typeReference = value ?? TypeReference.Null;
3186
 
                                if (!typeReference.IsNull) typeReference.Parent = this;
3187
 
                        }
3188
 
                }
3189
 
                
3190
 
                public ParameterModifiers ParamModifier {
3191
 
                        get {
3192
 
                                return paramModifier;
3193
 
                        }
3194
 
                        set {
3195
 
                                paramModifier = value;
3196
 
                        }
3197
 
                }
3198
 
                
3199
 
                public Expression DefaultValue {
3200
 
                        get {
3201
 
                                return defaultValue;
3202
 
                        }
3203
 
                        set {
3204
 
                                defaultValue = value ?? Expression.Null;
3205
 
                                if (!defaultValue.IsNull) defaultValue.Parent = this;
3206
 
                        }
3207
 
                }
3208
 
                
3209
 
                public ParameterDeclarationExpression(TypeReference typeReference, string parameterName) {
3210
 
                        TypeReference = typeReference;
3211
 
                        ParameterName = parameterName;
3212
 
                        attributes = new List<AttributeSection>();
3213
 
                        defaultValue = Expression.Null;
3214
 
                }
3215
 
                
3216
 
                public ParameterDeclarationExpression(TypeReference typeReference, string parameterName, ParameterModifiers paramModifier) {
3217
 
                        TypeReference = typeReference;
3218
 
                        ParameterName = parameterName;
3219
 
                        ParamModifier = paramModifier;
3220
 
                        attributes = new List<AttributeSection>();
3221
 
                        defaultValue = Expression.Null;
3222
 
                }
3223
 
                
3224
 
                public ParameterDeclarationExpression(TypeReference typeReference, string parameterName, ParameterModifiers paramModifier, Expression defaultValue) {
3225
 
                        TypeReference = typeReference;
3226
 
                        ParameterName = parameterName;
3227
 
                        ParamModifier = paramModifier;
3228
 
                        DefaultValue = defaultValue;
3229
 
                        attributes = new List<AttributeSection>();
3230
 
                }
3231
 
                
3232
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3233
 
                        return visitor.VisitParameterDeclarationExpression(this, data);
3234
 
                }
3235
 
                
3236
 
                public override string ToString() {
3237
 
                        return string.Format("[ParameterDeclarationExpression Attributes={0} ParameterName={1} TypeReference={2" +
3238
 
                                        "} ParamModifier={3} DefaultValue={4}]", GetCollectionString(Attributes), ParameterName, TypeReference, ParamModifier, DefaultValue);
3239
 
                }
3240
 
        }
3241
 
        
3242
 
        public abstract class ParametrizedNode : AttributedNode {
3243
 
                
3244
 
                string name;
3245
 
                
3246
 
                List<ParameterDeclarationExpression> parameters;
3247
 
                
3248
 
                public string Name {
3249
 
                        get {
3250
 
                                return name;
3251
 
                        }
3252
 
                        set {
3253
 
                                name = value ?? "";
3254
 
                        }
3255
 
                }
3256
 
                
3257
 
                public List<ParameterDeclarationExpression> Parameters {
3258
 
                        get {
3259
 
                                return parameters;
3260
 
                        }
3261
 
                        set {
3262
 
                                parameters = value ?? new List<ParameterDeclarationExpression>();
3263
 
                        }
3264
 
                }
3265
 
                
3266
 
                protected ParametrizedNode() {
3267
 
                        name = "";
3268
 
                        parameters = new List<ParameterDeclarationExpression>();
3269
 
                }
3270
 
                
3271
 
                protected ParametrizedNode(Modifiers modifier, List<AttributeSection> attributes, string name, List<ParameterDeclarationExpression> parameters) {
3272
 
                        Modifier = modifier;
3273
 
                        Attributes = attributes;
3274
 
                        Name = name;
3275
 
                        Parameters = parameters;
3276
 
                }
3277
 
        }
3278
 
        
3279
 
        public class ParenthesizedExpression : Expression {
3280
 
                
3281
 
                Expression expression;
3282
 
                
3283
 
                public Expression Expression {
3284
 
                        get {
3285
 
                                return expression;
3286
 
                        }
3287
 
                        set {
3288
 
                                expression = value ?? Expression.Null;
3289
 
                                if (!expression.IsNull) expression.Parent = this;
3290
 
                        }
3291
 
                }
3292
 
                
3293
 
                public ParenthesizedExpression(Expression expression) {
3294
 
                        Expression = expression;
3295
 
                }
3296
 
                
3297
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3298
 
                        return visitor.VisitParenthesizedExpression(this, data);
3299
 
                }
3300
 
                
3301
 
                public override string ToString() {
3302
 
                        return string.Format("[ParenthesizedExpression Expression={0}]", Expression);
3303
 
                }
3304
 
        }
3305
 
        
3306
 
        public class PointerReferenceExpression : Expression {
3307
 
                
3308
 
                Expression targetObject;
3309
 
                
3310
 
                string memberName;
3311
 
                
3312
 
                List<TypeReference> typeArguments;
3313
 
                
3314
 
                public Expression TargetObject {
3315
 
                        get {
3316
 
                                return targetObject;
3317
 
                        }
3318
 
                        set {
3319
 
                                targetObject = value ?? Expression.Null;
3320
 
                                if (!targetObject.IsNull) targetObject.Parent = this;
3321
 
                        }
3322
 
                }
3323
 
                
3324
 
                public string MemberName {
3325
 
                        get {
3326
 
                                return memberName;
3327
 
                        }
3328
 
                        set {
3329
 
                                memberName = value ?? "";
3330
 
                        }
3331
 
                }
3332
 
                
3333
 
                public List<TypeReference> TypeArguments {
3334
 
                        get {
3335
 
                                return typeArguments;
3336
 
                        }
3337
 
                        set {
3338
 
                                typeArguments = value ?? new List<TypeReference>();
3339
 
                        }
3340
 
                }
3341
 
                
3342
 
                public PointerReferenceExpression(Expression targetObject, string memberName) {
3343
 
                        TargetObject = targetObject;
3344
 
                        MemberName = memberName;
3345
 
                        typeArguments = new List<TypeReference>();
3346
 
                }
3347
 
                
3348
 
[Obsolete] public string Identifier { get { return MemberName; } set { MemberName = value; } }
3349
 
                
3350
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3351
 
                        return visitor.VisitPointerReferenceExpression(this, data);
3352
 
                }
3353
 
                
3354
 
                public override string ToString() {
3355
 
                        return string.Format("[PointerReferenceExpression TargetObject={0} MemberName={1} TypeArguments={2}]", TargetObject, MemberName, GetCollectionString(TypeArguments));
3356
 
                }
3357
 
        }
3358
 
        
3359
 
        public class PropertyDeclaration : MemberNode {
3360
 
                
3361
 
                Location bodyStart;
3362
 
                
3363
 
                Location bodyEnd;
3364
 
                
3365
 
                PropertyGetRegion getRegion;
3366
 
                
3367
 
                PropertySetRegion setRegion;
3368
 
                
3369
 
                public Location BodyStart {
3370
 
                        get {
3371
 
                                return bodyStart;
3372
 
                        }
3373
 
                        set {
3374
 
                                bodyStart = value;
3375
 
                        }
3376
 
                }
3377
 
                
3378
 
                public Location BodyEnd {
3379
 
                        get {
3380
 
                                return bodyEnd;
3381
 
                        }
3382
 
                        set {
3383
 
                                bodyEnd = value;
3384
 
                        }
3385
 
                }
3386
 
                
3387
 
                public PropertyGetRegion GetRegion {
3388
 
                        get {
3389
 
                                return getRegion;
3390
 
                        }
3391
 
                        set {
3392
 
                                getRegion = value ?? PropertyGetRegion.Null;
3393
 
                                if (!getRegion.IsNull) getRegion.Parent = this;
3394
 
                        }
3395
 
                }
3396
 
                
3397
 
                public PropertySetRegion SetRegion {
3398
 
                        get {
3399
 
                                return setRegion;
3400
 
                        }
3401
 
                        set {
3402
 
                                setRegion = value ?? PropertySetRegion.Null;
3403
 
                                if (!setRegion.IsNull) setRegion.Parent = this;
3404
 
                        }
3405
 
                }
3406
 
                
3407
 
                public PropertyDeclaration(Modifiers modifier, List<AttributeSection> attributes, string name, List<ParameterDeclarationExpression> parameters) {
3408
 
                        Modifier = modifier;
3409
 
                        Attributes = attributes;
3410
 
                        Name = name;
3411
 
                        Parameters = parameters;
3412
 
                        bodyStart = Location.Empty;
3413
 
                        bodyEnd = Location.Empty;
3414
 
                        getRegion = PropertyGetRegion.Null;
3415
 
                        setRegion = PropertySetRegion.Null;
3416
 
                }
3417
 
                
3418
 
                public bool HasGetRegion {
3419
 
                        get {
3420
 
                                return !getRegion.IsNull;
3421
 
                        }
3422
 
                }
3423
 
                
3424
 
                public bool HasSetRegion {
3425
 
                        get {
3426
 
                                return !setRegion.IsNull;
3427
 
                        }
3428
 
                }
3429
 
                
3430
 
                public bool IsReadOnly {
3431
 
                        get {
3432
 
                                return HasGetRegion && !HasSetRegion;
3433
 
                        }
3434
 
                }
3435
 
                
3436
 
 
3437
 
                internal PropertyDeclaration(string name, TypeReference typeReference, Modifiers modifier, List<AttributeSection> attributes) : this(modifier, attributes, name, null)
3438
 
                {
3439
 
                        this.TypeReference = typeReference;
3440
 
                        if ((modifier & Modifiers.ReadOnly) != Modifiers.ReadOnly) {
3441
 
                                this.SetRegion = new PropertySetRegion(null, null);
3442
 
                        }
3443
 
                        if ((modifier & Modifiers.WriteOnly) != Modifiers.WriteOnly) {
3444
 
                                this.GetRegion = new PropertyGetRegion(null, null);
3445
 
                        }
3446
 
                }
3447
 
                
3448
 
                public bool IsWriteOnly {
3449
 
                        get {
3450
 
                                return !HasGetRegion && HasSetRegion;
3451
 
                        }
3452
 
                }
3453
 
                
3454
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3455
 
                        return visitor.VisitPropertyDeclaration(this, data);
3456
 
                }
3457
 
                
3458
 
                public override string ToString() {
3459
 
                        return string.Format("[PropertyDeclaration BodyStart={0} BodyEnd={1} GetRegion={2} SetRegion={3} Interf" +
3460
 
                                        "aceImplementations={4} TypeReference={5} Name={6} Parameters={7} Attributes={8} " +
3461
 
                                        "Modifier={9}]", BodyStart, BodyEnd, GetRegion, SetRegion, GetCollectionString(InterfaceImplementations), TypeReference, Name, GetCollectionString(Parameters), GetCollectionString(Attributes), Modifier);
3462
 
                }
3463
 
        }
3464
 
        
3465
 
        public class PropertyGetRegion : PropertyGetSetRegion {
3466
 
                
3467
 
                public PropertyGetRegion(BlockStatement block, List<AttributeSection> attributes) : 
3468
 
                                base(block, attributes) {
3469
 
                }
3470
 
                
3471
 
                public static PropertyGetRegion Null {
3472
 
                        get {
3473
 
                                return NullPropertyGetRegion.Instance;
3474
 
                        }
3475
 
                }
3476
 
                
3477
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3478
 
                        return visitor.VisitPropertyGetRegion(this, data);
3479
 
                }
3480
 
                
3481
 
                public override string ToString() {
3482
 
                        return string.Format("[PropertyGetRegion Block={0} Attributes={1} Modifier={2}]", Block, GetCollectionString(Attributes), Modifier);
3483
 
                }
3484
 
        }
3485
 
        
3486
 
        internal sealed class NullPropertyGetRegion : PropertyGetRegion {
3487
 
                
3488
 
                private NullPropertyGetRegion() : 
3489
 
                                base(null, null) {
3490
 
                }
3491
 
                
3492
 
                internal static NullPropertyGetRegion Instance = new NullPropertyGetRegion();
3493
 
                
3494
 
                public override bool IsNull {
3495
 
                        get {
3496
 
                                return true;
3497
 
                        }
3498
 
                }
3499
 
                
3500
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3501
 
                        return null;
3502
 
                }
3503
 
                
3504
 
                public override string ToString() {
3505
 
                        return "[NullPropertyGetRegion]";
3506
 
                }
3507
 
        }
3508
 
        
3509
 
        public abstract class PropertyGetSetRegion : AttributedNode, INullable {
3510
 
                
3511
 
                BlockStatement block;
3512
 
                
3513
 
                public BlockStatement Block {
3514
 
                        get {
3515
 
                                return block;
3516
 
                        }
3517
 
                        set {
3518
 
                                block = value ?? BlockStatement.Null;
3519
 
                                if (!block.IsNull) block.Parent = this;
3520
 
                        }
3521
 
                }
3522
 
                
3523
 
                protected PropertyGetSetRegion(BlockStatement block, List<AttributeSection> attributes) {
3524
 
                        Block = block;
3525
 
                        Attributes = attributes;
3526
 
                }
3527
 
                
3528
 
                public virtual bool IsNull {
3529
 
                        get {
3530
 
                                return false;
3531
 
                        }
3532
 
                }
3533
 
        }
3534
 
        
3535
 
        public class PropertySetRegion : PropertyGetSetRegion {
3536
 
                
3537
 
                List<ParameterDeclarationExpression> parameters;
3538
 
                
3539
 
                public List<ParameterDeclarationExpression> Parameters {
3540
 
                        get {
3541
 
                                return parameters;
3542
 
                        }
3543
 
                        set {
3544
 
                                parameters = value ?? new List<ParameterDeclarationExpression>();
3545
 
                        }
3546
 
                }
3547
 
                
3548
 
                public PropertySetRegion(BlockStatement block, List<AttributeSection> attributes) : 
3549
 
                                base(block, attributes) {
3550
 
                        parameters = new List<ParameterDeclarationExpression>();
3551
 
                }
3552
 
                
3553
 
                public static PropertySetRegion Null {
3554
 
                        get {
3555
 
                                return NullPropertySetRegion.Instance;
3556
 
                        }
3557
 
                }
3558
 
                
3559
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3560
 
                        return visitor.VisitPropertySetRegion(this, data);
3561
 
                }
3562
 
                
3563
 
                public override string ToString() {
3564
 
                        return string.Format("[PropertySetRegion Parameters={0} Block={1} Attributes={2} Modifier={3}]", GetCollectionString(Parameters), Block, GetCollectionString(Attributes), Modifier);
3565
 
                }
3566
 
        }
3567
 
        
3568
 
        internal sealed class NullPropertySetRegion : PropertySetRegion {
3569
 
                
3570
 
                private NullPropertySetRegion() : 
3571
 
                                base(null, null) {
3572
 
                }
3573
 
                
3574
 
                internal static NullPropertySetRegion Instance = new NullPropertySetRegion();
3575
 
                
3576
 
                public override bool IsNull {
3577
 
                        get {
3578
 
                                return true;
3579
 
                        }
3580
 
                }
3581
 
                
3582
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3583
 
                        return null;
3584
 
                }
3585
 
                
3586
 
                public override string ToString() {
3587
 
                        return "[NullPropertySetRegion]";
3588
 
                }
3589
 
        }
3590
 
        
3591
 
        public class QueryExpression : Expression {
3592
 
                
3593
 
                QueryExpressionFromClause fromClause;
3594
 
                
3595
 
                bool isQueryContinuation;
3596
 
                
3597
 
                List<QueryExpressionClause> middleClauses;
3598
 
                
3599
 
                QueryExpressionClause selectOrGroupClause;
3600
 
                
3601
 
                public QueryExpressionFromClause FromClause {
3602
 
                        get {
3603
 
                                return fromClause;
3604
 
                        }
3605
 
                        set {
3606
 
                                fromClause = value ?? QueryExpressionFromClause.Null;
3607
 
                                if (!fromClause.IsNull) fromClause.Parent = this;
3608
 
                        }
3609
 
                }
3610
 
                
3611
 
                public bool IsQueryContinuation {
3612
 
                        get {
3613
 
                                return isQueryContinuation;
3614
 
                        }
3615
 
                        set {
3616
 
                                isQueryContinuation = value;
3617
 
                        }
3618
 
                }
3619
 
                
3620
 
                public List<QueryExpressionClause> MiddleClauses {
3621
 
                        get {
3622
 
                                return middleClauses;
3623
 
                        }
3624
 
                        set {
3625
 
                                middleClauses = value ?? new List<QueryExpressionClause>();
3626
 
                        }
3627
 
                }
3628
 
                
3629
 
                public QueryExpressionClause SelectOrGroupClause {
3630
 
                        get {
3631
 
                                return selectOrGroupClause;
3632
 
                        }
3633
 
                        set {
3634
 
                                selectOrGroupClause = value ?? QueryExpressionClause.Null;
3635
 
                                if (!selectOrGroupClause.IsNull) selectOrGroupClause.Parent = this;
3636
 
                        }
3637
 
                }
3638
 
                
3639
 
                public QueryExpression() {
3640
 
                        fromClause = QueryExpressionFromClause.Null;
3641
 
                        middleClauses = new List<QueryExpressionClause>();
3642
 
                        selectOrGroupClause = QueryExpressionClause.Null;
3643
 
                }
3644
 
                
3645
 
                public new static QueryExpression Null {
3646
 
                        get {
3647
 
                                return NullQueryExpression.Instance;
3648
 
                        }
3649
 
                }
3650
 
                
3651
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3652
 
                        return visitor.VisitQueryExpression(this, data);
3653
 
                }
3654
 
                
3655
 
                public override string ToString() {
3656
 
                        return string.Format("[QueryExpression FromClause={0} IsQueryContinuation={1} MiddleClauses={2} SelectO" +
3657
 
                                        "rGroupClause={3}]", FromClause, IsQueryContinuation, GetCollectionString(MiddleClauses), SelectOrGroupClause);
3658
 
                }
3659
 
        }
3660
 
        
3661
 
        internal sealed class NullQueryExpression : QueryExpression {
3662
 
                
3663
 
                internal static NullQueryExpression Instance = new NullQueryExpression();
3664
 
                
3665
 
                public override bool IsNull {
3666
 
                        get {
3667
 
                                return true;
3668
 
                        }
3669
 
                }
3670
 
                
3671
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3672
 
                        return null;
3673
 
                }
3674
 
                
3675
 
                public override string ToString() {
3676
 
                        return "[NullQueryExpression]";
3677
 
                }
3678
 
        }
3679
 
        
3680
 
        public class QueryExpressionAggregateClause : QueryExpressionClause {
3681
 
                
3682
 
                QueryExpressionFromClause fromClause;
3683
 
                
3684
 
                List<QueryExpressionClause> middleClauses;
3685
 
                
3686
 
                List<ExpressionRangeVariable> intoVariables;
3687
 
                
3688
 
                public QueryExpressionFromClause FromClause {
3689
 
                        get {
3690
 
                                return fromClause;
3691
 
                        }
3692
 
                        set {
3693
 
                                fromClause = value ?? QueryExpressionFromClause.Null;
3694
 
                                if (!fromClause.IsNull) fromClause.Parent = this;
3695
 
                        }
3696
 
                }
3697
 
                
3698
 
                public List<QueryExpressionClause> MiddleClauses {
3699
 
                        get {
3700
 
                                return middleClauses;
3701
 
                        }
3702
 
                        set {
3703
 
                                middleClauses = value ?? new List<QueryExpressionClause>();
3704
 
                        }
3705
 
                }
3706
 
                
3707
 
                public List<ExpressionRangeVariable> IntoVariables {
3708
 
                        get {
3709
 
                                return intoVariables;
3710
 
                        }
3711
 
                        set {
3712
 
                                intoVariables = value ?? new List<ExpressionRangeVariable>();
3713
 
                        }
3714
 
                }
3715
 
                
3716
 
                public QueryExpressionAggregateClause() {
3717
 
                        fromClause = QueryExpressionFromClause.Null;
3718
 
                        middleClauses = new List<QueryExpressionClause>();
3719
 
                        intoVariables = new List<ExpressionRangeVariable>();
3720
 
                }
3721
 
                
3722
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3723
 
                        return visitor.VisitQueryExpressionAggregateClause(this, data);
3724
 
                }
3725
 
                
3726
 
                public override string ToString() {
3727
 
                        return string.Format("[QueryExpressionAggregateClause FromClause={0} MiddleClauses={1} IntoVariables={2" +
3728
 
                                        "}]", FromClause, GetCollectionString(MiddleClauses), GetCollectionString(IntoVariables));
3729
 
                }
3730
 
        }
3731
 
        
3732
 
        public abstract class QueryExpressionClause : AbstractNode, INullable {
3733
 
                
3734
 
                protected QueryExpressionClause() {
3735
 
                }
3736
 
                
3737
 
                public virtual bool IsNull {
3738
 
                        get {
3739
 
                                return false;
3740
 
                        }
3741
 
                }
3742
 
                
3743
 
                public static QueryExpressionClause Null {
3744
 
                        get {
3745
 
                                return NullQueryExpressionClause.Instance;
3746
 
                        }
3747
 
                }
3748
 
        }
3749
 
        
3750
 
        internal sealed class NullQueryExpressionClause : QueryExpressionClause {
3751
 
                
3752
 
                internal static NullQueryExpressionClause Instance = new NullQueryExpressionClause();
3753
 
                
3754
 
                public override bool IsNull {
3755
 
                        get {
3756
 
                                return true;
3757
 
                        }
3758
 
                }
3759
 
                
3760
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3761
 
                        return null;
3762
 
                }
3763
 
                
3764
 
                public override string ToString() {
3765
 
                        return "[NullQueryExpressionClause]";
3766
 
                }
3767
 
        }
3768
 
        
3769
 
        public class QueryExpressionDistinctClause : QueryExpressionClause {
3770
 
                
3771
 
                public QueryExpressionDistinctClause() {
3772
 
                }
3773
 
                
3774
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3775
 
                        return visitor.VisitQueryExpressionDistinctClause(this, data);
3776
 
                }
3777
 
                
3778
 
                public override string ToString() {
3779
 
                        return "[QueryExpressionDistinctClause]";
3780
 
                }
3781
 
        }
3782
 
        
3783
 
        public class QueryExpressionFromClause : QueryExpressionFromOrJoinClause {
3784
 
                
3785
 
                public QueryExpressionFromClause() {
3786
 
                }
3787
 
                
3788
 
                public new static QueryExpressionFromClause Null {
3789
 
                        get {
3790
 
                                return NullQueryExpressionFromClause.Instance;
3791
 
                        }
3792
 
                }
3793
 
                
3794
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3795
 
                        return visitor.VisitQueryExpressionFromClause(this, data);
3796
 
                }
3797
 
                
3798
 
                public override string ToString() {
3799
 
                        return string.Format("[QueryExpressionFromClause Type={0} Identifier={1} InExpression={2}]", Type, Identifier, InExpression);
3800
 
                }
3801
 
        }
3802
 
        
3803
 
        internal sealed class NullQueryExpressionFromClause : QueryExpressionFromClause {
3804
 
                
3805
 
                internal static NullQueryExpressionFromClause Instance = new NullQueryExpressionFromClause();
3806
 
                
3807
 
                public override bool IsNull {
3808
 
                        get {
3809
 
                                return true;
3810
 
                        }
3811
 
                }
3812
 
                
3813
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3814
 
                        return null;
3815
 
                }
3816
 
                
3817
 
                public override string ToString() {
3818
 
                        return "[NullQueryExpressionFromClause]";
3819
 
                }
3820
 
        }
3821
 
        
3822
 
        public abstract class QueryExpressionFromOrJoinClause : QueryExpressionClause {
3823
 
                
3824
 
                TypeReference type;
3825
 
                
3826
 
                string identifier;
3827
 
                
3828
 
                Expression inExpression;
3829
 
                
3830
 
                public TypeReference Type {
3831
 
                        get {
3832
 
                                return type;
3833
 
                        }
3834
 
                        set {
3835
 
                                type = value ?? TypeReference.Null;
3836
 
                                if (!type.IsNull) type.Parent = this;
3837
 
                        }
3838
 
                }
3839
 
                
3840
 
                public string Identifier {
3841
 
                        get {
3842
 
                                return identifier;
3843
 
                        }
3844
 
                        set {
3845
 
                                identifier = string.IsNullOrEmpty(value) ? "?" : value;
3846
 
                        }
3847
 
                }
3848
 
                
3849
 
                public Expression InExpression {
3850
 
                        get {
3851
 
                                return inExpression;
3852
 
                        }
3853
 
                        set {
3854
 
                                inExpression = value ?? Expression.Null;
3855
 
                                if (!inExpression.IsNull) inExpression.Parent = this;
3856
 
                        }
3857
 
                }
3858
 
                
3859
 
                protected QueryExpressionFromOrJoinClause() {
3860
 
                        type = TypeReference.Null;
3861
 
                        identifier = "?";
3862
 
                        inExpression = Expression.Null;
3863
 
                }
3864
 
        }
3865
 
        
3866
 
        public class QueryExpressionGroupClause : QueryExpressionClause {
3867
 
                
3868
 
                Expression projection;
3869
 
                
3870
 
                Expression groupBy;
3871
 
                
3872
 
                public Expression Projection {
3873
 
                        get {
3874
 
                                return projection;
3875
 
                        }
3876
 
                        set {
3877
 
                                projection = value ?? Expression.Null;
3878
 
                                if (!projection.IsNull) projection.Parent = this;
3879
 
                        }
3880
 
                }
3881
 
                
3882
 
                public Expression GroupBy {
3883
 
                        get {
3884
 
                                return groupBy;
3885
 
                        }
3886
 
                        set {
3887
 
                                groupBy = value ?? Expression.Null;
3888
 
                                if (!groupBy.IsNull) groupBy.Parent = this;
3889
 
                        }
3890
 
                }
3891
 
                
3892
 
                public QueryExpressionGroupClause() {
3893
 
                        projection = Expression.Null;
3894
 
                        groupBy = Expression.Null;
3895
 
                }
3896
 
                
3897
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3898
 
                        return visitor.VisitQueryExpressionGroupClause(this, data);
3899
 
                }
3900
 
                
3901
 
                public override string ToString() {
3902
 
                        return string.Format("[QueryExpressionGroupClause Projection={0} GroupBy={1}]", Projection, GroupBy);
3903
 
                }
3904
 
        }
3905
 
        
3906
 
        public class QueryExpressionGroupJoinVBClause : QueryExpressionClause {
3907
 
                
3908
 
                QueryExpressionJoinVBClause joinClause;
3909
 
                
3910
 
                List<ExpressionRangeVariable> intoVariables;
3911
 
                
3912
 
                public QueryExpressionJoinVBClause JoinClause {
3913
 
                        get {
3914
 
                                return joinClause;
3915
 
                        }
3916
 
                        set {
3917
 
                                joinClause = value ?? QueryExpressionJoinVBClause.Null;
3918
 
                                if (!joinClause.IsNull) joinClause.Parent = this;
3919
 
                        }
3920
 
                }
3921
 
                
3922
 
                public List<ExpressionRangeVariable> IntoVariables {
3923
 
                        get {
3924
 
                                return intoVariables;
3925
 
                        }
3926
 
                        set {
3927
 
                                intoVariables = value ?? new List<ExpressionRangeVariable>();
3928
 
                        }
3929
 
                }
3930
 
                
3931
 
                public QueryExpressionGroupJoinVBClause() {
3932
 
                        joinClause = QueryExpressionJoinVBClause.Null;
3933
 
                        intoVariables = new List<ExpressionRangeVariable>();
3934
 
                }
3935
 
                
3936
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3937
 
                        return visitor.VisitQueryExpressionGroupJoinVBClause(this, data);
3938
 
                }
3939
 
                
3940
 
                public override string ToString() {
3941
 
                        return string.Format("[QueryExpressionGroupJoinVBClause JoinClause={0} IntoVariables={1}]", JoinClause, GetCollectionString(IntoVariables));
3942
 
                }
3943
 
        }
3944
 
        
3945
 
        public class QueryExpressionGroupVBClause : QueryExpressionClause {
3946
 
                
3947
 
                List<ExpressionRangeVariable> groupVariables;
3948
 
                
3949
 
                List<ExpressionRangeVariable> byVariables;
3950
 
                
3951
 
                List<ExpressionRangeVariable> intoVariables;
3952
 
                
3953
 
                public List<ExpressionRangeVariable> GroupVariables {
3954
 
                        get {
3955
 
                                return groupVariables;
3956
 
                        }
3957
 
                        set {
3958
 
                                groupVariables = value ?? new List<ExpressionRangeVariable>();
3959
 
                        }
3960
 
                }
3961
 
                
3962
 
                public List<ExpressionRangeVariable> ByVariables {
3963
 
                        get {
3964
 
                                return byVariables;
3965
 
                        }
3966
 
                        set {
3967
 
                                byVariables = value ?? new List<ExpressionRangeVariable>();
3968
 
                        }
3969
 
                }
3970
 
                
3971
 
                public List<ExpressionRangeVariable> IntoVariables {
3972
 
                        get {
3973
 
                                return intoVariables;
3974
 
                        }
3975
 
                        set {
3976
 
                                intoVariables = value ?? new List<ExpressionRangeVariable>();
3977
 
                        }
3978
 
                }
3979
 
                
3980
 
                public QueryExpressionGroupVBClause() {
3981
 
                        groupVariables = new List<ExpressionRangeVariable>();
3982
 
                        byVariables = new List<ExpressionRangeVariable>();
3983
 
                        intoVariables = new List<ExpressionRangeVariable>();
3984
 
                }
3985
 
                
3986
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
3987
 
                        return visitor.VisitQueryExpressionGroupVBClause(this, data);
3988
 
                }
3989
 
                
3990
 
                public override string ToString() {
3991
 
                        return string.Format("[QueryExpressionGroupVBClause GroupVariables={0} ByVariables={1} IntoVariables={2" +
3992
 
                                        "}]", GetCollectionString(GroupVariables), GetCollectionString(ByVariables), GetCollectionString(IntoVariables));
3993
 
                }
3994
 
        }
3995
 
        
3996
 
        public class QueryExpressionJoinClause : QueryExpressionFromOrJoinClause {
3997
 
                
3998
 
                Expression onExpression;
3999
 
                
4000
 
                Expression equalsExpression;
4001
 
                
4002
 
                string intoIdentifier;
4003
 
                
4004
 
                public Expression OnExpression {
4005
 
                        get {
4006
 
                                return onExpression;
4007
 
                        }
4008
 
                        set {
4009
 
                                onExpression = value ?? Expression.Null;
4010
 
                                if (!onExpression.IsNull) onExpression.Parent = this;
4011
 
                        }
4012
 
                }
4013
 
                
4014
 
                public Expression EqualsExpression {
4015
 
                        get {
4016
 
                                return equalsExpression;
4017
 
                        }
4018
 
                        set {
4019
 
                                equalsExpression = value ?? Expression.Null;
4020
 
                                if (!equalsExpression.IsNull) equalsExpression.Parent = this;
4021
 
                        }
4022
 
                }
4023
 
                
4024
 
                public string IntoIdentifier {
4025
 
                        get {
4026
 
                                return intoIdentifier;
4027
 
                        }
4028
 
                        set {
4029
 
                                intoIdentifier = value ?? "";
4030
 
                        }
4031
 
                }
4032
 
                
4033
 
                public QueryExpressionJoinClause() {
4034
 
                        onExpression = Expression.Null;
4035
 
                        equalsExpression = Expression.Null;
4036
 
                        intoIdentifier = "";
4037
 
                }
4038
 
                
4039
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4040
 
                        return visitor.VisitQueryExpressionJoinClause(this, data);
4041
 
                }
4042
 
                
4043
 
                public override string ToString() {
4044
 
                        return string.Format("[QueryExpressionJoinClause OnExpression={0} EqualsExpression={1} IntoIdentifier={" +
4045
 
                                        "2} Type={3} Identifier={4} InExpression={5}]", OnExpression, EqualsExpression, IntoIdentifier, Type, Identifier, InExpression);
4046
 
                }
4047
 
        }
4048
 
        
4049
 
        public class QueryExpressionJoinConditionVB : AbstractNode {
4050
 
                
4051
 
                Expression leftSide;
4052
 
                
4053
 
                Expression rightSide;
4054
 
                
4055
 
                public Expression LeftSide {
4056
 
                        get {
4057
 
                                return leftSide;
4058
 
                        }
4059
 
                        set {
4060
 
                                leftSide = value ?? Expression.Null;
4061
 
                                if (!leftSide.IsNull) leftSide.Parent = this;
4062
 
                        }
4063
 
                }
4064
 
                
4065
 
                public Expression RightSide {
4066
 
                        get {
4067
 
                                return rightSide;
4068
 
                        }
4069
 
                        set {
4070
 
                                rightSide = value ?? Expression.Null;
4071
 
                                if (!rightSide.IsNull) rightSide.Parent = this;
4072
 
                        }
4073
 
                }
4074
 
                
4075
 
                public QueryExpressionJoinConditionVB() {
4076
 
                        leftSide = Expression.Null;
4077
 
                        rightSide = Expression.Null;
4078
 
                }
4079
 
                
4080
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4081
 
                        return visitor.VisitQueryExpressionJoinConditionVB(this, data);
4082
 
                }
4083
 
                
4084
 
                public override string ToString() {
4085
 
                        return string.Format("[QueryExpressionJoinConditionVB LeftSide={0} RightSide={1}]", LeftSide, RightSide);
4086
 
                }
4087
 
        }
4088
 
        
4089
 
        public class QueryExpressionJoinVBClause : QueryExpressionClause {
4090
 
                
4091
 
                QueryExpressionFromClause joinVariable;
4092
 
                
4093
 
                QueryExpressionJoinVBClause subJoin;
4094
 
                
4095
 
                List<QueryExpressionJoinConditionVB> conditions;
4096
 
                
4097
 
                public QueryExpressionFromClause JoinVariable {
4098
 
                        get {
4099
 
                                return joinVariable;
4100
 
                        }
4101
 
                        set {
4102
 
                                joinVariable = value ?? QueryExpressionFromClause.Null;
4103
 
                                if (!joinVariable.IsNull) joinVariable.Parent = this;
4104
 
                        }
4105
 
                }
4106
 
                
4107
 
                public QueryExpressionJoinVBClause SubJoin {
4108
 
                        get {
4109
 
                                return subJoin;
4110
 
                        }
4111
 
                        set {
4112
 
                                subJoin = value ?? QueryExpressionJoinVBClause.Null;
4113
 
                                if (!subJoin.IsNull) subJoin.Parent = this;
4114
 
                        }
4115
 
                }
4116
 
                
4117
 
                public List<QueryExpressionJoinConditionVB> Conditions {
4118
 
                        get {
4119
 
                                return conditions;
4120
 
                        }
4121
 
                        set {
4122
 
                                conditions = value ?? new List<QueryExpressionJoinConditionVB>();
4123
 
                        }
4124
 
                }
4125
 
                
4126
 
                public QueryExpressionJoinVBClause() {
4127
 
                        joinVariable = QueryExpressionFromClause.Null;
4128
 
                        subJoin = QueryExpressionJoinVBClause.Null;
4129
 
                        conditions = new List<QueryExpressionJoinConditionVB>();
4130
 
                }
4131
 
                
4132
 
                public new static QueryExpressionJoinVBClause Null {
4133
 
                        get {
4134
 
                                return NullQueryExpressionJoinVBClause.Instance;
4135
 
                        }
4136
 
                }
4137
 
                
4138
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4139
 
                        return visitor.VisitQueryExpressionJoinVBClause(this, data);
4140
 
                }
4141
 
                
4142
 
                public override string ToString() {
4143
 
                        return string.Format("[QueryExpressionJoinVBClause JoinVariable={0} SubJoin={1} Conditions={2}]", JoinVariable, SubJoin, GetCollectionString(Conditions));
4144
 
                }
4145
 
        }
4146
 
        
4147
 
        internal sealed class NullQueryExpressionJoinVBClause : QueryExpressionJoinVBClause {
4148
 
                
4149
 
                internal static NullQueryExpressionJoinVBClause Instance = new NullQueryExpressionJoinVBClause();
4150
 
                
4151
 
                public override bool IsNull {
4152
 
                        get {
4153
 
                                return true;
4154
 
                        }
4155
 
                }
4156
 
                
4157
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4158
 
                        return null;
4159
 
                }
4160
 
                
4161
 
                public override string ToString() {
4162
 
                        return "[NullQueryExpressionJoinVBClause]";
4163
 
                }
4164
 
        }
4165
 
        
4166
 
        public class QueryExpressionLetClause : QueryExpressionClause {
4167
 
                
4168
 
                string identifier;
4169
 
                
4170
 
                Expression expression;
4171
 
                
4172
 
                public string Identifier {
4173
 
                        get {
4174
 
                                return identifier;
4175
 
                        }
4176
 
                        set {
4177
 
                                identifier = string.IsNullOrEmpty(value) ? "?" : value;
4178
 
                        }
4179
 
                }
4180
 
                
4181
 
                public Expression Expression {
4182
 
                        get {
4183
 
                                return expression;
4184
 
                        }
4185
 
                        set {
4186
 
                                expression = value ?? Expression.Null;
4187
 
                                if (!expression.IsNull) expression.Parent = this;
4188
 
                        }
4189
 
                }
4190
 
                
4191
 
                public QueryExpressionLetClause() {
4192
 
                        identifier = "?";
4193
 
                        expression = Expression.Null;
4194
 
                }
4195
 
                
4196
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4197
 
                        return visitor.VisitQueryExpressionLetClause(this, data);
4198
 
                }
4199
 
                
4200
 
                public override string ToString() {
4201
 
                        return string.Format("[QueryExpressionLetClause Identifier={0} Expression={1}]", Identifier, Expression);
4202
 
                }
4203
 
        }
4204
 
        
4205
 
        public class QueryExpressionLetVBClause : QueryExpressionClause {
4206
 
                
4207
 
                List<ExpressionRangeVariable> variables;
4208
 
                
4209
 
                public List<ExpressionRangeVariable> Variables {
4210
 
                        get {
4211
 
                                return variables;
4212
 
                        }
4213
 
                        set {
4214
 
                                variables = value ?? new List<ExpressionRangeVariable>();
4215
 
                        }
4216
 
                }
4217
 
                
4218
 
                public QueryExpressionLetVBClause() {
4219
 
                        variables = new List<ExpressionRangeVariable>();
4220
 
                }
4221
 
                
4222
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4223
 
                        return visitor.VisitQueryExpressionLetVBClause(this, data);
4224
 
                }
4225
 
                
4226
 
                public override string ToString() {
4227
 
                        return string.Format("[QueryExpressionLetVBClause Variables={0}]", GetCollectionString(Variables));
4228
 
                }
4229
 
        }
4230
 
        
4231
 
        public class QueryExpressionOrderClause : QueryExpressionClause {
4232
 
                
4233
 
                List<QueryExpressionOrdering> orderings;
4234
 
                
4235
 
                public List<QueryExpressionOrdering> Orderings {
4236
 
                        get {
4237
 
                                return orderings;
4238
 
                        }
4239
 
                        set {
4240
 
                                orderings = value ?? new List<QueryExpressionOrdering>();
4241
 
                        }
4242
 
                }
4243
 
                
4244
 
                public QueryExpressionOrderClause() {
4245
 
                        orderings = new List<QueryExpressionOrdering>();
4246
 
                }
4247
 
                
4248
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4249
 
                        return visitor.VisitQueryExpressionOrderClause(this, data);
4250
 
                }
4251
 
                
4252
 
                public override string ToString() {
4253
 
                        return string.Format("[QueryExpressionOrderClause Orderings={0}]", GetCollectionString(Orderings));
4254
 
                }
4255
 
        }
4256
 
        
4257
 
        public class QueryExpressionOrdering : AbstractNode {
4258
 
                
4259
 
                Expression criteria;
4260
 
                
4261
 
                QueryExpressionOrderingDirection direction;
4262
 
                
4263
 
                public Expression Criteria {
4264
 
                        get {
4265
 
                                return criteria;
4266
 
                        }
4267
 
                        set {
4268
 
                                criteria = value ?? Expression.Null;
4269
 
                                if (!criteria.IsNull) criteria.Parent = this;
4270
 
                        }
4271
 
                }
4272
 
                
4273
 
                public QueryExpressionOrderingDirection Direction {
4274
 
                        get {
4275
 
                                return direction;
4276
 
                        }
4277
 
                        set {
4278
 
                                direction = value;
4279
 
                        }
4280
 
                }
4281
 
                
4282
 
                public QueryExpressionOrdering() {
4283
 
                        criteria = Expression.Null;
4284
 
                }
4285
 
                
4286
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4287
 
                        return visitor.VisitQueryExpressionOrdering(this, data);
4288
 
                }
4289
 
                
4290
 
                public override string ToString() {
4291
 
                        return string.Format("[QueryExpressionOrdering Criteria={0} Direction={1}]", Criteria, Direction);
4292
 
                }
4293
 
        }
4294
 
        
4295
 
        public class QueryExpressionPartitionVBClause : QueryExpressionClause {
4296
 
                
4297
 
                Expression expression;
4298
 
                
4299
 
                QueryExpressionPartitionType partitionType;
4300
 
                
4301
 
                public Expression Expression {
4302
 
                        get {
4303
 
                                return expression;
4304
 
                        }
4305
 
                        set {
4306
 
                                expression = value ?? Expression.Null;
4307
 
                                if (!expression.IsNull) expression.Parent = this;
4308
 
                        }
4309
 
                }
4310
 
                
4311
 
                public QueryExpressionPartitionType PartitionType {
4312
 
                        get {
4313
 
                                return partitionType;
4314
 
                        }
4315
 
                        set {
4316
 
                                partitionType = value;
4317
 
                        }
4318
 
                }
4319
 
                
4320
 
                public QueryExpressionPartitionVBClause() {
4321
 
                        expression = Expression.Null;
4322
 
                }
4323
 
                
4324
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4325
 
                        return visitor.VisitQueryExpressionPartitionVBClause(this, data);
4326
 
                }
4327
 
                
4328
 
                public override string ToString() {
4329
 
                        return string.Format("[QueryExpressionPartitionVBClause Expression={0} PartitionType={1}]", Expression, PartitionType);
4330
 
                }
4331
 
        }
4332
 
        
4333
 
        public class QueryExpressionSelectClause : QueryExpressionClause {
4334
 
                
4335
 
                Expression projection;
4336
 
                
4337
 
                public Expression Projection {
4338
 
                        get {
4339
 
                                return projection;
4340
 
                        }
4341
 
                        set {
4342
 
                                projection = value ?? Expression.Null;
4343
 
                                if (!projection.IsNull) projection.Parent = this;
4344
 
                        }
4345
 
                }
4346
 
                
4347
 
                public QueryExpressionSelectClause() {
4348
 
                        projection = Expression.Null;
4349
 
                }
4350
 
                
4351
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4352
 
                        return visitor.VisitQueryExpressionSelectClause(this, data);
4353
 
                }
4354
 
                
4355
 
                public override string ToString() {
4356
 
                        return string.Format("[QueryExpressionSelectClause Projection={0}]", Projection);
4357
 
                }
4358
 
        }
4359
 
        
4360
 
        public class QueryExpressionSelectVBClause : QueryExpressionClause {
4361
 
                
4362
 
                List<ExpressionRangeVariable> variables;
4363
 
                
4364
 
                public List<ExpressionRangeVariable> Variables {
4365
 
                        get {
4366
 
                                return variables;
4367
 
                        }
4368
 
                        set {
4369
 
                                variables = value ?? new List<ExpressionRangeVariable>();
4370
 
                        }
4371
 
                }
4372
 
                
4373
 
                public QueryExpressionSelectVBClause() {
4374
 
                        variables = new List<ExpressionRangeVariable>();
4375
 
                }
4376
 
                
4377
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4378
 
                        return visitor.VisitQueryExpressionSelectVBClause(this, data);
4379
 
                }
4380
 
                
4381
 
                public override string ToString() {
4382
 
                        return string.Format("[QueryExpressionSelectVBClause Variables={0}]", GetCollectionString(Variables));
4383
 
                }
4384
 
        }
4385
 
        
4386
 
        public class QueryExpressionWhereClause : QueryExpressionClause {
4387
 
                
4388
 
                Expression condition;
4389
 
                
4390
 
                public Expression Condition {
4391
 
                        get {
4392
 
                                return condition;
4393
 
                        }
4394
 
                        set {
4395
 
                                condition = value ?? Expression.Null;
4396
 
                                if (!condition.IsNull) condition.Parent = this;
4397
 
                        }
4398
 
                }
4399
 
                
4400
 
                public QueryExpressionWhereClause() {
4401
 
                        condition = Expression.Null;
4402
 
                }
4403
 
                
4404
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4405
 
                        return visitor.VisitQueryExpressionWhereClause(this, data);
4406
 
                }
4407
 
                
4408
 
                public override string ToString() {
4409
 
                        return string.Format("[QueryExpressionWhereClause Condition={0}]", Condition);
4410
 
                }
4411
 
        }
4412
 
        
4413
 
        public class RaiseEventStatement : Statement {
4414
 
                
4415
 
                string eventName;
4416
 
                
4417
 
                List<Expression> arguments;
4418
 
                
4419
 
                public string EventName {
4420
 
                        get {
4421
 
                                return eventName;
4422
 
                        }
4423
 
                        set {
4424
 
                                eventName = value ?? "";
4425
 
                        }
4426
 
                }
4427
 
                
4428
 
                public List<Expression> Arguments {
4429
 
                        get {
4430
 
                                return arguments;
4431
 
                        }
4432
 
                        set {
4433
 
                                arguments = value ?? new List<Expression>();
4434
 
                        }
4435
 
                }
4436
 
                
4437
 
                public RaiseEventStatement(string eventName, List<Expression> arguments) {
4438
 
                        EventName = eventName;
4439
 
                        Arguments = arguments;
4440
 
                }
4441
 
                
4442
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4443
 
                        return visitor.VisitRaiseEventStatement(this, data);
4444
 
                }
4445
 
                
4446
 
                public override string ToString() {
4447
 
                        return string.Format("[RaiseEventStatement EventName={0} Arguments={1}]", EventName, GetCollectionString(Arguments));
4448
 
                }
4449
 
        }
4450
 
        
4451
 
        public class ReDimStatement : Statement {
4452
 
                
4453
 
                List<InvocationExpression> reDimClauses;
4454
 
                
4455
 
                bool isPreserve;
4456
 
                
4457
 
                public List<InvocationExpression> ReDimClauses {
4458
 
                        get {
4459
 
                                return reDimClauses;
4460
 
                        }
4461
 
                        set {
4462
 
                                reDimClauses = value ?? new List<InvocationExpression>();
4463
 
                        }
4464
 
                }
4465
 
                
4466
 
                public bool IsPreserve {
4467
 
                        get {
4468
 
                                return isPreserve;
4469
 
                        }
4470
 
                        set {
4471
 
                                isPreserve = value;
4472
 
                        }
4473
 
                }
4474
 
                
4475
 
                public ReDimStatement(bool isPreserve) {
4476
 
                        IsPreserve = isPreserve;
4477
 
                        reDimClauses = new List<InvocationExpression>();
4478
 
                }
4479
 
                
4480
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4481
 
                        return visitor.VisitReDimStatement(this, data);
4482
 
                }
4483
 
                
4484
 
                public override string ToString() {
4485
 
                        return string.Format("[ReDimStatement ReDimClauses={0} IsPreserve={1}]", GetCollectionString(ReDimClauses), IsPreserve);
4486
 
                }
4487
 
        }
4488
 
        
4489
 
        public class RemoveHandlerStatement : Statement {
4490
 
                
4491
 
                Expression eventExpression;
4492
 
                
4493
 
                Expression handlerExpression;
4494
 
                
4495
 
                public Expression EventExpression {
4496
 
                        get {
4497
 
                                return eventExpression;
4498
 
                        }
4499
 
                        set {
4500
 
                                eventExpression = value ?? Expression.Null;
4501
 
                                if (!eventExpression.IsNull) eventExpression.Parent = this;
4502
 
                        }
4503
 
                }
4504
 
                
4505
 
                public Expression HandlerExpression {
4506
 
                        get {
4507
 
                                return handlerExpression;
4508
 
                        }
4509
 
                        set {
4510
 
                                handlerExpression = value ?? Expression.Null;
4511
 
                                if (!handlerExpression.IsNull) handlerExpression.Parent = this;
4512
 
                        }
4513
 
                }
4514
 
                
4515
 
                public RemoveHandlerStatement(Expression eventExpression, Expression handlerExpression) {
4516
 
                        EventExpression = eventExpression;
4517
 
                        HandlerExpression = handlerExpression;
4518
 
                }
4519
 
                
4520
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4521
 
                        return visitor.VisitRemoveHandlerStatement(this, data);
4522
 
                }
4523
 
                
4524
 
                public override string ToString() {
4525
 
                        return string.Format("[RemoveHandlerStatement EventExpression={0} HandlerExpression={1}]", EventExpression, HandlerExpression);
4526
 
                }
4527
 
        }
4528
 
        
4529
 
        public class ResumeStatement : Statement {
4530
 
                
4531
 
                string labelName;
4532
 
                
4533
 
                bool isResumeNext;
4534
 
                
4535
 
                public string LabelName {
4536
 
                        get {
4537
 
                                return labelName;
4538
 
                        }
4539
 
                        set {
4540
 
                                labelName = value ?? "";
4541
 
                        }
4542
 
                }
4543
 
                
4544
 
                public bool IsResumeNext {
4545
 
                        get {
4546
 
                                return isResumeNext;
4547
 
                        }
4548
 
                        set {
4549
 
                                isResumeNext = value;
4550
 
                        }
4551
 
                }
4552
 
                
4553
 
                public ResumeStatement(bool isResumeNext) {
4554
 
                        IsResumeNext = isResumeNext;
4555
 
                        labelName = "";
4556
 
                }
4557
 
                
4558
 
                public ResumeStatement(string labelName) {
4559
 
                        LabelName = labelName;
4560
 
                }
4561
 
                
4562
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4563
 
                        return visitor.VisitResumeStatement(this, data);
4564
 
                }
4565
 
                
4566
 
                public override string ToString() {
4567
 
                        return string.Format("[ResumeStatement LabelName={0} IsResumeNext={1}]", LabelName, IsResumeNext);
4568
 
                }
4569
 
        }
4570
 
        
4571
 
        public class ReturnStatement : Statement {
4572
 
                
4573
 
                Expression expression;
4574
 
                
4575
 
                public Expression Expression {
4576
 
                        get {
4577
 
                                return expression;
4578
 
                        }
4579
 
                        set {
4580
 
                                expression = value ?? Expression.Null;
4581
 
                                if (!expression.IsNull) expression.Parent = this;
4582
 
                        }
4583
 
                }
4584
 
                
4585
 
                public ReturnStatement(Expression expression) {
4586
 
                        Expression = expression;
4587
 
                }
4588
 
                
4589
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4590
 
                        return visitor.VisitReturnStatement(this, data);
4591
 
                }
4592
 
                
4593
 
                public override string ToString() {
4594
 
                        return string.Format("[ReturnStatement Expression={0}]", Expression);
4595
 
                }
4596
 
        }
4597
 
        
4598
 
        public class SizeOfExpression : Expression {
4599
 
                
4600
 
                TypeReference typeReference;
4601
 
                
4602
 
                public TypeReference TypeReference {
4603
 
                        get {
4604
 
                                return typeReference;
4605
 
                        }
4606
 
                        set {
4607
 
                                typeReference = value ?? TypeReference.Null;
4608
 
                                if (!typeReference.IsNull) typeReference.Parent = this;
4609
 
                        }
4610
 
                }
4611
 
                
4612
 
                public SizeOfExpression(TypeReference typeReference) {
4613
 
                        TypeReference = typeReference;
4614
 
                }
4615
 
                
4616
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4617
 
                        return visitor.VisitSizeOfExpression(this, data);
4618
 
                }
4619
 
                
4620
 
                public override string ToString() {
4621
 
                        return string.Format("[SizeOfExpression TypeReference={0}]", TypeReference);
4622
 
                }
4623
 
        }
4624
 
        
4625
 
        public class StackAllocExpression : Expression {
4626
 
                
4627
 
                TypeReference typeReference;
4628
 
                
4629
 
                Expression expression;
4630
 
                
4631
 
                public TypeReference TypeReference {
4632
 
                        get {
4633
 
                                return typeReference;
4634
 
                        }
4635
 
                        set {
4636
 
                                typeReference = value ?? TypeReference.Null;
4637
 
                                if (!typeReference.IsNull) typeReference.Parent = this;
4638
 
                        }
4639
 
                }
4640
 
                
4641
 
                public Expression Expression {
4642
 
                        get {
4643
 
                                return expression;
4644
 
                        }
4645
 
                        set {
4646
 
                                expression = value ?? Expression.Null;
4647
 
                                if (!expression.IsNull) expression.Parent = this;
4648
 
                        }
4649
 
                }
4650
 
                
4651
 
                public StackAllocExpression(TypeReference typeReference, Expression expression) {
4652
 
                        TypeReference = typeReference;
4653
 
                        Expression = expression;
4654
 
                }
4655
 
                
4656
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4657
 
                        return visitor.VisitStackAllocExpression(this, data);
4658
 
                }
4659
 
                
4660
 
                public override string ToString() {
4661
 
                        return string.Format("[StackAllocExpression TypeReference={0} Expression={1}]", TypeReference, Expression);
4662
 
                }
4663
 
        }
4664
 
        
4665
 
        public class StopStatement : Statement {
4666
 
                
4667
 
                public StopStatement() {
4668
 
                }
4669
 
                
4670
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4671
 
                        return visitor.VisitStopStatement(this, data);
4672
 
                }
4673
 
                
4674
 
                public override string ToString() {
4675
 
                        return "[StopStatement]";
4676
 
                }
4677
 
        }
4678
 
        
4679
 
        public class SwitchSection : BlockStatement {
4680
 
                
4681
 
                List<CaseLabel> switchLabels;
4682
 
                
4683
 
                public List<CaseLabel> SwitchLabels {
4684
 
                        get {
4685
 
                                return switchLabels;
4686
 
                        }
4687
 
                        set {
4688
 
                                switchLabels = value ?? new List<CaseLabel>();
4689
 
                        }
4690
 
                }
4691
 
                
4692
 
                public SwitchSection() {
4693
 
                        switchLabels = new List<CaseLabel>();
4694
 
                }
4695
 
                
4696
 
                public SwitchSection(List<CaseLabel> switchLabels) {
4697
 
                        SwitchLabels = switchLabels;
4698
 
                }
4699
 
                
4700
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4701
 
                        return visitor.VisitSwitchSection(this, data);
4702
 
                }
4703
 
                
4704
 
                public override string ToString() {
4705
 
                        return string.Format("[SwitchSection SwitchLabels={0}]", GetCollectionString(SwitchLabels));
4706
 
                }
4707
 
        }
4708
 
        
4709
 
        public class SwitchStatement : Statement {
4710
 
                
4711
 
                Expression switchExpression;
4712
 
                
4713
 
                List<SwitchSection> switchSections;
4714
 
                
4715
 
                public Expression SwitchExpression {
4716
 
                        get {
4717
 
                                return switchExpression;
4718
 
                        }
4719
 
                        set {
4720
 
                                switchExpression = value ?? Expression.Null;
4721
 
                                if (!switchExpression.IsNull) switchExpression.Parent = this;
4722
 
                        }
4723
 
                }
4724
 
                
4725
 
                public List<SwitchSection> SwitchSections {
4726
 
                        get {
4727
 
                                return switchSections;
4728
 
                        }
4729
 
                        set {
4730
 
                                switchSections = value ?? new List<SwitchSection>();
4731
 
                        }
4732
 
                }
4733
 
                
4734
 
                public SwitchStatement(Expression switchExpression, List<SwitchSection> switchSections) {
4735
 
                        SwitchExpression = switchExpression;
4736
 
                        SwitchSections = switchSections;
4737
 
                }
4738
 
                
4739
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4740
 
                        return visitor.VisitSwitchStatement(this, data);
4741
 
                }
4742
 
                
4743
 
                public override string ToString() {
4744
 
                        return string.Format("[SwitchStatement SwitchExpression={0} SwitchSections={1}]", SwitchExpression, GetCollectionString(SwitchSections));
4745
 
                }
4746
 
        }
4747
 
        
4748
 
        public class TemplateDefinition : AttributedNode {
4749
 
                
4750
 
                string name;
4751
 
                
4752
 
                List<TypeReference> bases;
4753
 
                
4754
 
                public string Name {
4755
 
                        get {
4756
 
                                return name;
4757
 
                        }
4758
 
                        set {
4759
 
                                name = string.IsNullOrEmpty(value) ? "?" : value;
4760
 
                        }
4761
 
                }
4762
 
                
4763
 
                public List<TypeReference> Bases {
4764
 
                        get {
4765
 
                                return bases;
4766
 
                        }
4767
 
                        set {
4768
 
                                bases = value ?? new List<TypeReference>();
4769
 
                        }
4770
 
                }
4771
 
                
4772
 
                public TemplateDefinition(string name, List<AttributeSection> attributes) {
4773
 
                        Name = name;
4774
 
                        Attributes = attributes;
4775
 
                        bases = new List<TypeReference>();
4776
 
                }
4777
 
                
4778
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4779
 
                        return visitor.VisitTemplateDefinition(this, data);
4780
 
                }
4781
 
                
4782
 
                public override string ToString() {
4783
 
                        return string.Format("[TemplateDefinition Name={0} Bases={1} Attributes={2} Modifier={3}]", Name, GetCollectionString(Bases), GetCollectionString(Attributes), Modifier);
4784
 
                }
4785
 
        }
4786
 
        
4787
 
        public class ThisReferenceExpression : Expression {
4788
 
                
4789
 
                public ThisReferenceExpression() {
4790
 
                }
4791
 
                
4792
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4793
 
                        return visitor.VisitThisReferenceExpression(this, data);
4794
 
                }
4795
 
                
4796
 
                public override string ToString() {
4797
 
                        return "[ThisReferenceExpression]";
4798
 
                }
4799
 
        }
4800
 
        
4801
 
        public class ThrowStatement : Statement {
4802
 
                
4803
 
                Expression expression;
4804
 
                
4805
 
                public Expression Expression {
4806
 
                        get {
4807
 
                                return expression;
4808
 
                        }
4809
 
                        set {
4810
 
                                expression = value ?? Expression.Null;
4811
 
                                if (!expression.IsNull) expression.Parent = this;
4812
 
                        }
4813
 
                }
4814
 
                
4815
 
                public ThrowStatement(Expression expression) {
4816
 
                        Expression = expression;
4817
 
                }
4818
 
                
4819
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4820
 
                        return visitor.VisitThrowStatement(this, data);
4821
 
                }
4822
 
                
4823
 
                public override string ToString() {
4824
 
                        return string.Format("[ThrowStatement Expression={0}]", Expression);
4825
 
                }
4826
 
        }
4827
 
        
4828
 
        public class TryCatchStatement : Statement {
4829
 
                
4830
 
                Statement statementBlock;
4831
 
                
4832
 
                List<CatchClause> catchClauses;
4833
 
                
4834
 
                Statement finallyBlock;
4835
 
                
4836
 
                public Statement StatementBlock {
4837
 
                        get {
4838
 
                                return statementBlock;
4839
 
                        }
4840
 
                        set {
4841
 
                                statementBlock = value ?? Statement.Null;
4842
 
                                if (!statementBlock.IsNull) statementBlock.Parent = this;
4843
 
                        }
4844
 
                }
4845
 
                
4846
 
                public List<CatchClause> CatchClauses {
4847
 
                        get {
4848
 
                                return catchClauses;
4849
 
                        }
4850
 
                        set {
4851
 
                                catchClauses = value ?? new List<CatchClause>();
4852
 
                        }
4853
 
                }
4854
 
                
4855
 
                public Statement FinallyBlock {
4856
 
                        get {
4857
 
                                return finallyBlock;
4858
 
                        }
4859
 
                        set {
4860
 
                                finallyBlock = value ?? Statement.Null;
4861
 
                                if (!finallyBlock.IsNull) finallyBlock.Parent = this;
4862
 
                        }
4863
 
                }
4864
 
                
4865
 
                public TryCatchStatement(Statement statementBlock, List<CatchClause> catchClauses, Statement finallyBlock) {
4866
 
                        StatementBlock = statementBlock;
4867
 
                        CatchClauses = catchClauses;
4868
 
                        FinallyBlock = finallyBlock;
4869
 
                }
4870
 
                
4871
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4872
 
                        return visitor.VisitTryCatchStatement(this, data);
4873
 
                }
4874
 
                
4875
 
                public override string ToString() {
4876
 
                        return string.Format("[TryCatchStatement StatementBlock={0} CatchClauses={1} FinallyBlock={2}]", StatementBlock, GetCollectionString(CatchClauses), FinallyBlock);
4877
 
                }
4878
 
        }
4879
 
        
4880
 
        public class TypeDeclaration : AttributedNode {
4881
 
                
4882
 
                string name;
4883
 
                
4884
 
                ClassType type;
4885
 
                
4886
 
                List<TypeReference> baseTypes;
4887
 
                
4888
 
                List<TemplateDefinition> templates;
4889
 
                
4890
 
                Location bodyStartLocation;
4891
 
                
4892
 
                public string Name {
4893
 
                        get {
4894
 
                                return name;
4895
 
                        }
4896
 
                        set {
4897
 
                                name = value ?? "";
4898
 
                        }
4899
 
                }
4900
 
                
4901
 
                public ClassType Type {
4902
 
                        get {
4903
 
                                return type;
4904
 
                        }
4905
 
                        set {
4906
 
                                type = value;
4907
 
                        }
4908
 
                }
4909
 
                
4910
 
                public List<TypeReference> BaseTypes {
4911
 
                        get {
4912
 
                                return baseTypes;
4913
 
                        }
4914
 
                        set {
4915
 
                                baseTypes = value ?? new List<TypeReference>();
4916
 
                        }
4917
 
                }
4918
 
                
4919
 
                public List<TemplateDefinition> Templates {
4920
 
                        get {
4921
 
                                return templates;
4922
 
                        }
4923
 
                        set {
4924
 
                                templates = value ?? new List<TemplateDefinition>();
4925
 
                        }
4926
 
                }
4927
 
                
4928
 
                public Location BodyStartLocation {
4929
 
                        get {
4930
 
                                return bodyStartLocation;
4931
 
                        }
4932
 
                        set {
4933
 
                                bodyStartLocation = value;
4934
 
                        }
4935
 
                }
4936
 
                
4937
 
                public TypeDeclaration(Modifiers modifier, List<AttributeSection> attributes) {
4938
 
                        Modifier = modifier;
4939
 
                        Attributes = attributes;
4940
 
                        name = "";
4941
 
                        baseTypes = new List<TypeReference>();
4942
 
                        templates = new List<TemplateDefinition>();
4943
 
                        bodyStartLocation = Location.Empty;
4944
 
                }
4945
 
                
4946
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4947
 
                        return visitor.VisitTypeDeclaration(this, data);
4948
 
                }
4949
 
                
4950
 
                public override string ToString() {
4951
 
                        return string.Format("[TypeDeclaration Name={0} Type={1} BaseTypes={2} Templates={3} BodyStartLocation=" +
4952
 
                                        "{4} Attributes={5} Modifier={6}]", Name, Type, GetCollectionString(BaseTypes), GetCollectionString(Templates), BodyStartLocation, GetCollectionString(Attributes), Modifier);
4953
 
                }
4954
 
        }
4955
 
        
4956
 
        public class TypeOfExpression : Expression {
4957
 
                
4958
 
                TypeReference typeReference;
4959
 
                
4960
 
                public TypeReference TypeReference {
4961
 
                        get {
4962
 
                                return typeReference;
4963
 
                        }
4964
 
                        set {
4965
 
                                typeReference = value ?? TypeReference.Null;
4966
 
                                if (!typeReference.IsNull) typeReference.Parent = this;
4967
 
                        }
4968
 
                }
4969
 
                
4970
 
                public TypeOfExpression(TypeReference typeReference) {
4971
 
                        TypeReference = typeReference;
4972
 
                }
4973
 
                
4974
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
4975
 
                        return visitor.VisitTypeOfExpression(this, data);
4976
 
                }
4977
 
                
4978
 
                public override string ToString() {
4979
 
                        return string.Format("[TypeOfExpression TypeReference={0}]", TypeReference);
4980
 
                }
4981
 
        }
4982
 
        
4983
 
        public class TypeOfIsExpression : Expression {
4984
 
                
4985
 
                Expression expression;
4986
 
                
4987
 
                TypeReference typeReference;
4988
 
                
4989
 
                public Expression Expression {
4990
 
                        get {
4991
 
                                return expression;
4992
 
                        }
4993
 
                        set {
4994
 
                                expression = value ?? Expression.Null;
4995
 
                                if (!expression.IsNull) expression.Parent = this;
4996
 
                        }
4997
 
                }
4998
 
                
4999
 
                public TypeReference TypeReference {
5000
 
                        get {
5001
 
                                return typeReference;
5002
 
                        }
5003
 
                        set {
5004
 
                                typeReference = value ?? TypeReference.Null;
5005
 
                                if (!typeReference.IsNull) typeReference.Parent = this;
5006
 
                        }
5007
 
                }
5008
 
                
5009
 
                public TypeOfIsExpression(Expression expression, TypeReference typeReference) {
5010
 
                        Expression = expression;
5011
 
                        TypeReference = typeReference;
5012
 
                }
5013
 
                
5014
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
5015
 
                        return visitor.VisitTypeOfIsExpression(this, data);
5016
 
                }
5017
 
                
5018
 
                public override string ToString() {
5019
 
                        return string.Format("[TypeOfIsExpression Expression={0} TypeReference={1}]", Expression, TypeReference);
5020
 
                }
5021
 
        }
5022
 
        
5023
 
        public class TypeReferenceExpression : Expression {
5024
 
                
5025
 
                TypeReference typeReference;
5026
 
                
5027
 
                public TypeReference TypeReference {
5028
 
                        get {
5029
 
                                return typeReference;
5030
 
                        }
5031
 
                        set {
5032
 
                                typeReference = value ?? TypeReference.Null;
5033
 
                                if (!typeReference.IsNull) typeReference.Parent = this;
5034
 
                        }
5035
 
                }
5036
 
                
5037
 
                public TypeReferenceExpression(TypeReference typeReference) {
5038
 
                        TypeReference = typeReference;
5039
 
                }
5040
 
                
5041
 
[Obsolete] public TypeReferenceExpression(string typeName) : this(new TypeReference(typeName)) {}
5042
 
                
5043
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
5044
 
                        return visitor.VisitTypeReferenceExpression(this, data);
5045
 
                }
5046
 
                
5047
 
                public override string ToString() {
5048
 
                        return string.Format("[TypeReferenceExpression TypeReference={0}]", TypeReference);
5049
 
                }
5050
 
        }
5051
 
        
5052
 
        public class UnaryOperatorExpression : Expression {
5053
 
                
5054
 
                UnaryOperatorType op;
5055
 
                
5056
 
                Expression expression;
5057
 
                
5058
 
                public UnaryOperatorType Op {
5059
 
                        get {
5060
 
                                return op;
5061
 
                        }
5062
 
                        set {
5063
 
                                op = value;
5064
 
                        }
5065
 
                }
5066
 
                
5067
 
                public Expression Expression {
5068
 
                        get {
5069
 
                                return expression;
5070
 
                        }
5071
 
                        set {
5072
 
                                expression = value ?? Expression.Null;
5073
 
                                if (!expression.IsNull) expression.Parent = this;
5074
 
                        }
5075
 
                }
5076
 
                
5077
 
                public UnaryOperatorExpression(UnaryOperatorType op) {
5078
 
                        Op = op;
5079
 
                        expression = Expression.Null;
5080
 
                }
5081
 
                
5082
 
                public UnaryOperatorExpression(Expression expression, UnaryOperatorType op) {
5083
 
                        Expression = expression;
5084
 
                        Op = op;
5085
 
                }
5086
 
                
5087
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
5088
 
                        return visitor.VisitUnaryOperatorExpression(this, data);
5089
 
                }
5090
 
                
5091
 
                public override string ToString() {
5092
 
                        return string.Format("[UnaryOperatorExpression Op={0} Expression={1}]", Op, Expression);
5093
 
                }
5094
 
        }
5095
 
        
5096
 
        public class UncheckedExpression : Expression {
5097
 
                
5098
 
                Expression expression;
5099
 
                
5100
 
                public Expression Expression {
5101
 
                        get {
5102
 
                                return expression;
5103
 
                        }
5104
 
                        set {
5105
 
                                expression = value ?? Expression.Null;
5106
 
                                if (!expression.IsNull) expression.Parent = this;
5107
 
                        }
5108
 
                }
5109
 
                
5110
 
                public UncheckedExpression(Expression expression) {
5111
 
                        Expression = expression;
5112
 
                }
5113
 
                
5114
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
5115
 
                        return visitor.VisitUncheckedExpression(this, data);
5116
 
                }
5117
 
                
5118
 
                public override string ToString() {
5119
 
                        return string.Format("[UncheckedExpression Expression={0}]", Expression);
5120
 
                }
5121
 
        }
5122
 
        
5123
 
        public class UncheckedStatement : Statement {
5124
 
                
5125
 
                Statement block;
5126
 
                
5127
 
                public Statement Block {
5128
 
                        get {
5129
 
                                return block;
5130
 
                        }
5131
 
                        set {
5132
 
                                block = value ?? Statement.Null;
5133
 
                                if (!block.IsNull) block.Parent = this;
5134
 
                        }
5135
 
                }
5136
 
                
5137
 
                public UncheckedStatement(Statement block) {
5138
 
                        Block = block;
5139
 
                }
5140
 
                
5141
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
5142
 
                        return visitor.VisitUncheckedStatement(this, data);
5143
 
                }
5144
 
                
5145
 
                public override string ToString() {
5146
 
                        return string.Format("[UncheckedStatement Block={0}]", Block);
5147
 
                }
5148
 
        }
5149
 
        
5150
 
        public class UnsafeStatement : Statement {
5151
 
                
5152
 
                Statement block;
5153
 
                
5154
 
                public Statement Block {
5155
 
                        get {
5156
 
                                return block;
5157
 
                        }
5158
 
                        set {
5159
 
                                block = value ?? Statement.Null;
5160
 
                                if (!block.IsNull) block.Parent = this;
5161
 
                        }
5162
 
                }
5163
 
                
5164
 
                public UnsafeStatement(Statement block) {
5165
 
                        Block = block;
5166
 
                }
5167
 
                
5168
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
5169
 
                        return visitor.VisitUnsafeStatement(this, data);
5170
 
                }
5171
 
                
5172
 
                public override string ToString() {
5173
 
                        return string.Format("[UnsafeStatement Block={0}]", Block);
5174
 
                }
5175
 
        }
5176
 
        
5177
 
        public class Using : AbstractNode {
5178
 
                
5179
 
                string name;
5180
 
                
5181
 
                TypeReference alias;
5182
 
                
5183
 
                public string Name {
5184
 
                        get {
5185
 
                                return name;
5186
 
                        }
5187
 
                        set {
5188
 
                                name = string.IsNullOrEmpty(value) ? "?" : value;
5189
 
                        }
5190
 
                }
5191
 
                
5192
 
                public TypeReference Alias {
5193
 
                        get {
5194
 
                                return alias;
5195
 
                        }
5196
 
                        set {
5197
 
                                alias = value ?? TypeReference.Null;
5198
 
                                if (!alias.IsNull) alias.Parent = this;
5199
 
                        }
5200
 
                }
5201
 
                
5202
 
                public Using(string name) {
5203
 
                        Name = name;
5204
 
                        alias = TypeReference.Null;
5205
 
                }
5206
 
                
5207
 
                public Using(string name, TypeReference alias) {
5208
 
                        Name = name;
5209
 
                        Alias = alias;
5210
 
                }
5211
 
                
5212
 
                public bool IsAlias {
5213
 
                        get {
5214
 
                                return !alias.IsNull;
5215
 
                        }
5216
 
                }
5217
 
                
5218
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
5219
 
                        return visitor.VisitUsing(this, data);
5220
 
                }
5221
 
                
5222
 
                public override string ToString() {
5223
 
                        return string.Format("[Using Name={0} Alias={1}]", Name, Alias);
5224
 
                }
5225
 
        }
5226
 
        
5227
 
        public class UsingDeclaration : AbstractNode {
5228
 
                
5229
 
                List<Using> usings;
5230
 
                
5231
 
                public List<Using> Usings {
5232
 
                        get {
5233
 
                                return usings;
5234
 
                        }
5235
 
                        set {
5236
 
                                usings = value ?? new List<Using>();
5237
 
                        }
5238
 
                }
5239
 
                
5240
 
                public UsingDeclaration(List<Using> usings) {
5241
 
                        Usings = usings;
5242
 
                }
5243
 
                
5244
 
public UsingDeclaration(string @namespace) : this(@namespace, null) {}
5245
 
                
5246
 
public UsingDeclaration(string @namespace, TypeReference alias) { usings = new List<Using>(1); usings.Add(new Using(@namespace, alias)); }
5247
 
                
5248
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
5249
 
                        return visitor.VisitUsingDeclaration(this, data);
5250
 
                }
5251
 
                
5252
 
                public override string ToString() {
5253
 
                        return string.Format("[UsingDeclaration Usings={0}]", GetCollectionString(Usings));
5254
 
                }
5255
 
        }
5256
 
        
5257
 
        public class UsingStatement : StatementWithEmbeddedStatement {
5258
 
                
5259
 
                Statement resourceAcquisition;
5260
 
                
5261
 
                public Statement ResourceAcquisition {
5262
 
                        get {
5263
 
                                return resourceAcquisition;
5264
 
                        }
5265
 
                        set {
5266
 
                                resourceAcquisition = value ?? Statement.Null;
5267
 
                                if (!resourceAcquisition.IsNull) resourceAcquisition.Parent = this;
5268
 
                        }
5269
 
                }
5270
 
                
5271
 
                public UsingStatement(Statement resourceAcquisition, Statement embeddedStatement) {
5272
 
                        ResourceAcquisition = resourceAcquisition;
5273
 
                        EmbeddedStatement = embeddedStatement;
5274
 
                }
5275
 
                
5276
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
5277
 
                        return visitor.VisitUsingStatement(this, data);
5278
 
                }
5279
 
                
5280
 
                public override string ToString() {
5281
 
                        return string.Format("[UsingStatement ResourceAcquisition={0} EmbeddedStatement={1}]", ResourceAcquisition, EmbeddedStatement);
5282
 
                }
5283
 
        }
5284
 
        
5285
 
        public class VariableDeclaration : AbstractNode {
5286
 
                
5287
 
                string name;
5288
 
                
5289
 
                Expression initializer;
5290
 
                
5291
 
                TypeReference typeReference;
5292
 
                
5293
 
                Expression fixedArrayInitialization;
5294
 
                
5295
 
                public string Name {
5296
 
                        get {
5297
 
                                return name;
5298
 
                        }
5299
 
                        set {
5300
 
                                name = value ?? "";
5301
 
                        }
5302
 
                }
5303
 
                
5304
 
                public Expression Initializer {
5305
 
                        get {
5306
 
                                return initializer;
5307
 
                        }
5308
 
                        set {
5309
 
                                initializer = value ?? Expression.Null;
5310
 
                                if (!initializer.IsNull) initializer.Parent = this;
5311
 
                        }
5312
 
                }
5313
 
                
5314
 
                public TypeReference TypeReference {
5315
 
                        get {
5316
 
                                return typeReference;
5317
 
                        }
5318
 
                        set {
5319
 
                                typeReference = value ?? TypeReference.Null;
5320
 
                                if (!typeReference.IsNull) typeReference.Parent = this;
5321
 
                        }
5322
 
                }
5323
 
                
5324
 
                public Expression FixedArrayInitialization {
5325
 
                        get {
5326
 
                                return fixedArrayInitialization;
5327
 
                        }
5328
 
                        set {
5329
 
                                fixedArrayInitialization = value ?? Expression.Null;
5330
 
                                if (!fixedArrayInitialization.IsNull) fixedArrayInitialization.Parent = this;
5331
 
                        }
5332
 
                }
5333
 
                
5334
 
                public VariableDeclaration(string name) {
5335
 
                        Name = name;
5336
 
                        initializer = Expression.Null;
5337
 
                        typeReference = TypeReference.Null;
5338
 
                        fixedArrayInitialization = Expression.Null;
5339
 
                }
5340
 
                
5341
 
                public VariableDeclaration(string name, Expression initializer) {
5342
 
                        Name = name;
5343
 
                        Initializer = initializer;
5344
 
                        typeReference = TypeReference.Null;
5345
 
                        fixedArrayInitialization = Expression.Null;
5346
 
                }
5347
 
                
5348
 
                public VariableDeclaration(string name, Expression initializer, TypeReference typeReference) {
5349
 
                        Name = name;
5350
 
                        Initializer = initializer;
5351
 
                        TypeReference = typeReference;
5352
 
                        fixedArrayInitialization = Expression.Null;
5353
 
                }
5354
 
                
5355
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
5356
 
                        return visitor.VisitVariableDeclaration(this, data);
5357
 
                }
5358
 
                
5359
 
                public override string ToString() {
5360
 
                        return string.Format("[VariableDeclaration Name={0} Initializer={1} TypeReference={2} FixedArrayInitial" +
5361
 
                                        "ization={3}]", Name, Initializer, TypeReference, FixedArrayInitialization);
5362
 
                }
5363
 
        }
5364
 
        
5365
 
        public class WithStatement : Statement {
5366
 
                
5367
 
                Expression expression;
5368
 
                
5369
 
                BlockStatement body;
5370
 
                
5371
 
                public Expression Expression {
5372
 
                        get {
5373
 
                                return expression;
5374
 
                        }
5375
 
                        set {
5376
 
                                expression = value ?? Expression.Null;
5377
 
                                if (!expression.IsNull) expression.Parent = this;
5378
 
                        }
5379
 
                }
5380
 
                
5381
 
                public BlockStatement Body {
5382
 
                        get {
5383
 
                                return body;
5384
 
                        }
5385
 
                        set {
5386
 
                                body = value ?? BlockStatement.Null;
5387
 
                                if (!body.IsNull) body.Parent = this;
5388
 
                        }
5389
 
                }
5390
 
                
5391
 
                public WithStatement(Expression expression) {
5392
 
                        Expression = expression;
5393
 
                        body = BlockStatement.Null;
5394
 
                }
5395
 
                
5396
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
5397
 
                        return visitor.VisitWithStatement(this, data);
5398
 
                }
5399
 
                
5400
 
                public override string ToString() {
5401
 
                        return string.Format("[WithStatement Expression={0} Body={1}]", Expression, Body);
5402
 
                }
5403
 
        }
5404
 
        
5405
 
        public class YieldStatement : Statement {
5406
 
                
5407
 
                Statement statement;
5408
 
                
5409
 
                public Statement Statement {
5410
 
                        get {
5411
 
                                return statement;
5412
 
                        }
5413
 
                        set {
5414
 
                                statement = value ?? Statement.Null;
5415
 
                                if (!statement.IsNull) statement.Parent = this;
5416
 
                        }
5417
 
                }
5418
 
                
5419
 
                public YieldStatement(Statement statement) {
5420
 
                        Statement = statement;
5421
 
                }
5422
 
                
5423
 
                public bool IsYieldBreak {
5424
 
                        get {
5425
 
                                return statement is BreakStatement;
5426
 
                        }
5427
 
                }
5428
 
                
5429
 
                public bool IsYieldReturn {
5430
 
                        get {
5431
 
                                return statement is ReturnStatement;
5432
 
                        }
5433
 
                }
5434
 
                
5435
 
                public override object AcceptVisitor(IAstVisitor visitor, object data) {
5436
 
                        return visitor.VisitYieldStatement(this, data);
5437
 
                }
5438
 
                
5439
 
                public override string ToString() {
5440
 
                        return string.Format("[YieldStatement Statement={0}]", Statement);
5441
 
                }
5442
 
        }
5443
 
}