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

« back to all changes in this revision

Viewing changes to contrib/NRefactory/Project/Src/Parser/CSharp/Parser.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
 
#line  1 "Frames/cs.ATG" 
3
 
using System.Collections;
4
 
using System.Collections.Generic;
5
 
using System.Collections.Specialized;
6
 
using System.Text;
7
 
using ICSharpCode.OldNRefactory.Parser;
8
 
using ICSharpCode.OldNRefactory.Ast;
9
 
using ASTAttribute = ICSharpCode.OldNRefactory.Ast.Attribute;
10
 
using Types = ICSharpCode.OldNRefactory.Ast.ClassType;
11
 
/*
12
 
  Parser.frame file for NRefactory.
13
 
 */
14
 
using System;
15
 
using System.Reflection;
16
 
 
17
 
namespace ICSharpCode.OldNRefactory.Parser.CSharp {
18
 
 
19
 
 
20
 
 
21
 
partial class Parser : AbstractParser
22
 
{
23
 
        const int maxT = 145;
24
 
 
25
 
        const  bool   T            = true;
26
 
        const  bool   x            = false;
27
 
        
28
 
 
29
 
#line  18 "Frames/cs.ATG" 
30
 
 
31
 
 
32
 
/*
33
 
 
34
 
*/
35
 
 
36
 
        void CS() {
37
 
 
38
 
#line  179 "Frames/cs.ATG" 
39
 
                lexer.NextToken(); /* get the first token */ 
40
 
                while (la.kind == 71) {
41
 
                        ExternAliasDirective();
42
 
                }
43
 
                while (la.kind == 121) {
44
 
                        UsingDirective();
45
 
                }
46
 
                while (
47
 
#line  183 "Frames/cs.ATG" 
48
 
IsGlobalAttrTarget()) {
49
 
                        GlobalAttributeSection();
50
 
                }
51
 
                while (StartOf(1)) {
52
 
                        NamespaceMemberDecl();
53
 
                }
54
 
                Expect(0);
55
 
        }
56
 
 
57
 
        void ExternAliasDirective() {
58
 
 
59
 
#line  353 "Frames/cs.ATG" 
60
 
                ExternAliasDirective ead = new ExternAliasDirective { StartLocation = la.Location }; 
61
 
                Expect(71);
62
 
                Identifier();
63
 
 
64
 
#line  356 "Frames/cs.ATG" 
65
 
                if (t.val != "alias") Error("Expected 'extern alias'."); 
66
 
                Identifier();
67
 
 
68
 
#line  357 "Frames/cs.ATG" 
69
 
                ead.Name = t.val; 
70
 
                Expect(11);
71
 
 
72
 
#line  358 "Frames/cs.ATG" 
73
 
                ead.EndLocation = t.EndLocation; 
74
 
 
75
 
#line  359 "Frames/cs.ATG" 
76
 
                compilationUnit.AddChild(ead); 
77
 
        }
78
 
 
79
 
        void UsingDirective() {
80
 
 
81
 
#line  190 "Frames/cs.ATG" 
82
 
                string qualident = null; TypeReference aliasedType = null;
83
 
                
84
 
                Expect(121);
85
 
 
86
 
#line  193 "Frames/cs.ATG" 
87
 
                Location startPos = t.Location; 
88
 
                Qualident(
89
 
#line  194 "Frames/cs.ATG" 
90
 
out qualident);
91
 
                if (la.kind == 3) {
92
 
                        lexer.NextToken();
93
 
                        NonArrayType(
94
 
#line  195 "Frames/cs.ATG" 
95
 
out aliasedType);
96
 
                }
97
 
                Expect(11);
98
 
 
99
 
#line  197 "Frames/cs.ATG" 
100
 
                if (qualident != null && qualident.Length > 0) {
101
 
                 INode node;
102
 
                 if (aliasedType != null) {
103
 
                     node = new UsingDeclaration(qualident, aliasedType);
104
 
                 } else {
105
 
                     node = new UsingDeclaration(qualident);
106
 
                 }
107
 
                 node.StartLocation = startPos;
108
 
                 node.EndLocation   = t.EndLocation;
109
 
                 compilationUnit.AddChild(node);
110
 
                }
111
 
                
112
 
        }
113
 
 
114
 
        void GlobalAttributeSection() {
115
 
                Expect(18);
116
 
 
117
 
#line  213 "Frames/cs.ATG" 
118
 
                Location startPos = t.Location; 
119
 
                Identifier();
120
 
 
121
 
#line  214 "Frames/cs.ATG" 
122
 
                if (t.val != "assembly" && t.val != "module") Error("global attribute target specifier (assembly or module) expected");
123
 
                string attributeTarget = t.val;
124
 
                List<ASTAttribute> attributes = new List<ASTAttribute>();
125
 
                ASTAttribute attribute;
126
 
                
127
 
                Expect(9);
128
 
                Attribute(
129
 
#line  219 "Frames/cs.ATG" 
130
 
out attribute);
131
 
 
132
 
#line  219 "Frames/cs.ATG" 
133
 
                attributes.Add(attribute); 
134
 
                while (
135
 
#line  220 "Frames/cs.ATG" 
136
 
NotFinalComma()) {
137
 
                        Expect(14);
138
 
                        Attribute(
139
 
#line  220 "Frames/cs.ATG" 
140
 
out attribute);
141
 
 
142
 
#line  220 "Frames/cs.ATG" 
143
 
                        attributes.Add(attribute); 
144
 
                }
145
 
                if (la.kind == 14) {
146
 
                        lexer.NextToken();
147
 
                }
148
 
                Expect(19);
149
 
 
150
 
#line  222 "Frames/cs.ATG" 
151
 
                AttributeSection section = new AttributeSection {
152
 
                   AttributeTarget = attributeTarget,
153
 
                   Attributes = attributes,
154
 
                   StartLocation = startPos,
155
 
                   EndLocation = t.EndLocation
156
 
                };
157
 
                compilationUnit.AddChild(section);
158
 
                
159
 
        }
160
 
 
161
 
        void NamespaceMemberDecl() {
162
 
 
163
 
#line  326 "Frames/cs.ATG" 
164
 
                AttributeSection section;
165
 
                List<AttributeSection> attributes = new List<AttributeSection>();
166
 
                ModifierList m = new ModifierList();
167
 
                string qualident;
168
 
                
169
 
                if (la.kind == 88) {
170
 
                        lexer.NextToken();
171
 
 
172
 
#line  332 "Frames/cs.ATG" 
173
 
                        Location startPos = t.Location; 
174
 
                        Qualident(
175
 
#line  333 "Frames/cs.ATG" 
176
 
out qualident);
177
 
 
178
 
#line  333 "Frames/cs.ATG" 
179
 
                        INode node =  new NamespaceDeclaration(qualident);
180
 
                        node.StartLocation = startPos;
181
 
                        compilationUnit.AddChild(node);
182
 
                        compilationUnit.BlockStart(node);
183
 
                        
184
 
                        Expect(16);
185
 
                        while (la.kind == 71) {
186
 
                                ExternAliasDirective();
187
 
                        }
188
 
                        while (la.kind == 121) {
189
 
                                UsingDirective();
190
 
                        }
191
 
                        while (StartOf(1)) {
192
 
                                NamespaceMemberDecl();
193
 
                        }
194
 
                        Expect(17);
195
 
                        if (la.kind == 11) {
196
 
                                lexer.NextToken();
197
 
                        }
198
 
 
199
 
#line  343 "Frames/cs.ATG" 
200
 
                        node.EndLocation   = t.EndLocation;
201
 
                        compilationUnit.BlockEnd();
202
 
                        
203
 
                } else if (StartOf(2)) {
204
 
                        while (la.kind == 18) {
205
 
                                AttributeSection(
206
 
#line  347 "Frames/cs.ATG" 
207
 
out section);
208
 
 
209
 
#line  347 "Frames/cs.ATG" 
210
 
                                attributes.Add(section); 
211
 
                        }
212
 
                        while (StartOf(3)) {
213
 
                                TypeModifier(
214
 
#line  348 "Frames/cs.ATG" 
215
 
m);
216
 
                        }
217
 
                        TypeDecl(
218
 
#line  349 "Frames/cs.ATG" 
219
 
m, attributes);
220
 
                } else SynErr(146);
221
 
        }
222
 
 
223
 
        void Qualident(
224
 
#line  483 "Frames/cs.ATG" 
225
 
out string qualident) {
226
 
                Identifier();
227
 
 
228
 
#line  485 "Frames/cs.ATG" 
229
 
                qualidentBuilder.Length = 0; qualidentBuilder.Append(t.val); 
230
 
                while (
231
 
#line  486 "Frames/cs.ATG" 
232
 
DotAndIdent()) {
233
 
                        Expect(15);
234
 
                        Identifier();
235
 
 
236
 
#line  486 "Frames/cs.ATG" 
237
 
                        qualidentBuilder.Append('.');
238
 
                        qualidentBuilder.Append(t.val); 
239
 
                        
240
 
                }
241
 
 
242
 
#line  489 "Frames/cs.ATG" 
243
 
                qualident = qualidentBuilder.ToString(); 
244
 
        }
245
 
 
246
 
        void NonArrayType(
247
 
#line  601 "Frames/cs.ATG" 
248
 
out TypeReference type) {
249
 
 
250
 
#line  603 "Frames/cs.ATG" 
251
 
                Location startPos = la.Location;
252
 
                string name;
253
 
                int pointer = 0;
254
 
                type = null;
255
 
                
256
 
                if (StartOf(4)) {
257
 
                        ClassType(
258
 
#line  609 "Frames/cs.ATG" 
259
 
out type, false);
260
 
                } else if (StartOf(5)) {
261
 
                        SimpleType(
262
 
#line  610 "Frames/cs.ATG" 
263
 
out name);
264
 
 
265
 
#line  610 "Frames/cs.ATG" 
266
 
                        type = new TypeReference(name, true); 
267
 
                } else if (la.kind == 123) {
268
 
                        lexer.NextToken();
269
 
                        Expect(6);
270
 
 
271
 
#line  611 "Frames/cs.ATG" 
272
 
                        pointer = 1; type = new TypeReference("System.Void", true); 
273
 
                } else SynErr(147);
274
 
                if (la.kind == 12) {
275
 
                        NullableQuestionMark(
276
 
#line  614 "Frames/cs.ATG" 
277
 
ref type);
278
 
                }
279
 
                while (
280
 
#line  616 "Frames/cs.ATG" 
281
 
IsPointer()) {
282
 
                        Expect(6);
283
 
 
284
 
#line  617 "Frames/cs.ATG" 
285
 
                        ++pointer; 
286
 
                }
287
 
 
288
 
#line  619 "Frames/cs.ATG" 
289
 
                if (type != null) {
290
 
                type.PointerNestingLevel = pointer; 
291
 
                type.EndLocation = t.EndLocation;
292
 
                type.StartLocation = startPos;
293
 
                } 
294
 
                
295
 
        }
296
 
 
297
 
        void Identifier() {
298
 
                switch (la.kind) {
299
 
                case 1: {
300
 
                        lexer.NextToken();
301
 
                        break;
302
 
                }
303
 
                case 126: {
304
 
                        lexer.NextToken();
305
 
                        break;
306
 
                }
307
 
                case 127: {
308
 
                        lexer.NextToken();
309
 
                        break;
310
 
                }
311
 
                case 128: {
312
 
                        lexer.NextToken();
313
 
                        break;
314
 
                }
315
 
                case 129: {
316
 
                        lexer.NextToken();
317
 
                        break;
318
 
                }
319
 
                case 130: {
320
 
                        lexer.NextToken();
321
 
                        break;
322
 
                }
323
 
                case 131: {
324
 
                        lexer.NextToken();
325
 
                        break;
326
 
                }
327
 
                case 132: {
328
 
                        lexer.NextToken();
329
 
                        break;
330
 
                }
331
 
                case 133: {
332
 
                        lexer.NextToken();
333
 
                        break;
334
 
                }
335
 
                case 134: {
336
 
                        lexer.NextToken();
337
 
                        break;
338
 
                }
339
 
                case 135: {
340
 
                        lexer.NextToken();
341
 
                        break;
342
 
                }
343
 
                case 136: {
344
 
                        lexer.NextToken();
345
 
                        break;
346
 
                }
347
 
                case 137: {
348
 
                        lexer.NextToken();
349
 
                        break;
350
 
                }
351
 
                case 138: {
352
 
                        lexer.NextToken();
353
 
                        break;
354
 
                }
355
 
                case 139: {
356
 
                        lexer.NextToken();
357
 
                        break;
358
 
                }
359
 
                case 140: {
360
 
                        lexer.NextToken();
361
 
                        break;
362
 
                }
363
 
                case 141: {
364
 
                        lexer.NextToken();
365
 
                        break;
366
 
                }
367
 
                case 142: {
368
 
                        lexer.NextToken();
369
 
                        break;
370
 
                }
371
 
                case 143: {
372
 
                        lexer.NextToken();
373
 
                        break;
374
 
                }
375
 
                case 144: {
376
 
                        lexer.NextToken();
377
 
                        break;
378
 
                }
379
 
                default: SynErr(148); break;
380
 
                }
381
 
        }
382
 
 
383
 
        void Attribute(
384
 
#line  232 "Frames/cs.ATG" 
385
 
out ASTAttribute attribute) {
386
 
 
387
 
#line  233 "Frames/cs.ATG" 
388
 
                string qualident;
389
 
                string alias = null;
390
 
                
391
 
 
392
 
#line  237 "Frames/cs.ATG" 
393
 
                Location startPos = la.Location; 
394
 
                if (
395
 
#line  238 "Frames/cs.ATG" 
396
 
IdentAndDoubleColon()) {
397
 
                        Identifier();
398
 
 
399
 
#line  239 "Frames/cs.ATG" 
400
 
                        alias = t.val; 
401
 
                        Expect(10);
402
 
                }
403
 
                Qualident(
404
 
#line  242 "Frames/cs.ATG" 
405
 
out qualident);
406
 
 
407
 
#line  243 "Frames/cs.ATG" 
408
 
                List<Expression> positional = null;
409
 
                List<NamedArgumentExpression> named = null;
410
 
                string name = (alias != null && alias != "global") ? alias + "." + qualident : qualident;
411
 
                
412
 
                if (la.kind == 20) {
413
 
                        AttributeArguments(
414
 
#line  247 "Frames/cs.ATG" 
415
 
out positional, out named);
416
 
                }
417
 
 
418
 
#line  248 "Frames/cs.ATG" 
419
 
                attribute = new ASTAttribute(name, positional, named); 
420
 
                attribute.StartLocation = startPos;
421
 
                attribute.EndLocation = t.EndLocation;
422
 
                
423
 
        }
424
 
 
425
 
        void AttributeArguments(
426
 
#line  254 "Frames/cs.ATG" 
427
 
out List<Expression> positional, out List<NamedArgumentExpression> named) {
428
 
 
429
 
#line  256 "Frames/cs.ATG" 
430
 
                bool nameFound = false;
431
 
                string name = "";
432
 
                Expression expr;
433
 
                positional = new List<Expression>();
434
 
                named = new List<NamedArgumentExpression> ();
435
 
                
436
 
                Expect(20);
437
 
                if (StartOf(6)) {
438
 
                        if (
439
 
#line  266 "Frames/cs.ATG" 
440
 
IsAssignment()) {
441
 
 
442
 
#line  266 "Frames/cs.ATG" 
443
 
                                nameFound = true; 
444
 
                                Identifier();
445
 
 
446
 
#line  267 "Frames/cs.ATG" 
447
 
                                name = t.val; 
448
 
                                Expect(3);
449
 
                        }
450
 
                        Expr(
451
 
#line  269 "Frames/cs.ATG" 
452
 
out expr);
453
 
 
454
 
#line  269 "Frames/cs.ATG" 
455
 
                        if (expr != null) {  
456
 
                        if(name == "") positional.Add(expr);
457
 
                                                  else { named.Add(new NamedArgumentExpression(name, expr)); name = ""; }
458
 
                                                  }
459
 
                                               
460
 
                        while (la.kind == 14) {
461
 
                                lexer.NextToken();
462
 
                                if (
463
 
#line  278 "Frames/cs.ATG" 
464
 
IsAssignment()) {
465
 
 
466
 
#line  278 "Frames/cs.ATG" 
467
 
                                        nameFound = true; 
468
 
                                        Identifier();
469
 
 
470
 
#line  279 "Frames/cs.ATG" 
471
 
                                        name = t.val; 
472
 
                                        Expect(3);
473
 
                                } else if (StartOf(6)) {
474
 
 
475
 
#line  281 "Frames/cs.ATG" 
476
 
                                        if (nameFound) Error("no positional argument after named argument"); 
477
 
                                } else SynErr(149);
478
 
                                Expr(
479
 
#line  282 "Frames/cs.ATG" 
480
 
out expr);
481
 
 
482
 
#line  282 "Frames/cs.ATG" 
483
 
                                if (expr != null) { if(name == "") positional.Add(expr);
484
 
                                else { named.Add(new NamedArgumentExpression(name, expr)); name = ""; }
485
 
                                }
486
 
                                
487
 
                        }
488
 
                }
489
 
                Expect(21);
490
 
        }
491
 
 
492
 
        void Expr(
493
 
#line  1804 "Frames/cs.ATG" 
494
 
out Expression expr) {
495
 
 
496
 
#line  1805 "Frames/cs.ATG" 
497
 
                expr = null; Expression expr1 = null, expr2 = null; AssignmentOperatorType op; 
498
 
 
499
 
#line  1807 "Frames/cs.ATG" 
500
 
                Location startLocation = la.Location; 
501
 
                UnaryExpr(
502
 
#line  1808 "Frames/cs.ATG" 
503
 
out expr);
504
 
                if (StartOf(7)) {
505
 
                        AssignmentOperator(
506
 
#line  1811 "Frames/cs.ATG" 
507
 
out op);
508
 
                        Expr(
509
 
#line  1811 "Frames/cs.ATG" 
510
 
out expr1);
511
 
 
512
 
#line  1811 "Frames/cs.ATG" 
513
 
                        expr = new AssignmentExpression(expr, op, expr1); 
514
 
                } else if (
515
 
#line  1812 "Frames/cs.ATG" 
516
 
la.kind == Tokens.GreaterThan && Peek(1).kind == Tokens.GreaterEqual) {
517
 
                        AssignmentOperator(
518
 
#line  1813 "Frames/cs.ATG" 
519
 
out op);
520
 
                        Expr(
521
 
#line  1813 "Frames/cs.ATG" 
522
 
out expr1);
523
 
 
524
 
#line  1813 "Frames/cs.ATG" 
525
 
                        expr = new AssignmentExpression(expr, op, expr1); 
526
 
                } else if (StartOf(8)) {
527
 
                        ConditionalOrExpr(
528
 
#line  1815 "Frames/cs.ATG" 
529
 
ref expr);
530
 
                        if (la.kind == 13) {
531
 
                                lexer.NextToken();
532
 
                                Expr(
533
 
#line  1816 "Frames/cs.ATG" 
534
 
out expr1);
535
 
 
536
 
#line  1816 "Frames/cs.ATG" 
537
 
                                expr = new BinaryOperatorExpression(expr, BinaryOperatorType.NullCoalescing, expr1); 
538
 
                        }
539
 
                        if (la.kind == 12) {
540
 
                                lexer.NextToken();
541
 
                                Expr(
542
 
#line  1817 "Frames/cs.ATG" 
543
 
out expr1);
544
 
                                Expect(9);
545
 
                                Expr(
546
 
#line  1817 "Frames/cs.ATG" 
547
 
out expr2);
548
 
 
549
 
#line  1817 "Frames/cs.ATG" 
550
 
                                expr = new ConditionalExpression(expr, expr1, expr2);  
551
 
                        }
552
 
                } else SynErr(150);
553
 
 
554
 
#line  1820 "Frames/cs.ATG" 
555
 
                if (expr != null) {
556
 
                expr.StartLocation = startLocation;
557
 
                expr.EndLocation = t.EndLocation;
558
 
                }
559
 
                
560
 
        }
561
 
 
562
 
        void AttributeSection(
563
 
#line  291 "Frames/cs.ATG" 
564
 
out AttributeSection section) {
565
 
 
566
 
#line  293 "Frames/cs.ATG" 
567
 
                string attributeTarget = "";
568
 
                List<ASTAttribute> attributes = new List<ASTAttribute>();
569
 
                ASTAttribute attribute;
570
 
                
571
 
                
572
 
                Expect(18);
573
 
 
574
 
#line  299 "Frames/cs.ATG" 
575
 
                Location startPos = t.Location; 
576
 
                if (
577
 
#line  300 "Frames/cs.ATG" 
578
 
IsLocalAttrTarget()) {
579
 
                        if (la.kind == 69) {
580
 
                                lexer.NextToken();
581
 
 
582
 
#line  301 "Frames/cs.ATG" 
583
 
                                attributeTarget = "event";
584
 
                        } else if (la.kind == 101) {
585
 
                                lexer.NextToken();
586
 
 
587
 
#line  302 "Frames/cs.ATG" 
588
 
                                attributeTarget = "return";
589
 
                        } else {
590
 
                                Identifier();
591
 
 
592
 
#line  303 "Frames/cs.ATG" 
593
 
                                if (t.val != "field"   && t.val != "method" &&
594
 
                                  t.val != "param" &&
595
 
                                  t.val != "property" && t.val != "type")
596
 
                                Error("attribute target specifier (field, event, method, param, property, return or type) expected");
597
 
                                attributeTarget = t.val;
598
 
                                
599
 
                        }
600
 
                        Expect(9);
601
 
                }
602
 
                Attribute(
603
 
#line  312 "Frames/cs.ATG" 
604
 
out attribute);
605
 
 
606
 
#line  312 "Frames/cs.ATG" 
607
 
                attributes.Add(attribute); 
608
 
                while (
609
 
#line  313 "Frames/cs.ATG" 
610
 
NotFinalComma()) {
611
 
                        Expect(14);
612
 
                        Attribute(
613
 
#line  313 "Frames/cs.ATG" 
614
 
out attribute);
615
 
 
616
 
#line  313 "Frames/cs.ATG" 
617
 
                        attributes.Add(attribute); 
618
 
                }
619
 
                if (la.kind == 14) {
620
 
                        lexer.NextToken();
621
 
                }
622
 
                Expect(19);
623
 
 
624
 
#line  315 "Frames/cs.ATG" 
625
 
                section = new AttributeSection {
626
 
                   AttributeTarget = attributeTarget,
627
 
                   Attributes = attributes,
628
 
                   StartLocation = startPos,
629
 
                   EndLocation = t.EndLocation
630
 
                };
631
 
                
632
 
        }
633
 
 
634
 
        void TypeModifier(
635
 
#line  696 "Frames/cs.ATG" 
636
 
ModifierList m) {
637
 
                switch (la.kind) {
638
 
                case 89: {
639
 
                        lexer.NextToken();
640
 
 
641
 
#line  698 "Frames/cs.ATG" 
642
 
                        m.Add(Modifiers.New, t.Location); 
643
 
                        break;
644
 
                }
645
 
                case 98: {
646
 
                        lexer.NextToken();
647
 
 
648
 
#line  699 "Frames/cs.ATG" 
649
 
                        m.Add(Modifiers.Public, t.Location); 
650
 
                        break;
651
 
                }
652
 
                case 97: {
653
 
                        lexer.NextToken();
654
 
 
655
 
#line  700 "Frames/cs.ATG" 
656
 
                        m.Add(Modifiers.Protected, t.Location); 
657
 
                        break;
658
 
                }
659
 
                case 84: {
660
 
                        lexer.NextToken();
661
 
 
662
 
#line  701 "Frames/cs.ATG" 
663
 
                        m.Add(Modifiers.Internal, t.Location); 
664
 
                        break;
665
 
                }
666
 
                case 96: {
667
 
                        lexer.NextToken();
668
 
 
669
 
#line  702 "Frames/cs.ATG" 
670
 
                        m.Add(Modifiers.Private, t.Location); 
671
 
                        break;
672
 
                }
673
 
                case 119: {
674
 
                        lexer.NextToken();
675
 
 
676
 
#line  703 "Frames/cs.ATG" 
677
 
                        m.Add(Modifiers.Unsafe, t.Location); 
678
 
                        break;
679
 
                }
680
 
                case 49: {
681
 
                        lexer.NextToken();
682
 
 
683
 
#line  704 "Frames/cs.ATG" 
684
 
                        m.Add(Modifiers.Abstract, t.Location); 
685
 
                        break;
686
 
                }
687
 
                case 103: {
688
 
                        lexer.NextToken();
689
 
 
690
 
#line  705 "Frames/cs.ATG" 
691
 
                        m.Add(Modifiers.Sealed, t.Location); 
692
 
                        break;
693
 
                }
694
 
                case 107: {
695
 
                        lexer.NextToken();
696
 
 
697
 
#line  706 "Frames/cs.ATG" 
698
 
                        m.Add(Modifiers.Static, t.Location); 
699
 
                        break;
700
 
                }
701
 
                case 126: {
702
 
                        lexer.NextToken();
703
 
 
704
 
#line  707 "Frames/cs.ATG" 
705
 
                        m.Add(Modifiers.Partial, t.Location); 
706
 
                        break;
707
 
                }
708
 
                default: SynErr(151); break;
709
 
                }
710
 
        }
711
 
 
712
 
        void TypeDecl(
713
 
#line  362 "Frames/cs.ATG" 
714
 
ModifierList m, List<AttributeSection> attributes) {
715
 
 
716
 
#line  364 "Frames/cs.ATG" 
717
 
                TypeReference type;
718
 
                List<TypeReference> names;
719
 
                List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
720
 
                string name;
721
 
                List<TemplateDefinition> templates;
722
 
                
723
 
                if (la.kind == 59) {
724
 
 
725
 
#line  370 "Frames/cs.ATG" 
726
 
                        m.Check(Modifiers.Classes); 
727
 
                        lexer.NextToken();
728
 
 
729
 
#line  371 "Frames/cs.ATG" 
730
 
                        TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes);
731
 
                        templates = newType.Templates;
732
 
                        compilationUnit.AddChild(newType);
733
 
                        compilationUnit.BlockStart(newType);
734
 
                        newType.StartLocation = m.GetDeclarationLocation(t.Location);
735
 
                        
736
 
                        newType.Type = Types.Class;
737
 
                        
738
 
                        Identifier();
739
 
 
740
 
#line  379 "Frames/cs.ATG" 
741
 
                        newType.Name = t.val; 
742
 
                        if (la.kind == 23) {
743
 
                                TypeParameterList(
744
 
#line  382 "Frames/cs.ATG" 
745
 
templates);
746
 
                        }
747
 
                        if (la.kind == 9) {
748
 
                                ClassBase(
749
 
#line  384 "Frames/cs.ATG" 
750
 
out names);
751
 
 
752
 
#line  384 "Frames/cs.ATG" 
753
 
                                newType.BaseTypes = names; 
754
 
                        }
755
 
                        while (la.kind == 127) {
756
 
                                TypeParameterConstraintsClause(
757
 
#line  387 "Frames/cs.ATG" 
758
 
templates);
759
 
                        }
760
 
 
761
 
#line  389 "Frames/cs.ATG" 
762
 
                        newType.BodyStartLocation = t.EndLocation; 
763
 
                        Expect(16);
764
 
                        ClassBody();
765
 
                        Expect(17);
766
 
                        if (la.kind == 11) {
767
 
                                lexer.NextToken();
768
 
                        }
769
 
 
770
 
#line  393 "Frames/cs.ATG" 
771
 
                        newType.EndLocation = t.EndLocation; 
772
 
                        compilationUnit.BlockEnd();
773
 
                        
774
 
                } else if (StartOf(9)) {
775
 
 
776
 
#line  396 "Frames/cs.ATG" 
777
 
                        m.Check(Modifiers.StructsInterfacesEnumsDelegates); 
778
 
                        if (la.kind == 109) {
779
 
                                lexer.NextToken();
780
 
 
781
 
#line  397 "Frames/cs.ATG" 
782
 
                                TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes);
783
 
                                templates = newType.Templates;
784
 
                                newType.StartLocation = m.GetDeclarationLocation(t.Location);
785
 
                                compilationUnit.AddChild(newType);
786
 
                                compilationUnit.BlockStart(newType);
787
 
                                newType.Type = Types.Struct; 
788
 
                                
789
 
                                Identifier();
790
 
 
791
 
#line  404 "Frames/cs.ATG" 
792
 
                                newType.Name = t.val; 
793
 
                                if (la.kind == 23) {
794
 
                                        TypeParameterList(
795
 
#line  407 "Frames/cs.ATG" 
796
 
templates);
797
 
                                }
798
 
                                if (la.kind == 9) {
799
 
                                        StructInterfaces(
800
 
#line  409 "Frames/cs.ATG" 
801
 
out names);
802
 
 
803
 
#line  409 "Frames/cs.ATG" 
804
 
                                        newType.BaseTypes = names; 
805
 
                                }
806
 
                                while (la.kind == 127) {
807
 
                                        TypeParameterConstraintsClause(
808
 
#line  412 "Frames/cs.ATG" 
809
 
templates);
810
 
                                }
811
 
 
812
 
#line  415 "Frames/cs.ATG" 
813
 
                                newType.BodyStartLocation = t.EndLocation; 
814
 
                                StructBody();
815
 
                                if (la.kind == 11) {
816
 
                                        lexer.NextToken();
817
 
                                }
818
 
 
819
 
#line  417 "Frames/cs.ATG" 
820
 
                                newType.EndLocation = t.EndLocation; 
821
 
                                compilationUnit.BlockEnd();
822
 
                                
823
 
                        } else if (la.kind == 83) {
824
 
                                lexer.NextToken();
825
 
 
826
 
#line  421 "Frames/cs.ATG" 
827
 
                                TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes);
828
 
                                templates = newType.Templates;
829
 
                                compilationUnit.AddChild(newType);
830
 
                                compilationUnit.BlockStart(newType);
831
 
                                newType.StartLocation = m.GetDeclarationLocation(t.Location);
832
 
                                newType.Type = Types.Interface;
833
 
                                
834
 
                                Identifier();
835
 
 
836
 
#line  428 "Frames/cs.ATG" 
837
 
                                newType.Name = t.val; 
838
 
                                if (la.kind == 23) {
839
 
                                        TypeParameterList(
840
 
#line  431 "Frames/cs.ATG" 
841
 
templates);
842
 
                                }
843
 
                                if (la.kind == 9) {
844
 
                                        InterfaceBase(
845
 
#line  433 "Frames/cs.ATG" 
846
 
out names);
847
 
 
848
 
#line  433 "Frames/cs.ATG" 
849
 
                                        newType.BaseTypes = names; 
850
 
                                }
851
 
                                while (la.kind == 127) {
852
 
                                        TypeParameterConstraintsClause(
853
 
#line  436 "Frames/cs.ATG" 
854
 
templates);
855
 
                                }
856
 
 
857
 
#line  438 "Frames/cs.ATG" 
858
 
                                newType.BodyStartLocation = t.EndLocation; 
859
 
                                InterfaceBody();
860
 
                                if (la.kind == 11) {
861
 
                                        lexer.NextToken();
862
 
                                }
863
 
 
864
 
#line  440 "Frames/cs.ATG" 
865
 
                                newType.EndLocation = t.EndLocation; 
866
 
                                compilationUnit.BlockEnd();
867
 
                                
868
 
                        } else if (la.kind == 68) {
869
 
                                lexer.NextToken();
870
 
 
871
 
#line  444 "Frames/cs.ATG" 
872
 
                                TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes);
873
 
                                compilationUnit.AddChild(newType);
874
 
                                compilationUnit.BlockStart(newType);
875
 
                                newType.StartLocation = m.GetDeclarationLocation(t.Location);
876
 
                                newType.Type = Types.Enum;
877
 
                                
878
 
                                Identifier();
879
 
 
880
 
#line  450 "Frames/cs.ATG" 
881
 
                                newType.Name = t.val; 
882
 
                                if (la.kind == 9) {
883
 
                                        lexer.NextToken();
884
 
                                        IntegralType(
885
 
#line  451 "Frames/cs.ATG" 
886
 
out name);
887
 
 
888
 
#line  451 "Frames/cs.ATG" 
889
 
                                        newType.BaseTypes.Add(new TypeReference(name, true)); 
890
 
                                }
891
 
 
892
 
#line  453 "Frames/cs.ATG" 
893
 
                                newType.BodyStartLocation = t.EndLocation; 
894
 
                                EnumBody();
895
 
                                if (la.kind == 11) {
896
 
                                        lexer.NextToken();
897
 
                                }
898
 
 
899
 
#line  455 "Frames/cs.ATG" 
900
 
                                newType.EndLocation = t.EndLocation; 
901
 
                                compilationUnit.BlockEnd();
902
 
                                
903
 
                        } else {
904
 
                                lexer.NextToken();
905
 
 
906
 
#line  459 "Frames/cs.ATG" 
907
 
                                DelegateDeclaration delegateDeclr = new DelegateDeclaration(m.Modifier, attributes);
908
 
                                templates = delegateDeclr.Templates;
909
 
                                delegateDeclr.StartLocation = m.GetDeclarationLocation(t.Location);
910
 
                                
911
 
                                if (
912
 
#line  463 "Frames/cs.ATG" 
913
 
NotVoidPointer()) {
914
 
                                        Expect(123);
915
 
 
916
 
#line  463 "Frames/cs.ATG" 
917
 
                                        delegateDeclr.ReturnType = new TypeReference("System.Void", true); 
918
 
                                } else if (StartOf(10)) {
919
 
                                        Type(
920
 
#line  464 "Frames/cs.ATG" 
921
 
out type);
922
 
 
923
 
#line  464 "Frames/cs.ATG" 
924
 
                                        delegateDeclr.ReturnType = type; 
925
 
                                } else SynErr(152);
926
 
                                Identifier();
927
 
 
928
 
#line  466 "Frames/cs.ATG" 
929
 
                                delegateDeclr.Name = t.val; 
930
 
                                if (la.kind == 23) {
931
 
                                        TypeParameterList(
932
 
#line  469 "Frames/cs.ATG" 
933
 
templates);
934
 
                                }
935
 
                                Expect(20);
936
 
                                if (StartOf(11)) {
937
 
                                        FormalParameterList(
938
 
#line  471 "Frames/cs.ATG" 
939
 
p);
940
 
 
941
 
#line  471 "Frames/cs.ATG" 
942
 
                                        delegateDeclr.Parameters = p; 
943
 
                                }
944
 
                                Expect(21);
945
 
                                while (la.kind == 127) {
946
 
                                        TypeParameterConstraintsClause(
947
 
#line  475 "Frames/cs.ATG" 
948
 
templates);
949
 
                                }
950
 
                                Expect(11);
951
 
 
952
 
#line  477 "Frames/cs.ATG" 
953
 
                                delegateDeclr.EndLocation = t.EndLocation;
954
 
                                compilationUnit.AddChild(delegateDeclr);
955
 
                                
956
 
                        }
957
 
                } else SynErr(153);
958
 
        }
959
 
 
960
 
        void TypeParameterList(
961
 
#line  2381 "Frames/cs.ATG" 
962
 
List<TemplateDefinition> templates) {
963
 
 
964
 
#line  2383 "Frames/cs.ATG" 
965
 
                AttributeSection section;
966
 
                List<AttributeSection> attributes = new List<AttributeSection>();
967
 
                
968
 
                Expect(23);
969
 
                while (la.kind == 18) {
970
 
                        AttributeSection(
971
 
#line  2387 "Frames/cs.ATG" 
972
 
out section);
973
 
 
974
 
#line  2387 "Frames/cs.ATG" 
975
 
                        attributes.Add(section); 
976
 
                }
977
 
                Identifier();
978
 
 
979
 
#line  2388 "Frames/cs.ATG" 
980
 
                templates.Add(new TemplateDefinition(t.val, attributes)); 
981
 
                while (la.kind == 14) {
982
 
                        lexer.NextToken();
983
 
                        while (la.kind == 18) {
984
 
                                AttributeSection(
985
 
#line  2389 "Frames/cs.ATG" 
986
 
out section);
987
 
 
988
 
#line  2389 "Frames/cs.ATG" 
989
 
                                attributes.Add(section); 
990
 
                        }
991
 
                        Identifier();
992
 
 
993
 
#line  2390 "Frames/cs.ATG" 
994
 
                        templates.Add(new TemplateDefinition(t.val, attributes)); 
995
 
                }
996
 
                Expect(22);
997
 
        }
998
 
 
999
 
        void ClassBase(
1000
 
#line  492 "Frames/cs.ATG" 
1001
 
out List<TypeReference> names) {
1002
 
 
1003
 
#line  494 "Frames/cs.ATG" 
1004
 
                TypeReference typeRef;
1005
 
                names = new List<TypeReference>();
1006
 
                
1007
 
                Expect(9);
1008
 
                ClassType(
1009
 
#line  498 "Frames/cs.ATG" 
1010
 
out typeRef, false);
1011
 
 
1012
 
#line  498 "Frames/cs.ATG" 
1013
 
                if (typeRef != null) { names.Add(typeRef); } 
1014
 
                while (la.kind == 14) {
1015
 
                        lexer.NextToken();
1016
 
                        TypeName(
1017
 
#line  499 "Frames/cs.ATG" 
1018
 
out typeRef, false);
1019
 
 
1020
 
#line  499 "Frames/cs.ATG" 
1021
 
                        if (typeRef != null) { names.Add(typeRef); } 
1022
 
                }
1023
 
        }
1024
 
 
1025
 
        void TypeParameterConstraintsClause(
1026
 
#line  2394 "Frames/cs.ATG" 
1027
 
List<TemplateDefinition> templates) {
1028
 
 
1029
 
#line  2395 "Frames/cs.ATG" 
1030
 
                string name = ""; TypeReference type; 
1031
 
                Expect(127);
1032
 
                Identifier();
1033
 
 
1034
 
#line  2398 "Frames/cs.ATG" 
1035
 
                name = t.val; 
1036
 
                Expect(9);
1037
 
                TypeParameterConstraintsClauseBase(
1038
 
#line  2400 "Frames/cs.ATG" 
1039
 
out type);
1040
 
 
1041
 
#line  2401 "Frames/cs.ATG" 
1042
 
                TemplateDefinition td = null;
1043
 
                foreach (TemplateDefinition d in templates) {
1044
 
                        if (d.Name == name) {
1045
 
                                td = d;
1046
 
                                break;
1047
 
                        }
1048
 
                }
1049
 
                if ( td != null && type != null) { td.Bases.Add(type); }
1050
 
                
1051
 
                while (la.kind == 14) {
1052
 
                        lexer.NextToken();
1053
 
                        TypeParameterConstraintsClauseBase(
1054
 
#line  2410 "Frames/cs.ATG" 
1055
 
out type);
1056
 
 
1057
 
#line  2411 "Frames/cs.ATG" 
1058
 
                        td = null;
1059
 
                        foreach (TemplateDefinition d in templates) {
1060
 
                                if (d.Name == name) {
1061
 
                                        td = d;
1062
 
                                        break;
1063
 
                                }
1064
 
                        }
1065
 
                        if ( td != null && type != null) { td.Bases.Add(type); }
1066
 
                        
1067
 
                }
1068
 
        }
1069
 
 
1070
 
        void ClassBody() {
1071
 
 
1072
 
#line  503 "Frames/cs.ATG" 
1073
 
                AttributeSection section; 
1074
 
                while (StartOf(12)) {
1075
 
 
1076
 
#line  505 "Frames/cs.ATG" 
1077
 
                        List<AttributeSection> attributes = new List<AttributeSection>();
1078
 
                        ModifierList m = new ModifierList();
1079
 
                        
1080
 
                        while (!(StartOf(13))) {SynErr(154); lexer.NextToken(); }
1081
 
                        while (la.kind == 18) {
1082
 
                                AttributeSection(
1083
 
#line  509 "Frames/cs.ATG" 
1084
 
out section);
1085
 
 
1086
 
#line  509 "Frames/cs.ATG" 
1087
 
                                attributes.Add(section); 
1088
 
                        }
1089
 
                        MemberModifiers(
1090
 
#line  510 "Frames/cs.ATG" 
1091
 
m);
1092
 
                        ClassMemberDecl(
1093
 
#line  511 "Frames/cs.ATG" 
1094
 
m, attributes);
1095
 
                }
1096
 
        }
1097
 
 
1098
 
        void StructInterfaces(
1099
 
#line  515 "Frames/cs.ATG" 
1100
 
out List<TypeReference> names) {
1101
 
 
1102
 
#line  517 "Frames/cs.ATG" 
1103
 
                TypeReference typeRef;
1104
 
                names = new List<TypeReference>();
1105
 
                
1106
 
                Expect(9);
1107
 
                TypeName(
1108
 
#line  521 "Frames/cs.ATG" 
1109
 
out typeRef, false);
1110
 
 
1111
 
#line  521 "Frames/cs.ATG" 
1112
 
                if (typeRef != null) { names.Add(typeRef); } 
1113
 
                while (la.kind == 14) {
1114
 
                        lexer.NextToken();
1115
 
                        TypeName(
1116
 
#line  522 "Frames/cs.ATG" 
1117
 
out typeRef, false);
1118
 
 
1119
 
#line  522 "Frames/cs.ATG" 
1120
 
                        if (typeRef != null) { names.Add(typeRef); } 
1121
 
                }
1122
 
        }
1123
 
 
1124
 
        void StructBody() {
1125
 
 
1126
 
#line  526 "Frames/cs.ATG" 
1127
 
                AttributeSection section; 
1128
 
                Expect(16);
1129
 
                while (StartOf(14)) {
1130
 
 
1131
 
#line  529 "Frames/cs.ATG" 
1132
 
                        List<AttributeSection> attributes = new List<AttributeSection>();
1133
 
                        ModifierList m = new ModifierList();
1134
 
                        
1135
 
                        while (la.kind == 18) {
1136
 
                                AttributeSection(
1137
 
#line  532 "Frames/cs.ATG" 
1138
 
out section);
1139
 
 
1140
 
#line  532 "Frames/cs.ATG" 
1141
 
                                attributes.Add(section); 
1142
 
                        }
1143
 
                        MemberModifiers(
1144
 
#line  533 "Frames/cs.ATG" 
1145
 
m);
1146
 
                        StructMemberDecl(
1147
 
#line  534 "Frames/cs.ATG" 
1148
 
m, attributes);
1149
 
                }
1150
 
                Expect(17);
1151
 
        }
1152
 
 
1153
 
        void InterfaceBase(
1154
 
#line  539 "Frames/cs.ATG" 
1155
 
out List<TypeReference> names) {
1156
 
 
1157
 
#line  541 "Frames/cs.ATG" 
1158
 
                TypeReference typeRef;
1159
 
                names = new List<TypeReference>();
1160
 
                
1161
 
                Expect(9);
1162
 
                TypeName(
1163
 
#line  545 "Frames/cs.ATG" 
1164
 
out typeRef, false);
1165
 
 
1166
 
#line  545 "Frames/cs.ATG" 
1167
 
                if (typeRef != null) { names.Add(typeRef); } 
1168
 
                while (la.kind == 14) {
1169
 
                        lexer.NextToken();
1170
 
                        TypeName(
1171
 
#line  546 "Frames/cs.ATG" 
1172
 
out typeRef, false);
1173
 
 
1174
 
#line  546 "Frames/cs.ATG" 
1175
 
                        if (typeRef != null) { names.Add(typeRef); } 
1176
 
                }
1177
 
        }
1178
 
 
1179
 
        void InterfaceBody() {
1180
 
                Expect(16);
1181
 
                while (StartOf(15)) {
1182
 
                        while (!(StartOf(16))) {SynErr(155); lexer.NextToken(); }
1183
 
                        InterfaceMemberDecl();
1184
 
                }
1185
 
                Expect(17);
1186
 
        }
1187
 
 
1188
 
        void IntegralType(
1189
 
#line  718 "Frames/cs.ATG" 
1190
 
out string name) {
1191
 
 
1192
 
#line  718 "Frames/cs.ATG" 
1193
 
                name = ""; 
1194
 
                switch (la.kind) {
1195
 
                case 102: {
1196
 
                        lexer.NextToken();
1197
 
 
1198
 
#line  720 "Frames/cs.ATG" 
1199
 
                        name = "System.SByte"; 
1200
 
                        break;
1201
 
                }
1202
 
                case 54: {
1203
 
                        lexer.NextToken();
1204
 
 
1205
 
#line  721 "Frames/cs.ATG" 
1206
 
                        name = "System.Byte"; 
1207
 
                        break;
1208
 
                }
1209
 
                case 104: {
1210
 
                        lexer.NextToken();
1211
 
 
1212
 
#line  722 "Frames/cs.ATG" 
1213
 
                        name = "System.Int16"; 
1214
 
                        break;
1215
 
                }
1216
 
                case 120: {
1217
 
                        lexer.NextToken();
1218
 
 
1219
 
#line  723 "Frames/cs.ATG" 
1220
 
                        name = "System.UInt16"; 
1221
 
                        break;
1222
 
                }
1223
 
                case 82: {
1224
 
                        lexer.NextToken();
1225
 
 
1226
 
#line  724 "Frames/cs.ATG" 
1227
 
                        name = "System.Int32"; 
1228
 
                        break;
1229
 
                }
1230
 
                case 116: {
1231
 
                        lexer.NextToken();
1232
 
 
1233
 
#line  725 "Frames/cs.ATG" 
1234
 
                        name = "System.UInt32"; 
1235
 
                        break;
1236
 
                }
1237
 
                case 87: {
1238
 
                        lexer.NextToken();
1239
 
 
1240
 
#line  726 "Frames/cs.ATG" 
1241
 
                        name = "System.Int64"; 
1242
 
                        break;
1243
 
                }
1244
 
                case 117: {
1245
 
                        lexer.NextToken();
1246
 
 
1247
 
#line  727 "Frames/cs.ATG" 
1248
 
                        name = "System.UInt64"; 
1249
 
                        break;
1250
 
                }
1251
 
                case 57: {
1252
 
                        lexer.NextToken();
1253
 
 
1254
 
#line  728 "Frames/cs.ATG" 
1255
 
                        name = "System.Char"; 
1256
 
                        break;
1257
 
                }
1258
 
                default: SynErr(156); break;
1259
 
                }
1260
 
        }
1261
 
 
1262
 
        void EnumBody() {
1263
 
 
1264
 
#line  555 "Frames/cs.ATG" 
1265
 
                FieldDeclaration f; 
1266
 
                Expect(16);
1267
 
                if (StartOf(17)) {
1268
 
                        EnumMemberDecl(
1269
 
#line  558 "Frames/cs.ATG" 
1270
 
out f);
1271
 
 
1272
 
#line  558 "Frames/cs.ATG" 
1273
 
                        compilationUnit.AddChild(f); 
1274
 
                        while (
1275
 
#line  559 "Frames/cs.ATG" 
1276
 
NotFinalComma()) {
1277
 
                                Expect(14);
1278
 
                                EnumMemberDecl(
1279
 
#line  560 "Frames/cs.ATG" 
1280
 
out f);
1281
 
 
1282
 
#line  560 "Frames/cs.ATG" 
1283
 
                                compilationUnit.AddChild(f); 
1284
 
                        }
1285
 
                        if (la.kind == 14) {
1286
 
                                lexer.NextToken();
1287
 
                        }
1288
 
                }
1289
 
                Expect(17);
1290
 
        }
1291
 
 
1292
 
        void Type(
1293
 
#line  566 "Frames/cs.ATG" 
1294
 
out TypeReference type) {
1295
 
                TypeWithRestriction(
1296
 
#line  568 "Frames/cs.ATG" 
1297
 
out type, true, false);
1298
 
        }
1299
 
 
1300
 
        void FormalParameterList(
1301
 
#line  638 "Frames/cs.ATG" 
1302
 
List<ParameterDeclarationExpression> parameter) {
1303
 
 
1304
 
#line  641 "Frames/cs.ATG" 
1305
 
                ParameterDeclarationExpression p;
1306
 
                AttributeSection section;
1307
 
                List<AttributeSection> attributes = new List<AttributeSection>();
1308
 
                
1309
 
                while (la.kind == 18) {
1310
 
                        AttributeSection(
1311
 
#line  646 "Frames/cs.ATG" 
1312
 
out section);
1313
 
 
1314
 
#line  646 "Frames/cs.ATG" 
1315
 
                        attributes.Add(section); 
1316
 
                }
1317
 
                if (StartOf(18)) {
1318
 
                        FixedParameter(
1319
 
#line  648 "Frames/cs.ATG" 
1320
 
out p);
1321
 
 
1322
 
#line  648 "Frames/cs.ATG" 
1323
 
                        bool paramsFound = false;
1324
 
                        p.Attributes = attributes;
1325
 
                        parameter.Add(p);
1326
 
                        
1327
 
                        while (la.kind == 14) {
1328
 
                                lexer.NextToken();
1329
 
 
1330
 
#line  653 "Frames/cs.ATG" 
1331
 
                                attributes = new List<AttributeSection>(); if (paramsFound) Error("params array must be at end of parameter list"); 
1332
 
                                while (la.kind == 18) {
1333
 
                                        AttributeSection(
1334
 
#line  654 "Frames/cs.ATG" 
1335
 
out section);
1336
 
 
1337
 
#line  654 "Frames/cs.ATG" 
1338
 
                                        attributes.Add(section); 
1339
 
                                }
1340
 
                                if (StartOf(18)) {
1341
 
                                        FixedParameter(
1342
 
#line  656 "Frames/cs.ATG" 
1343
 
out p);
1344
 
 
1345
 
#line  656 "Frames/cs.ATG" 
1346
 
                                        p.Attributes = attributes; parameter.Add(p); 
1347
 
                                } else if (la.kind == 95) {
1348
 
                                        ParameterArray(
1349
 
#line  657 "Frames/cs.ATG" 
1350
 
out p);
1351
 
 
1352
 
#line  657 "Frames/cs.ATG" 
1353
 
                                        paramsFound = true; p.Attributes = attributes; parameter.Add(p); 
1354
 
                                } else SynErr(157);
1355
 
                        }
1356
 
                } else if (la.kind == 95) {
1357
 
                        ParameterArray(
1358
 
#line  660 "Frames/cs.ATG" 
1359
 
out p);
1360
 
 
1361
 
#line  660 "Frames/cs.ATG" 
1362
 
                        p.Attributes = attributes; parameter.Add(p); 
1363
 
                } else SynErr(158);
1364
 
        }
1365
 
 
1366
 
        void ClassType(
1367
 
#line  710 "Frames/cs.ATG" 
1368
 
out TypeReference typeRef, bool canBeUnbound) {
1369
 
 
1370
 
#line  711 "Frames/cs.ATG" 
1371
 
                TypeReference r; typeRef = null; 
1372
 
                if (StartOf(19)) {
1373
 
                        TypeName(
1374
 
#line  713 "Frames/cs.ATG" 
1375
 
out r, canBeUnbound);
1376
 
 
1377
 
#line  713 "Frames/cs.ATG" 
1378
 
                        typeRef = r; 
1379
 
                } else if (la.kind == 91) {
1380
 
                        lexer.NextToken();
1381
 
 
1382
 
#line  714 "Frames/cs.ATG" 
1383
 
                        typeRef = new TypeReference("System.Object", true); typeRef.StartLocation = t.Location; 
1384
 
                } else if (la.kind == 108) {
1385
 
                        lexer.NextToken();
1386
 
 
1387
 
#line  715 "Frames/cs.ATG" 
1388
 
                        typeRef = new TypeReference("System.String", true); typeRef.StartLocation = t.Location; 
1389
 
                } else SynErr(159);
1390
 
        }
1391
 
 
1392
 
        void TypeName(
1393
 
#line  2322 "Frames/cs.ATG" 
1394
 
out TypeReference typeRef, bool canBeUnbound) {
1395
 
 
1396
 
#line  2323 "Frames/cs.ATG" 
1397
 
                List<TypeReference> typeArguments = null;
1398
 
                string alias = null;
1399
 
                string qualident;
1400
 
                Location startLocation = la.Location;
1401
 
                
1402
 
                if (
1403
 
#line  2329 "Frames/cs.ATG" 
1404
 
IdentAndDoubleColon()) {
1405
 
                        Identifier();
1406
 
 
1407
 
#line  2330 "Frames/cs.ATG" 
1408
 
                        alias = t.val; 
1409
 
                        Expect(10);
1410
 
                }
1411
 
                Qualident(
1412
 
#line  2333 "Frames/cs.ATG" 
1413
 
out qualident);
1414
 
                if (la.kind == 23) {
1415
 
                        TypeArgumentList(
1416
 
#line  2334 "Frames/cs.ATG" 
1417
 
out typeArguments, canBeUnbound);
1418
 
                }
1419
 
 
1420
 
#line  2336 "Frames/cs.ATG" 
1421
 
                if (alias == null) {
1422
 
                typeRef = new TypeReference(qualident, typeArguments);
1423
 
                } else if (alias == "global") {
1424
 
                        typeRef = new TypeReference(qualident, typeArguments);
1425
 
                        typeRef.IsGlobal = true;
1426
 
                } else {
1427
 
                        typeRef = new TypeReference(alias + "." + qualident, typeArguments);
1428
 
                }
1429
 
                
1430
 
                while (
1431
 
#line  2345 "Frames/cs.ATG" 
1432
 
DotAndIdent()) {
1433
 
                        Expect(15);
1434
 
 
1435
 
#line  2346 "Frames/cs.ATG" 
1436
 
                        typeArguments = null; 
1437
 
                        Qualident(
1438
 
#line  2347 "Frames/cs.ATG" 
1439
 
out qualident);
1440
 
                        if (la.kind == 23) {
1441
 
                                TypeArgumentList(
1442
 
#line  2348 "Frames/cs.ATG" 
1443
 
out typeArguments, canBeUnbound);
1444
 
                        }
1445
 
 
1446
 
#line  2349 "Frames/cs.ATG" 
1447
 
                        typeRef = new InnerClassTypeReference(typeRef, qualident, typeArguments); 
1448
 
                }
1449
 
 
1450
 
#line  2351 "Frames/cs.ATG" 
1451
 
                typeRef.StartLocation = startLocation; 
1452
 
        }
1453
 
 
1454
 
        void MemberModifiers(
1455
 
#line  731 "Frames/cs.ATG" 
1456
 
ModifierList m) {
1457
 
                while (StartOf(20)) {
1458
 
                        switch (la.kind) {
1459
 
                        case 49: {
1460
 
                                lexer.NextToken();
1461
 
 
1462
 
#line  734 "Frames/cs.ATG" 
1463
 
                                m.Add(Modifiers.Abstract, t.Location); 
1464
 
                                break;
1465
 
                        }
1466
 
                        case 71: {
1467
 
                                lexer.NextToken();
1468
 
 
1469
 
#line  735 "Frames/cs.ATG" 
1470
 
                                m.Add(Modifiers.Extern, t.Location); 
1471
 
                                break;
1472
 
                        }
1473
 
                        case 84: {
1474
 
                                lexer.NextToken();
1475
 
 
1476
 
#line  736 "Frames/cs.ATG" 
1477
 
                                m.Add(Modifiers.Internal, t.Location); 
1478
 
                                break;
1479
 
                        }
1480
 
                        case 89: {
1481
 
                                lexer.NextToken();
1482
 
 
1483
 
#line  737 "Frames/cs.ATG" 
1484
 
                                m.Add(Modifiers.New, t.Location); 
1485
 
                                break;
1486
 
                        }
1487
 
                        case 94: {
1488
 
                                lexer.NextToken();
1489
 
 
1490
 
#line  738 "Frames/cs.ATG" 
1491
 
                                m.Add(Modifiers.Override, t.Location); 
1492
 
                                break;
1493
 
                        }
1494
 
                        case 96: {
1495
 
                                lexer.NextToken();
1496
 
 
1497
 
#line  739 "Frames/cs.ATG" 
1498
 
                                m.Add(Modifiers.Private, t.Location); 
1499
 
                                break;
1500
 
                        }
1501
 
                        case 97: {
1502
 
                                lexer.NextToken();
1503
 
 
1504
 
#line  740 "Frames/cs.ATG" 
1505
 
                                m.Add(Modifiers.Protected, t.Location); 
1506
 
                                break;
1507
 
                        }
1508
 
                        case 98: {
1509
 
                                lexer.NextToken();
1510
 
 
1511
 
#line  741 "Frames/cs.ATG" 
1512
 
                                m.Add(Modifiers.Public, t.Location); 
1513
 
                                break;
1514
 
                        }
1515
 
                        case 99: {
1516
 
                                lexer.NextToken();
1517
 
 
1518
 
#line  742 "Frames/cs.ATG" 
1519
 
                                m.Add(Modifiers.ReadOnly, t.Location); 
1520
 
                                break;
1521
 
                        }
1522
 
                        case 103: {
1523
 
                                lexer.NextToken();
1524
 
 
1525
 
#line  743 "Frames/cs.ATG" 
1526
 
                                m.Add(Modifiers.Sealed, t.Location); 
1527
 
                                break;
1528
 
                        }
1529
 
                        case 107: {
1530
 
                                lexer.NextToken();
1531
 
 
1532
 
#line  744 "Frames/cs.ATG" 
1533
 
                                m.Add(Modifiers.Static, t.Location); 
1534
 
                                break;
1535
 
                        }
1536
 
                        case 74: {
1537
 
                                lexer.NextToken();
1538
 
 
1539
 
#line  745 "Frames/cs.ATG" 
1540
 
                                m.Add(Modifiers.Fixed, t.Location); 
1541
 
                                break;
1542
 
                        }
1543
 
                        case 119: {
1544
 
                                lexer.NextToken();
1545
 
 
1546
 
#line  746 "Frames/cs.ATG" 
1547
 
                                m.Add(Modifiers.Unsafe, t.Location); 
1548
 
                                break;
1549
 
                        }
1550
 
                        case 122: {
1551
 
                                lexer.NextToken();
1552
 
 
1553
 
#line  747 "Frames/cs.ATG" 
1554
 
                                m.Add(Modifiers.Virtual, t.Location); 
1555
 
                                break;
1556
 
                        }
1557
 
                        case 124: {
1558
 
                                lexer.NextToken();
1559
 
 
1560
 
#line  748 "Frames/cs.ATG" 
1561
 
                                m.Add(Modifiers.Volatile, t.Location); 
1562
 
                                break;
1563
 
                        }
1564
 
                        case 126: {
1565
 
                                lexer.NextToken();
1566
 
 
1567
 
#line  749 "Frames/cs.ATG" 
1568
 
                                m.Add(Modifiers.Partial, t.Location); 
1569
 
                                break;
1570
 
                        }
1571
 
                        }
1572
 
                }
1573
 
        }
1574
 
 
1575
 
        void ClassMemberDecl(
1576
 
#line  1076 "Frames/cs.ATG" 
1577
 
ModifierList m, List<AttributeSection> attributes) {
1578
 
 
1579
 
#line  1077 "Frames/cs.ATG" 
1580
 
                Statement stmt = null; 
1581
 
                if (StartOf(21)) {
1582
 
                        StructMemberDecl(
1583
 
#line  1079 "Frames/cs.ATG" 
1584
 
m, attributes);
1585
 
                } else if (la.kind == 27) {
1586
 
 
1587
 
#line  1080 "Frames/cs.ATG" 
1588
 
                        m.Check(Modifiers.Destructors); Location startPos = la.Location; 
1589
 
                        lexer.NextToken();
1590
 
                        Identifier();
1591
 
 
1592
 
#line  1081 "Frames/cs.ATG" 
1593
 
                        DestructorDeclaration d = new DestructorDeclaration(t.val, m.Modifier, attributes); 
1594
 
                        d.Modifier = m.Modifier;
1595
 
                        d.StartLocation = m.GetDeclarationLocation(startPos);
1596
 
                        
1597
 
                        Expect(20);
1598
 
                        Expect(21);
1599
 
 
1600
 
#line  1085 "Frames/cs.ATG" 
1601
 
                        d.EndLocation = t.EndLocation; 
1602
 
                        if (la.kind == 16) {
1603
 
                                Block(
1604
 
#line  1085 "Frames/cs.ATG" 
1605
 
out stmt);
1606
 
                        } else if (la.kind == 11) {
1607
 
                                lexer.NextToken();
1608
 
                        } else SynErr(160);
1609
 
 
1610
 
#line  1086 "Frames/cs.ATG" 
1611
 
                        d.Body = (BlockStatement)stmt;
1612
 
                        compilationUnit.AddChild(d);
1613
 
                        
1614
 
                } else SynErr(161);
1615
 
        }
1616
 
 
1617
 
        void StructMemberDecl(
1618
 
#line  753 "Frames/cs.ATG" 
1619
 
ModifierList m, List<AttributeSection> attributes) {
1620
 
 
1621
 
#line  755 "Frames/cs.ATG" 
1622
 
                string qualident = null;
1623
 
                TypeReference type;
1624
 
                Expression expr;
1625
 
                List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
1626
 
                Statement stmt = null;
1627
 
                List<TemplateDefinition> templates = new List<TemplateDefinition>();
1628
 
                TypeReference explicitInterface = null;
1629
 
                bool isExtensionMethod = false;
1630
 
                
1631
 
                if (la.kind == 60) {
1632
 
 
1633
 
#line  765 "Frames/cs.ATG" 
1634
 
                        m.Check(Modifiers.Constants); 
1635
 
                        lexer.NextToken();
1636
 
 
1637
 
#line  766 "Frames/cs.ATG" 
1638
 
                        Location startPos = t.Location; 
1639
 
                        Type(
1640
 
#line  767 "Frames/cs.ATG" 
1641
 
out type);
1642
 
                        Identifier();
1643
 
 
1644
 
#line  767 "Frames/cs.ATG" 
1645
 
                        FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier | Modifiers.Const);
1646
 
                        fd.StartLocation = m.GetDeclarationLocation(startPos);
1647
 
                        VariableDeclaration f = new VariableDeclaration(t.val);
1648
 
                        f.StartLocation = t.Location;
1649
 
                        f.TypeReference = type;
1650
 
                        SafeAdd(fd, fd.Fields, f);
1651
 
                        
1652
 
                        Expect(3);
1653
 
                        Expr(
1654
 
#line  774 "Frames/cs.ATG" 
1655
 
out expr);
1656
 
 
1657
 
#line  774 "Frames/cs.ATG" 
1658
 
                        f.Initializer = expr; 
1659
 
                        while (la.kind == 14) {
1660
 
                                lexer.NextToken();
1661
 
                                Identifier();
1662
 
 
1663
 
#line  775 "Frames/cs.ATG" 
1664
 
                                f = new VariableDeclaration(t.val);
1665
 
                                f.StartLocation = t.Location;
1666
 
                                f.TypeReference = type;
1667
 
                                SafeAdd(fd, fd.Fields, f);
1668
 
                                
1669
 
                                Expect(3);
1670
 
                                Expr(
1671
 
#line  780 "Frames/cs.ATG" 
1672
 
out expr);
1673
 
 
1674
 
#line  780 "Frames/cs.ATG" 
1675
 
                                f.EndLocation = t.EndLocation; f.Initializer = expr; 
1676
 
                        }
1677
 
                        Expect(11);
1678
 
 
1679
 
#line  781 "Frames/cs.ATG" 
1680
 
                        fd.EndLocation = t.EndLocation; compilationUnit.AddChild(fd); 
1681
 
                } else if (
1682
 
#line  785 "Frames/cs.ATG" 
1683
 
NotVoidPointer()) {
1684
 
 
1685
 
#line  785 "Frames/cs.ATG" 
1686
 
                        m.Check(Modifiers.PropertysEventsMethods); 
1687
 
                        Expect(123);
1688
 
 
1689
 
#line  786 "Frames/cs.ATG" 
1690
 
                        Location startPos = t.Location; 
1691
 
                        if (
1692
 
#line  787 "Frames/cs.ATG" 
1693
 
IsExplicitInterfaceImplementation()) {
1694
 
                                TypeName(
1695
 
#line  788 "Frames/cs.ATG" 
1696
 
out explicitInterface, false);
1697
 
 
1698
 
#line  789 "Frames/cs.ATG" 
1699
 
                                if (la.kind != Tokens.Dot || Peek(1).kind != Tokens.This) {
1700
 
                                qualident = TypeReference.StripLastIdentifierFromType(ref explicitInterface);
1701
 
                                 } 
1702
 
                        } else if (StartOf(19)) {
1703
 
                                Identifier();
1704
 
 
1705
 
#line  792 "Frames/cs.ATG" 
1706
 
                                qualident = t.val; 
1707
 
                        } else SynErr(162);
1708
 
                        if (la.kind == 23) {
1709
 
                                TypeParameterList(
1710
 
#line  795 "Frames/cs.ATG" 
1711
 
templates);
1712
 
                        }
1713
 
                        Expect(20);
1714
 
                        if (la.kind == 111) {
1715
 
                                lexer.NextToken();
1716
 
 
1717
 
#line  798 "Frames/cs.ATG" 
1718
 
                                isExtensionMethod = true; /* C# 3.0 */ 
1719
 
                        }
1720
 
                        if (StartOf(11)) {
1721
 
                                FormalParameterList(
1722
 
#line  799 "Frames/cs.ATG" 
1723
 
p);
1724
 
                        }
1725
 
                        Expect(21);
1726
 
 
1727
 
#line  800 "Frames/cs.ATG" 
1728
 
                        MethodDeclaration methodDeclaration = new MethodDeclaration {
1729
 
                        Name = qualident,
1730
 
                        Modifier = m.Modifier,
1731
 
                        TypeReference = new TypeReference("System.Void", true),
1732
 
                        Parameters = p,
1733
 
                        Attributes = attributes,
1734
 
                        StartLocation = m.GetDeclarationLocation(startPos),
1735
 
                        EndLocation = t.EndLocation,
1736
 
                        Templates = templates,
1737
 
                        IsExtensionMethod = isExtensionMethod
1738
 
                        };
1739
 
                        if (explicitInterface != null)
1740
 
                                SafeAdd(methodDeclaration, methodDeclaration.InterfaceImplementations, new InterfaceImplementation(explicitInterface, qualident));
1741
 
                        compilationUnit.AddChild(methodDeclaration);
1742
 
                        compilationUnit.BlockStart(methodDeclaration);
1743
 
                        
1744
 
                        while (la.kind == 127) {
1745
 
                                TypeParameterConstraintsClause(
1746
 
#line  818 "Frames/cs.ATG" 
1747
 
templates);
1748
 
                        }
1749
 
                        if (la.kind == 16) {
1750
 
                                Block(
1751
 
#line  820 "Frames/cs.ATG" 
1752
 
out stmt);
1753
 
                        } else if (la.kind == 11) {
1754
 
                                lexer.NextToken();
1755
 
                        } else SynErr(163);
1756
 
 
1757
 
#line  820 "Frames/cs.ATG" 
1758
 
                        compilationUnit.BlockEnd();
1759
 
                        methodDeclaration.Body  = (BlockStatement)stmt;
1760
 
                        
1761
 
                } else if (la.kind == 69) {
1762
 
 
1763
 
#line  824 "Frames/cs.ATG" 
1764
 
                        m.Check(Modifiers.PropertysEventsMethods); 
1765
 
                        lexer.NextToken();
1766
 
 
1767
 
#line  826 "Frames/cs.ATG" 
1768
 
                        EventDeclaration eventDecl = new EventDeclaration {
1769
 
                        Modifier = m.Modifier, 
1770
 
                        Attributes = attributes,
1771
 
                        StartLocation = t.Location
1772
 
                        };
1773
 
                        compilationUnit.AddChild(eventDecl);
1774
 
                        compilationUnit.BlockStart(eventDecl);
1775
 
                        EventAddRegion addBlock = null;
1776
 
                        EventRemoveRegion removeBlock = null;
1777
 
                        
1778
 
                        Type(
1779
 
#line  836 "Frames/cs.ATG" 
1780
 
out type);
1781
 
 
1782
 
#line  836 "Frames/cs.ATG" 
1783
 
                        eventDecl.TypeReference = type; 
1784
 
                        if (
1785
 
#line  837 "Frames/cs.ATG" 
1786
 
IsExplicitInterfaceImplementation()) {
1787
 
                                TypeName(
1788
 
#line  838 "Frames/cs.ATG" 
1789
 
out explicitInterface, false);
1790
 
 
1791
 
#line  839 "Frames/cs.ATG" 
1792
 
                                qualident = TypeReference.StripLastIdentifierFromType(ref explicitInterface); 
1793
 
 
1794
 
#line  840 "Frames/cs.ATG" 
1795
 
                                eventDecl.InterfaceImplementations.Add(new InterfaceImplementation(explicitInterface, qualident)); 
1796
 
                        } else if (StartOf(19)) {
1797
 
                                Identifier();
1798
 
 
1799
 
#line  842 "Frames/cs.ATG" 
1800
 
                                qualident = t.val; 
1801
 
                        } else SynErr(164);
1802
 
 
1803
 
#line  844 "Frames/cs.ATG" 
1804
 
                        eventDecl.Name = qualident; eventDecl.EndLocation = t.EndLocation; 
1805
 
                        if (la.kind == 3) {
1806
 
                                lexer.NextToken();
1807
 
                                Expr(
1808
 
#line  845 "Frames/cs.ATG" 
1809
 
out expr);
1810
 
 
1811
 
#line  845 "Frames/cs.ATG" 
1812
 
                                eventDecl.Initializer = expr; 
1813
 
                        }
1814
 
                        if (la.kind == 16) {
1815
 
                                lexer.NextToken();
1816
 
 
1817
 
#line  846 "Frames/cs.ATG" 
1818
 
                                eventDecl.BodyStart = t.Location; 
1819
 
                                EventAccessorDecls(
1820
 
#line  847 "Frames/cs.ATG" 
1821
 
out addBlock, out removeBlock);
1822
 
                                Expect(17);
1823
 
 
1824
 
#line  848 "Frames/cs.ATG" 
1825
 
                                eventDecl.BodyEnd   = t.EndLocation; 
1826
 
                        }
1827
 
 
1828
 
#line  850 "Frames/cs.ATG" 
1829
 
                        compilationUnit.BlockEnd();
1830
 
                        eventDecl.AddRegion = addBlock;
1831
 
                        eventDecl.RemoveRegion = removeBlock;
1832
 
                        
1833
 
                        while (la.kind == 14) {
1834
 
                                lexer.NextToken();
1835
 
                                Identifier();
1836
 
 
1837
 
#line  854 "Frames/cs.ATG" 
1838
 
                                EventDeclaration additionalEventDeclaration = new EventDeclaration {
1839
 
                                    Modifier = eventDecl.Modifier, 
1840
 
                                    Attributes = eventDecl.Attributes,
1841
 
                                    StartLocation = eventDecl.StartLocation,
1842
 
                                    TypeReference = eventDecl.TypeReference,
1843
 
                                    Name = t.val
1844
 
                                };
1845
 
                                compilationUnit.AddChild (additionalEventDeclaration);
1846
 
                                
1847
 
                        }
1848
 
                        if (la.kind == 11) {
1849
 
                                lexer.NextToken();
1850
 
                        }
1851
 
                } else if (
1852
 
#line  868 "Frames/cs.ATG" 
1853
 
IdentAndLPar()) {
1854
 
 
1855
 
#line  868 "Frames/cs.ATG" 
1856
 
                        m.Check(Modifiers.Constructors | Modifiers.StaticConstructors); 
1857
 
                        Identifier();
1858
 
 
1859
 
#line  869 "Frames/cs.ATG" 
1860
 
                        string name = t.val; Location startPos = t.Location; 
1861
 
                        Expect(20);
1862
 
                        if (StartOf(11)) {
1863
 
 
1864
 
#line  869 "Frames/cs.ATG" 
1865
 
                                m.Check(Modifiers.Constructors); 
1866
 
                                FormalParameterList(
1867
 
#line  870 "Frames/cs.ATG" 
1868
 
p);
1869
 
                        }
1870
 
                        Expect(21);
1871
 
 
1872
 
#line  872 "Frames/cs.ATG" 
1873
 
                        ConstructorInitializer init = null;  
1874
 
                        if (la.kind == 9) {
1875
 
 
1876
 
#line  873 "Frames/cs.ATG" 
1877
 
                                m.Check(Modifiers.Constructors); 
1878
 
                                ConstructorInitializer(
1879
 
#line  874 "Frames/cs.ATG" 
1880
 
out init);
1881
 
                        }
1882
 
 
1883
 
#line  876 "Frames/cs.ATG" 
1884
 
                        ConstructorDeclaration cd = new ConstructorDeclaration(name, m.Modifier, p, init, attributes);
1885
 
                        cd.StartLocation = startPos;
1886
 
                        cd.EndLocation   = t.EndLocation;
1887
 
                        
1888
 
                        if (la.kind == 16) {
1889
 
                                Block(
1890
 
#line  881 "Frames/cs.ATG" 
1891
 
out stmt);
1892
 
                        } else if (la.kind == 11) {
1893
 
                                lexer.NextToken();
1894
 
                        } else SynErr(165);
1895
 
 
1896
 
#line  881 "Frames/cs.ATG" 
1897
 
                        cd.Body = (BlockStatement)stmt; compilationUnit.AddChild(cd); 
1898
 
                } else if (la.kind == 70 || la.kind == 80) {
1899
 
 
1900
 
#line  884 "Frames/cs.ATG" 
1901
 
                        m.Check(Modifiers.Operators);
1902
 
                        if (m.isNone) Error("at least one modifier must be set"); 
1903
 
                        bool isImplicit = true;
1904
 
                        Location startPos = Location.Empty;
1905
 
                        
1906
 
                        if (la.kind == 80) {
1907
 
                                lexer.NextToken();
1908
 
 
1909
 
#line  889 "Frames/cs.ATG" 
1910
 
                                startPos = t.Location; 
1911
 
                        } else {
1912
 
                                lexer.NextToken();
1913
 
 
1914
 
#line  889 "Frames/cs.ATG" 
1915
 
                                isImplicit = false; startPos = t.Location; 
1916
 
                        }
1917
 
                        Expect(92);
1918
 
                        Type(
1919
 
#line  890 "Frames/cs.ATG" 
1920
 
out type);
1921
 
 
1922
 
#line  890 "Frames/cs.ATG" 
1923
 
                        TypeReference operatorType = type; 
1924
 
                        Expect(20);
1925
 
                        Type(
1926
 
#line  891 "Frames/cs.ATG" 
1927
 
out type);
1928
 
                        Identifier();
1929
 
 
1930
 
#line  891 "Frames/cs.ATG" 
1931
 
                        string varName = t.val; 
1932
 
                        Expect(21);
1933
 
 
1934
 
#line  892 "Frames/cs.ATG" 
1935
 
                        Location endPos = t.Location; 
1936
 
                        if (la.kind == 16) {
1937
 
                                Block(
1938
 
#line  893 "Frames/cs.ATG" 
1939
 
out stmt);
1940
 
                        } else if (la.kind == 11) {
1941
 
                                lexer.NextToken();
1942
 
 
1943
 
#line  893 "Frames/cs.ATG" 
1944
 
                                stmt = null; 
1945
 
                        } else SynErr(166);
1946
 
 
1947
 
#line  896 "Frames/cs.ATG" 
1948
 
                        List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>();
1949
 
                        parameters.Add(new ParameterDeclarationExpression(type, varName));
1950
 
                        OperatorDeclaration operatorDeclaration = new OperatorDeclaration {
1951
 
                                Name = (isImplicit ? "op_Implicit" : "op_Explicit"),
1952
 
                                Modifier = m.Modifier,
1953
 
                                Attributes = attributes, 
1954
 
                                Parameters = parameters, 
1955
 
                                TypeReference = operatorType,
1956
 
                                ConversionType = isImplicit ? ConversionType.Implicit : ConversionType.Explicit,
1957
 
                                Body = (BlockStatement)stmt,
1958
 
                                StartLocation = m.GetDeclarationLocation(startPos),
1959
 
                                EndLocation = endPos
1960
 
                        };
1961
 
                        compilationUnit.AddChild(operatorDeclaration);
1962
 
                        
1963
 
                } else if (StartOf(22)) {
1964
 
                        TypeDecl(
1965
 
#line  914 "Frames/cs.ATG" 
1966
 
m, attributes);
1967
 
                } else if (StartOf(10)) {
1968
 
                        Type(
1969
 
#line  916 "Frames/cs.ATG" 
1970
 
out type);
1971
 
 
1972
 
#line  916 "Frames/cs.ATG" 
1973
 
                        Location startPos = t.Location;  
1974
 
                        if (la.kind == 92) {
1975
 
 
1976
 
#line  918 "Frames/cs.ATG" 
1977
 
                                OverloadableOperatorType op;
1978
 
                                m.Check(Modifiers.Operators);
1979
 
                                if (m.isNone) Error("at least one modifier must be set");
1980
 
                                
1981
 
                                lexer.NextToken();
1982
 
                                OverloadableOperator(
1983
 
#line  922 "Frames/cs.ATG" 
1984
 
out op);
1985
 
 
1986
 
#line  922 "Frames/cs.ATG" 
1987
 
                                TypeReference firstType, secondType = null; string secondName = null; 
1988
 
                                Expect(20);
1989
 
                                Type(
1990
 
#line  923 "Frames/cs.ATG" 
1991
 
out firstType);
1992
 
                                Identifier();
1993
 
 
1994
 
#line  923 "Frames/cs.ATG" 
1995
 
                                string firstName = t.val; 
1996
 
                                if (la.kind == 14) {
1997
 
                                        lexer.NextToken();
1998
 
                                        Type(
1999
 
#line  924 "Frames/cs.ATG" 
2000
 
out secondType);
2001
 
                                        Identifier();
2002
 
 
2003
 
#line  924 "Frames/cs.ATG" 
2004
 
                                        secondName = t.val; 
2005
 
                                } else if (la.kind == 21) {
2006
 
                                } else SynErr(167);
2007
 
 
2008
 
#line  932 "Frames/cs.ATG" 
2009
 
                                Location endPos = t.Location; 
2010
 
                                Expect(21);
2011
 
                                if (la.kind == 16) {
2012
 
                                        Block(
2013
 
#line  933 "Frames/cs.ATG" 
2014
 
out stmt);
2015
 
                                } else if (la.kind == 11) {
2016
 
                                        lexer.NextToken();
2017
 
                                } else SynErr(168);
2018
 
 
2019
 
#line  935 "Frames/cs.ATG" 
2020
 
                                if (op == OverloadableOperatorType.Add && secondType == null)
2021
 
                                op = OverloadableOperatorType.UnaryPlus;
2022
 
                                if (op == OverloadableOperatorType.Subtract && secondType == null)
2023
 
                                        op = OverloadableOperatorType.UnaryMinus;
2024
 
                                OperatorDeclaration operatorDeclaration = new OperatorDeclaration {
2025
 
                                        Modifier = m.Modifier,
2026
 
                                        Attributes = attributes,
2027
 
                                        TypeReference = type,
2028
 
                                        OverloadableOperator = op,
2029
 
                                        Name = GetReflectionNameForOperator(op),
2030
 
                                        Body = (BlockStatement)stmt,
2031
 
                                        StartLocation = m.GetDeclarationLocation(startPos),
2032
 
                                        EndLocation = endPos
2033
 
                                };
2034
 
                                SafeAdd(operatorDeclaration, operatorDeclaration.Parameters, new ParameterDeclarationExpression(firstType, firstName));
2035
 
                                if (secondType != null) {
2036
 
                                        SafeAdd(operatorDeclaration, operatorDeclaration.Parameters, new ParameterDeclarationExpression(secondType, secondName));
2037
 
                                }
2038
 
                                compilationUnit.AddChild(operatorDeclaration);
2039
 
                                
2040
 
                        } else if (
2041
 
#line  957 "Frames/cs.ATG" 
2042
 
IsVarDecl()) {
2043
 
 
2044
 
#line  958 "Frames/cs.ATG" 
2045
 
                                m.Check(Modifiers.Fields);
2046
 
                                FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier);
2047
 
                                fd.StartLocation = m.GetDeclarationLocation(startPos); 
2048
 
                                
2049
 
                                if (
2050
 
#line  962 "Frames/cs.ATG" 
2051
 
m.Contains(Modifiers.Fixed)) {
2052
 
                                        VariableDeclarator(
2053
 
#line  963 "Frames/cs.ATG" 
2054
 
fd);
2055
 
                                        Expect(18);
2056
 
                                        Expr(
2057
 
#line  965 "Frames/cs.ATG" 
2058
 
out expr);
2059
 
 
2060
 
#line  965 "Frames/cs.ATG" 
2061
 
                                        if (fd.Fields.Count > 0)
2062
 
                                        fd.Fields[fd.Fields.Count-1].FixedArrayInitialization = expr; 
2063
 
                                        Expect(19);
2064
 
                                        while (la.kind == 14) {
2065
 
                                                lexer.NextToken();
2066
 
                                                VariableDeclarator(
2067
 
#line  969 "Frames/cs.ATG" 
2068
 
fd);
2069
 
                                                Expect(18);
2070
 
                                                Expr(
2071
 
#line  971 "Frames/cs.ATG" 
2072
 
out expr);
2073
 
 
2074
 
#line  971 "Frames/cs.ATG" 
2075
 
                                                if (fd.Fields.Count > 0)
2076
 
                                                fd.Fields[fd.Fields.Count-1].FixedArrayInitialization = expr; 
2077
 
                                                Expect(19);
2078
 
                                        }
2079
 
                                } else if (StartOf(19)) {
2080
 
                                        VariableDeclarator(
2081
 
#line  976 "Frames/cs.ATG" 
2082
 
fd);
2083
 
                                        while (la.kind == 14) {
2084
 
                                                lexer.NextToken();
2085
 
                                                VariableDeclarator(
2086
 
#line  977 "Frames/cs.ATG" 
2087
 
fd);
2088
 
                                        }
2089
 
                                } else SynErr(169);
2090
 
                                Expect(11);
2091
 
 
2092
 
#line  979 "Frames/cs.ATG" 
2093
 
                                fd.EndLocation = t.EndLocation; compilationUnit.AddChild(fd); 
2094
 
                        } else if (la.kind == 111) {
2095
 
 
2096
 
#line  982 "Frames/cs.ATG" 
2097
 
                                m.Check(Modifiers.Indexers); 
2098
 
                                lexer.NextToken();
2099
 
                                Expect(18);
2100
 
                                FormalParameterList(
2101
 
#line  983 "Frames/cs.ATG" 
2102
 
p);
2103
 
                                Expect(19);
2104
 
 
2105
 
#line  983 "Frames/cs.ATG" 
2106
 
                                Location endLocation = t.EndLocation; 
2107
 
                                Expect(16);
2108
 
 
2109
 
#line  984 "Frames/cs.ATG" 
2110
 
                                IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes);
2111
 
                                indexer.StartLocation = startPos;
2112
 
                                indexer.EndLocation   = endLocation;
2113
 
                                indexer.BodyStart     = t.Location;
2114
 
                                PropertyGetRegion getRegion;
2115
 
                                PropertySetRegion setRegion;
2116
 
                                
2117
 
                                AccessorDecls(
2118
 
#line  991 "Frames/cs.ATG" 
2119
 
out getRegion, out setRegion);
2120
 
                                Expect(17);
2121
 
 
2122
 
#line  992 "Frames/cs.ATG" 
2123
 
                                indexer.BodyEnd    = t.EndLocation;
2124
 
                                indexer.GetRegion = getRegion;
2125
 
                                indexer.SetRegion = setRegion;
2126
 
                                compilationUnit.AddChild(indexer);
2127
 
                                
2128
 
                        } else if (
2129
 
#line  997 "Frames/cs.ATG" 
2130
 
IsIdentifierToken(la)) {
2131
 
                                if (
2132
 
#line  998 "Frames/cs.ATG" 
2133
 
IsExplicitInterfaceImplementation()) {
2134
 
                                        TypeName(
2135
 
#line  999 "Frames/cs.ATG" 
2136
 
out explicitInterface, false);
2137
 
 
2138
 
#line  1000 "Frames/cs.ATG" 
2139
 
                                        if (la.kind != Tokens.Dot || Peek(1).kind != Tokens.This) {
2140
 
                                        qualident = TypeReference.StripLastIdentifierFromType(ref explicitInterface);
2141
 
                                         } 
2142
 
                                } else if (StartOf(19)) {
2143
 
                                        Identifier();
2144
 
 
2145
 
#line  1003 "Frames/cs.ATG" 
2146
 
                                        qualident = t.val; 
2147
 
                                } else SynErr(170);
2148
 
 
2149
 
#line  1005 "Frames/cs.ATG" 
2150
 
                                Location qualIdentEndLocation = t.EndLocation; 
2151
 
                                if (la.kind == 16 || la.kind == 20 || la.kind == 23) {
2152
 
                                        if (la.kind == 20 || la.kind == 23) {
2153
 
 
2154
 
#line  1009 "Frames/cs.ATG" 
2155
 
                                                m.Check(Modifiers.PropertysEventsMethods); 
2156
 
                                                if (la.kind == 23) {
2157
 
                                                        TypeParameterList(
2158
 
#line  1011 "Frames/cs.ATG" 
2159
 
templates);
2160
 
                                                }
2161
 
                                                Expect(20);
2162
 
                                                if (la.kind == 111) {
2163
 
                                                        lexer.NextToken();
2164
 
 
2165
 
#line  1013 "Frames/cs.ATG" 
2166
 
                                                        isExtensionMethod = true; 
2167
 
                                                }
2168
 
                                                if (StartOf(11)) {
2169
 
                                                        FormalParameterList(
2170
 
#line  1014 "Frames/cs.ATG" 
2171
 
p);
2172
 
                                                }
2173
 
                                                Expect(21);
2174
 
 
2175
 
#line  1016 "Frames/cs.ATG" 
2176
 
                                                MethodDeclaration methodDeclaration = new MethodDeclaration {
2177
 
                                                Name = qualident,
2178
 
                                                Modifier = m.Modifier,
2179
 
                                                TypeReference = type,
2180
 
                                                Parameters = p, 
2181
 
                                                Attributes = attributes
2182
 
                                                };
2183
 
                                                if (explicitInterface != null)
2184
 
                                                        methodDeclaration.InterfaceImplementations.Add(new InterfaceImplementation(explicitInterface, qualident));
2185
 
                                                methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos);
2186
 
                                                methodDeclaration.EndLocation   = t.EndLocation;
2187
 
                                                methodDeclaration.IsExtensionMethod = isExtensionMethod;
2188
 
                                                methodDeclaration.Templates = templates;
2189
 
                                                compilationUnit.AddChild(methodDeclaration);
2190
 
                                                                                      
2191
 
                                                while (la.kind == 127) {
2192
 
                                                        TypeParameterConstraintsClause(
2193
 
#line  1031 "Frames/cs.ATG" 
2194
 
templates);
2195
 
                                                }
2196
 
                                                if (la.kind == 16) {
2197
 
                                                        Block(
2198
 
#line  1032 "Frames/cs.ATG" 
2199
 
out stmt);
2200
 
                                                } else if (la.kind == 11) {
2201
 
                                                        lexer.NextToken();
2202
 
                                                } else SynErr(171);
2203
 
 
2204
 
#line  1032 "Frames/cs.ATG" 
2205
 
                                                methodDeclaration.Body  = (BlockStatement)stmt; 
2206
 
                                        } else {
2207
 
                                                lexer.NextToken();
2208
 
 
2209
 
#line  1035 "Frames/cs.ATG" 
2210
 
                                                PropertyDeclaration pDecl = new PropertyDeclaration(qualident, type, m.Modifier, attributes); 
2211
 
                                                if (explicitInterface != null)
2212
 
                                                pDecl.InterfaceImplementations.Add(new InterfaceImplementation(explicitInterface, qualident));
2213
 
                                                      pDecl.StartLocation = m.GetDeclarationLocation(startPos);
2214
 
                                                      pDecl.EndLocation   = qualIdentEndLocation;
2215
 
                                                      pDecl.BodyStart   = t.Location;
2216
 
                                                      PropertyGetRegion getRegion;
2217
 
                                                      PropertySetRegion setRegion;
2218
 
                                                   
2219
 
                                                AccessorDecls(
2220
 
#line  1044 "Frames/cs.ATG" 
2221
 
out getRegion, out setRegion);
2222
 
                                                Expect(17);
2223
 
 
2224
 
#line  1046 "Frames/cs.ATG" 
2225
 
                                                pDecl.GetRegion = getRegion;
2226
 
                                                pDecl.SetRegion = setRegion;
2227
 
                                                pDecl.BodyEnd = t.EndLocation;
2228
 
                                                compilationUnit.AddChild(pDecl);
2229
 
                                                
2230
 
                                        }
2231
 
                                } else if (la.kind == 15) {
2232
 
 
2233
 
#line  1054 "Frames/cs.ATG" 
2234
 
                                        m.Check(Modifiers.Indexers); 
2235
 
                                        lexer.NextToken();
2236
 
                                        Expect(111);
2237
 
                                        Expect(18);
2238
 
                                        FormalParameterList(
2239
 
#line  1055 "Frames/cs.ATG" 
2240
 
p);
2241
 
                                        Expect(19);
2242
 
 
2243
 
#line  1056 "Frames/cs.ATG" 
2244
 
                                        IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes);
2245
 
                                        indexer.StartLocation = m.GetDeclarationLocation(startPos);
2246
 
                                        indexer.EndLocation   = t.EndLocation;
2247
 
                                        if (explicitInterface != null)
2248
 
                                        SafeAdd(indexer, indexer.InterfaceImplementations, new InterfaceImplementation(explicitInterface, "this"));
2249
 
                                              PropertyGetRegion getRegion;
2250
 
                                              PropertySetRegion setRegion;
2251
 
                                            
2252
 
                                        Expect(16);
2253
 
 
2254
 
#line  1064 "Frames/cs.ATG" 
2255
 
                                        Location bodyStart = t.Location; 
2256
 
                                        AccessorDecls(
2257
 
#line  1065 "Frames/cs.ATG" 
2258
 
out getRegion, out setRegion);
2259
 
                                        Expect(17);
2260
 
 
2261
 
#line  1066 "Frames/cs.ATG" 
2262
 
                                        indexer.BodyStart = bodyStart;
2263
 
                                        indexer.BodyEnd   = t.EndLocation;
2264
 
                                        indexer.GetRegion = getRegion;
2265
 
                                        indexer.SetRegion = setRegion;
2266
 
                                        compilationUnit.AddChild(indexer);
2267
 
                                        
2268
 
                                } else SynErr(172);
2269
 
                        } else SynErr(173);
2270
 
                } else SynErr(174);
2271
 
        }
2272
 
 
2273
 
        void InterfaceMemberDecl() {
2274
 
 
2275
 
#line  1093 "Frames/cs.ATG" 
2276
 
                TypeReference type;
2277
 
                        AttributeSection section;
2278
 
                Modifiers mod = Modifiers.None;
2279
 
                List<AttributeSection> attributes = new List<AttributeSection>();
2280
 
                List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>();
2281
 
                string name;
2282
 
                PropertyGetRegion getBlock;
2283
 
                PropertySetRegion setBlock;
2284
 
                Location startLocation = new Location(-1, -1);
2285
 
                List<TemplateDefinition> templates = new List<TemplateDefinition>();
2286
 
                
2287
 
                while (la.kind == 18) {
2288
 
                        AttributeSection(
2289
 
#line  1106 "Frames/cs.ATG" 
2290
 
out section);
2291
 
 
2292
 
#line  1106 "Frames/cs.ATG" 
2293
 
                        attributes.Add(section); 
2294
 
                }
2295
 
                if (la.kind == 89) {
2296
 
                        lexer.NextToken();
2297
 
 
2298
 
#line  1107 "Frames/cs.ATG" 
2299
 
                        mod = Modifiers.New; startLocation = t.Location; 
2300
 
                }
2301
 
                if (
2302
 
#line  1110 "Frames/cs.ATG" 
2303
 
NotVoidPointer()) {
2304
 
                        Expect(123);
2305
 
 
2306
 
#line  1110 "Frames/cs.ATG" 
2307
 
                        if (startLocation.IsEmpty) startLocation = t.Location; 
2308
 
                        Identifier();
2309
 
 
2310
 
#line  1111 "Frames/cs.ATG" 
2311
 
                        name = t.val; 
2312
 
                        if (la.kind == 23) {
2313
 
                                TypeParameterList(
2314
 
#line  1112 "Frames/cs.ATG" 
2315
 
templates);
2316
 
                        }
2317
 
                        Expect(20);
2318
 
                        if (StartOf(11)) {
2319
 
                                FormalParameterList(
2320
 
#line  1113 "Frames/cs.ATG" 
2321
 
parameters);
2322
 
                        }
2323
 
                        Expect(21);
2324
 
                        while (la.kind == 127) {
2325
 
                                TypeParameterConstraintsClause(
2326
 
#line  1114 "Frames/cs.ATG" 
2327
 
templates);
2328
 
                        }
2329
 
                        Expect(11);
2330
 
 
2331
 
#line  1116 "Frames/cs.ATG" 
2332
 
                        MethodDeclaration md = new MethodDeclaration {
2333
 
                        Name = name, Modifier = mod, TypeReference = new TypeReference("System.Void", true), 
2334
 
                        Parameters = parameters, Attributes = attributes, Templates = templates,
2335
 
                        StartLocation = startLocation, EndLocation = t.EndLocation
2336
 
                        };
2337
 
                        compilationUnit.AddChild(md);
2338
 
                        
2339
 
                } else if (StartOf(23)) {
2340
 
                        if (StartOf(10)) {
2341
 
                                Type(
2342
 
#line  1124 "Frames/cs.ATG" 
2343
 
out type);
2344
 
 
2345
 
#line  1124 "Frames/cs.ATG" 
2346
 
                                if (startLocation.IsEmpty) startLocation = t.Location; 
2347
 
                                if (StartOf(19)) {
2348
 
                                        Identifier();
2349
 
 
2350
 
#line  1126 "Frames/cs.ATG" 
2351
 
                                        name = t.val; Location qualIdentEndLocation = t.EndLocation; 
2352
 
                                        if (la.kind == 20 || la.kind == 23) {
2353
 
                                                if (la.kind == 23) {
2354
 
                                                        TypeParameterList(
2355
 
#line  1130 "Frames/cs.ATG" 
2356
 
templates);
2357
 
                                                }
2358
 
                                                Expect(20);
2359
 
                                                if (StartOf(11)) {
2360
 
                                                        FormalParameterList(
2361
 
#line  1131 "Frames/cs.ATG" 
2362
 
parameters);
2363
 
                                                }
2364
 
                                                Expect(21);
2365
 
                                                while (la.kind == 127) {
2366
 
                                                        TypeParameterConstraintsClause(
2367
 
#line  1133 "Frames/cs.ATG" 
2368
 
templates);
2369
 
                                                }
2370
 
                                                Expect(11);
2371
 
 
2372
 
#line  1134 "Frames/cs.ATG" 
2373
 
                                                MethodDeclaration md = new MethodDeclaration {
2374
 
                                                Name = name, Modifier = mod, TypeReference = type,
2375
 
                                                Parameters = parameters, Attributes = attributes, Templates = templates,
2376
 
                                                StartLocation = startLocation, EndLocation = t.EndLocation
2377
 
                                                };
2378
 
                                                compilationUnit.AddChild(md);
2379
 
                                                
2380
 
                                        } else if (la.kind == 16) {
2381
 
 
2382
 
#line  1143 "Frames/cs.ATG" 
2383
 
                                                PropertyDeclaration pd = new PropertyDeclaration(name, type, mod, attributes);
2384
 
                                                compilationUnit.AddChild(pd); 
2385
 
                                                lexer.NextToken();
2386
 
 
2387
 
#line  1146 "Frames/cs.ATG" 
2388
 
                                                Location bodyStart = t.Location;
2389
 
                                                InterfaceAccessors(
2390
 
#line  1147 "Frames/cs.ATG" 
2391
 
out getBlock, out setBlock);
2392
 
                                                Expect(17);
2393
 
 
2394
 
#line  1148 "Frames/cs.ATG" 
2395
 
                                                pd.GetRegion = getBlock; pd.SetRegion = setBlock; pd.StartLocation = startLocation; pd.EndLocation = qualIdentEndLocation; pd.BodyStart = bodyStart; pd.BodyEnd = t.EndLocation; 
2396
 
                                        } else SynErr(175);
2397
 
                                } else if (la.kind == 111) {
2398
 
                                        lexer.NextToken();
2399
 
                                        Expect(18);
2400
 
                                        FormalParameterList(
2401
 
#line  1151 "Frames/cs.ATG" 
2402
 
parameters);
2403
 
                                        Expect(19);
2404
 
 
2405
 
#line  1152 "Frames/cs.ATG" 
2406
 
                                        Location bracketEndLocation = t.EndLocation; 
2407
 
 
2408
 
#line  1153 "Frames/cs.ATG" 
2409
 
                                        IndexerDeclaration id = new IndexerDeclaration(type, parameters, mod, attributes);
2410
 
                                        compilationUnit.AddChild(id); 
2411
 
                                        Expect(16);
2412
 
 
2413
 
#line  1155 "Frames/cs.ATG" 
2414
 
                                        Location bodyStart = t.Location;
2415
 
                                        InterfaceAccessors(
2416
 
#line  1156 "Frames/cs.ATG" 
2417
 
out getBlock, out setBlock);
2418
 
                                        Expect(17);
2419
 
 
2420
 
#line  1158 "Frames/cs.ATG" 
2421
 
                                        id.GetRegion = getBlock; id.SetRegion = setBlock; id.StartLocation = startLocation;  id.EndLocation = bracketEndLocation; id.BodyStart = bodyStart; id.BodyEnd = t.EndLocation;
2422
 
                                } else SynErr(176);
2423
 
                        } else {
2424
 
                                lexer.NextToken();
2425
 
 
2426
 
#line  1161 "Frames/cs.ATG" 
2427
 
                                if (startLocation.IsEmpty) startLocation = t.Location; 
2428
 
                                Type(
2429
 
#line  1162 "Frames/cs.ATG" 
2430
 
out type);
2431
 
                                Identifier();
2432
 
 
2433
 
#line  1163 "Frames/cs.ATG" 
2434
 
                                EventDeclaration ed = new EventDeclaration {
2435
 
                                TypeReference = type, Name = t.val, Modifier = mod, Attributes = attributes
2436
 
                                };
2437
 
                                compilationUnit.AddChild(ed);
2438
 
                                
2439
 
                                Expect(11);
2440
 
 
2441
 
#line  1169 "Frames/cs.ATG" 
2442
 
                                ed.StartLocation = startLocation; ed.EndLocation = t.EndLocation; 
2443
 
                        }
2444
 
                } else SynErr(177);
2445
 
        }
2446
 
 
2447
 
        void EnumMemberDecl(
2448
 
#line  1174 "Frames/cs.ATG" 
2449
 
out FieldDeclaration f) {
2450
 
 
2451
 
#line  1176 "Frames/cs.ATG" 
2452
 
                Expression expr = null;
2453
 
                List<AttributeSection> attributes = new List<AttributeSection>();
2454
 
                AttributeSection section = null;
2455
 
                VariableDeclaration varDecl = null;
2456
 
                
2457
 
                while (la.kind == 18) {
2458
 
                        AttributeSection(
2459
 
#line  1182 "Frames/cs.ATG" 
2460
 
out section);
2461
 
 
2462
 
#line  1182 "Frames/cs.ATG" 
2463
 
                        attributes.Add(section); 
2464
 
                }
2465
 
                Identifier();
2466
 
 
2467
 
#line  1183 "Frames/cs.ATG" 
2468
 
                f = new FieldDeclaration(attributes);
2469
 
                varDecl         = new VariableDeclaration(t.val);
2470
 
                f.Fields.Add(varDecl);
2471
 
                f.StartLocation = t.Location;
2472
 
                f.EndLocation = t.EndLocation;
2473
 
                
2474
 
                if (la.kind == 3) {
2475
 
                        lexer.NextToken();
2476
 
                        Expr(
2477
 
#line  1189 "Frames/cs.ATG" 
2478
 
out expr);
2479
 
 
2480
 
#line  1189 "Frames/cs.ATG" 
2481
 
                        varDecl.Initializer = expr; 
2482
 
                }
2483
 
        }
2484
 
 
2485
 
        void TypeWithRestriction(
2486
 
#line  571 "Frames/cs.ATG" 
2487
 
out TypeReference type, bool allowNullable, bool canBeUnbound) {
2488
 
 
2489
 
#line  573 "Frames/cs.ATG" 
2490
 
                Location startPos = la.Location;
2491
 
                string name;
2492
 
                int pointer = 0;
2493
 
                type = null;
2494
 
                
2495
 
                if (StartOf(4)) {
2496
 
                        ClassType(
2497
 
#line  579 "Frames/cs.ATG" 
2498
 
out type, canBeUnbound);
2499
 
                } else if (StartOf(5)) {
2500
 
                        SimpleType(
2501
 
#line  580 "Frames/cs.ATG" 
2502
 
out name);
2503
 
 
2504
 
#line  580 "Frames/cs.ATG" 
2505
 
                        type = new TypeReference(name, true); 
2506
 
                } else if (la.kind == 123) {
2507
 
                        lexer.NextToken();
2508
 
                        Expect(6);
2509
 
 
2510
 
#line  581 "Frames/cs.ATG" 
2511
 
                        pointer = 1; type = new TypeReference("System.Void", true); 
2512
 
                } else SynErr(178);
2513
 
 
2514
 
#line  582 "Frames/cs.ATG" 
2515
 
                List<int> r = new List<int>(); 
2516
 
                if (
2517
 
#line  584 "Frames/cs.ATG" 
2518
 
allowNullable && la.kind == Tokens.Question) {
2519
 
                        NullableQuestionMark(
2520
 
#line  584 "Frames/cs.ATG" 
2521
 
ref type);
2522
 
                }
2523
 
                while (
2524
 
#line  586 "Frames/cs.ATG" 
2525
 
IsPointerOrDims()) {
2526
 
 
2527
 
#line  586 "Frames/cs.ATG" 
2528
 
                        int i = 0; 
2529
 
                        if (la.kind == 6) {
2530
 
                                lexer.NextToken();
2531
 
 
2532
 
#line  587 "Frames/cs.ATG" 
2533
 
                                ++pointer; 
2534
 
                        } else if (la.kind == 18) {
2535
 
                                lexer.NextToken();
2536
 
                                while (la.kind == 14) {
2537
 
                                        lexer.NextToken();
2538
 
 
2539
 
#line  588 "Frames/cs.ATG" 
2540
 
                                        ++i; 
2541
 
                                }
2542
 
                                Expect(19);
2543
 
 
2544
 
#line  588 "Frames/cs.ATG" 
2545
 
                                r.Add(i); 
2546
 
                        } else SynErr(179);
2547
 
                }
2548
 
 
2549
 
#line  591 "Frames/cs.ATG" 
2550
 
                if (type != null) {
2551
 
                type.RankSpecifier = r.ToArray();
2552
 
                type.PointerNestingLevel = pointer;
2553
 
                type.EndLocation = t.EndLocation;
2554
 
                type.StartLocation = startPos;
2555
 
                }
2556
 
                
2557
 
        }
2558
 
 
2559
 
        void SimpleType(
2560
 
#line  627 "Frames/cs.ATG" 
2561
 
out string name) {
2562
 
 
2563
 
#line  628 "Frames/cs.ATG" 
2564
 
                name = String.Empty; 
2565
 
                if (StartOf(24)) {
2566
 
                        IntegralType(
2567
 
#line  630 "Frames/cs.ATG" 
2568
 
out name);
2569
 
                } else if (la.kind == 75) {
2570
 
                        lexer.NextToken();
2571
 
 
2572
 
#line  631 "Frames/cs.ATG" 
2573
 
                        name = "System.Single"; 
2574
 
                } else if (la.kind == 66) {
2575
 
                        lexer.NextToken();
2576
 
 
2577
 
#line  632 "Frames/cs.ATG" 
2578
 
                        name = "System.Double"; 
2579
 
                } else if (la.kind == 62) {
2580
 
                        lexer.NextToken();
2581
 
 
2582
 
#line  633 "Frames/cs.ATG" 
2583
 
                        name = "System.Decimal"; 
2584
 
                } else if (la.kind == 52) {
2585
 
                        lexer.NextToken();
2586
 
 
2587
 
#line  634 "Frames/cs.ATG" 
2588
 
                        name = "System.Boolean"; 
2589
 
                } else SynErr(180);
2590
 
        }
2591
 
 
2592
 
        void NullableQuestionMark(
2593
 
#line  2355 "Frames/cs.ATG" 
2594
 
ref TypeReference typeRef) {
2595
 
 
2596
 
#line  2356 "Frames/cs.ATG" 
2597
 
                List<TypeReference> typeArguments = new List<TypeReference>(1); 
2598
 
                Expect(12);
2599
 
 
2600
 
#line  2360 "Frames/cs.ATG" 
2601
 
                if (typeRef != null) typeArguments.Add(typeRef);
2602
 
                typeRef = new TypeReference("System.Nullable", typeArguments) { IsKeyword = true };
2603
 
                
2604
 
        }
2605
 
 
2606
 
        void FixedParameter(
2607
 
#line  664 "Frames/cs.ATG" 
2608
 
out ParameterDeclarationExpression p) {
2609
 
 
2610
 
#line  666 "Frames/cs.ATG" 
2611
 
                TypeReference type;
2612
 
                ParameterModifiers mod = ParameterModifiers.In;
2613
 
                Location start = la.Location;
2614
 
                Expression defaultParameterExpr = null;
2615
 
                
2616
 
                if (la.kind == 93 || la.kind == 100) {
2617
 
                        if (la.kind == 100) {
2618
 
                                lexer.NextToken();
2619
 
 
2620
 
#line  673 "Frames/cs.ATG" 
2621
 
                                mod = ParameterModifiers.Ref; 
2622
 
                        } else {
2623
 
                                lexer.NextToken();
2624
 
 
2625
 
#line  674 "Frames/cs.ATG" 
2626
 
                                mod = ParameterModifiers.Out; 
2627
 
                        }
2628
 
                }
2629
 
                Type(
2630
 
#line  676 "Frames/cs.ATG" 
2631
 
out type);
2632
 
                Identifier();
2633
 
 
2634
 
#line  676 "Frames/cs.ATG" 
2635
 
                p = new ParameterDeclarationExpression(type, t.val, mod); p.StartLocation = start; p.EndLocation = t.Location; 
2636
 
                if (la.kind == 3) {
2637
 
                        lexer.NextToken();
2638
 
                        Expr(
2639
 
#line  677 "Frames/cs.ATG" 
2640
 
out defaultParameterExpr);
2641
 
                }
2642
 
        }
2643
 
 
2644
 
        void ParameterArray(
2645
 
#line  680 "Frames/cs.ATG" 
2646
 
out ParameterDeclarationExpression p) {
2647
 
 
2648
 
#line  681 "Frames/cs.ATG" 
2649
 
                TypeReference type; 
2650
 
                Expect(95);
2651
 
                Type(
2652
 
#line  683 "Frames/cs.ATG" 
2653
 
out type);
2654
 
                Identifier();
2655
 
 
2656
 
#line  683 "Frames/cs.ATG" 
2657
 
                p = new ParameterDeclarationExpression(type, t.val, ParameterModifiers.Params); 
2658
 
        }
2659
 
 
2660
 
        void AccessorModifiers(
2661
 
#line  686 "Frames/cs.ATG" 
2662
 
out ModifierList m) {
2663
 
 
2664
 
#line  687 "Frames/cs.ATG" 
2665
 
                m = new ModifierList(); 
2666
 
                if (la.kind == 96) {
2667
 
                        lexer.NextToken();
2668
 
 
2669
 
#line  689 "Frames/cs.ATG" 
2670
 
                        m.Add(Modifiers.Private, t.Location); 
2671
 
                } else if (la.kind == 97) {
2672
 
                        lexer.NextToken();
2673
 
 
2674
 
#line  690 "Frames/cs.ATG" 
2675
 
                        m.Add(Modifiers.Protected, t.Location); 
2676
 
                        if (la.kind == 84) {
2677
 
                                lexer.NextToken();
2678
 
 
2679
 
#line  691 "Frames/cs.ATG" 
2680
 
                                m.Add(Modifiers.Internal, t.Location); 
2681
 
                        }
2682
 
                } else if (la.kind == 84) {
2683
 
                        lexer.NextToken();
2684
 
 
2685
 
#line  692 "Frames/cs.ATG" 
2686
 
                        m.Add(Modifiers.Internal, t.Location); 
2687
 
                        if (la.kind == 97) {
2688
 
                                lexer.NextToken();
2689
 
 
2690
 
#line  693 "Frames/cs.ATG" 
2691
 
                                m.Add(Modifiers.Protected, t.Location); 
2692
 
                        }
2693
 
                } else SynErr(181);
2694
 
        }
2695
 
 
2696
 
        void Block(
2697
 
#line  1309 "Frames/cs.ATG" 
2698
 
out Statement stmt) {
2699
 
                Expect(16);
2700
 
 
2701
 
#line  1311 "Frames/cs.ATG" 
2702
 
                BlockStatement blockStmt = new BlockStatement();
2703
 
                blockStmt.StartLocation = t.Location;
2704
 
                compilationUnit.BlockStart(blockStmt);
2705
 
                if (!ParseMethodBodies) lexer.SkipCurrentBlock(0);
2706
 
                
2707
 
                while (StartOf(25)) {
2708
 
                        Statement();
2709
 
                }
2710
 
                while (!(la.kind == 0 || la.kind == 17)) {SynErr(182); lexer.NextToken(); }
2711
 
                Expect(17);
2712
 
 
2713
 
#line  1319 "Frames/cs.ATG" 
2714
 
                stmt = blockStmt;
2715
 
                blockStmt.EndLocation = t.Kind != Tokens.CloseCurlyBrace ? Location.Empty : t.EndLocation;
2716
 
                compilationUnit.BlockEnd();
2717
 
                
2718
 
        }
2719
 
 
2720
 
        void EventAccessorDecls(
2721
 
#line  1246 "Frames/cs.ATG" 
2722
 
out EventAddRegion addBlock, out EventRemoveRegion removeBlock) {
2723
 
 
2724
 
#line  1247 "Frames/cs.ATG" 
2725
 
                AttributeSection section;
2726
 
                List<AttributeSection> attributes = new List<AttributeSection>();
2727
 
                Statement stmt;
2728
 
                addBlock = null;
2729
 
                removeBlock = null;
2730
 
                
2731
 
                while (la.kind == 18) {
2732
 
                        AttributeSection(
2733
 
#line  1254 "Frames/cs.ATG" 
2734
 
out section);
2735
 
 
2736
 
#line  1254 "Frames/cs.ATG" 
2737
 
                        attributes.Add(section); 
2738
 
                }
2739
 
                if (la.kind == 130) {
2740
 
 
2741
 
#line  1256 "Frames/cs.ATG" 
2742
 
                        addBlock = new EventAddRegion(attributes); 
2743
 
                        AddAccessorDecl(
2744
 
#line  1257 "Frames/cs.ATG" 
2745
 
out stmt);
2746
 
 
2747
 
#line  1257 "Frames/cs.ATG" 
2748
 
                        attributes = new List<AttributeSection>(); addBlock.Block = (BlockStatement)stmt; 
2749
 
                        while (la.kind == 18) {
2750
 
                                AttributeSection(
2751
 
#line  1258 "Frames/cs.ATG" 
2752
 
out section);
2753
 
 
2754
 
#line  1258 "Frames/cs.ATG" 
2755
 
                                attributes.Add(section); 
2756
 
                        }
2757
 
                        RemoveAccessorDecl(
2758
 
#line  1259 "Frames/cs.ATG" 
2759
 
out stmt);
2760
 
 
2761
 
#line  1259 "Frames/cs.ATG" 
2762
 
                        removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; 
2763
 
                } else if (la.kind == 131) {
2764
 
                        RemoveAccessorDecl(
2765
 
#line  1261 "Frames/cs.ATG" 
2766
 
out stmt);
2767
 
 
2768
 
#line  1261 "Frames/cs.ATG" 
2769
 
                        removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; attributes = new List<AttributeSection>(); 
2770
 
                        while (la.kind == 18) {
2771
 
                                AttributeSection(
2772
 
#line  1262 "Frames/cs.ATG" 
2773
 
out section);
2774
 
 
2775
 
#line  1262 "Frames/cs.ATG" 
2776
 
                                attributes.Add(section); 
2777
 
                        }
2778
 
                        AddAccessorDecl(
2779
 
#line  1263 "Frames/cs.ATG" 
2780
 
out stmt);
2781
 
 
2782
 
#line  1263 "Frames/cs.ATG" 
2783
 
                        addBlock = new EventAddRegion(attributes); addBlock.Block = (BlockStatement)stmt; 
2784
 
                } else SynErr(183);
2785
 
        }
2786
 
 
2787
 
        void ConstructorInitializer(
2788
 
#line  1339 "Frames/cs.ATG" 
2789
 
out ConstructorInitializer ci) {
2790
 
 
2791
 
#line  1340 "Frames/cs.ATG" 
2792
 
                Expression expr; ci = new ConstructorInitializer(); 
2793
 
                Expect(9);
2794
 
                if (la.kind == 51) {
2795
 
                        lexer.NextToken();
2796
 
 
2797
 
#line  1344 "Frames/cs.ATG" 
2798
 
                        ci.ConstructorInitializerType = ConstructorInitializerType.Base; 
2799
 
                } else if (la.kind == 111) {
2800
 
                        lexer.NextToken();
2801
 
 
2802
 
#line  1345 "Frames/cs.ATG" 
2803
 
                        ci.ConstructorInitializerType = ConstructorInitializerType.This; 
2804
 
                } else SynErr(184);
2805
 
                Expect(20);
2806
 
                if (StartOf(26)) {
2807
 
                        Argument(
2808
 
#line  1348 "Frames/cs.ATG" 
2809
 
out expr);
2810
 
 
2811
 
#line  1348 "Frames/cs.ATG" 
2812
 
                        SafeAdd(ci, ci.Arguments, expr); 
2813
 
                        while (la.kind == 14) {
2814
 
                                lexer.NextToken();
2815
 
                                Argument(
2816
 
#line  1349 "Frames/cs.ATG" 
2817
 
out expr);
2818
 
 
2819
 
#line  1349 "Frames/cs.ATG" 
2820
 
                                SafeAdd(ci, ci.Arguments, expr); 
2821
 
                        }
2822
 
                }
2823
 
                Expect(21);
2824
 
        }
2825
 
 
2826
 
        void OverloadableOperator(
2827
 
#line  1362 "Frames/cs.ATG" 
2828
 
out OverloadableOperatorType op) {
2829
 
 
2830
 
#line  1363 "Frames/cs.ATG" 
2831
 
                op = OverloadableOperatorType.None; 
2832
 
                switch (la.kind) {
2833
 
                case 4: {
2834
 
                        lexer.NextToken();
2835
 
 
2836
 
#line  1365 "Frames/cs.ATG" 
2837
 
                        op = OverloadableOperatorType.Add; 
2838
 
                        break;
2839
 
                }
2840
 
                case 5: {
2841
 
                        lexer.NextToken();
2842
 
 
2843
 
#line  1366 "Frames/cs.ATG" 
2844
 
                        op = OverloadableOperatorType.Subtract; 
2845
 
                        break;
2846
 
                }
2847
 
                case 24: {
2848
 
                        lexer.NextToken();
2849
 
 
2850
 
#line  1368 "Frames/cs.ATG" 
2851
 
                        op = OverloadableOperatorType.Not; 
2852
 
                        break;
2853
 
                }
2854
 
                case 27: {
2855
 
                        lexer.NextToken();
2856
 
 
2857
 
#line  1369 "Frames/cs.ATG" 
2858
 
                        op = OverloadableOperatorType.BitNot; 
2859
 
                        break;
2860
 
                }
2861
 
                case 31: {
2862
 
                        lexer.NextToken();
2863
 
 
2864
 
#line  1371 "Frames/cs.ATG" 
2865
 
                        op = OverloadableOperatorType.Increment; 
2866
 
                        break;
2867
 
                }
2868
 
                case 32: {
2869
 
                        lexer.NextToken();
2870
 
 
2871
 
#line  1372 "Frames/cs.ATG" 
2872
 
                        op = OverloadableOperatorType.Decrement; 
2873
 
                        break;
2874
 
                }
2875
 
                case 113: {
2876
 
                        lexer.NextToken();
2877
 
 
2878
 
#line  1374 "Frames/cs.ATG" 
2879
 
                        op = OverloadableOperatorType.IsTrue; 
2880
 
                        break;
2881
 
                }
2882
 
                case 72: {
2883
 
                        lexer.NextToken();
2884
 
 
2885
 
#line  1375 "Frames/cs.ATG" 
2886
 
                        op = OverloadableOperatorType.IsFalse; 
2887
 
                        break;
2888
 
                }
2889
 
                case 6: {
2890
 
                        lexer.NextToken();
2891
 
 
2892
 
#line  1377 "Frames/cs.ATG" 
2893
 
                        op = OverloadableOperatorType.Multiply; 
2894
 
                        break;
2895
 
                }
2896
 
                case 7: {
2897
 
                        lexer.NextToken();
2898
 
 
2899
 
#line  1378 "Frames/cs.ATG" 
2900
 
                        op = OverloadableOperatorType.Divide; 
2901
 
                        break;
2902
 
                }
2903
 
                case 8: {
2904
 
                        lexer.NextToken();
2905
 
 
2906
 
#line  1379 "Frames/cs.ATG" 
2907
 
                        op = OverloadableOperatorType.Modulus; 
2908
 
                        break;
2909
 
                }
2910
 
                case 28: {
2911
 
                        lexer.NextToken();
2912
 
 
2913
 
#line  1381 "Frames/cs.ATG" 
2914
 
                        op = OverloadableOperatorType.BitwiseAnd; 
2915
 
                        break;
2916
 
                }
2917
 
                case 29: {
2918
 
                        lexer.NextToken();
2919
 
 
2920
 
#line  1382 "Frames/cs.ATG" 
2921
 
                        op = OverloadableOperatorType.BitwiseOr; 
2922
 
                        break;
2923
 
                }
2924
 
                case 30: {
2925
 
                        lexer.NextToken();
2926
 
 
2927
 
#line  1383 "Frames/cs.ATG" 
2928
 
                        op = OverloadableOperatorType.ExclusiveOr; 
2929
 
                        break;
2930
 
                }
2931
 
                case 37: {
2932
 
                        lexer.NextToken();
2933
 
 
2934
 
#line  1385 "Frames/cs.ATG" 
2935
 
                        op = OverloadableOperatorType.ShiftLeft; 
2936
 
                        break;
2937
 
                }
2938
 
                case 33: {
2939
 
                        lexer.NextToken();
2940
 
 
2941
 
#line  1386 "Frames/cs.ATG" 
2942
 
                        op = OverloadableOperatorType.Equality; 
2943
 
                        break;
2944
 
                }
2945
 
                case 34: {
2946
 
                        lexer.NextToken();
2947
 
 
2948
 
#line  1387 "Frames/cs.ATG" 
2949
 
                        op = OverloadableOperatorType.InEquality; 
2950
 
                        break;
2951
 
                }
2952
 
                case 23: {
2953
 
                        lexer.NextToken();
2954
 
 
2955
 
#line  1388 "Frames/cs.ATG" 
2956
 
                        op = OverloadableOperatorType.LessThan; 
2957
 
                        break;
2958
 
                }
2959
 
                case 35: {
2960
 
                        lexer.NextToken();
2961
 
 
2962
 
#line  1389 "Frames/cs.ATG" 
2963
 
                        op = OverloadableOperatorType.GreaterThanOrEqual; 
2964
 
                        break;
2965
 
                }
2966
 
                case 36: {
2967
 
                        lexer.NextToken();
2968
 
 
2969
 
#line  1390 "Frames/cs.ATG" 
2970
 
                        op = OverloadableOperatorType.LessThanOrEqual; 
2971
 
                        break;
2972
 
                }
2973
 
                case 22: {
2974
 
                        lexer.NextToken();
2975
 
 
2976
 
#line  1391 "Frames/cs.ATG" 
2977
 
                        op = OverloadableOperatorType.GreaterThan; 
2978
 
                        if (la.kind == 22) {
2979
 
                                lexer.NextToken();
2980
 
 
2981
 
#line  1391 "Frames/cs.ATG" 
2982
 
                                op = OverloadableOperatorType.ShiftRight; 
2983
 
                        }
2984
 
                        break;
2985
 
                }
2986
 
                default: SynErr(185); break;
2987
 
                }
2988
 
        }
2989
 
 
2990
 
        void VariableDeclarator(
2991
 
#line  1301 "Frames/cs.ATG" 
2992
 
FieldDeclaration parentFieldDeclaration) {
2993
 
 
2994
 
#line  1302 "Frames/cs.ATG" 
2995
 
                Expression expr = null; 
2996
 
                Identifier();
2997
 
 
2998
 
#line  1304 "Frames/cs.ATG" 
2999
 
                VariableDeclaration f = new VariableDeclaration(t.val); f.StartLocation = t.Location; 
3000
 
                if (la.kind == 3) {
3001
 
                        lexer.NextToken();
3002
 
                        VariableInitializer(
3003
 
#line  1305 "Frames/cs.ATG" 
3004
 
out expr);
3005
 
 
3006
 
#line  1305 "Frames/cs.ATG" 
3007
 
                        f.Initializer = expr; 
3008
 
                }
3009
 
 
3010
 
#line  1306 "Frames/cs.ATG" 
3011
 
                f.EndLocation = t.EndLocation; SafeAdd(parentFieldDeclaration, parentFieldDeclaration.Fields, f); 
3012
 
        }
3013
 
 
3014
 
        void AccessorDecls(
3015
 
#line  1193 "Frames/cs.ATG" 
3016
 
out PropertyGetRegion getBlock, out PropertySetRegion setBlock) {
3017
 
 
3018
 
#line  1195 "Frames/cs.ATG" 
3019
 
                List<AttributeSection> attributes = new List<AttributeSection>(); 
3020
 
                AttributeSection section;
3021
 
                getBlock = null;
3022
 
                setBlock = null; 
3023
 
                ModifierList modifiers = null;
3024
 
                
3025
 
                while (la.kind == 18) {
3026
 
                        AttributeSection(
3027
 
#line  1202 "Frames/cs.ATG" 
3028
 
out section);
3029
 
 
3030
 
#line  1202 "Frames/cs.ATG" 
3031
 
                        attributes.Add(section); 
3032
 
                }
3033
 
                if (la.kind == 84 || la.kind == 96 || la.kind == 97) {
3034
 
                        AccessorModifiers(
3035
 
#line  1203 "Frames/cs.ATG" 
3036
 
out modifiers);
3037
 
                }
3038
 
                if (la.kind == 128) {
3039
 
                        GetAccessorDecl(
3040
 
#line  1205 "Frames/cs.ATG" 
3041
 
out getBlock, attributes);
3042
 
 
3043
 
#line  1206 "Frames/cs.ATG" 
3044
 
                        if (modifiers != null) {getBlock.Modifier = modifiers.Modifier; } 
3045
 
                        if (StartOf(27)) {
3046
 
 
3047
 
#line  1207 "Frames/cs.ATG" 
3048
 
                                attributes = new List<AttributeSection>(); modifiers = null; 
3049
 
                                while (la.kind == 18) {
3050
 
                                        AttributeSection(
3051
 
#line  1208 "Frames/cs.ATG" 
3052
 
out section);
3053
 
 
3054
 
#line  1208 "Frames/cs.ATG" 
3055
 
                                        attributes.Add(section); 
3056
 
                                }
3057
 
                                if (la.kind == 84 || la.kind == 96 || la.kind == 97) {
3058
 
                                        AccessorModifiers(
3059
 
#line  1209 "Frames/cs.ATG" 
3060
 
out modifiers);
3061
 
                                }
3062
 
                                SetAccessorDecl(
3063
 
#line  1210 "Frames/cs.ATG" 
3064
 
out setBlock, attributes);
3065
 
 
3066
 
#line  1211 "Frames/cs.ATG" 
3067
 
                                if (modifiers != null) {setBlock.Modifier = modifiers.Modifier; } 
3068
 
                        }
3069
 
                } else if (la.kind == 129) {
3070
 
                        SetAccessorDecl(
3071
 
#line  1214 "Frames/cs.ATG" 
3072
 
out setBlock, attributes);
3073
 
 
3074
 
#line  1215 "Frames/cs.ATG" 
3075
 
                        if (modifiers != null) {setBlock.Modifier = modifiers.Modifier; } 
3076
 
                        if (StartOf(28)) {
3077
 
 
3078
 
#line  1216 "Frames/cs.ATG" 
3079
 
                                attributes = new List<AttributeSection>(); modifiers = null; 
3080
 
                                while (la.kind == 18) {
3081
 
                                        AttributeSection(
3082
 
#line  1217 "Frames/cs.ATG" 
3083
 
out section);
3084
 
 
3085
 
#line  1217 "Frames/cs.ATG" 
3086
 
                                        attributes.Add(section); 
3087
 
                                }
3088
 
                                if (la.kind == 84 || la.kind == 96 || la.kind == 97) {
3089
 
                                        AccessorModifiers(
3090
 
#line  1218 "Frames/cs.ATG" 
3091
 
out modifiers);
3092
 
                                }
3093
 
                                GetAccessorDecl(
3094
 
#line  1219 "Frames/cs.ATG" 
3095
 
out getBlock, attributes);
3096
 
 
3097
 
#line  1220 "Frames/cs.ATG" 
3098
 
                                if (modifiers != null) {getBlock.Modifier = modifiers.Modifier; } 
3099
 
                        }
3100
 
                } else if (StartOf(19)) {
3101
 
                        Identifier();
3102
 
 
3103
 
#line  1222 "Frames/cs.ATG" 
3104
 
                        Error("get or set accessor declaration expected"); 
3105
 
                } else SynErr(186);
3106
 
        }
3107
 
 
3108
 
        void InterfaceAccessors(
3109
 
#line  1267 "Frames/cs.ATG" 
3110
 
out PropertyGetRegion getBlock, out PropertySetRegion setBlock) {
3111
 
 
3112
 
#line  1269 "Frames/cs.ATG" 
3113
 
                AttributeSection section;
3114
 
                List<AttributeSection> attributes = new List<AttributeSection>();
3115
 
                getBlock = null; setBlock = null;
3116
 
                PropertyGetSetRegion lastBlock = null;
3117
 
                
3118
 
                while (la.kind == 18) {
3119
 
                        AttributeSection(
3120
 
#line  1275 "Frames/cs.ATG" 
3121
 
out section);
3122
 
 
3123
 
#line  1275 "Frames/cs.ATG" 
3124
 
                        attributes.Add(section); 
3125
 
                }
3126
 
 
3127
 
#line  1276 "Frames/cs.ATG" 
3128
 
                Location startLocation = la.Location; 
3129
 
                if (la.kind == 128) {
3130
 
                        lexer.NextToken();
3131
 
 
3132
 
#line  1278 "Frames/cs.ATG" 
3133
 
                        getBlock = new PropertyGetRegion(null, attributes); 
3134
 
                } else if (la.kind == 129) {
3135
 
                        lexer.NextToken();
3136
 
 
3137
 
#line  1279 "Frames/cs.ATG" 
3138
 
                        setBlock = new PropertySetRegion(null, attributes); 
3139
 
                } else SynErr(187);
3140
 
                Expect(11);
3141
 
 
3142
 
#line  1282 "Frames/cs.ATG" 
3143
 
                if (getBlock != null) { getBlock.StartLocation = startLocation; getBlock.EndLocation = t.EndLocation; }
3144
 
                if (setBlock != null) { setBlock.StartLocation = startLocation; setBlock.EndLocation = t.EndLocation; }
3145
 
                attributes = new List<AttributeSection>(); 
3146
 
                if (la.kind == 18 || la.kind == 128 || la.kind == 129) {
3147
 
                        while (la.kind == 18) {
3148
 
                                AttributeSection(
3149
 
#line  1286 "Frames/cs.ATG" 
3150
 
out section);
3151
 
 
3152
 
#line  1286 "Frames/cs.ATG" 
3153
 
                                attributes.Add(section); 
3154
 
                        }
3155
 
 
3156
 
#line  1287 "Frames/cs.ATG" 
3157
 
                        startLocation = la.Location; 
3158
 
                        if (la.kind == 128) {
3159
 
                                lexer.NextToken();
3160
 
 
3161
 
#line  1289 "Frames/cs.ATG" 
3162
 
                                if (getBlock != null) Error("get already declared");
3163
 
                                                 else { getBlock = new PropertyGetRegion(null, attributes); lastBlock = getBlock; }
3164
 
                                              
3165
 
                        } else if (la.kind == 129) {
3166
 
                                lexer.NextToken();
3167
 
 
3168
 
#line  1292 "Frames/cs.ATG" 
3169
 
                                if (setBlock != null) Error("set already declared");
3170
 
                                                 else { setBlock = new PropertySetRegion(null, attributes); lastBlock = setBlock; }
3171
 
                                              
3172
 
                        } else SynErr(188);
3173
 
                        Expect(11);
3174
 
 
3175
 
#line  1297 "Frames/cs.ATG" 
3176
 
                        if (lastBlock != null) { lastBlock.StartLocation = startLocation; lastBlock.EndLocation = t.EndLocation; } 
3177
 
                }
3178
 
        }
3179
 
 
3180
 
        void GetAccessorDecl(
3181
 
#line  1226 "Frames/cs.ATG" 
3182
 
out PropertyGetRegion getBlock, List<AttributeSection> attributes) {
3183
 
 
3184
 
#line  1227 "Frames/cs.ATG" 
3185
 
                Statement stmt = null; 
3186
 
                Expect(128);
3187
 
 
3188
 
#line  1230 "Frames/cs.ATG" 
3189
 
                Location startLocation = t.Location; 
3190
 
                if (la.kind == 16) {
3191
 
                        Block(
3192
 
#line  1231 "Frames/cs.ATG" 
3193
 
out stmt);
3194
 
                } else if (la.kind == 11) {
3195
 
                        lexer.NextToken();
3196
 
                } else SynErr(189);
3197
 
 
3198
 
#line  1232 "Frames/cs.ATG" 
3199
 
                getBlock = new PropertyGetRegion((BlockStatement)stmt, attributes); 
3200
 
 
3201
 
#line  1233 "Frames/cs.ATG" 
3202
 
                getBlock.StartLocation = startLocation; getBlock.EndLocation = t.EndLocation; 
3203
 
        }
3204
 
 
3205
 
        void SetAccessorDecl(
3206
 
#line  1236 "Frames/cs.ATG" 
3207
 
out PropertySetRegion setBlock, List<AttributeSection> attributes) {
3208
 
 
3209
 
#line  1237 "Frames/cs.ATG" 
3210
 
                Statement stmt = null; 
3211
 
                Expect(129);
3212
 
 
3213
 
#line  1240 "Frames/cs.ATG" 
3214
 
                Location startLocation = t.Location; 
3215
 
                if (la.kind == 16) {
3216
 
                        Block(
3217
 
#line  1241 "Frames/cs.ATG" 
3218
 
out stmt);
3219
 
                } else if (la.kind == 11) {
3220
 
                        lexer.NextToken();
3221
 
                } else SynErr(190);
3222
 
 
3223
 
#line  1242 "Frames/cs.ATG" 
3224
 
                setBlock = new PropertySetRegion((BlockStatement)stmt, attributes); 
3225
 
 
3226
 
#line  1243 "Frames/cs.ATG" 
3227
 
                setBlock.StartLocation = startLocation; setBlock.EndLocation = t.EndLocation; 
3228
 
        }
3229
 
 
3230
 
        void AddAccessorDecl(
3231
 
#line  1325 "Frames/cs.ATG" 
3232
 
out Statement stmt) {
3233
 
 
3234
 
#line  1326 "Frames/cs.ATG" 
3235
 
                stmt = null;
3236
 
                Expect(130);
3237
 
                Block(
3238
 
#line  1329 "Frames/cs.ATG" 
3239
 
out stmt);
3240
 
        }
3241
 
 
3242
 
        void RemoveAccessorDecl(
3243
 
#line  1332 "Frames/cs.ATG" 
3244
 
out Statement stmt) {
3245
 
 
3246
 
#line  1333 "Frames/cs.ATG" 
3247
 
                stmt = null;
3248
 
                Expect(131);
3249
 
                Block(
3250
 
#line  1336 "Frames/cs.ATG" 
3251
 
out stmt);
3252
 
        }
3253
 
 
3254
 
        void VariableInitializer(
3255
 
#line  1354 "Frames/cs.ATG" 
3256
 
out Expression initializerExpression) {
3257
 
 
3258
 
#line  1355 "Frames/cs.ATG" 
3259
 
                TypeReference type = null; Expression expr = null; initializerExpression = null; 
3260
 
                if (StartOf(6)) {
3261
 
                        Expr(
3262
 
#line  1357 "Frames/cs.ATG" 
3263
 
out initializerExpression);
3264
 
                } else if (la.kind == 16) {
3265
 
                        CollectionInitializer(
3266
 
#line  1358 "Frames/cs.ATG" 
3267
 
out initializerExpression);
3268
 
                } else if (la.kind == 106) {
3269
 
                        lexer.NextToken();
3270
 
                        Type(
3271
 
#line  1359 "Frames/cs.ATG" 
3272
 
out type);
3273
 
                        Expect(18);
3274
 
                        Expr(
3275
 
#line  1359 "Frames/cs.ATG" 
3276
 
out expr);
3277
 
                        Expect(19);
3278
 
 
3279
 
#line  1359 "Frames/cs.ATG" 
3280
 
                        initializerExpression = new StackAllocExpression(type, expr); 
3281
 
                } else SynErr(191);
3282
 
        }
3283
 
 
3284
 
        void Statement() {
3285
 
 
3286
 
#line  1502 "Frames/cs.ATG" 
3287
 
                TypeReference type;
3288
 
                Expression expr;
3289
 
                Statement stmt = null;
3290
 
                Location startPos = la.Location;
3291
 
                
3292
 
                while (!(StartOf(29))) {SynErr(192); lexer.NextToken(); }
3293
 
                if (
3294
 
#line  1511 "Frames/cs.ATG" 
3295
 
IsLabel()) {
3296
 
                        Identifier();
3297
 
 
3298
 
#line  1511 "Frames/cs.ATG" 
3299
 
                        compilationUnit.AddChild(new LabelStatement(t.val)); 
3300
 
                        Expect(9);
3301
 
                        Statement();
3302
 
                } else if (la.kind == 60) {
3303
 
                        lexer.NextToken();
3304
 
                        Type(
3305
 
#line  1514 "Frames/cs.ATG" 
3306
 
out type);
3307
 
 
3308
 
#line  1514 "Frames/cs.ATG" 
3309
 
                        LocalVariableDeclaration var = new LocalVariableDeclaration(type, Modifiers.Const); string ident = null; var.StartLocation = t.Location; 
3310
 
                        Identifier();
3311
 
 
3312
 
#line  1515 "Frames/cs.ATG" 
3313
 
                        ident = t.val; Location varStart = t.Location; 
3314
 
                        Expect(3);
3315
 
                        Expr(
3316
 
#line  1516 "Frames/cs.ATG" 
3317
 
out expr);
3318
 
 
3319
 
#line  1518 "Frames/cs.ATG" 
3320
 
                        SafeAdd(var, var.Variables, new VariableDeclaration(ident, expr) {
3321
 
                        StartLocation = varStart,
3322
 
                        EndLocation = t.EndLocation,
3323
 
                        TypeReference = type
3324
 
                        }); 
3325
 
                         
3326
 
                        while (la.kind == 14) {
3327
 
                                lexer.NextToken();
3328
 
                                Identifier();
3329
 
 
3330
 
#line  1524 "Frames/cs.ATG" 
3331
 
                                ident = t.val; 
3332
 
                                Expect(3);
3333
 
                                Expr(
3334
 
#line  1524 "Frames/cs.ATG" 
3335
 
out expr);
3336
 
 
3337
 
#line  1526 "Frames/cs.ATG" 
3338
 
                                SafeAdd(var, var.Variables, new VariableDeclaration(ident, expr) {
3339
 
                                StartLocation = varStart,
3340
 
                                EndLocation = t.EndLocation,
3341
 
                                TypeReference = type
3342
 
                                });
3343
 
                                 
3344
 
                        }
3345
 
                        Expect(11);
3346
 
 
3347
 
#line  1532 "Frames/cs.ATG" 
3348
 
                        var.EndLocation = t.EndLocation; if (t.Kind == Tokens.Semicolon) var.SemicolonPosition = t.EndLocation; compilationUnit.AddChild(var); 
3349
 
                } else if (
3350
 
#line  1535 "Frames/cs.ATG" 
3351
 
IsLocalVarDecl()) {
3352
 
                        LocalVariableDecl(
3353
 
#line  1535 "Frames/cs.ATG" 
3354
 
out stmt);
3355
 
                        Expect(11);
3356
 
 
3357
 
#line  1535 "Frames/cs.ATG" 
3358
 
                        if (t.Kind == Tokens.Semicolon) ((LocalVariableDeclaration)stmt).SemicolonPosition = t.EndLocation; compilationUnit.AddChild(stmt); 
3359
 
                } else if (StartOf(30)) {
3360
 
                        EmbeddedStatement(
3361
 
#line  1537 "Frames/cs.ATG" 
3362
 
out stmt);
3363
 
 
3364
 
#line  1537 "Frames/cs.ATG" 
3365
 
                        compilationUnit.AddChild(stmt); 
3366
 
                } else SynErr(193);
3367
 
 
3368
 
#line  1543 "Frames/cs.ATG" 
3369
 
                if (stmt != null) {
3370
 
                stmt.StartLocation = startPos;
3371
 
                stmt.EndLocation = t.EndLocation;
3372
 
                }
3373
 
                
3374
 
        }
3375
 
 
3376
 
        void Argument(
3377
 
#line  1394 "Frames/cs.ATG" 
3378
 
out Expression argumentexpr) {
3379
 
 
3380
 
#line  1396 "Frames/cs.ATG" 
3381
 
                Expression expr;
3382
 
                FieldDirection fd = FieldDirection.None;
3383
 
                
3384
 
                if (la.kind == 93 || la.kind == 100) {
3385
 
                        if (la.kind == 100) {
3386
 
                                lexer.NextToken();
3387
 
 
3388
 
#line  1401 "Frames/cs.ATG" 
3389
 
                                fd = FieldDirection.Ref; 
3390
 
                        } else {
3391
 
                                lexer.NextToken();
3392
 
 
3393
 
#line  1402 "Frames/cs.ATG" 
3394
 
                                fd = FieldDirection.Out; 
3395
 
                        }
3396
 
                }
3397
 
                Expr(
3398
 
#line  1404 "Frames/cs.ATG" 
3399
 
out expr);
3400
 
 
3401
 
#line  1405 "Frames/cs.ATG" 
3402
 
                argumentexpr = fd != FieldDirection.None ? argumentexpr = new DirectionExpression(fd, expr) : expr; 
3403
 
        }
3404
 
 
3405
 
        void CollectionInitializer(
3406
 
#line  1425 "Frames/cs.ATG" 
3407
 
out Expression outExpr) {
3408
 
 
3409
 
#line  1427 "Frames/cs.ATG" 
3410
 
                Expression expr = null;
3411
 
                CollectionInitializerExpression initializer = new CollectionInitializerExpression();
3412
 
                
3413
 
                Expect(16);
3414
 
 
3415
 
#line  1431 "Frames/cs.ATG" 
3416
 
                initializer.StartLocation = t.Location; 
3417
 
                if (StartOf(31)) {
3418
 
                        VariableInitializer(
3419
 
#line  1432 "Frames/cs.ATG" 
3420
 
out expr);
3421
 
 
3422
 
#line  1433 "Frames/cs.ATG" 
3423
 
                        SafeAdd(initializer, initializer.CreateExpressions, expr); 
3424
 
                        while (
3425
 
#line  1434 "Frames/cs.ATG" 
3426
 
NotFinalComma()) {
3427
 
                                Expect(14);
3428
 
                                VariableInitializer(
3429
 
#line  1435 "Frames/cs.ATG" 
3430
 
out expr);
3431
 
 
3432
 
#line  1436 "Frames/cs.ATG" 
3433
 
                                SafeAdd(initializer, initializer.CreateExpressions, expr); 
3434
 
                        }
3435
 
                        if (la.kind == 14) {
3436
 
                                lexer.NextToken();
3437
 
                        }
3438
 
                }
3439
 
                Expect(17);
3440
 
 
3441
 
#line  1440 "Frames/cs.ATG" 
3442
 
                initializer.EndLocation = t.Location; outExpr = initializer; 
3443
 
        }
3444
 
 
3445
 
        void AssignmentOperator(
3446
 
#line  1408 "Frames/cs.ATG" 
3447
 
out AssignmentOperatorType op) {
3448
 
 
3449
 
#line  1409 "Frames/cs.ATG" 
3450
 
                op = AssignmentOperatorType.None; 
3451
 
                if (la.kind == 3) {
3452
 
                        lexer.NextToken();
3453
 
 
3454
 
#line  1411 "Frames/cs.ATG" 
3455
 
                        op = AssignmentOperatorType.Assign; 
3456
 
                } else if (la.kind == 38) {
3457
 
                        lexer.NextToken();
3458
 
 
3459
 
#line  1412 "Frames/cs.ATG" 
3460
 
                        op = AssignmentOperatorType.Add; 
3461
 
                } else if (la.kind == 39) {
3462
 
                        lexer.NextToken();
3463
 
 
3464
 
#line  1413 "Frames/cs.ATG" 
3465
 
                        op = AssignmentOperatorType.Subtract; 
3466
 
                } else if (la.kind == 40) {
3467
 
                        lexer.NextToken();
3468
 
 
3469
 
#line  1414 "Frames/cs.ATG" 
3470
 
                        op = AssignmentOperatorType.Multiply; 
3471
 
                } else if (la.kind == 41) {
3472
 
                        lexer.NextToken();
3473
 
 
3474
 
#line  1415 "Frames/cs.ATG" 
3475
 
                        op = AssignmentOperatorType.Divide; 
3476
 
                } else if (la.kind == 42) {
3477
 
                        lexer.NextToken();
3478
 
 
3479
 
#line  1416 "Frames/cs.ATG" 
3480
 
                        op = AssignmentOperatorType.Modulus; 
3481
 
                } else if (la.kind == 43) {
3482
 
                        lexer.NextToken();
3483
 
 
3484
 
#line  1417 "Frames/cs.ATG" 
3485
 
                        op = AssignmentOperatorType.BitwiseAnd; 
3486
 
                } else if (la.kind == 44) {
3487
 
                        lexer.NextToken();
3488
 
 
3489
 
#line  1418 "Frames/cs.ATG" 
3490
 
                        op = AssignmentOperatorType.BitwiseOr; 
3491
 
                } else if (la.kind == 45) {
3492
 
                        lexer.NextToken();
3493
 
 
3494
 
#line  1419 "Frames/cs.ATG" 
3495
 
                        op = AssignmentOperatorType.ExclusiveOr; 
3496
 
                } else if (la.kind == 46) {
3497
 
                        lexer.NextToken();
3498
 
 
3499
 
#line  1420 "Frames/cs.ATG" 
3500
 
                        op = AssignmentOperatorType.ShiftLeft; 
3501
 
                } else if (
3502
 
#line  1421 "Frames/cs.ATG" 
3503
 
la.kind == Tokens.GreaterThan && Peek(1).kind == Tokens.GreaterEqual) {
3504
 
                        Expect(22);
3505
 
                        Expect(35);
3506
 
 
3507
 
#line  1422 "Frames/cs.ATG" 
3508
 
                        op = AssignmentOperatorType.ShiftRight; 
3509
 
                } else SynErr(194);
3510
 
        }
3511
 
 
3512
 
        void CollectionOrObjectInitializer(
3513
 
#line  1443 "Frames/cs.ATG" 
3514
 
out Expression outExpr) {
3515
 
 
3516
 
#line  1445 "Frames/cs.ATG" 
3517
 
                Expression expr = null;
3518
 
                CollectionInitializerExpression initializer = new CollectionInitializerExpression();
3519
 
                
3520
 
                Expect(16);
3521
 
 
3522
 
#line  1449 "Frames/cs.ATG" 
3523
 
                initializer.StartLocation = t.Location; 
3524
 
                if (StartOf(31)) {
3525
 
                        ObjectPropertyInitializerOrVariableInitializer(
3526
 
#line  1450 "Frames/cs.ATG" 
3527
 
out expr);
3528
 
 
3529
 
#line  1451 "Frames/cs.ATG" 
3530
 
                        SafeAdd(initializer, initializer.CreateExpressions, expr); 
3531
 
                        while (
3532
 
#line  1452 "Frames/cs.ATG" 
3533
 
NotFinalComma()) {
3534
 
                                Expect(14);
3535
 
                                ObjectPropertyInitializerOrVariableInitializer(
3536
 
#line  1453 "Frames/cs.ATG" 
3537
 
out expr);
3538
 
 
3539
 
#line  1454 "Frames/cs.ATG" 
3540
 
                                SafeAdd(initializer, initializer.CreateExpressions, expr); 
3541
 
                        }
3542
 
                        if (la.kind == 14) {
3543
 
                                lexer.NextToken();
3544
 
                        }
3545
 
                }
3546
 
                Expect(17);
3547
 
 
3548
 
#line  1458 "Frames/cs.ATG" 
3549
 
                initializer.EndLocation = t.Location; outExpr = initializer; 
3550
 
        }
3551
 
 
3552
 
        void ObjectPropertyInitializerOrVariableInitializer(
3553
 
#line  1461 "Frames/cs.ATG" 
3554
 
out Expression expr) {
3555
 
 
3556
 
#line  1462 "Frames/cs.ATG" 
3557
 
                expr = null; 
3558
 
                if (
3559
 
#line  1464 "Frames/cs.ATG" 
3560
 
IdentAndAsgn()) {
3561
 
                        Identifier();
3562
 
 
3563
 
#line  1466 "Frames/cs.ATG" 
3564
 
                        NamedArgumentExpression nae = new NamedArgumentExpression(t.val, null);
3565
 
                        nae.StartLocation = t.Location;
3566
 
                        Expression r = null; 
3567
 
                        Expect(3);
3568
 
                        if (la.kind == 16) {
3569
 
                                CollectionOrObjectInitializer(
3570
 
#line  1470 "Frames/cs.ATG" 
3571
 
out r);
3572
 
                        } else if (StartOf(31)) {
3573
 
                                VariableInitializer(
3574
 
#line  1471 "Frames/cs.ATG" 
3575
 
out r);
3576
 
                        } else SynErr(195);
3577
 
 
3578
 
#line  1472 "Frames/cs.ATG" 
3579
 
                        nae.Expression = r; nae.EndLocation = t.EndLocation; expr = nae; 
3580
 
                } else if (StartOf(31)) {
3581
 
                        VariableInitializer(
3582
 
#line  1474 "Frames/cs.ATG" 
3583
 
out expr);
3584
 
                } else SynErr(196);
3585
 
        }
3586
 
 
3587
 
        void LocalVariableDecl(
3588
 
#line  1478 "Frames/cs.ATG" 
3589
 
out Statement stmt) {
3590
 
 
3591
 
#line  1480 "Frames/cs.ATG" 
3592
 
                TypeReference type;
3593
 
                VariableDeclaration      var = null;
3594
 
                LocalVariableDeclaration localVariableDeclaration; 
3595
 
                Location startPos = la.Location;
3596
 
                
3597
 
                Type(
3598
 
#line  1486 "Frames/cs.ATG" 
3599
 
out type);
3600
 
 
3601
 
#line  1486 "Frames/cs.ATG" 
3602
 
                localVariableDeclaration = new LocalVariableDeclaration(type); localVariableDeclaration.StartLocation = startPos; 
3603
 
                LocalVariableDeclarator(
3604
 
#line  1487 "Frames/cs.ATG" 
3605
 
out var);
3606
 
 
3607
 
#line  1487 "Frames/cs.ATG" 
3608
 
                SafeAdd(localVariableDeclaration, localVariableDeclaration.Variables, var); 
3609
 
                while (la.kind == 14) {
3610
 
                        lexer.NextToken();
3611
 
                        LocalVariableDeclarator(
3612
 
#line  1488 "Frames/cs.ATG" 
3613
 
out var);
3614
 
 
3615
 
#line  1488 "Frames/cs.ATG" 
3616
 
                        SafeAdd(localVariableDeclaration, localVariableDeclaration.Variables, var); 
3617
 
                }
3618
 
 
3619
 
#line  1489 "Frames/cs.ATG" 
3620
 
                stmt = localVariableDeclaration; stmt.EndLocation = t.EndLocation; 
3621
 
        }
3622
 
 
3623
 
        void LocalVariableDeclarator(
3624
 
#line  1492 "Frames/cs.ATG" 
3625
 
out VariableDeclaration var) {
3626
 
 
3627
 
#line  1493 "Frames/cs.ATG" 
3628
 
                Expression expr = null; 
3629
 
                Identifier();
3630
 
 
3631
 
#line  1495 "Frames/cs.ATG" 
3632
 
                var = new VariableDeclaration(t.val); var.StartLocation = t.Location; 
3633
 
                if (la.kind == 3) {
3634
 
                        lexer.NextToken();
3635
 
                        VariableInitializer(
3636
 
#line  1496 "Frames/cs.ATG" 
3637
 
out expr);
3638
 
 
3639
 
#line  1496 "Frames/cs.ATG" 
3640
 
                        var.Initializer = expr; 
3641
 
                }
3642
 
 
3643
 
#line  1497 "Frames/cs.ATG" 
3644
 
                var.EndLocation = t.EndLocation; 
3645
 
        }
3646
 
 
3647
 
        void EmbeddedStatement(
3648
 
#line  1550 "Frames/cs.ATG" 
3649
 
out Statement statement) {
3650
 
 
3651
 
#line  1552 "Frames/cs.ATG" 
3652
 
                TypeReference type = null;
3653
 
                Expression expr = null;
3654
 
                Statement embeddedStatement = null;
3655
 
                statement = null;
3656
 
                
3657
 
 
3658
 
#line  1558 "Frames/cs.ATG" 
3659
 
                Location startLocation = la.Location; 
3660
 
                if (la.kind == 16) {
3661
 
                        Block(
3662
 
#line  1560 "Frames/cs.ATG" 
3663
 
out statement);
3664
 
                } else if (la.kind == 11) {
3665
 
                        lexer.NextToken();
3666
 
 
3667
 
#line  1563 "Frames/cs.ATG" 
3668
 
                        statement = new EmptyStatement(); 
3669
 
                } else if (
3670
 
#line  1566 "Frames/cs.ATG" 
3671
 
UnCheckedAndLBrace()) {
3672
 
 
3673
 
#line  1566 "Frames/cs.ATG" 
3674
 
                        Statement block; bool isChecked = true; 
3675
 
                        if (la.kind == 58) {
3676
 
                                lexer.NextToken();
3677
 
                        } else if (la.kind == 118) {
3678
 
                                lexer.NextToken();
3679
 
 
3680
 
#line  1567 "Frames/cs.ATG" 
3681
 
                                isChecked = false;
3682
 
                        } else SynErr(197);
3683
 
                        Block(
3684
 
#line  1568 "Frames/cs.ATG" 
3685
 
out block);
3686
 
 
3687
 
#line  1568 "Frames/cs.ATG" 
3688
 
                        statement = isChecked ? (Statement)new CheckedStatement(block) : (Statement)new UncheckedStatement(block); 
3689
 
                } else if (la.kind == 79) {
3690
 
                        IfStatement(
3691
 
#line  1571 "Frames/cs.ATG" 
3692
 
out statement);
3693
 
                } else if (la.kind == 110) {
3694
 
                        lexer.NextToken();
3695
 
 
3696
 
#line  1573 "Frames/cs.ATG" 
3697
 
                        List<SwitchSection> switchSections = new List<SwitchSection>(); 
3698
 
                        Expect(20);
3699
 
                        Expr(
3700
 
#line  1574 "Frames/cs.ATG" 
3701
 
out expr);
3702
 
                        Expect(21);
3703
 
                        Expect(16);
3704
 
                        SwitchSections(
3705
 
#line  1575 "Frames/cs.ATG" 
3706
 
switchSections);
3707
 
                        Expect(17);
3708
 
 
3709
 
#line  1577 "Frames/cs.ATG" 
3710
 
                        statement = new SwitchStatement(expr, switchSections); 
3711
 
                } else if (la.kind == 125) {
3712
 
                        lexer.NextToken();
3713
 
                        Expect(20);
3714
 
                        Expr(
3715
 
#line  1580 "Frames/cs.ATG" 
3716
 
out expr);
3717
 
                        Expect(21);
3718
 
                        EmbeddedStatement(
3719
 
#line  1581 "Frames/cs.ATG" 
3720
 
out embeddedStatement);
3721
 
 
3722
 
#line  1582 "Frames/cs.ATG" 
3723
 
                        statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.Start);
3724
 
                } else if (la.kind == 65) {
3725
 
                        lexer.NextToken();
3726
 
                        EmbeddedStatement(
3727
 
#line  1584 "Frames/cs.ATG" 
3728
 
out embeddedStatement);
3729
 
                        Expect(125);
3730
 
                        Expect(20);
3731
 
                        Expr(
3732
 
#line  1585 "Frames/cs.ATG" 
3733
 
out expr);
3734
 
                        Expect(21);
3735
 
                        Expect(11);
3736
 
 
3737
 
#line  1586 "Frames/cs.ATG" 
3738
 
                        statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.End); 
3739
 
                } else if (la.kind == 76) {
3740
 
                        lexer.NextToken();
3741
 
 
3742
 
#line  1588 "Frames/cs.ATG" 
3743
 
                        List<Statement> initializer = null; List<Statement> iterator = null; 
3744
 
                        Expect(20);
3745
 
                        if (StartOf(6)) {
3746
 
                                ForInitializer(
3747
 
#line  1589 "Frames/cs.ATG" 
3748
 
out initializer);
3749
 
                        }
3750
 
                        Expect(11);
3751
 
                        if (StartOf(6)) {
3752
 
                                Expr(
3753
 
#line  1590 "Frames/cs.ATG" 
3754
 
out expr);
3755
 
                        }
3756
 
                        Expect(11);
3757
 
                        if (StartOf(6)) {
3758
 
                                ForIterator(
3759
 
#line  1591 "Frames/cs.ATG" 
3760
 
out iterator);
3761
 
                        }
3762
 
                        Expect(21);
3763
 
                        EmbeddedStatement(
3764
 
#line  1592 "Frames/cs.ATG" 
3765
 
out embeddedStatement);
3766
 
 
3767
 
#line  1593 "Frames/cs.ATG" 
3768
 
                        statement = new ForStatement(initializer, expr, iterator, embeddedStatement); 
3769
 
                } else if (la.kind == 77) {
3770
 
                        lexer.NextToken();
3771
 
                        Expect(20);
3772
 
                        Type(
3773
 
#line  1595 "Frames/cs.ATG" 
3774
 
out type);
3775
 
                        Identifier();
3776
 
 
3777
 
#line  1595 "Frames/cs.ATG" 
3778
 
                        string varName = t.val; 
3779
 
                        Expect(81);
3780
 
                        Expr(
3781
 
#line  1596 "Frames/cs.ATG" 
3782
 
out expr);
3783
 
                        Expect(21);
3784
 
                        EmbeddedStatement(
3785
 
#line  1597 "Frames/cs.ATG" 
3786
 
out embeddedStatement);
3787
 
 
3788
 
#line  1598 "Frames/cs.ATG" 
3789
 
                        statement = new ForeachStatement(type, varName , expr, embeddedStatement); 
3790
 
                } else if (la.kind == 53) {
3791
 
                        lexer.NextToken();
3792
 
                        Expect(11);
3793
 
 
3794
 
#line  1601 "Frames/cs.ATG" 
3795
 
                        statement = new BreakStatement(); 
3796
 
                } else if (la.kind == 61) {
3797
 
                        lexer.NextToken();
3798
 
                        Expect(11);
3799
 
 
3800
 
#line  1602 "Frames/cs.ATG" 
3801
 
                        statement = new ContinueStatement(); 
3802
 
                } else if (la.kind == 78) {
3803
 
                        GotoStatement(
3804
 
#line  1603 "Frames/cs.ATG" 
3805
 
out statement);
3806
 
                } else if (
3807
 
#line  1605 "Frames/cs.ATG" 
3808
 
IsYieldStatement()) {
3809
 
                        Expect(132);
3810
 
                        if (la.kind == 101) {
3811
 
                                lexer.NextToken();
3812
 
                                Expr(
3813
 
#line  1606 "Frames/cs.ATG" 
3814
 
out expr);
3815
 
 
3816
 
#line  1606 "Frames/cs.ATG" 
3817
 
                                statement = new YieldStatement(new ReturnStatement(expr)); 
3818
 
                        } else if (la.kind == 53) {
3819
 
                                lexer.NextToken();
3820
 
 
3821
 
#line  1607 "Frames/cs.ATG" 
3822
 
                                statement = new YieldStatement(new BreakStatement()); 
3823
 
                        } else SynErr(198);
3824
 
                        Expect(11);
3825
 
                } else if (la.kind == 101) {
3826
 
                        lexer.NextToken();
3827
 
                        if (StartOf(6)) {
3828
 
                                Expr(
3829
 
#line  1610 "Frames/cs.ATG" 
3830
 
out expr);
3831
 
                        }
3832
 
                        Expect(11);
3833
 
 
3834
 
#line  1610 "Frames/cs.ATG" 
3835
 
                        statement = new ReturnStatement(expr); 
3836
 
                } else if (la.kind == 112) {
3837
 
                        lexer.NextToken();
3838
 
                        if (StartOf(6)) {
3839
 
                                Expr(
3840
 
#line  1611 "Frames/cs.ATG" 
3841
 
out expr);
3842
 
                        }
3843
 
                        Expect(11);
3844
 
 
3845
 
#line  1611 "Frames/cs.ATG" 
3846
 
                        statement = new ThrowStatement(expr); 
3847
 
                } else if (StartOf(6)) {
3848
 
                        StatementExpr(
3849
 
#line  1614 "Frames/cs.ATG" 
3850
 
out statement);
3851
 
                        while (!(la.kind == 0 || la.kind == 11)) {SynErr(199); lexer.NextToken(); }
3852
 
                        Expect(11);
3853
 
                } else if (la.kind == 114) {
3854
 
                        TryStatement(
3855
 
#line  1617 "Frames/cs.ATG" 
3856
 
out statement);
3857
 
                } else if (la.kind == 86) {
3858
 
                        lexer.NextToken();
3859
 
                        Expect(20);
3860
 
                        Expr(
3861
 
#line  1620 "Frames/cs.ATG" 
3862
 
out expr);
3863
 
                        Expect(21);
3864
 
                        EmbeddedStatement(
3865
 
#line  1621 "Frames/cs.ATG" 
3866
 
out embeddedStatement);
3867
 
 
3868
 
#line  1621 "Frames/cs.ATG" 
3869
 
                        statement = new LockStatement(expr, embeddedStatement); 
3870
 
                } else if (la.kind == 121) {
3871
 
 
3872
 
#line  1624 "Frames/cs.ATG" 
3873
 
                        Statement resourceAcquisitionStmt = null; 
3874
 
                        lexer.NextToken();
3875
 
                        Expect(20);
3876
 
                        ResourceAcquisition(
3877
 
#line  1626 "Frames/cs.ATG" 
3878
 
out resourceAcquisitionStmt);
3879
 
                        Expect(21);
3880
 
                        EmbeddedStatement(
3881
 
#line  1627 "Frames/cs.ATG" 
3882
 
out embeddedStatement);
3883
 
 
3884
 
#line  1627 "Frames/cs.ATG" 
3885
 
                        statement = new UsingStatement(resourceAcquisitionStmt, embeddedStatement); 
3886
 
                } else if (la.kind == 119) {
3887
 
                        lexer.NextToken();
3888
 
                        Block(
3889
 
#line  1630 "Frames/cs.ATG" 
3890
 
out embeddedStatement);
3891
 
 
3892
 
#line  1630 "Frames/cs.ATG" 
3893
 
                        statement = new UnsafeStatement(embeddedStatement); 
3894
 
                } else if (la.kind == 74) {
3895
 
 
3896
 
#line  1632 "Frames/cs.ATG" 
3897
 
                        Statement pointerDeclarationStmt = null; 
3898
 
                        lexer.NextToken();
3899
 
                        Expect(20);
3900
 
                        ResourceAcquisition(
3901
 
#line  1634 "Frames/cs.ATG" 
3902
 
out pointerDeclarationStmt);
3903
 
                        Expect(21);
3904
 
                        EmbeddedStatement(
3905
 
#line  1635 "Frames/cs.ATG" 
3906
 
out embeddedStatement);
3907
 
 
3908
 
#line  1635 "Frames/cs.ATG" 
3909
 
                        statement = new FixedStatement(pointerDeclarationStmt, embeddedStatement); 
3910
 
                } else SynErr(200);
3911
 
 
3912
 
#line  1637 "Frames/cs.ATG" 
3913
 
                if (statement != null) {
3914
 
                statement.StartLocation = startLocation;
3915
 
                statement.EndLocation = t.EndLocation;
3916
 
                }
3917
 
                
3918
 
        }
3919
 
 
3920
 
        void IfStatement(
3921
 
#line  1644 "Frames/cs.ATG" 
3922
 
out Statement statement) {
3923
 
 
3924
 
#line  1646 "Frames/cs.ATG" 
3925
 
                Expression expr = null;
3926
 
                Statement embeddedStatement = null;
3927
 
                statement = null;
3928
 
                Location elseStart = Location.Empty;
3929
 
                
3930
 
                Expect(79);
3931
 
                Expect(20);
3932
 
                Expr(
3933
 
#line  1653 "Frames/cs.ATG" 
3934
 
out expr);
3935
 
                Expect(21);
3936
 
                EmbeddedStatement(
3937
 
#line  1654 "Frames/cs.ATG" 
3938
 
out embeddedStatement);
3939
 
 
3940
 
#line  1655 "Frames/cs.ATG" 
3941
 
                Statement elseStatement = null; 
3942
 
                if (la.kind == 67) {
3943
 
                        lexer.NextToken();
3944
 
 
3945
 
#line  1656 "Frames/cs.ATG" 
3946
 
                        elseStart = t.Location; 
3947
 
                        EmbeddedStatement(
3948
 
#line  1656 "Frames/cs.ATG" 
3949
 
out elseStatement);
3950
 
                }
3951
 
 
3952
 
#line  1657 "Frames/cs.ATG" 
3953
 
                statement = elseStatement != null ? new IfElseStatement(expr, embeddedStatement, elseStatement) : new IfElseStatement(expr, embeddedStatement); 
3954
 
 
3955
 
#line  1658 "Frames/cs.ATG" 
3956
 
                if (elseStatement is IfElseStatement && (elseStatement as IfElseStatement).TrueStatement.Count == 1) {
3957
 
                /* else if-section (otherwise we would have a BlockStatment) */
3958
 
                ElseIfSection elseIfSection = new ElseIfSection((elseStatement as IfElseStatement).Condition, (elseStatement as IfElseStatement).TrueStatement[0]);
3959
 
                elseIfSection.StartLocation = elseStart;
3960
 
                elseIfSection.EndLocation = (elseStatement as IfElseStatement).TrueStatement[0].EndLocation;
3961
 
                (statement as IfElseStatement).ElseIfSections.Add(elseIfSection);
3962
 
                (statement as IfElseStatement).ElseIfSections.AddRange((elseStatement as IfElseStatement).ElseIfSections);
3963
 
                (statement as IfElseStatement).FalseStatement = (elseStatement as IfElseStatement).FalseStatement;
3964
 
                }
3965
 
                
3966
 
        }
3967
 
 
3968
 
        void SwitchSections(
3969
 
#line  1689 "Frames/cs.ATG" 
3970
 
List<SwitchSection> switchSections) {
3971
 
 
3972
 
#line  1691 "Frames/cs.ATG" 
3973
 
                SwitchSection switchSection = new SwitchSection();
3974
 
                CaseLabel label;
3975
 
                
3976
 
                SwitchLabel(
3977
 
#line  1695 "Frames/cs.ATG" 
3978
 
out label);
3979
 
 
3980
 
#line  1695 "Frames/cs.ATG" 
3981
 
                SafeAdd(switchSection, switchSection.SwitchLabels, label); 
3982
 
 
3983
 
#line  1696 "Frames/cs.ATG" 
3984
 
                compilationUnit.BlockStart(switchSection); 
3985
 
                while (StartOf(32)) {
3986
 
                        if (la.kind == 55 || la.kind == 63) {
3987
 
                                SwitchLabel(
3988
 
#line  1698 "Frames/cs.ATG" 
3989
 
out label);
3990
 
 
3991
 
#line  1699 "Frames/cs.ATG" 
3992
 
                                if (label != null) {
3993
 
                                if (switchSection.Children.Count > 0) {
3994
 
                                        // open new section
3995
 
                                        compilationUnit.BlockEnd(); switchSections.Add(switchSection);
3996
 
                                        switchSection = new SwitchSection();
3997
 
                                        compilationUnit.BlockStart(switchSection);
3998
 
                                }
3999
 
                                SafeAdd(switchSection, switchSection.SwitchLabels, label);
4000
 
                                }
4001
 
                                
4002
 
                        } else {
4003
 
                                Statement();
4004
 
                        }
4005
 
                }
4006
 
 
4007
 
#line  1711 "Frames/cs.ATG" 
4008
 
                compilationUnit.BlockEnd(); switchSections.Add(switchSection); 
4009
 
        }
4010
 
 
4011
 
        void ForInitializer(
4012
 
#line  1670 "Frames/cs.ATG" 
4013
 
out List<Statement> initializer) {
4014
 
 
4015
 
#line  1672 "Frames/cs.ATG" 
4016
 
                Statement stmt; 
4017
 
                initializer = new List<Statement>();
4018
 
                
4019
 
                if (
4020
 
#line  1676 "Frames/cs.ATG" 
4021
 
IsLocalVarDecl()) {
4022
 
                        LocalVariableDecl(
4023
 
#line  1676 "Frames/cs.ATG" 
4024
 
out stmt);
4025
 
 
4026
 
#line  1676 "Frames/cs.ATG" 
4027
 
                        ((LocalVariableDeclaration)stmt).SemicolonPosition = t.EndLocation; initializer.Add(stmt); 
4028
 
                } else if (StartOf(6)) {
4029
 
                        StatementExpr(
4030
 
#line  1677 "Frames/cs.ATG" 
4031
 
out stmt);
4032
 
 
4033
 
#line  1677 "Frames/cs.ATG" 
4034
 
                        initializer.Add(stmt);
4035
 
                        while (la.kind == 14) {
4036
 
                                lexer.NextToken();
4037
 
                                StatementExpr(
4038
 
#line  1677 "Frames/cs.ATG" 
4039
 
out stmt);
4040
 
 
4041
 
#line  1677 "Frames/cs.ATG" 
4042
 
                                initializer.Add(stmt);
4043
 
                        }
4044
 
                } else SynErr(201);
4045
 
        }
4046
 
 
4047
 
        void ForIterator(
4048
 
#line  1680 "Frames/cs.ATG" 
4049
 
out List<Statement> iterator) {
4050
 
 
4051
 
#line  1682 "Frames/cs.ATG" 
4052
 
                Statement stmt; 
4053
 
                iterator = new List<Statement>();
4054
 
                
4055
 
                StatementExpr(
4056
 
#line  1686 "Frames/cs.ATG" 
4057
 
out stmt);
4058
 
 
4059
 
#line  1686 "Frames/cs.ATG" 
4060
 
                iterator.Add(stmt);
4061
 
                while (la.kind == 14) {
4062
 
                        lexer.NextToken();
4063
 
                        StatementExpr(
4064
 
#line  1686 "Frames/cs.ATG" 
4065
 
out stmt);
4066
 
 
4067
 
#line  1686 "Frames/cs.ATG" 
4068
 
                        iterator.Add(stmt); 
4069
 
                }
4070
 
        }
4071
 
 
4072
 
        void GotoStatement(
4073
 
#line  1768 "Frames/cs.ATG" 
4074
 
out Statement stmt) {
4075
 
 
4076
 
#line  1769 "Frames/cs.ATG" 
4077
 
                Expression expr; stmt = null; 
4078
 
                Expect(78);
4079
 
                if (StartOf(19)) {
4080
 
                        Identifier();
4081
 
 
4082
 
#line  1773 "Frames/cs.ATG" 
4083
 
                        stmt = new GotoStatement(t.val); 
4084
 
                        Expect(11);
4085
 
                } else if (la.kind == 55) {
4086
 
                        lexer.NextToken();
4087
 
                        Expr(
4088
 
#line  1774 "Frames/cs.ATG" 
4089
 
out expr);
4090
 
                        Expect(11);
4091
 
 
4092
 
#line  1774 "Frames/cs.ATG" 
4093
 
                        stmt = new GotoCaseStatement(expr); 
4094
 
                } else if (la.kind == 63) {
4095
 
                        lexer.NextToken();
4096
 
                        Expect(11);
4097
 
 
4098
 
#line  1775 "Frames/cs.ATG" 
4099
 
                        stmt = new GotoCaseStatement(null); 
4100
 
                } else SynErr(202);
4101
 
        }
4102
 
 
4103
 
        void StatementExpr(
4104
 
#line  1795 "Frames/cs.ATG" 
4105
 
out Statement stmt) {
4106
 
 
4107
 
#line  1796 "Frames/cs.ATG" 
4108
 
                Expression expr; 
4109
 
                Expr(
4110
 
#line  1798 "Frames/cs.ATG" 
4111
 
out expr);
4112
 
 
4113
 
#line  1801 "Frames/cs.ATG" 
4114
 
                stmt = new ExpressionStatement(expr); if (expr is PrimitiveExpression) Error("Primitive expressions are not allowed as statements."); 
4115
 
        }
4116
 
 
4117
 
        void TryStatement(
4118
 
#line  1721 "Frames/cs.ATG" 
4119
 
out Statement tryStatement) {
4120
 
 
4121
 
#line  1723 "Frames/cs.ATG" 
4122
 
                Statement blockStmt = null, finallyStmt = null;
4123
 
                CatchClause catchClause = null;
4124
 
                List<CatchClause> catchClauses = new List<CatchClause>();
4125
 
                
4126
 
                Expect(114);
4127
 
                Block(
4128
 
#line  1728 "Frames/cs.ATG" 
4129
 
out blockStmt);
4130
 
                while (la.kind == 56) {
4131
 
                        CatchClause(
4132
 
#line  1730 "Frames/cs.ATG" 
4133
 
out catchClause);
4134
 
 
4135
 
#line  1731 "Frames/cs.ATG" 
4136
 
                        if (catchClause != null) catchClauses.Add(catchClause); 
4137
 
                }
4138
 
                if (la.kind == 73) {
4139
 
                        lexer.NextToken();
4140
 
                        Block(
4141
 
#line  1733 "Frames/cs.ATG" 
4142
 
out finallyStmt);
4143
 
                }
4144
 
 
4145
 
#line  1735 "Frames/cs.ATG" 
4146
 
                tryStatement = new TryCatchStatement(blockStmt, catchClauses, finallyStmt);
4147
 
                if (catchClauses != null) {
4148
 
                        foreach (CatchClause cc in catchClauses) cc.Parent = tryStatement;
4149
 
                }
4150
 
                
4151
 
        }
4152
 
 
4153
 
        void ResourceAcquisition(
4154
 
#line  1779 "Frames/cs.ATG" 
4155
 
out Statement stmt) {
4156
 
 
4157
 
#line  1781 "Frames/cs.ATG" 
4158
 
                stmt = null;
4159
 
                Expression expr;
4160
 
                
4161
 
                if (
4162
 
#line  1786 "Frames/cs.ATG" 
4163
 
IsLocalVarDecl()) {
4164
 
                        LocalVariableDecl(
4165
 
#line  1786 "Frames/cs.ATG" 
4166
 
out stmt);
4167
 
 
4168
 
#line  1786 "Frames/cs.ATG" 
4169
 
                        ((LocalVariableDeclaration)stmt).SemicolonPosition = t.EndLocation; 
4170
 
                } else if (StartOf(6)) {
4171
 
                        Expr(
4172
 
#line  1787 "Frames/cs.ATG" 
4173
 
out expr);
4174
 
 
4175
 
#line  1791 "Frames/cs.ATG" 
4176
 
                        stmt = new ExpressionStatement(expr); 
4177
 
                } else SynErr(203);
4178
 
        }
4179
 
 
4180
 
        void SwitchLabel(
4181
 
#line  1714 "Frames/cs.ATG" 
4182
 
out CaseLabel label) {
4183
 
 
4184
 
#line  1715 "Frames/cs.ATG" 
4185
 
                Expression expr = null; label = null; 
4186
 
                if (la.kind == 55) {
4187
 
                        lexer.NextToken();
4188
 
                        Expr(
4189
 
#line  1717 "Frames/cs.ATG" 
4190
 
out expr);
4191
 
                        Expect(9);
4192
 
 
4193
 
#line  1717 "Frames/cs.ATG" 
4194
 
                        label =  new CaseLabel(expr); 
4195
 
                } else if (la.kind == 63) {
4196
 
                        lexer.NextToken();
4197
 
                        Expect(9);
4198
 
 
4199
 
#line  1718 "Frames/cs.ATG" 
4200
 
                        label =  new CaseLabel(); 
4201
 
                } else SynErr(204);
4202
 
        }
4203
 
 
4204
 
        void CatchClause(
4205
 
#line  1742 "Frames/cs.ATG" 
4206
 
out CatchClause catchClause) {
4207
 
                Expect(56);
4208
 
 
4209
 
#line  1744 "Frames/cs.ATG" 
4210
 
                string identifier;
4211
 
                Statement stmt;
4212
 
                TypeReference typeRef;
4213
 
                Location startPos = t.Location;
4214
 
                catchClause = null;
4215
 
                
4216
 
                if (la.kind == 16) {
4217
 
                        Block(
4218
 
#line  1752 "Frames/cs.ATG" 
4219
 
out stmt);
4220
 
 
4221
 
#line  1752 "Frames/cs.ATG" 
4222
 
                        catchClause = new CatchClause(stmt);  
4223
 
                } else if (la.kind == 20) {
4224
 
                        lexer.NextToken();
4225
 
                        ClassType(
4226
 
#line  1755 "Frames/cs.ATG" 
4227
 
out typeRef, false);
4228
 
 
4229
 
#line  1755 "Frames/cs.ATG" 
4230
 
                        identifier = null; 
4231
 
                        if (StartOf(19)) {
4232
 
                                Identifier();
4233
 
 
4234
 
#line  1756 "Frames/cs.ATG" 
4235
 
                                identifier = t.val; 
4236
 
                        }
4237
 
                        Expect(21);
4238
 
                        Block(
4239
 
#line  1757 "Frames/cs.ATG" 
4240
 
out stmt);
4241
 
 
4242
 
#line  1758 "Frames/cs.ATG" 
4243
 
                        catchClause = new CatchClause(typeRef, identifier, stmt); 
4244
 
                } else SynErr(205);
4245
 
 
4246
 
#line  1761 "Frames/cs.ATG" 
4247
 
                if (catchClause != null) {
4248
 
                catchClause.StartLocation = startPos;
4249
 
                catchClause.EndLocation = t.Location;
4250
 
                }
4251
 
                
4252
 
        }
4253
 
 
4254
 
        void UnaryExpr(
4255
 
#line  1828 "Frames/cs.ATG" 
4256
 
out Expression uExpr) {
4257
 
 
4258
 
#line  1830 "Frames/cs.ATG" 
4259
 
                TypeReference type = null;
4260
 
                Expression expr = null;
4261
 
                ArrayList expressions = new ArrayList();
4262
 
                uExpr = null;
4263
 
                
4264
 
                while (StartOf(33) || 
4265
 
#line  1852 "Frames/cs.ATG" 
4266
 
IsTypeCast()) {
4267
 
                        if (la.kind == 4) {
4268
 
                                lexer.NextToken();
4269
 
 
4270
 
#line  1839 "Frames/cs.ATG" 
4271
 
                                expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Plus)); 
4272
 
                        } else if (la.kind == 5) {
4273
 
                                lexer.NextToken();
4274
 
 
4275
 
#line  1840 "Frames/cs.ATG" 
4276
 
                                expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Minus)); 
4277
 
                        } else if (la.kind == 24) {
4278
 
                                lexer.NextToken();
4279
 
 
4280
 
#line  1841 "Frames/cs.ATG" 
4281
 
                                expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Not)); 
4282
 
                        } else if (la.kind == 27) {
4283
 
                                lexer.NextToken();
4284
 
 
4285
 
#line  1842 "Frames/cs.ATG" 
4286
 
                                expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.BitNot)); 
4287
 
                        } else if (la.kind == 6) {
4288
 
                                lexer.NextToken();
4289
 
 
4290
 
#line  1843 "Frames/cs.ATG" 
4291
 
                                expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Dereference)); 
4292
 
                        } else if (la.kind == 31) {
4293
 
                                lexer.NextToken();
4294
 
 
4295
 
#line  1844 "Frames/cs.ATG" 
4296
 
                                expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Increment)); 
4297
 
                        } else if (la.kind == 32) {
4298
 
                                lexer.NextToken();
4299
 
 
4300
 
#line  1845 "Frames/cs.ATG" 
4301
 
                                expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Decrement)); 
4302
 
                        } else if (la.kind == 28) {
4303
 
                                lexer.NextToken();
4304
 
 
4305
 
#line  1846 "Frames/cs.ATG" 
4306
 
                                expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.AddressOf)); 
4307
 
                        } else {
4308
 
                                Expect(20);
4309
 
                                Type(
4310
 
#line  1852 "Frames/cs.ATG" 
4311
 
out type);
4312
 
                                Expect(21);
4313
 
 
4314
 
#line  1852 "Frames/cs.ATG" 
4315
 
                                expressions.Add(new CastExpression(type)); 
4316
 
                        }
4317
 
                }
4318
 
                if (
4319
 
#line  1857 "Frames/cs.ATG" 
4320
 
LastExpressionIsUnaryMinus(expressions) && IsMostNegativeIntegerWithoutTypeSuffix()) {
4321
 
                        Expect(2);
4322
 
 
4323
 
#line  1860 "Frames/cs.ATG" 
4324
 
                        expressions.RemoveAt(expressions.Count - 1);
4325
 
                        if (t.literalValue is uint) {
4326
 
                                expr = new PrimitiveExpression(int.MinValue, int.MinValue.ToString());
4327
 
                        } else if (t.literalValue is ulong) {
4328
 
                                expr = new PrimitiveExpression(long.MinValue, long.MinValue.ToString());
4329
 
                        } else {
4330
 
                                throw new Exception("t.literalValue must be uint or ulong");
4331
 
                        }
4332
 
                        
4333
 
                } else if (StartOf(34)) {
4334
 
                        PrimaryExpr(
4335
 
#line  1869 "Frames/cs.ATG" 
4336
 
out expr);
4337
 
                } else SynErr(206);
4338
 
 
4339
 
#line  1871 "Frames/cs.ATG" 
4340
 
                for (int i = 0; i < expressions.Count; ++i) {
4341
 
                Expression nextExpression = i + 1 < expressions.Count ? (Expression)expressions[i + 1] : expr;
4342
 
                if (expressions[i] is CastExpression) {
4343
 
                        ((CastExpression)expressions[i]).Expression = nextExpression;
4344
 
                } else {
4345
 
                        ((UnaryOperatorExpression)expressions[i]).Expression = nextExpression;
4346
 
                }
4347
 
                }
4348
 
                if (expressions.Count > 0) {
4349
 
                        uExpr = (Expression)expressions[0];
4350
 
                } else {
4351
 
                        uExpr = expr;
4352
 
                }
4353
 
                
4354
 
        }
4355
 
 
4356
 
        void ConditionalOrExpr(
4357
 
#line  2193 "Frames/cs.ATG" 
4358
 
ref Expression outExpr) {
4359
 
 
4360
 
#line  2194 "Frames/cs.ATG" 
4361
 
                Expression expr;   
4362
 
                ConditionalAndExpr(
4363
 
#line  2196 "Frames/cs.ATG" 
4364
 
ref outExpr);
4365
 
                while (la.kind == 26) {
4366
 
                        lexer.NextToken();
4367
 
                        UnaryExpr(
4368
 
#line  2196 "Frames/cs.ATG" 
4369
 
out expr);
4370
 
                        ConditionalAndExpr(
4371
 
#line  2196 "Frames/cs.ATG" 
4372
 
ref expr);
4373
 
 
4374
 
#line  2196 "Frames/cs.ATG" 
4375
 
                        outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalOr, expr);  
4376
 
                }
4377
 
        }
4378
 
 
4379
 
        void PrimaryExpr(
4380
 
#line  1888 "Frames/cs.ATG" 
4381
 
out Expression pexpr) {
4382
 
 
4383
 
#line  1890 "Frames/cs.ATG" 
4384
 
                TypeReference type = null;
4385
 
                Expression expr;
4386
 
                pexpr = null;
4387
 
                
4388
 
 
4389
 
#line  1895 "Frames/cs.ATG" 
4390
 
                Location startLocation = la.Location; 
4391
 
                if (la.kind == 113) {
4392
 
                        lexer.NextToken();
4393
 
 
4394
 
#line  1897 "Frames/cs.ATG" 
4395
 
                        pexpr = new PrimitiveExpression(true, "true");  
4396
 
                } else if (la.kind == 72) {
4397
 
                        lexer.NextToken();
4398
 
 
4399
 
#line  1898 "Frames/cs.ATG" 
4400
 
                        pexpr = new PrimitiveExpression(false, "false"); 
4401
 
                } else if (la.kind == 90) {
4402
 
                        lexer.NextToken();
4403
 
 
4404
 
#line  1899 "Frames/cs.ATG" 
4405
 
                        pexpr = new PrimitiveExpression(null, "null");  
4406
 
                } else if (la.kind == 2) {
4407
 
                        lexer.NextToken();
4408
 
 
4409
 
#line  1900 "Frames/cs.ATG" 
4410
 
                        pexpr = new PrimitiveExpression(t.literalValue, t.val) { LiteralFormat = t.literalFormat };  
4411
 
                } else if (
4412
 
#line  1901 "Frames/cs.ATG" 
4413
 
StartOfQueryExpression()) {
4414
 
                        QueryExpression(
4415
 
#line  1902 "Frames/cs.ATG" 
4416
 
out pexpr);
4417
 
                } else if (
4418
 
#line  1903 "Frames/cs.ATG" 
4419
 
IdentAndDoubleColon()) {
4420
 
                        Identifier();
4421
 
 
4422
 
#line  1904 "Frames/cs.ATG" 
4423
 
                        type = new TypeReference(t.val); 
4424
 
                        Expect(10);
4425
 
 
4426
 
#line  1905 "Frames/cs.ATG" 
4427
 
                        pexpr = new TypeReferenceExpression(type); 
4428
 
                        Identifier();
4429
 
 
4430
 
#line  1906 "Frames/cs.ATG" 
4431
 
                        if (type.Type == "global") { type.IsGlobal = true; type.Type = t.val ?? "?"; } else type.Type += "." + (t.val ?? "?"); 
4432
 
                } else if (StartOf(19)) {
4433
 
                        Identifier();
4434
 
 
4435
 
#line  1910 "Frames/cs.ATG" 
4436
 
                        pexpr = new IdentifierExpression(t.val); 
4437
 
                        if (la.kind == 48 || 
4438
 
#line  1913 "Frames/cs.ATG" 
4439
 
IsGenericInSimpleNameOrMemberAccess()) {
4440
 
                                if (la.kind == 48) {
4441
 
                                        ShortedLambdaExpression(
4442
 
#line  1912 "Frames/cs.ATG" 
4443
 
(IdentifierExpression)pexpr, out pexpr);
4444
 
                                } else {
4445
 
 
4446
 
#line  1914 "Frames/cs.ATG" 
4447
 
                                        List<TypeReference> typeList; 
4448
 
                                        TypeArgumentList(
4449
 
#line  1915 "Frames/cs.ATG" 
4450
 
out typeList, false);
4451
 
 
4452
 
#line  1916 "Frames/cs.ATG" 
4453
 
                                        ((IdentifierExpression)pexpr).TypeArguments = typeList; 
4454
 
                                }
4455
 
                        }
4456
 
                } else if (
4457
 
#line  1918 "Frames/cs.ATG" 
4458
 
IsLambdaExpression()) {
4459
 
                        LambdaExpression(
4460
 
#line  1919 "Frames/cs.ATG" 
4461
 
out pexpr);
4462
 
                } else if (la.kind == 20) {
4463
 
                        lexer.NextToken();
4464
 
                        Expr(
4465
 
#line  1922 "Frames/cs.ATG" 
4466
 
out expr);
4467
 
                        Expect(21);
4468
 
 
4469
 
#line  1922 "Frames/cs.ATG" 
4470
 
                        pexpr = new ParenthesizedExpression(expr); 
4471
 
                } else if (StartOf(35)) {
4472
 
 
4473
 
#line  1925 "Frames/cs.ATG" 
4474
 
                        string val = null; 
4475
 
                        switch (la.kind) {
4476
 
                        case 52: {
4477
 
                                lexer.NextToken();
4478
 
 
4479
 
#line  1926 "Frames/cs.ATG" 
4480
 
                                val = "System.Boolean"; 
4481
 
                                break;
4482
 
                        }
4483
 
                        case 54: {
4484
 
                                lexer.NextToken();
4485
 
 
4486
 
#line  1927 "Frames/cs.ATG" 
4487
 
                                val = "System.Byte"; 
4488
 
                                break;
4489
 
                        }
4490
 
                        case 57: {
4491
 
                                lexer.NextToken();
4492
 
 
4493
 
#line  1928 "Frames/cs.ATG" 
4494
 
                                val = "System.Char"; 
4495
 
                                break;
4496
 
                        }
4497
 
                        case 62: {
4498
 
                                lexer.NextToken();
4499
 
 
4500
 
#line  1929 "Frames/cs.ATG" 
4501
 
                                val = "System.Decimal"; 
4502
 
                                break;
4503
 
                        }
4504
 
                        case 66: {
4505
 
                                lexer.NextToken();
4506
 
 
4507
 
#line  1930 "Frames/cs.ATG" 
4508
 
                                val = "System.Double"; 
4509
 
                                break;
4510
 
                        }
4511
 
                        case 75: {
4512
 
                                lexer.NextToken();
4513
 
 
4514
 
#line  1931 "Frames/cs.ATG" 
4515
 
                                val = "System.Single"; 
4516
 
                                break;
4517
 
                        }
4518
 
                        case 82: {
4519
 
                                lexer.NextToken();
4520
 
 
4521
 
#line  1932 "Frames/cs.ATG" 
4522
 
                                val = "System.Int32"; 
4523
 
                                break;
4524
 
                        }
4525
 
                        case 87: {
4526
 
                                lexer.NextToken();
4527
 
 
4528
 
#line  1933 "Frames/cs.ATG" 
4529
 
                                val = "System.Int64"; 
4530
 
                                break;
4531
 
                        }
4532
 
                        case 91: {
4533
 
                                lexer.NextToken();
4534
 
 
4535
 
#line  1934 "Frames/cs.ATG" 
4536
 
                                val = "System.Object"; 
4537
 
                                break;
4538
 
                        }
4539
 
                        case 102: {
4540
 
                                lexer.NextToken();
4541
 
 
4542
 
#line  1935 "Frames/cs.ATG" 
4543
 
                                val = "System.SByte"; 
4544
 
                                break;
4545
 
                        }
4546
 
                        case 104: {
4547
 
                                lexer.NextToken();
4548
 
 
4549
 
#line  1936 "Frames/cs.ATG" 
4550
 
                                val = "System.Int16"; 
4551
 
                                break;
4552
 
                        }
4553
 
                        case 108: {
4554
 
                                lexer.NextToken();
4555
 
 
4556
 
#line  1937 "Frames/cs.ATG" 
4557
 
                                val = "System.String"; 
4558
 
                                break;
4559
 
                        }
4560
 
                        case 116: {
4561
 
                                lexer.NextToken();
4562
 
 
4563
 
#line  1938 "Frames/cs.ATG" 
4564
 
                                val = "System.UInt32"; 
4565
 
                                break;
4566
 
                        }
4567
 
                        case 117: {
4568
 
                                lexer.NextToken();
4569
 
 
4570
 
#line  1939 "Frames/cs.ATG" 
4571
 
                                val = "System.UInt64"; 
4572
 
                                break;
4573
 
                        }
4574
 
                        case 120: {
4575
 
                                lexer.NextToken();
4576
 
 
4577
 
#line  1940 "Frames/cs.ATG" 
4578
 
                                val = "System.UInt16"; 
4579
 
                                break;
4580
 
                        }
4581
 
                        case 123: {
4582
 
                                lexer.NextToken();
4583
 
 
4584
 
#line  1941 "Frames/cs.ATG" 
4585
 
                                val = "System.Void"; 
4586
 
                                break;
4587
 
                        }
4588
 
                        }
4589
 
 
4590
 
#line  1943 "Frames/cs.ATG" 
4591
 
                        pexpr = new TypeReferenceExpression(new TypeReference(val, true)) { StartLocation = t.Location, EndLocation = t.EndLocation }; 
4592
 
                } else if (la.kind == 111) {
4593
 
                        lexer.NextToken();
4594
 
 
4595
 
#line  1946 "Frames/cs.ATG" 
4596
 
                        pexpr = new ThisReferenceExpression(); pexpr.StartLocation = t.Location; pexpr.EndLocation = t.EndLocation; 
4597
 
                } else if (la.kind == 51) {
4598
 
                        lexer.NextToken();
4599
 
 
4600
 
#line  1948 "Frames/cs.ATG" 
4601
 
                        pexpr = new BaseReferenceExpression(); pexpr.StartLocation = t.Location; pexpr.EndLocation = t.EndLocation; 
4602
 
                } else if (la.kind == 89) {
4603
 
                        NewExpression(
4604
 
#line  1951 "Frames/cs.ATG" 
4605
 
out pexpr);
4606
 
                } else if (la.kind == 115) {
4607
 
                        lexer.NextToken();
4608
 
                        Expect(20);
4609
 
                        if (
4610
 
#line  1955 "Frames/cs.ATG" 
4611
 
NotVoidPointer()) {
4612
 
                                Expect(123);
4613
 
 
4614
 
#line  1955 "Frames/cs.ATG" 
4615
 
                                type = new TypeReference("System.Void", true); 
4616
 
                        } else if (StartOf(10)) {
4617
 
                                TypeWithRestriction(
4618
 
#line  1956 "Frames/cs.ATG" 
4619
 
out type, true, true);
4620
 
                        } else SynErr(207);
4621
 
                        Expect(21);
4622
 
 
4623
 
#line  1958 "Frames/cs.ATG" 
4624
 
                        pexpr = new TypeOfExpression(type); 
4625
 
                } else if (la.kind == 63) {
4626
 
                        lexer.NextToken();
4627
 
                        Expect(20);
4628
 
                        Type(
4629
 
#line  1960 "Frames/cs.ATG" 
4630
 
out type);
4631
 
                        Expect(21);
4632
 
 
4633
 
#line  1960 "Frames/cs.ATG" 
4634
 
                        pexpr = new DefaultValueExpression(type); 
4635
 
                } else if (la.kind == 105) {
4636
 
                        lexer.NextToken();
4637
 
                        Expect(20);
4638
 
                        Type(
4639
 
#line  1961 "Frames/cs.ATG" 
4640
 
out type);
4641
 
                        Expect(21);
4642
 
 
4643
 
#line  1961 "Frames/cs.ATG" 
4644
 
                        pexpr = new SizeOfExpression(type); 
4645
 
                } else if (la.kind == 58) {
4646
 
                        lexer.NextToken();
4647
 
                        Expect(20);
4648
 
                        Expr(
4649
 
#line  1962 "Frames/cs.ATG" 
4650
 
out expr);
4651
 
                        Expect(21);
4652
 
 
4653
 
#line  1962 "Frames/cs.ATG" 
4654
 
                        pexpr = new CheckedExpression(expr); 
4655
 
                } else if (la.kind == 118) {
4656
 
                        lexer.NextToken();
4657
 
                        Expect(20);
4658
 
                        Expr(
4659
 
#line  1963 "Frames/cs.ATG" 
4660
 
out expr);
4661
 
                        Expect(21);
4662
 
 
4663
 
#line  1963 "Frames/cs.ATG" 
4664
 
                        pexpr = new UncheckedExpression(expr); 
4665
 
                } else if (la.kind == 64) {
4666
 
                        lexer.NextToken();
4667
 
                        AnonymousMethodExpr(
4668
 
#line  1964 "Frames/cs.ATG" 
4669
 
out expr);
4670
 
 
4671
 
#line  1964 "Frames/cs.ATG" 
4672
 
                        pexpr = expr; 
4673
 
                } else SynErr(208);
4674
 
 
4675
 
#line  1966 "Frames/cs.ATG" 
4676
 
                if (pexpr != null) {
4677
 
                if (pexpr.StartLocation.IsEmpty)
4678
 
                        pexpr.StartLocation = startLocation;
4679
 
                if (pexpr.EndLocation.IsEmpty)
4680
 
                        pexpr.EndLocation = t.EndLocation;
4681
 
                }
4682
 
                
4683
 
                while (StartOf(36)) {
4684
 
                        if (la.kind == 31 || la.kind == 32) {
4685
 
 
4686
 
#line  1974 "Frames/cs.ATG" 
4687
 
                                startLocation = la.Location; 
4688
 
                                if (la.kind == 31) {
4689
 
                                        lexer.NextToken();
4690
 
 
4691
 
#line  1976 "Frames/cs.ATG" 
4692
 
                                        pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostIncrement); 
4693
 
                                } else if (la.kind == 32) {
4694
 
                                        lexer.NextToken();
4695
 
 
4696
 
#line  1977 "Frames/cs.ATG" 
4697
 
                                        pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostDecrement); 
4698
 
                                } else SynErr(209);
4699
 
                        } else if (la.kind == 47) {
4700
 
                                PointerMemberAccess(
4701
 
#line  1980 "Frames/cs.ATG" 
4702
 
out pexpr, pexpr);
4703
 
                        } else if (la.kind == 15) {
4704
 
                                MemberAccess(
4705
 
#line  1981 "Frames/cs.ATG" 
4706
 
out pexpr, pexpr);
4707
 
                        } else if (la.kind == 20) {
4708
 
                                lexer.NextToken();
4709
 
 
4710
 
#line  1985 "Frames/cs.ATG" 
4711
 
                                List<Expression> parameters = new List<Expression>(); 
4712
 
 
4713
 
#line  1986 "Frames/cs.ATG" 
4714
 
                                pexpr = new InvocationExpression(pexpr, parameters); pexpr.StartLocation = startLocation; 
4715
 
                                if (StartOf(26)) {
4716
 
                                        Argument(
4717
 
#line  1987 "Frames/cs.ATG" 
4718
 
out expr);
4719
 
 
4720
 
#line  1987 "Frames/cs.ATG" 
4721
 
                                        SafeAdd(pexpr, parameters, expr); 
4722
 
                                        while (la.kind == 14) {
4723
 
                                                lexer.NextToken();
4724
 
                                                Argument(
4725
 
#line  1988 "Frames/cs.ATG" 
4726
 
out expr);
4727
 
 
4728
 
#line  1988 "Frames/cs.ATG" 
4729
 
                                                SafeAdd(pexpr, parameters, expr); 
4730
 
                                        }
4731
 
                                }
4732
 
                                Expect(21);
4733
 
                        } else {
4734
 
 
4735
 
#line  1994 "Frames/cs.ATG" 
4736
 
                                List<Expression> indices = new List<Expression>();
4737
 
                                pexpr = new IndexerExpression(pexpr, indices);
4738
 
                                
4739
 
                                lexer.NextToken();
4740
 
                                Expr(
4741
 
#line  1997 "Frames/cs.ATG" 
4742
 
out expr);
4743
 
 
4744
 
#line  1997 "Frames/cs.ATG" 
4745
 
                                SafeAdd(pexpr, indices, expr); 
4746
 
                                while (la.kind == 14) {
4747
 
                                        lexer.NextToken();
4748
 
                                        Expr(
4749
 
#line  1998 "Frames/cs.ATG" 
4750
 
out expr);
4751
 
 
4752
 
#line  1998 "Frames/cs.ATG" 
4753
 
                                        SafeAdd(pexpr, indices, expr); 
4754
 
                                }
4755
 
                                Expect(19);
4756
 
 
4757
 
#line  2001 "Frames/cs.ATG" 
4758
 
                                if (pexpr != null) {
4759
 
                                pexpr.StartLocation = startLocation;
4760
 
                                pexpr.EndLocation = t.EndLocation;
4761
 
                                }
4762
 
                                
4763
 
                        }
4764
 
                }
4765
 
        }
4766
 
 
4767
 
        void QueryExpression(
4768
 
#line  2431 "Frames/cs.ATG" 
4769
 
out Expression outExpr) {
4770
 
 
4771
 
#line  2432 "Frames/cs.ATG" 
4772
 
                QueryExpression q = new QueryExpression(); outExpr = q; q.StartLocation = la.Location; 
4773
 
                QueryExpressionFromClause fromClause;
4774
 
                
4775
 
                QueryExpressionFromClause(
4776
 
#line  2436 "Frames/cs.ATG" 
4777
 
out fromClause);
4778
 
 
4779
 
#line  2436 "Frames/cs.ATG" 
4780
 
                q.FromClause = fromClause; 
4781
 
                QueryExpressionBody(
4782
 
#line  2437 "Frames/cs.ATG" 
4783
 
ref q);
4784
 
 
4785
 
#line  2438 "Frames/cs.ATG" 
4786
 
                q.EndLocation = t.EndLocation; 
4787
 
                outExpr = q; /* set outExpr to q again if QueryExpressionBody changed it (can happen with 'into' clauses) */ 
4788
 
                
4789
 
        }
4790
 
 
4791
 
        void ShortedLambdaExpression(
4792
 
#line  2113 "Frames/cs.ATG" 
4793
 
IdentifierExpression ident, out Expression pexpr) {
4794
 
 
4795
 
#line  2114 "Frames/cs.ATG" 
4796
 
                LambdaExpression lambda = new LambdaExpression(); pexpr = lambda; 
4797
 
                Expect(48);
4798
 
 
4799
 
#line  2119 "Frames/cs.ATG" 
4800
 
                lambda.StartLocation = ident.StartLocation;
4801
 
                SafeAdd(lambda, lambda.Parameters, new ParameterDeclarationExpression(null, ident.Identifier));
4802
 
                lambda.Parameters[0].StartLocation = ident.StartLocation;
4803
 
                lambda.Parameters[0].EndLocation = ident.EndLocation;
4804
 
                
4805
 
                LambdaExpressionBody(
4806
 
#line  2124 "Frames/cs.ATG" 
4807
 
lambda);
4808
 
        }
4809
 
 
4810
 
        void TypeArgumentList(
4811
 
#line  2365 "Frames/cs.ATG" 
4812
 
out List<TypeReference> types, bool canBeUnbound) {
4813
 
 
4814
 
#line  2367 "Frames/cs.ATG" 
4815
 
                types = new List<TypeReference>();
4816
 
                TypeReference type = null;
4817
 
                
4818
 
                Expect(23);
4819
 
                if (
4820
 
#line  2372 "Frames/cs.ATG" 
4821
 
canBeUnbound && (la.kind == Tokens.GreaterThan || la.kind == Tokens.Comma)) {
4822
 
 
4823
 
#line  2373 "Frames/cs.ATG" 
4824
 
                        types.Add(TypeReference.Null); 
4825
 
                        while (la.kind == 14) {
4826
 
                                lexer.NextToken();
4827
 
 
4828
 
#line  2374 "Frames/cs.ATG" 
4829
 
                                types.Add(TypeReference.Null); 
4830
 
                        }
4831
 
                } else if (StartOf(10)) {
4832
 
                        Type(
4833
 
#line  2375 "Frames/cs.ATG" 
4834
 
out type);
4835
 
 
4836
 
#line  2375 "Frames/cs.ATG" 
4837
 
                        if (type != null) { types.Add(type); } 
4838
 
                        while (la.kind == 14) {
4839
 
                                lexer.NextToken();
4840
 
                                Type(
4841
 
#line  2376 "Frames/cs.ATG" 
4842
 
out type);
4843
 
 
4844
 
#line  2376 "Frames/cs.ATG" 
4845
 
                                if (type != null) { types.Add(type); } 
4846
 
                        }
4847
 
                } else SynErr(210);
4848
 
                Expect(22);
4849
 
        }
4850
 
 
4851
 
        void LambdaExpression(
4852
 
#line  2093 "Frames/cs.ATG" 
4853
 
out Expression outExpr) {
4854
 
 
4855
 
#line  2095 "Frames/cs.ATG" 
4856
 
                LambdaExpression lambda = new LambdaExpression();
4857
 
                lambda.StartLocation = la.Location;
4858
 
                ParameterDeclarationExpression p;
4859
 
                outExpr = lambda;
4860
 
                
4861
 
                Expect(20);
4862
 
                if (StartOf(18)) {
4863
 
                        LambdaExpressionParameter(
4864
 
#line  2103 "Frames/cs.ATG" 
4865
 
out p);
4866
 
 
4867
 
#line  2103 "Frames/cs.ATG" 
4868
 
                        SafeAdd(lambda, lambda.Parameters, p); 
4869
 
                        while (la.kind == 14) {
4870
 
                                lexer.NextToken();
4871
 
                                LambdaExpressionParameter(
4872
 
#line  2105 "Frames/cs.ATG" 
4873
 
out p);
4874
 
 
4875
 
#line  2105 "Frames/cs.ATG" 
4876
 
                                SafeAdd(lambda, lambda.Parameters, p); 
4877
 
                        }
4878
 
                }
4879
 
                Expect(21);
4880
 
                Expect(48);
4881
 
                LambdaExpressionBody(
4882
 
#line  2110 "Frames/cs.ATG" 
4883
 
lambda);
4884
 
        }
4885
 
 
4886
 
        void NewExpression(
4887
 
#line  2040 "Frames/cs.ATG" 
4888
 
out Expression pexpr) {
4889
 
 
4890
 
#line  2041 "Frames/cs.ATG" 
4891
 
                pexpr = null;
4892
 
                List<Expression> parameters = new List<Expression>();
4893
 
                TypeReference type = null;
4894
 
                Expression expr;
4895
 
                
4896
 
                Expect(89);
4897
 
                if (StartOf(10)) {
4898
 
                        NonArrayType(
4899
 
#line  2048 "Frames/cs.ATG" 
4900
 
out type);
4901
 
                }
4902
 
                if (la.kind == 16 || la.kind == 20) {
4903
 
                        if (la.kind == 20) {
4904
 
 
4905
 
#line  2054 "Frames/cs.ATG" 
4906
 
                                ObjectCreateExpression oce = new ObjectCreateExpression(type, parameters); 
4907
 
                                lexer.NextToken();
4908
 
 
4909
 
#line  2055 "Frames/cs.ATG" 
4910
 
                                if (type == null) Error("Cannot use an anonymous type with arguments for the constructor"); 
4911
 
                                if (StartOf(26)) {
4912
 
                                        Argument(
4913
 
#line  2056 "Frames/cs.ATG" 
4914
 
out expr);
4915
 
 
4916
 
#line  2056 "Frames/cs.ATG" 
4917
 
                                        SafeAdd(oce, parameters, expr); 
4918
 
                                        while (la.kind == 14) {
4919
 
                                                lexer.NextToken();
4920
 
                                                Argument(
4921
 
#line  2057 "Frames/cs.ATG" 
4922
 
out expr);
4923
 
 
4924
 
#line  2057 "Frames/cs.ATG" 
4925
 
                                                SafeAdd(oce, parameters, expr); 
4926
 
                                        }
4927
 
                                }
4928
 
                                Expect(21);
4929
 
 
4930
 
#line  2059 "Frames/cs.ATG" 
4931
 
                                pexpr = oce; 
4932
 
                                if (la.kind == 16) {
4933
 
                                        CollectionOrObjectInitializer(
4934
 
#line  2060 "Frames/cs.ATG" 
4935
 
out expr);
4936
 
 
4937
 
#line  2060 "Frames/cs.ATG" 
4938
 
                                        oce.ObjectInitializer = (CollectionInitializerExpression)expr; 
4939
 
                                }
4940
 
                        } else {
4941
 
 
4942
 
#line  2061 "Frames/cs.ATG" 
4943
 
                                ObjectCreateExpression oce = new ObjectCreateExpression(type, parameters); 
4944
 
                                CollectionOrObjectInitializer(
4945
 
#line  2062 "Frames/cs.ATG" 
4946
 
out expr);
4947
 
 
4948
 
#line  2062 "Frames/cs.ATG" 
4949
 
                                oce.ObjectInitializer = (CollectionInitializerExpression)expr; 
4950
 
 
4951
 
#line  2063 "Frames/cs.ATG" 
4952
 
                                pexpr = oce; 
4953
 
                        }
4954
 
                } else if (la.kind == 18) {
4955
 
                        lexer.NextToken();
4956
 
 
4957
 
#line  2068 "Frames/cs.ATG" 
4958
 
                        ArrayCreateExpression ace = new ArrayCreateExpression(type);
4959
 
                        /* we must not change RankSpecifier on the null type reference*/
4960
 
                        if (ace.CreateType.IsNull) { ace.CreateType = new TypeReference(""); }
4961
 
                        pexpr = ace;
4962
 
                        int dims = 0; List<int> ranks = new List<int>();
4963
 
                        
4964
 
                        if (la.kind == 14 || la.kind == 19) {
4965
 
                                while (la.kind == 14) {
4966
 
                                        lexer.NextToken();
4967
 
 
4968
 
#line  2075 "Frames/cs.ATG" 
4969
 
                                        dims += 1; 
4970
 
                                }
4971
 
                                Expect(19);
4972
 
 
4973
 
#line  2076 "Frames/cs.ATG" 
4974
 
                                ranks.Add(dims); dims = 0; 
4975
 
                                while (la.kind == 18) {
4976
 
                                        lexer.NextToken();
4977
 
                                        while (la.kind == 14) {
4978
 
                                                lexer.NextToken();
4979
 
 
4980
 
#line  2077 "Frames/cs.ATG" 
4981
 
                                                ++dims; 
4982
 
                                        }
4983
 
                                        Expect(19);
4984
 
 
4985
 
#line  2077 "Frames/cs.ATG" 
4986
 
                                        ranks.Add(dims); dims = 0; 
4987
 
                                }
4988
 
 
4989
 
#line  2078 "Frames/cs.ATG" 
4990
 
                                ace.CreateType.RankSpecifier = ranks.ToArray(); 
4991
 
                                CollectionInitializer(
4992
 
#line  2079 "Frames/cs.ATG" 
4993
 
out expr);
4994
 
 
4995
 
#line  2079 "Frames/cs.ATG" 
4996
 
                                ace.ArrayInitializer = (CollectionInitializerExpression)expr; 
4997
 
                        } else if (StartOf(6)) {
4998
 
                                Expr(
4999
 
#line  2080 "Frames/cs.ATG" 
5000
 
out expr);
5001
 
 
5002
 
#line  2080 "Frames/cs.ATG" 
5003
 
                                if (expr != null) parameters.Add(expr); 
5004
 
                                while (la.kind == 14) {
5005
 
                                        lexer.NextToken();
5006
 
 
5007
 
#line  2081 "Frames/cs.ATG" 
5008
 
                                        dims += 1; 
5009
 
                                        Expr(
5010
 
#line  2082 "Frames/cs.ATG" 
5011
 
out expr);
5012
 
 
5013
 
#line  2082 "Frames/cs.ATG" 
5014
 
                                        if (expr != null) parameters.Add(expr); 
5015
 
                                }
5016
 
                                Expect(19);
5017
 
 
5018
 
#line  2084 "Frames/cs.ATG" 
5019
 
                                ranks.Add(dims); ace.Arguments = parameters; dims = 0; 
5020
 
                                while (la.kind == 18) {
5021
 
                                        lexer.NextToken();
5022
 
                                        while (la.kind == 14) {
5023
 
                                                lexer.NextToken();
5024
 
 
5025
 
#line  2085 "Frames/cs.ATG" 
5026
 
                                                ++dims; 
5027
 
                                        }
5028
 
                                        Expect(19);
5029
 
 
5030
 
#line  2085 "Frames/cs.ATG" 
5031
 
                                        ranks.Add(dims); dims = 0; 
5032
 
                                }
5033
 
 
5034
 
#line  2086 "Frames/cs.ATG" 
5035
 
                                ace.CreateType.RankSpecifier = ranks.ToArray(); 
5036
 
                                if (la.kind == 16) {
5037
 
                                        CollectionInitializer(
5038
 
#line  2087 "Frames/cs.ATG" 
5039
 
out expr);
5040
 
 
5041
 
#line  2087 "Frames/cs.ATG" 
5042
 
                                        ace.ArrayInitializer = (CollectionInitializerExpression)expr; 
5043
 
                                }
5044
 
                        } else SynErr(211);
5045
 
                } else SynErr(212);
5046
 
        }
5047
 
 
5048
 
        void AnonymousMethodExpr(
5049
 
#line  2160 "Frames/cs.ATG" 
5050
 
out Expression outExpr) {
5051
 
 
5052
 
#line  2162 "Frames/cs.ATG" 
5053
 
                AnonymousMethodExpression expr = new AnonymousMethodExpression();
5054
 
                expr.StartLocation = t.Location;
5055
 
                BlockStatement stmt;
5056
 
                List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
5057
 
                outExpr = expr;
5058
 
                
5059
 
                if (la.kind == 20) {
5060
 
                        lexer.NextToken();
5061
 
                        if (StartOf(11)) {
5062
 
                                FormalParameterList(
5063
 
#line  2171 "Frames/cs.ATG" 
5064
 
p);
5065
 
 
5066
 
#line  2171 "Frames/cs.ATG" 
5067
 
                                expr.Parameters = p; 
5068
 
                        }
5069
 
                        Expect(21);
5070
 
 
5071
 
#line  2173 "Frames/cs.ATG" 
5072
 
                        expr.HasParameterList = true; 
5073
 
                }
5074
 
                BlockInsideExpression(
5075
 
#line  2175 "Frames/cs.ATG" 
5076
 
out stmt);
5077
 
 
5078
 
#line  2175 "Frames/cs.ATG" 
5079
 
                expr.Body  = stmt; 
5080
 
 
5081
 
#line  2176 "Frames/cs.ATG" 
5082
 
                expr.EndLocation = t.Location; 
5083
 
        }
5084
 
 
5085
 
        void PointerMemberAccess(
5086
 
#line  2028 "Frames/cs.ATG" 
5087
 
out Expression expr, Expression target) {
5088
 
 
5089
 
#line  2029 "Frames/cs.ATG" 
5090
 
                List<TypeReference> typeList; 
5091
 
                Expect(47);
5092
 
                Identifier();
5093
 
 
5094
 
#line  2033 "Frames/cs.ATG" 
5095
 
                expr = new PointerReferenceExpression(target, t.val); expr.StartLocation = t.Location; expr.EndLocation = t.EndLocation; 
5096
 
                if (
5097
 
#line  2034 "Frames/cs.ATG" 
5098
 
IsGenericInSimpleNameOrMemberAccess()) {
5099
 
                        TypeArgumentList(
5100
 
#line  2035 "Frames/cs.ATG" 
5101
 
out typeList, false);
5102
 
 
5103
 
#line  2036 "Frames/cs.ATG" 
5104
 
                        ((MemberReferenceExpression)expr).TypeArguments = typeList; 
5105
 
                }
5106
 
        }
5107
 
 
5108
 
        void MemberAccess(
5109
 
#line  2009 "Frames/cs.ATG" 
5110
 
out Expression expr, Expression target) {
5111
 
 
5112
 
#line  2010 "Frames/cs.ATG" 
5113
 
                List<TypeReference> typeList; 
5114
 
 
5115
 
#line  2012 "Frames/cs.ATG" 
5116
 
                if (ShouldConvertTargetExpressionToTypeReference(target)) {
5117
 
                TypeReference type = GetTypeReferenceFromExpression(target);
5118
 
                if (type != null) {
5119
 
                        target = new TypeReferenceExpression(type) { StartLocation = t.Location, EndLocation = t.EndLocation };
5120
 
                }
5121
 
                }
5122
 
                
5123
 
                Expect(15);
5124
 
                Identifier();
5125
 
 
5126
 
#line  2021 "Frames/cs.ATG" 
5127
 
                expr = new MemberReferenceExpression(target, t.val); expr.StartLocation = t.Location; expr.EndLocation = t.EndLocation; 
5128
 
                if (
5129
 
#line  2022 "Frames/cs.ATG" 
5130
 
IsGenericInSimpleNameOrMemberAccess()) {
5131
 
                        TypeArgumentList(
5132
 
#line  2023 "Frames/cs.ATG" 
5133
 
out typeList, false);
5134
 
 
5135
 
#line  2024 "Frames/cs.ATG" 
5136
 
                        ((MemberReferenceExpression)expr).TypeArguments = typeList; 
5137
 
                }
5138
 
        }
5139
 
 
5140
 
        void LambdaExpressionParameter(
5141
 
#line  2127 "Frames/cs.ATG" 
5142
 
out ParameterDeclarationExpression p) {
5143
 
 
5144
 
#line  2128 "Frames/cs.ATG" 
5145
 
                Location start = la.Location; p = null;
5146
 
                TypeReference type;
5147
 
                ParameterModifiers mod = ParameterModifiers.In;
5148
 
                
5149
 
                if (
5150
 
#line  2133 "Frames/cs.ATG" 
5151
 
Peek(1).kind == Tokens.Comma || Peek(1).kind == Tokens.CloseParenthesis) {
5152
 
                        Identifier();
5153
 
 
5154
 
#line  2135 "Frames/cs.ATG" 
5155
 
                        p = new ParameterDeclarationExpression(null, t.val);
5156
 
                        p.StartLocation = start; p.EndLocation = t.EndLocation;
5157
 
                        
5158
 
                } else if (StartOf(18)) {
5159
 
                        if (la.kind == 93 || la.kind == 100) {
5160
 
                                if (la.kind == 100) {
5161
 
                                        lexer.NextToken();
5162
 
 
5163
 
#line  2138 "Frames/cs.ATG" 
5164
 
                                        mod = ParameterModifiers.Ref; 
5165
 
                                } else {
5166
 
                                        lexer.NextToken();
5167
 
 
5168
 
#line  2139 "Frames/cs.ATG" 
5169
 
                                        mod = ParameterModifiers.Out; 
5170
 
                                }
5171
 
                        }
5172
 
                        Type(
5173
 
#line  2141 "Frames/cs.ATG" 
5174
 
out type);
5175
 
                        Identifier();
5176
 
 
5177
 
#line  2143 "Frames/cs.ATG" 
5178
 
                        p = new ParameterDeclarationExpression(type, t.val, mod);
5179
 
                        p.StartLocation = start; p.EndLocation = t.EndLocation;
5180
 
                        
5181
 
                } else SynErr(213);
5182
 
        }
5183
 
 
5184
 
        void LambdaExpressionBody(
5185
 
#line  2149 "Frames/cs.ATG" 
5186
 
LambdaExpression lambda) {
5187
 
 
5188
 
#line  2150 "Frames/cs.ATG" 
5189
 
                Expression expr; BlockStatement stmt; 
5190
 
                if (la.kind == 16) {
5191
 
                        BlockInsideExpression(
5192
 
#line  2153 "Frames/cs.ATG" 
5193
 
out stmt);
5194
 
 
5195
 
#line  2153 "Frames/cs.ATG" 
5196
 
                        lambda.StatementBody = stmt; 
5197
 
                } else if (StartOf(6)) {
5198
 
                        Expr(
5199
 
#line  2154 "Frames/cs.ATG" 
5200
 
out expr);
5201
 
 
5202
 
#line  2154 "Frames/cs.ATG" 
5203
 
                        lambda.ExpressionBody = expr; 
5204
 
                } else SynErr(214);
5205
 
 
5206
 
#line  2156 "Frames/cs.ATG" 
5207
 
                lambda.EndLocation = t.EndLocation; 
5208
 
 
5209
 
#line  2157 "Frames/cs.ATG" 
5210
 
                lambda.ExtendedEndLocation = la.Location; 
5211
 
        }
5212
 
 
5213
 
        void BlockInsideExpression(
5214
 
#line  2179 "Frames/cs.ATG" 
5215
 
out BlockStatement outStmt) {
5216
 
 
5217
 
#line  2180 "Frames/cs.ATG" 
5218
 
                Statement stmt = null; outStmt = null; 
5219
 
 
5220
 
#line  2184 "Frames/cs.ATG" 
5221
 
                if (compilationUnit != null) { 
5222
 
                Block(
5223
 
#line  2185 "Frames/cs.ATG" 
5224
 
out stmt);
5225
 
 
5226
 
#line  2185 "Frames/cs.ATG" 
5227
 
                outStmt = (BlockStatement)stmt; 
5228
 
 
5229
 
#line  2186 "Frames/cs.ATG" 
5230
 
                } else { 
5231
 
                Expect(16);
5232
 
 
5233
 
#line  2188 "Frames/cs.ATG" 
5234
 
                lexer.SkipCurrentBlock(0); 
5235
 
                Expect(17);
5236
 
 
5237
 
#line  2190 "Frames/cs.ATG" 
5238
 
                } 
5239
 
        }
5240
 
 
5241
 
        void ConditionalAndExpr(
5242
 
#line  2199 "Frames/cs.ATG" 
5243
 
ref Expression outExpr) {
5244
 
 
5245
 
#line  2200 "Frames/cs.ATG" 
5246
 
                Expression expr; 
5247
 
                InclusiveOrExpr(
5248
 
#line  2202 "Frames/cs.ATG" 
5249
 
ref outExpr);
5250
 
                while (la.kind == 25) {
5251
 
                        lexer.NextToken();
5252
 
                        UnaryExpr(
5253
 
#line  2202 "Frames/cs.ATG" 
5254
 
out expr);
5255
 
                        InclusiveOrExpr(
5256
 
#line  2202 "Frames/cs.ATG" 
5257
 
ref expr);
5258
 
 
5259
 
#line  2202 "Frames/cs.ATG" 
5260
 
                        outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalAnd, expr);  
5261
 
                }
5262
 
        }
5263
 
 
5264
 
        void InclusiveOrExpr(
5265
 
#line  2205 "Frames/cs.ATG" 
5266
 
ref Expression outExpr) {
5267
 
 
5268
 
#line  2206 "Frames/cs.ATG" 
5269
 
                Expression expr; 
5270
 
                ExclusiveOrExpr(
5271
 
#line  2208 "Frames/cs.ATG" 
5272
 
ref outExpr);
5273
 
                while (la.kind == 29) {
5274
 
                        lexer.NextToken();
5275
 
                        UnaryExpr(
5276
 
#line  2208 "Frames/cs.ATG" 
5277
 
out expr);
5278
 
                        ExclusiveOrExpr(
5279
 
#line  2208 "Frames/cs.ATG" 
5280
 
ref expr);
5281
 
 
5282
 
#line  2208 "Frames/cs.ATG" 
5283
 
                        outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseOr, expr);  
5284
 
                }
5285
 
        }
5286
 
 
5287
 
        void ExclusiveOrExpr(
5288
 
#line  2211 "Frames/cs.ATG" 
5289
 
ref Expression outExpr) {
5290
 
 
5291
 
#line  2212 "Frames/cs.ATG" 
5292
 
                Expression expr; 
5293
 
                AndExpr(
5294
 
#line  2214 "Frames/cs.ATG" 
5295
 
ref outExpr);
5296
 
                while (la.kind == 30) {
5297
 
                        lexer.NextToken();
5298
 
                        UnaryExpr(
5299
 
#line  2214 "Frames/cs.ATG" 
5300
 
out expr);
5301
 
                        AndExpr(
5302
 
#line  2214 "Frames/cs.ATG" 
5303
 
ref expr);
5304
 
 
5305
 
#line  2214 "Frames/cs.ATG" 
5306
 
                        outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.ExclusiveOr, expr);  
5307
 
                }
5308
 
        }
5309
 
 
5310
 
        void AndExpr(
5311
 
#line  2217 "Frames/cs.ATG" 
5312
 
ref Expression outExpr) {
5313
 
 
5314
 
#line  2218 "Frames/cs.ATG" 
5315
 
                Expression expr; 
5316
 
                EqualityExpr(
5317
 
#line  2220 "Frames/cs.ATG" 
5318
 
ref outExpr);
5319
 
                while (la.kind == 28) {
5320
 
                        lexer.NextToken();
5321
 
                        UnaryExpr(
5322
 
#line  2220 "Frames/cs.ATG" 
5323
 
out expr);
5324
 
                        EqualityExpr(
5325
 
#line  2220 "Frames/cs.ATG" 
5326
 
ref expr);
5327
 
 
5328
 
#line  2220 "Frames/cs.ATG" 
5329
 
                        outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseAnd, expr);  
5330
 
                }
5331
 
        }
5332
 
 
5333
 
        void EqualityExpr(
5334
 
#line  2223 "Frames/cs.ATG" 
5335
 
ref Expression outExpr) {
5336
 
 
5337
 
#line  2225 "Frames/cs.ATG" 
5338
 
                Expression expr;
5339
 
                BinaryOperatorType op = BinaryOperatorType.None;
5340
 
                
5341
 
                RelationalExpr(
5342
 
#line  2229 "Frames/cs.ATG" 
5343
 
ref outExpr);
5344
 
                while (la.kind == 33 || la.kind == 34) {
5345
 
                        if (la.kind == 34) {
5346
 
                                lexer.NextToken();
5347
 
 
5348
 
#line  2232 "Frames/cs.ATG" 
5349
 
                                op = BinaryOperatorType.InEquality; 
5350
 
                        } else {
5351
 
                                lexer.NextToken();
5352
 
 
5353
 
#line  2233 "Frames/cs.ATG" 
5354
 
                                op = BinaryOperatorType.Equality; 
5355
 
                        }
5356
 
                        UnaryExpr(
5357
 
#line  2235 "Frames/cs.ATG" 
5358
 
out expr);
5359
 
                        RelationalExpr(
5360
 
#line  2235 "Frames/cs.ATG" 
5361
 
ref expr);
5362
 
 
5363
 
#line  2235 "Frames/cs.ATG" 
5364
 
                        outExpr = new BinaryOperatorExpression(outExpr, op, expr);  
5365
 
                }
5366
 
        }
5367
 
 
5368
 
        void RelationalExpr(
5369
 
#line  2239 "Frames/cs.ATG" 
5370
 
ref Expression outExpr) {
5371
 
 
5372
 
#line  2241 "Frames/cs.ATG" 
5373
 
                TypeReference type;
5374
 
                Expression expr;
5375
 
                BinaryOperatorType op = BinaryOperatorType.None;
5376
 
                
5377
 
                ShiftExpr(
5378
 
#line  2246 "Frames/cs.ATG" 
5379
 
ref outExpr);
5380
 
                while (StartOf(37)) {
5381
 
                        if (StartOf(38)) {
5382
 
                                if (la.kind == 23) {
5383
 
                                        lexer.NextToken();
5384
 
 
5385
 
#line  2248 "Frames/cs.ATG" 
5386
 
                                        op = BinaryOperatorType.LessThan; 
5387
 
                                } else if (la.kind == 22) {
5388
 
                                        lexer.NextToken();
5389
 
 
5390
 
#line  2249 "Frames/cs.ATG" 
5391
 
                                        op = BinaryOperatorType.GreaterThan; 
5392
 
                                } else if (la.kind == 36) {
5393
 
                                        lexer.NextToken();
5394
 
 
5395
 
#line  2250 "Frames/cs.ATG" 
5396
 
                                        op = BinaryOperatorType.LessThanOrEqual; 
5397
 
                                } else if (la.kind == 35) {
5398
 
                                        lexer.NextToken();
5399
 
 
5400
 
#line  2251 "Frames/cs.ATG" 
5401
 
                                        op = BinaryOperatorType.GreaterThanOrEqual; 
5402
 
                                } else SynErr(215);
5403
 
                                UnaryExpr(
5404
 
#line  2253 "Frames/cs.ATG" 
5405
 
out expr);
5406
 
                                ShiftExpr(
5407
 
#line  2254 "Frames/cs.ATG" 
5408
 
ref expr);
5409
 
 
5410
 
#line  2255 "Frames/cs.ATG" 
5411
 
                                outExpr = new BinaryOperatorExpression(outExpr, op, expr); 
5412
 
                        } else {
5413
 
                                if (la.kind == 85) {
5414
 
                                        lexer.NextToken();
5415
 
                                        TypeWithRestriction(
5416
 
#line  2258 "Frames/cs.ATG" 
5417
 
out type, false, false);
5418
 
                                        if (
5419
 
#line  2259 "Frames/cs.ATG" 
5420
 
la.kind == Tokens.Question && !IsPossibleExpressionStart(Peek(1).kind)) {
5421
 
                                                NullableQuestionMark(
5422
 
#line  2260 "Frames/cs.ATG" 
5423
 
ref type);
5424
 
                                        }
5425
 
 
5426
 
#line  2261 "Frames/cs.ATG" 
5427
 
                                        outExpr = new TypeOfIsExpression(outExpr, type); 
5428
 
                                } else if (la.kind == 50) {
5429
 
                                        lexer.NextToken();
5430
 
                                        TypeWithRestriction(
5431
 
#line  2263 "Frames/cs.ATG" 
5432
 
out type, false, false);
5433
 
                                        if (
5434
 
#line  2264 "Frames/cs.ATG" 
5435
 
la.kind == Tokens.Question && !IsPossibleExpressionStart(Peek(1).kind)) {
5436
 
                                                NullableQuestionMark(
5437
 
#line  2265 "Frames/cs.ATG" 
5438
 
ref type);
5439
 
                                        }
5440
 
 
5441
 
#line  2266 "Frames/cs.ATG" 
5442
 
                                        outExpr = new CastExpression(type, outExpr, CastType.TryCast); 
5443
 
                                } else SynErr(216);
5444
 
                        }
5445
 
                }
5446
 
        }
5447
 
 
5448
 
        void ShiftExpr(
5449
 
#line  2271 "Frames/cs.ATG" 
5450
 
ref Expression outExpr) {
5451
 
 
5452
 
#line  2273 "Frames/cs.ATG" 
5453
 
                Expression expr;
5454
 
                BinaryOperatorType op = BinaryOperatorType.None;
5455
 
                
5456
 
                AdditiveExpr(
5457
 
#line  2277 "Frames/cs.ATG" 
5458
 
ref outExpr);
5459
 
                while (la.kind == 37 || 
5460
 
#line  2280 "Frames/cs.ATG" 
5461
 
IsShiftRight()) {
5462
 
                        if (la.kind == 37) {
5463
 
                                lexer.NextToken();
5464
 
 
5465
 
#line  2279 "Frames/cs.ATG" 
5466
 
                                op = BinaryOperatorType.ShiftLeft; 
5467
 
                        } else {
5468
 
                                Expect(22);
5469
 
                                Expect(22);
5470
 
 
5471
 
#line  2281 "Frames/cs.ATG" 
5472
 
                                op = BinaryOperatorType.ShiftRight; 
5473
 
                        }
5474
 
                        UnaryExpr(
5475
 
#line  2284 "Frames/cs.ATG" 
5476
 
out expr);
5477
 
                        AdditiveExpr(
5478
 
#line  2284 "Frames/cs.ATG" 
5479
 
ref expr);
5480
 
 
5481
 
#line  2284 "Frames/cs.ATG" 
5482
 
                        outExpr = new BinaryOperatorExpression(outExpr, op, expr);  
5483
 
                }
5484
 
        }
5485
 
 
5486
 
        void AdditiveExpr(
5487
 
#line  2288 "Frames/cs.ATG" 
5488
 
ref Expression outExpr) {
5489
 
 
5490
 
#line  2290 "Frames/cs.ATG" 
5491
 
                Expression expr;
5492
 
                BinaryOperatorType op = BinaryOperatorType.None;
5493
 
                
5494
 
                MultiplicativeExpr(
5495
 
#line  2294 "Frames/cs.ATG" 
5496
 
ref outExpr);
5497
 
                while (la.kind == 4 || la.kind == 5) {
5498
 
                        if (la.kind == 4) {
5499
 
                                lexer.NextToken();
5500
 
 
5501
 
#line  2297 "Frames/cs.ATG" 
5502
 
                                op = BinaryOperatorType.Add; 
5503
 
                        } else {
5504
 
                                lexer.NextToken();
5505
 
 
5506
 
#line  2298 "Frames/cs.ATG" 
5507
 
                                op = BinaryOperatorType.Subtract; 
5508
 
                        }
5509
 
                        UnaryExpr(
5510
 
#line  2300 "Frames/cs.ATG" 
5511
 
out expr);
5512
 
                        MultiplicativeExpr(
5513
 
#line  2300 "Frames/cs.ATG" 
5514
 
ref expr);
5515
 
 
5516
 
#line  2300 "Frames/cs.ATG" 
5517
 
                        outExpr = new BinaryOperatorExpression(outExpr, op, expr);  
5518
 
                }
5519
 
        }
5520
 
 
5521
 
        void MultiplicativeExpr(
5522
 
#line  2304 "Frames/cs.ATG" 
5523
 
ref Expression outExpr) {
5524
 
 
5525
 
#line  2306 "Frames/cs.ATG" 
5526
 
                Expression expr;
5527
 
                BinaryOperatorType op = BinaryOperatorType.None;
5528
 
                
5529
 
                while (la.kind == 6 || la.kind == 7 || la.kind == 8) {
5530
 
                        if (la.kind == 6) {
5531
 
                                lexer.NextToken();
5532
 
 
5533
 
#line  2312 "Frames/cs.ATG" 
5534
 
                                op = BinaryOperatorType.Multiply; 
5535
 
                        } else if (la.kind == 7) {
5536
 
                                lexer.NextToken();
5537
 
 
5538
 
#line  2313 "Frames/cs.ATG" 
5539
 
                                op = BinaryOperatorType.Divide; 
5540
 
                        } else {
5541
 
                                lexer.NextToken();
5542
 
 
5543
 
#line  2314 "Frames/cs.ATG" 
5544
 
                                op = BinaryOperatorType.Modulus; 
5545
 
                        }
5546
 
                        UnaryExpr(
5547
 
#line  2316 "Frames/cs.ATG" 
5548
 
out expr);
5549
 
 
5550
 
#line  2316 "Frames/cs.ATG" 
5551
 
                        outExpr = new BinaryOperatorExpression(outExpr, op, expr); 
5552
 
                }
5553
 
        }
5554
 
 
5555
 
        void TypeParameterConstraintsClauseBase(
5556
 
#line  2422 "Frames/cs.ATG" 
5557
 
out TypeReference type) {
5558
 
 
5559
 
#line  2423 "Frames/cs.ATG" 
5560
 
                TypeReference t; type = null; 
5561
 
                if (la.kind == 109) {
5562
 
                        lexer.NextToken();
5563
 
 
5564
 
#line  2425 "Frames/cs.ATG" 
5565
 
                        type = TypeReference.StructConstraint; 
5566
 
                } else if (la.kind == 59) {
5567
 
                        lexer.NextToken();
5568
 
 
5569
 
#line  2426 "Frames/cs.ATG" 
5570
 
                        type = TypeReference.ClassConstraint; 
5571
 
                } else if (la.kind == 89) {
5572
 
                        lexer.NextToken();
5573
 
                        Expect(20);
5574
 
                        Expect(21);
5575
 
 
5576
 
#line  2427 "Frames/cs.ATG" 
5577
 
                        type = TypeReference.NewConstraint; 
5578
 
                } else if (StartOf(10)) {
5579
 
                        Type(
5580
 
#line  2428 "Frames/cs.ATG" 
5581
 
out t);
5582
 
 
5583
 
#line  2428 "Frames/cs.ATG" 
5584
 
                        type = t; 
5585
 
                } else SynErr(217);
5586
 
        }
5587
 
 
5588
 
        void QueryExpressionFromClause(
5589
 
#line  2443 "Frames/cs.ATG" 
5590
 
out QueryExpressionFromClause fc) {
5591
 
 
5592
 
#line  2444 "Frames/cs.ATG" 
5593
 
                fc = new QueryExpressionFromClause(); fc.StartLocation = la.Location; 
5594
 
                
5595
 
                Expect(137);
5596
 
                QueryExpressionFromOrJoinClause(
5597
 
#line  2448 "Frames/cs.ATG" 
5598
 
fc);
5599
 
 
5600
 
#line  2449 "Frames/cs.ATG" 
5601
 
                fc.EndLocation = t.EndLocation; 
5602
 
        }
5603
 
 
5604
 
        void QueryExpressionBody(
5605
 
#line  2479 "Frames/cs.ATG" 
5606
 
ref QueryExpression q) {
5607
 
 
5608
 
#line  2480 "Frames/cs.ATG" 
5609
 
                QueryExpressionFromClause fromClause;     QueryExpressionWhereClause whereClause;
5610
 
                QueryExpressionLetClause letClause;       QueryExpressionJoinClause joinClause;
5611
 
                QueryExpressionOrderClause orderClause;
5612
 
                QueryExpressionSelectClause selectClause; QueryExpressionGroupClause groupClause;
5613
 
                
5614
 
                while (StartOf(39)) {
5615
 
                        if (la.kind == 137) {
5616
 
                                QueryExpressionFromClause(
5617
 
#line  2486 "Frames/cs.ATG" 
5618
 
out fromClause);
5619
 
 
5620
 
#line  2486 "Frames/cs.ATG" 
5621
 
                                SafeAdd<QueryExpressionClause>(q, q.MiddleClauses, fromClause); 
5622
 
                        } else if (la.kind == 127) {
5623
 
                                QueryExpressionWhereClause(
5624
 
#line  2487 "Frames/cs.ATG" 
5625
 
out whereClause);
5626
 
 
5627
 
#line  2487 "Frames/cs.ATG" 
5628
 
                                SafeAdd<QueryExpressionClause>(q, q.MiddleClauses, whereClause); 
5629
 
                        } else if (la.kind == 141) {
5630
 
                                QueryExpressionLetClause(
5631
 
#line  2488 "Frames/cs.ATG" 
5632
 
out letClause);
5633
 
 
5634
 
#line  2488 "Frames/cs.ATG" 
5635
 
                                SafeAdd<QueryExpressionClause>(q, q.MiddleClauses, letClause); 
5636
 
                        } else if (la.kind == 142) {
5637
 
                                QueryExpressionJoinClause(
5638
 
#line  2489 "Frames/cs.ATG" 
5639
 
out joinClause);
5640
 
 
5641
 
#line  2489 "Frames/cs.ATG" 
5642
 
                                SafeAdd<QueryExpressionClause>(q, q.MiddleClauses, joinClause); 
5643
 
                        } else {
5644
 
                                QueryExpressionOrderByClause(
5645
 
#line  2490 "Frames/cs.ATG" 
5646
 
out orderClause);
5647
 
 
5648
 
#line  2490 "Frames/cs.ATG" 
5649
 
                                SafeAdd<QueryExpressionClause>(q, q.MiddleClauses, orderClause); 
5650
 
                        }
5651
 
                }
5652
 
                if (la.kind == 133) {
5653
 
                        QueryExpressionSelectClause(
5654
 
#line  2492 "Frames/cs.ATG" 
5655
 
out selectClause);
5656
 
 
5657
 
#line  2492 "Frames/cs.ATG" 
5658
 
                        q.SelectOrGroupClause = selectClause; 
5659
 
                } else if (la.kind == 134) {
5660
 
                        QueryExpressionGroupClause(
5661
 
#line  2493 "Frames/cs.ATG" 
5662
 
out groupClause);
5663
 
 
5664
 
#line  2493 "Frames/cs.ATG" 
5665
 
                        q.SelectOrGroupClause = groupClause; 
5666
 
                } else SynErr(218);
5667
 
                if (la.kind == 136) {
5668
 
                        QueryExpressionIntoClause(
5669
 
#line  2495 "Frames/cs.ATG" 
5670
 
ref q);
5671
 
                }
5672
 
        }
5673
 
 
5674
 
        void QueryExpressionFromOrJoinClause(
5675
 
#line  2469 "Frames/cs.ATG" 
5676
 
QueryExpressionFromOrJoinClause fjc) {
5677
 
 
5678
 
#line  2470 "Frames/cs.ATG" 
5679
 
                TypeReference type; Expression expr; 
5680
 
 
5681
 
#line  2472 "Frames/cs.ATG" 
5682
 
                fjc.Type = null; 
5683
 
                if (
5684
 
#line  2473 "Frames/cs.ATG" 
5685
 
IsLocalVarDecl()) {
5686
 
                        Type(
5687
 
#line  2473 "Frames/cs.ATG" 
5688
 
out type);
5689
 
 
5690
 
#line  2473 "Frames/cs.ATG" 
5691
 
                        fjc.Type = type; 
5692
 
                }
5693
 
                Identifier();
5694
 
 
5695
 
#line  2474 "Frames/cs.ATG" 
5696
 
                fjc.Identifier = t.val; 
5697
 
                Expect(81);
5698
 
                Expr(
5699
 
#line  2476 "Frames/cs.ATG" 
5700
 
out expr);
5701
 
 
5702
 
#line  2476 "Frames/cs.ATG" 
5703
 
                fjc.InExpression = expr; 
5704
 
        }
5705
 
 
5706
 
        void QueryExpressionJoinClause(
5707
 
#line  2452 "Frames/cs.ATG" 
5708
 
out QueryExpressionJoinClause jc) {
5709
 
 
5710
 
#line  2453 "Frames/cs.ATG" 
5711
 
                jc = new QueryExpressionJoinClause(); jc.StartLocation = la.Location; 
5712
 
                Expression expr;
5713
 
                
5714
 
                Expect(142);
5715
 
                QueryExpressionFromOrJoinClause(
5716
 
#line  2458 "Frames/cs.ATG" 
5717
 
jc);
5718
 
                Expect(143);
5719
 
                Expr(
5720
 
#line  2460 "Frames/cs.ATG" 
5721
 
out expr);
5722
 
 
5723
 
#line  2460 "Frames/cs.ATG" 
5724
 
                jc.OnExpression = expr; 
5725
 
                Expect(144);
5726
 
                Expr(
5727
 
#line  2462 "Frames/cs.ATG" 
5728
 
out expr);
5729
 
 
5730
 
#line  2462 "Frames/cs.ATG" 
5731
 
                jc.EqualsExpression = expr; 
5732
 
                if (la.kind == 136) {
5733
 
                        lexer.NextToken();
5734
 
                        Identifier();
5735
 
 
5736
 
#line  2464 "Frames/cs.ATG" 
5737
 
                        jc.IntoIdentifier = t.val; 
5738
 
                }
5739
 
 
5740
 
#line  2466 "Frames/cs.ATG" 
5741
 
                jc.EndLocation = t.EndLocation; 
5742
 
        }
5743
 
 
5744
 
        void QueryExpressionWhereClause(
5745
 
#line  2498 "Frames/cs.ATG" 
5746
 
out QueryExpressionWhereClause wc) {
5747
 
 
5748
 
#line  2499 "Frames/cs.ATG" 
5749
 
                Expression expr; wc = new QueryExpressionWhereClause(); wc.StartLocation = la.Location; 
5750
 
                Expect(127);
5751
 
                Expr(
5752
 
#line  2502 "Frames/cs.ATG" 
5753
 
out expr);
5754
 
 
5755
 
#line  2502 "Frames/cs.ATG" 
5756
 
                wc.Condition = expr; 
5757
 
 
5758
 
#line  2503 "Frames/cs.ATG" 
5759
 
                wc.EndLocation = t.EndLocation; 
5760
 
        }
5761
 
 
5762
 
        void QueryExpressionLetClause(
5763
 
#line  2506 "Frames/cs.ATG" 
5764
 
out QueryExpressionLetClause wc) {
5765
 
 
5766
 
#line  2507 "Frames/cs.ATG" 
5767
 
                Expression expr; wc = new QueryExpressionLetClause(); wc.StartLocation = la.Location; 
5768
 
                Expect(141);
5769
 
                Identifier();
5770
 
 
5771
 
#line  2510 "Frames/cs.ATG" 
5772
 
                wc.Identifier = t.val; 
5773
 
                Expect(3);
5774
 
                Expr(
5775
 
#line  2512 "Frames/cs.ATG" 
5776
 
out expr);
5777
 
 
5778
 
#line  2512 "Frames/cs.ATG" 
5779
 
                wc.Expression = expr; 
5780
 
 
5781
 
#line  2513 "Frames/cs.ATG" 
5782
 
                wc.EndLocation = t.EndLocation; 
5783
 
        }
5784
 
 
5785
 
        void QueryExpressionOrderByClause(
5786
 
#line  2516 "Frames/cs.ATG" 
5787
 
out QueryExpressionOrderClause oc) {
5788
 
 
5789
 
#line  2517 "Frames/cs.ATG" 
5790
 
                QueryExpressionOrdering ordering; oc = new QueryExpressionOrderClause(); oc.StartLocation = la.Location; 
5791
 
                Expect(140);
5792
 
                QueryExpressionOrdering(
5793
 
#line  2520 "Frames/cs.ATG" 
5794
 
out ordering);
5795
 
 
5796
 
#line  2520 "Frames/cs.ATG" 
5797
 
                SafeAdd(oc, oc.Orderings, ordering); 
5798
 
                while (la.kind == 14) {
5799
 
                        lexer.NextToken();
5800
 
                        QueryExpressionOrdering(
5801
 
#line  2522 "Frames/cs.ATG" 
5802
 
out ordering);
5803
 
 
5804
 
#line  2522 "Frames/cs.ATG" 
5805
 
                        SafeAdd(oc, oc.Orderings, ordering); 
5806
 
                }
5807
 
 
5808
 
#line  2524 "Frames/cs.ATG" 
5809
 
                oc.EndLocation = t.EndLocation; 
5810
 
        }
5811
 
 
5812
 
        void QueryExpressionSelectClause(
5813
 
#line  2537 "Frames/cs.ATG" 
5814
 
out QueryExpressionSelectClause sc) {
5815
 
 
5816
 
#line  2538 "Frames/cs.ATG" 
5817
 
                Expression expr; sc = new QueryExpressionSelectClause(); sc.StartLocation = la.Location; 
5818
 
                Expect(133);
5819
 
                Expr(
5820
 
#line  2541 "Frames/cs.ATG" 
5821
 
out expr);
5822
 
 
5823
 
#line  2541 "Frames/cs.ATG" 
5824
 
                sc.Projection = expr; 
5825
 
 
5826
 
#line  2542 "Frames/cs.ATG" 
5827
 
                sc.EndLocation = t.EndLocation; 
5828
 
        }
5829
 
 
5830
 
        void QueryExpressionGroupClause(
5831
 
#line  2545 "Frames/cs.ATG" 
5832
 
out QueryExpressionGroupClause gc) {
5833
 
 
5834
 
#line  2546 "Frames/cs.ATG" 
5835
 
                Expression expr; gc = new QueryExpressionGroupClause(); gc.StartLocation = la.Location; 
5836
 
                Expect(134);
5837
 
                Expr(
5838
 
#line  2549 "Frames/cs.ATG" 
5839
 
out expr);
5840
 
 
5841
 
#line  2549 "Frames/cs.ATG" 
5842
 
                gc.Projection = expr; 
5843
 
                Expect(135);
5844
 
                Expr(
5845
 
#line  2551 "Frames/cs.ATG" 
5846
 
out expr);
5847
 
 
5848
 
#line  2551 "Frames/cs.ATG" 
5849
 
                gc.GroupBy = expr; 
5850
 
 
5851
 
#line  2552 "Frames/cs.ATG" 
5852
 
                gc.EndLocation = t.EndLocation; 
5853
 
        }
5854
 
 
5855
 
        void QueryExpressionIntoClause(
5856
 
#line  2555 "Frames/cs.ATG" 
5857
 
ref QueryExpression q) {
5858
 
 
5859
 
#line  2556 "Frames/cs.ATG" 
5860
 
                QueryExpression firstQuery = q;
5861
 
                QueryExpression continuedQuery = new QueryExpression(); 
5862
 
                continuedQuery.StartLocation = q.StartLocation;
5863
 
                firstQuery.EndLocation = la.Location;
5864
 
                continuedQuery.FromClause = new QueryExpressionFromClause();
5865
 
                continuedQuery.FromClause.StartLocation = la.Location;
5866
 
                // nest firstQuery inside continuedQuery.
5867
 
                continuedQuery.FromClause.InExpression = firstQuery;
5868
 
                continuedQuery.IsQueryContinuation = true;
5869
 
                q = continuedQuery;
5870
 
                
5871
 
                Expect(136);
5872
 
                Identifier();
5873
 
 
5874
 
#line  2569 "Frames/cs.ATG" 
5875
 
                continuedQuery.FromClause.Identifier = t.val; 
5876
 
 
5877
 
#line  2570 "Frames/cs.ATG" 
5878
 
                continuedQuery.FromClause.EndLocation = t.EndLocation; 
5879
 
                QueryExpressionBody(
5880
 
#line  2571 "Frames/cs.ATG" 
5881
 
ref q);
5882
 
        }
5883
 
 
5884
 
        void QueryExpressionOrdering(
5885
 
#line  2527 "Frames/cs.ATG" 
5886
 
out QueryExpressionOrdering ordering) {
5887
 
 
5888
 
#line  2528 "Frames/cs.ATG" 
5889
 
                Expression expr; ordering = new QueryExpressionOrdering(); ordering.StartLocation = la.Location; 
5890
 
                Expr(
5891
 
#line  2530 "Frames/cs.ATG" 
5892
 
out expr);
5893
 
 
5894
 
#line  2530 "Frames/cs.ATG" 
5895
 
                ordering.Criteria = expr; 
5896
 
                if (la.kind == 138 || la.kind == 139) {
5897
 
                        if (la.kind == 138) {
5898
 
                                lexer.NextToken();
5899
 
 
5900
 
#line  2531 "Frames/cs.ATG" 
5901
 
                                ordering.Direction = QueryExpressionOrderingDirection.Ascending; 
5902
 
                        } else {
5903
 
                                lexer.NextToken();
5904
 
 
5905
 
#line  2532 "Frames/cs.ATG" 
5906
 
                                ordering.Direction = QueryExpressionOrderingDirection.Descending; 
5907
 
                        }
5908
 
                }
5909
 
 
5910
 
#line  2534 "Frames/cs.ATG" 
5911
 
                ordering.EndLocation = t.EndLocation; 
5912
 
        }
5913
 
 
5914
 
 
5915
 
        
5916
 
        void ParseRoot()
5917
 
        {
5918
 
                CS();
5919
 
 
5920
 
        }
5921
 
        
5922
 
        protected override void SynErr(int line, int col, int errorNumber)
5923
 
        {
5924
 
                string s;
5925
 
                switch (errorNumber) {
5926
 
                        case 0: s = "EOF expected"; break;
5927
 
                        case 1: s = "ident expected"; break;
5928
 
                        case 2: s = "Literal expected"; break;
5929
 
                        case 3: s = "\"=\" expected"; break;
5930
 
                        case 4: s = "\"+\" expected"; break;
5931
 
                        case 5: s = "\"-\" expected"; break;
5932
 
                        case 6: s = "\"*\" expected"; break;
5933
 
                        case 7: s = "\"/\" expected"; break;
5934
 
                        case 8: s = "\"%\" expected"; break;
5935
 
                        case 9: s = "\":\" expected"; break;
5936
 
                        case 10: s = "\"::\" expected"; break;
5937
 
                        case 11: s = "\";\" expected"; break;
5938
 
                        case 12: s = "\"?\" expected"; break;
5939
 
                        case 13: s = "\"??\" expected"; break;
5940
 
                        case 14: s = "\",\" expected"; break;
5941
 
                        case 15: s = "\".\" expected"; break;
5942
 
                        case 16: s = "\"{\" expected"; break;
5943
 
                        case 17: s = "\"}\" expected"; break;
5944
 
                        case 18: s = "\"[\" expected"; break;
5945
 
                        case 19: s = "\"]\" expected"; break;
5946
 
                        case 20: s = "\"(\" expected"; break;
5947
 
                        case 21: s = "\")\" expected"; break;
5948
 
                        case 22: s = "\">\" expected"; break;
5949
 
                        case 23: s = "\"<\" expected"; break;
5950
 
                        case 24: s = "\"!\" expected"; break;
5951
 
                        case 25: s = "\"&&\" expected"; break;
5952
 
                        case 26: s = "\"||\" expected"; break;
5953
 
                        case 27: s = "\"~\" expected"; break;
5954
 
                        case 28: s = "\"&\" expected"; break;
5955
 
                        case 29: s = "\"|\" expected"; break;
5956
 
                        case 30: s = "\"^\" expected"; break;
5957
 
                        case 31: s = "\"++\" expected"; break;
5958
 
                        case 32: s = "\"--\" expected"; break;
5959
 
                        case 33: s = "\"==\" expected"; break;
5960
 
                        case 34: s = "\"!=\" expected"; break;
5961
 
                        case 35: s = "\">=\" expected"; break;
5962
 
                        case 36: s = "\"<=\" expected"; break;
5963
 
                        case 37: s = "\"<<\" expected"; break;
5964
 
                        case 38: s = "\"+=\" expected"; break;
5965
 
                        case 39: s = "\"-=\" expected"; break;
5966
 
                        case 40: s = "\"*=\" expected"; break;
5967
 
                        case 41: s = "\"/=\" expected"; break;
5968
 
                        case 42: s = "\"%=\" expected"; break;
5969
 
                        case 43: s = "\"&=\" expected"; break;
5970
 
                        case 44: s = "\"|=\" expected"; break;
5971
 
                        case 45: s = "\"^=\" expected"; break;
5972
 
                        case 46: s = "\"<<=\" expected"; break;
5973
 
                        case 47: s = "\"->\" expected"; break;
5974
 
                        case 48: s = "\"=>\" expected"; break;
5975
 
                        case 49: s = "\"abstract\" expected"; break;
5976
 
                        case 50: s = "\"as\" expected"; break;
5977
 
                        case 51: s = "\"base\" expected"; break;
5978
 
                        case 52: s = "\"bool\" expected"; break;
5979
 
                        case 53: s = "\"break\" expected"; break;
5980
 
                        case 54: s = "\"byte\" expected"; break;
5981
 
                        case 55: s = "\"case\" expected"; break;
5982
 
                        case 56: s = "\"catch\" expected"; break;
5983
 
                        case 57: s = "\"char\" expected"; break;
5984
 
                        case 58: s = "\"checked\" expected"; break;
5985
 
                        case 59: s = "\"class\" expected"; break;
5986
 
                        case 60: s = "\"const\" expected"; break;
5987
 
                        case 61: s = "\"continue\" expected"; break;
5988
 
                        case 62: s = "\"decimal\" expected"; break;
5989
 
                        case 63: s = "\"default\" expected"; break;
5990
 
                        case 64: s = "\"delegate\" expected"; break;
5991
 
                        case 65: s = "\"do\" expected"; break;
5992
 
                        case 66: s = "\"double\" expected"; break;
5993
 
                        case 67: s = "\"else\" expected"; break;
5994
 
                        case 68: s = "\"enum\" expected"; break;
5995
 
                        case 69: s = "\"event\" expected"; break;
5996
 
                        case 70: s = "\"explicit\" expected"; break;
5997
 
                        case 71: s = "\"extern\" expected"; break;
5998
 
                        case 72: s = "\"false\" expected"; break;
5999
 
                        case 73: s = "\"finally\" expected"; break;
6000
 
                        case 74: s = "\"fixed\" expected"; break;
6001
 
                        case 75: s = "\"float\" expected"; break;
6002
 
                        case 76: s = "\"for\" expected"; break;
6003
 
                        case 77: s = "\"foreach\" expected"; break;
6004
 
                        case 78: s = "\"goto\" expected"; break;
6005
 
                        case 79: s = "\"if\" expected"; break;
6006
 
                        case 80: s = "\"implicit\" expected"; break;
6007
 
                        case 81: s = "\"in\" expected"; break;
6008
 
                        case 82: s = "\"int\" expected"; break;
6009
 
                        case 83: s = "\"interface\" expected"; break;
6010
 
                        case 84: s = "\"internal\" expected"; break;
6011
 
                        case 85: s = "\"is\" expected"; break;
6012
 
                        case 86: s = "\"lock\" expected"; break;
6013
 
                        case 87: s = "\"long\" expected"; break;
6014
 
                        case 88: s = "\"namespace\" expected"; break;
6015
 
                        case 89: s = "\"new\" expected"; break;
6016
 
                        case 90: s = "\"null\" expected"; break;
6017
 
                        case 91: s = "\"object\" expected"; break;
6018
 
                        case 92: s = "\"operator\" expected"; break;
6019
 
                        case 93: s = "\"out\" expected"; break;
6020
 
                        case 94: s = "\"override\" expected"; break;
6021
 
                        case 95: s = "\"params\" expected"; break;
6022
 
                        case 96: s = "\"private\" expected"; break;
6023
 
                        case 97: s = "\"protected\" expected"; break;
6024
 
                        case 98: s = "\"public\" expected"; break;
6025
 
                        case 99: s = "\"readonly\" expected"; break;
6026
 
                        case 100: s = "\"ref\" expected"; break;
6027
 
                        case 101: s = "\"return\" expected"; break;
6028
 
                        case 102: s = "\"sbyte\" expected"; break;
6029
 
                        case 103: s = "\"sealed\" expected"; break;
6030
 
                        case 104: s = "\"short\" expected"; break;
6031
 
                        case 105: s = "\"sizeof\" expected"; break;
6032
 
                        case 106: s = "\"stackalloc\" expected"; break;
6033
 
                        case 107: s = "\"static\" expected"; break;
6034
 
                        case 108: s = "\"string\" expected"; break;
6035
 
                        case 109: s = "\"struct\" expected"; break;
6036
 
                        case 110: s = "\"switch\" expected"; break;
6037
 
                        case 111: s = "\"this\" expected"; break;
6038
 
                        case 112: s = "\"throw\" expected"; break;
6039
 
                        case 113: s = "\"true\" expected"; break;
6040
 
                        case 114: s = "\"try\" expected"; break;
6041
 
                        case 115: s = "\"typeof\" expected"; break;
6042
 
                        case 116: s = "\"uint\" expected"; break;
6043
 
                        case 117: s = "\"ulong\" expected"; break;
6044
 
                        case 118: s = "\"unchecked\" expected"; break;
6045
 
                        case 119: s = "\"unsafe\" expected"; break;
6046
 
                        case 120: s = "\"ushort\" expected"; break;
6047
 
                        case 121: s = "\"using\" expected"; break;
6048
 
                        case 122: s = "\"virtual\" expected"; break;
6049
 
                        case 123: s = "\"void\" expected"; break;
6050
 
                        case 124: s = "\"volatile\" expected"; break;
6051
 
                        case 125: s = "\"while\" expected"; break;
6052
 
                        case 126: s = "\"partial\" expected"; break;
6053
 
                        case 127: s = "\"where\" expected"; break;
6054
 
                        case 128: s = "\"get\" expected"; break;
6055
 
                        case 129: s = "\"set\" expected"; break;
6056
 
                        case 130: s = "\"add\" expected"; break;
6057
 
                        case 131: s = "\"remove\" expected"; break;
6058
 
                        case 132: s = "\"yield\" expected"; break;
6059
 
                        case 133: s = "\"select\" expected"; break;
6060
 
                        case 134: s = "\"group\" expected"; break;
6061
 
                        case 135: s = "\"by\" expected"; break;
6062
 
                        case 136: s = "\"into\" expected"; break;
6063
 
                        case 137: s = "\"from\" expected"; break;
6064
 
                        case 138: s = "\"ascending\" expected"; break;
6065
 
                        case 139: s = "\"descending\" expected"; break;
6066
 
                        case 140: s = "\"orderby\" expected"; break;
6067
 
                        case 141: s = "\"let\" expected"; break;
6068
 
                        case 142: s = "\"join\" expected"; break;
6069
 
                        case 143: s = "\"on\" expected"; break;
6070
 
                        case 144: s = "\"equals\" expected"; break;
6071
 
                        case 145: s = "??? expected"; break;
6072
 
                        case 146: s = "invalid NamespaceMemberDecl"; break;
6073
 
                        case 147: s = "invalid NonArrayType"; break;
6074
 
                        case 148: s = "invalid Identifier"; break;
6075
 
                        case 149: s = "invalid AttributeArguments"; break;
6076
 
                        case 150: s = "invalid Expr"; break;
6077
 
                        case 151: s = "invalid TypeModifier"; break;
6078
 
                        case 152: s = "invalid TypeDecl"; break;
6079
 
                        case 153: s = "invalid TypeDecl"; break;
6080
 
                        case 154: s = "this symbol not expected in ClassBody"; break;
6081
 
                        case 155: s = "this symbol not expected in InterfaceBody"; break;
6082
 
                        case 156: s = "invalid IntegralType"; break;
6083
 
                        case 157: s = "invalid FormalParameterList"; break;
6084
 
                        case 158: s = "invalid FormalParameterList"; break;
6085
 
                        case 159: s = "invalid ClassType"; break;
6086
 
                        case 160: s = "invalid ClassMemberDecl"; break;
6087
 
                        case 161: s = "invalid ClassMemberDecl"; break;
6088
 
                        case 162: s = "invalid StructMemberDecl"; break;
6089
 
                        case 163: s = "invalid StructMemberDecl"; break;
6090
 
                        case 164: s = "invalid StructMemberDecl"; break;
6091
 
                        case 165: s = "invalid StructMemberDecl"; break;
6092
 
                        case 166: s = "invalid StructMemberDecl"; break;
6093
 
                        case 167: s = "invalid StructMemberDecl"; break;
6094
 
                        case 168: s = "invalid StructMemberDecl"; break;
6095
 
                        case 169: s = "invalid StructMemberDecl"; break;
6096
 
                        case 170: s = "invalid StructMemberDecl"; break;
6097
 
                        case 171: s = "invalid StructMemberDecl"; break;
6098
 
                        case 172: s = "invalid StructMemberDecl"; break;
6099
 
                        case 173: s = "invalid StructMemberDecl"; break;
6100
 
                        case 174: s = "invalid StructMemberDecl"; break;
6101
 
                        case 175: s = "invalid InterfaceMemberDecl"; break;
6102
 
                        case 176: s = "invalid InterfaceMemberDecl"; break;
6103
 
                        case 177: s = "invalid InterfaceMemberDecl"; break;
6104
 
                        case 178: s = "invalid TypeWithRestriction"; break;
6105
 
                        case 179: s = "invalid TypeWithRestriction"; break;
6106
 
                        case 180: s = "invalid SimpleType"; break;
6107
 
                        case 181: s = "invalid AccessorModifiers"; break;
6108
 
                        case 182: s = "this symbol not expected in Block"; break;
6109
 
                        case 183: s = "invalid EventAccessorDecls"; break;
6110
 
                        case 184: s = "invalid ConstructorInitializer"; break;
6111
 
                        case 185: s = "invalid OverloadableOperator"; break;
6112
 
                        case 186: s = "invalid AccessorDecls"; break;
6113
 
                        case 187: s = "invalid InterfaceAccessors"; break;
6114
 
                        case 188: s = "invalid InterfaceAccessors"; break;
6115
 
                        case 189: s = "invalid GetAccessorDecl"; break;
6116
 
                        case 190: s = "invalid SetAccessorDecl"; break;
6117
 
                        case 191: s = "invalid VariableInitializer"; break;
6118
 
                        case 192: s = "this symbol not expected in Statement"; break;
6119
 
                        case 193: s = "invalid Statement"; break;
6120
 
                        case 194: s = "invalid AssignmentOperator"; break;
6121
 
                        case 195: s = "invalid ObjectPropertyInitializerOrVariableInitializer"; break;
6122
 
                        case 196: s = "invalid ObjectPropertyInitializerOrVariableInitializer"; break;
6123
 
                        case 197: s = "invalid EmbeddedStatement"; break;
6124
 
                        case 198: s = "invalid EmbeddedStatement"; break;
6125
 
                        case 199: s = "this symbol not expected in EmbeddedStatement"; break;
6126
 
                        case 200: s = "invalid EmbeddedStatement"; break;
6127
 
                        case 201: s = "invalid ForInitializer"; break;
6128
 
                        case 202: s = "invalid GotoStatement"; break;
6129
 
                        case 203: s = "invalid ResourceAcquisition"; break;
6130
 
                        case 204: s = "invalid SwitchLabel"; break;
6131
 
                        case 205: s = "invalid CatchClause"; break;
6132
 
                        case 206: s = "invalid UnaryExpr"; break;
6133
 
                        case 207: s = "invalid PrimaryExpr"; break;
6134
 
                        case 208: s = "invalid PrimaryExpr"; break;
6135
 
                        case 209: s = "invalid PrimaryExpr"; break;
6136
 
                        case 210: s = "invalid TypeArgumentList"; break;
6137
 
                        case 211: s = "invalid NewExpression"; break;
6138
 
                        case 212: s = "invalid NewExpression"; break;
6139
 
                        case 213: s = "invalid LambdaExpressionParameter"; break;
6140
 
                        case 214: s = "invalid LambdaExpressionBody"; break;
6141
 
                        case 215: s = "invalid RelationalExpr"; break;
6142
 
                        case 216: s = "invalid RelationalExpr"; break;
6143
 
                        case 217: s = "invalid TypeParameterConstraintsClauseBase"; break;
6144
 
                        case 218: s = "invalid QueryExpressionBody"; break;
6145
 
 
6146
 
                        default: s = "error " + errorNumber; break;
6147
 
                }
6148
 
                this.Errors.Error(line, col, s);
6149
 
        }
6150
 
        
6151
 
        private bool StartOf(int s)
6152
 
        {
6153
 
                return set[s, lexer.LookAhead.kind];
6154
 
        }
6155
 
        
6156
 
        static bool[,] set = {
6157
 
        {T,T,T,x, T,T,T,x, x,x,x,T, x,x,x,x, T,T,T,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,T, T,T,T,x, x,T,T,T, T,T,T,T, T,T,T,x, T,T,T,T, T,x,T,T, T,T,T,T, T,x,T,T, T,x,T,T, x,T,T,T, x,x,T,x, T,T,T,T, x,T,T,T, T,T,x,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6158
 
        {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,x, T,T,x,x, x,x,x,x, T,T,T,x, x,x,x,T, x,x,x,T, x,T,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
6159
 
        {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,x, x,T,x,x, x,x,x,x, T,T,T,x, x,x,x,T, x,x,x,T, x,T,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
6160
 
        {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,T,x,x, x,x,x,x, T,T,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
6161
 
        {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6162
 
        {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
6163
 
        {x,T,T,x, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,T,x, x,T,T,x, x,x,T,T, T,x,T,x, x,x,x,x, T,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,T,T, x,x,x,x, x,x,x,x, x,x,T,x, T,T,x,x, T,x,x,T, x,T,x,T, T,T,T,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6164
 
        {x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,T,T,T, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
6165
 
        {x,T,x,T, T,T,T,T, T,T,x,T, T,T,T,T, T,T,T,T, T,T,T,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, x,T,T,x, T,x,T,x, x,T,x,T, T,x,T,x, T,x,T,x, T,T,T,T, x,x,T,T, x,x,x,x, T,x,T,T, T,T,x,T, x,T,x,T, x,x,T,x, T,T,T,T, x,x,T,T, T,x,x,T, T,T,x,x, x,x,x,x, T,T,x,T, T,x,T,T, T,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6166
 
        {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
6167
 
        {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6168
 
        {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,T,x,T, x,x,x,x, T,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6169
 
        {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, T,x,T,x, x,T,x,T, T,x,T,x, T,x,T,x, T,T,T,T, x,x,T,T, x,x,x,x, T,x,T,T, T,x,x,T, x,T,x,T, x,x,T,x, T,T,T,T, x,x,T,T, T,x,x,T, T,T,x,x, x,x,x,x, T,T,x,T, T,x,T,T, T,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6170
 
        {T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, T,x,T,x, x,T,x,T, T,x,T,x, T,x,T,x, T,T,T,T, x,x,T,T, x,x,x,x, T,x,T,T, T,x,x,T, x,T,x,T, x,x,T,x, T,T,T,T, x,x,T,T, T,x,x,T, T,T,x,x, x,x,x,x, T,T,x,T, T,x,T,T, T,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6171
 
        {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, T,x,T,x, x,T,x,T, T,x,T,x, T,x,T,x, T,T,T,T, x,x,T,T, x,x,x,x, T,x,T,T, T,x,x,T, x,T,x,T, x,x,T,x, T,T,T,T, x,x,T,T, T,x,x,T, T,T,x,x, x,x,x,x, T,T,x,T, T,x,T,T, T,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6172
 
        {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,T,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6173
 
        {T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,T,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6174
 
        {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6175
 
        {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,T,x,x, x,x,x,x, T,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6176
 
        {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6177
 
        {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,T,x, x,x,x,x, x,x,x,x, T,x,x,x, x,T,x,x, x,x,T,x, T,T,T,T, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,T, x,x,T,x, T,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
6178
 
        {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,T, T,x,T,x, T,x,T,x, T,T,T,x, x,x,x,T, x,x,x,x, T,x,T,T, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,T,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6179
 
        {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
6180
 
        {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,T,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6181
 
        {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
6182
 
        {x,T,T,x, T,T,T,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,T,T,x, x,T,T,x, T,T,T,T, T,T,T,x, x,x,x,x, T,x,T,T, T,T,T,T, x,x,T,x, x,x,T,T, x,T,T,T, x,x,x,x, x,x,x,x, x,T,T,x, T,T,x,x, T,x,T,T, T,T,T,T, T,T,T,T, T,T,x,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6183
 
        {x,T,T,x, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,T,x, x,T,T,x, x,x,T,T, T,x,T,x, x,x,x,x, T,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,T,T, x,T,x,x, x,x,x,x, T,x,T,x, T,T,x,x, T,x,x,T, x,T,x,T, T,T,T,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6184
 
        {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
6185
 
        {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
6186
 
        {T,T,T,x, T,T,T,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,T,T,x, x,T,T,x, T,T,T,T, T,T,T,x, x,x,x,x, T,x,T,T, T,T,T,T, x,x,T,x, x,x,T,T, x,T,T,T, x,x,x,x, x,x,x,x, x,T,T,x, T,T,x,x, T,x,T,T, T,T,T,T, T,T,T,T, T,T,x,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6187
 
        {x,T,T,x, T,T,T,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,T,T,x, x,T,T,x, x,T,T,T, T,T,T,x, x,x,x,x, T,x,T,T, T,T,T,T, x,x,T,x, x,x,T,T, x,T,T,T, x,x,x,x, x,x,x,x, x,T,T,x, T,T,x,x, T,x,T,T, T,T,T,T, T,T,T,T, T,T,x,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6188
 
        {x,T,T,x, T,T,T,x, x,x,x,x, x,x,x,x, T,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,T,x, x,T,T,x, x,x,T,T, T,x,T,x, x,x,x,x, T,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,T,T, x,x,x,x, x,x,x,x, x,x,T,x, T,T,T,x, T,x,x,T, x,T,x,T, T,T,T,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6189
 
        {x,T,T,x, T,T,T,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,T,T,T, x,T,T,x, T,T,T,T, T,T,T,x, x,x,x,x, T,x,T,T, T,T,T,T, x,x,T,x, x,x,T,T, x,T,T,T, x,x,x,x, x,x,x,x, x,T,T,x, T,T,x,x, T,x,T,T, T,T,T,T, T,T,T,T, T,T,x,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6190
 
        {x,x,x,x, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
6191
 
        {x,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,T,x, x,T,T,x, x,x,T,T, T,x,T,x, x,x,x,x, T,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,T,T, x,x,x,x, x,x,x,x, x,x,T,x, T,T,x,x, T,x,x,T, x,T,x,T, T,T,T,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x},
6192
 
        {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
6193
 
        {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,T,x, T,x,x,x, x,x,x,x, x,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
6194
 
        {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
6195
 
        {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x},
6196
 
        {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,T,x,x, T,T,T,x, x,x,x}
6197
 
 
6198
 
        };
6199
 
} // end Parser
6200
 
 
6201
 
}
 
 
b'\\ No newline at end of file'