From 49379014d376f7c9fe4bd0b04fa6a3efcabe0528 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Wed, 7 Jul 2010 14:01:16 +0000 Subject: [PATCH 1/8] Fixed conversion of "If(If(a,b,c),d,e)" from VB to C#. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@6064 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../CSharp/CSharpOutputVisitor.cs | 6 +++++- .../CSharp/VBNetToCSharpConverterTest.cs | 8 ++++++++ .../Expressions/ConditionalExpressionTests.cs | 20 +++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs b/src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs index f288ba109c..90012d636c 100644 --- a/src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs +++ b/src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs @@ -2903,7 +2903,11 @@ namespace ICSharpCode.NRefactory.PrettyPrinter public override object TrackedVisitConditionalExpression(ConditionalExpression conditionalExpression, object data) { - TrackVisit(conditionalExpression.Condition, data); + if (conditionalExpression.Condition is ConditionalExpression) { + TrackedVisitParenthesizedExpression(new ParenthesizedExpression(conditionalExpression.Condition), data); + } else { + TrackVisit(conditionalExpression.Condition, data); + } if (this.prettyPrintOptions.ConditionalOperatorBeforeConditionSpace) { outputFormatter.Space(); } diff --git a/src/Libraries/NRefactory/Test/Output/CSharp/VBNetToCSharpConverterTest.cs b/src/Libraries/NRefactory/Test/Output/CSharp/VBNetToCSharpConverterTest.cs index 1687ea65d4..7afe163d6f 100644 --- a/src/Libraries/NRefactory/Test/Output/CSharp/VBNetToCSharpConverterTest.cs +++ b/src/Libraries/NRefactory/Test/Output/CSharp/VBNetToCSharpConverterTest.cs @@ -778,5 +778,13 @@ static bool InitStaticVariableHelper(Microsoft.VisualBasic.CompilerServices.Stat { TestStatement("Dim x As Integer = CInt(obj)", "int x = Convert.ToInt32(obj);"); } + + [Test] + public void ConditionalExprPrecedence() + { + TestStatement("Dim x As Integer = If(If(a,b,c),d,e)", "int x = (a ? b : c) ? d : e;"); + TestStatement("Dim x As Integer = If(a,If(b,c,d),e)", "int x = a ? b ? c : d : e;"); + TestStatement("Dim x As Integer = If(a,b,If(c,d,e))", "int x = a ? b : c ? d : e;"); + } } } diff --git a/src/Libraries/NRefactory/Test/Parser/Expressions/ConditionalExpressionTests.cs b/src/Libraries/NRefactory/Test/Parser/Expressions/ConditionalExpressionTests.cs index 4c323cb0f5..a3b1b0cf83 100644 --- a/src/Libraries/NRefactory/Test/Parser/Expressions/ConditionalExpressionTests.cs +++ b/src/Libraries/NRefactory/Test/Parser/Expressions/ConditionalExpressionTests.cs @@ -88,6 +88,26 @@ namespace ICSharpCode.NRefactory.Tests.Ast Assert.IsTrue(ce.TrueExpression is UnaryOperatorExpression); Assert.IsTrue(ce.FalseExpression is PrimitiveExpression); } + + [Test] + public void CSharpRepeatedConditionalExpr() + { + ConditionalExpression ce = ParseUtilCSharp.ParseExpression("a ? b : c ? d : e"); + + Assert.AreEqual("a", ((IdentifierExpression)ce.Condition).Identifier); + Assert.AreEqual("b", ((IdentifierExpression)ce.TrueExpression).Identifier); + Assert.IsTrue(ce.FalseExpression is ConditionalExpression); + } + + [Test] + public void CSharpNestedConditionalExpr() + { + ConditionalExpression ce = ParseUtilCSharp.ParseExpression("a ? b ? c : d : e"); + + Assert.AreEqual("a", ((IdentifierExpression)ce.Condition).Identifier); + Assert.AreEqual("e", ((IdentifierExpression)ce.FalseExpression).Identifier); + Assert.IsTrue(ce.TrueExpression is ConditionalExpression); + } #endregion #region VB.NET From 8b052cb414552285daceb87d83be576da80b5021 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 17 Jul 2010 23:02:47 +0000 Subject: [PATCH 2/8] Fix forum-11540: C# parser fails on "using global::System;" git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@6135 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Project/Src/Parser/CSharp/Parser.cs | 2459 +++++++++-------- .../Project/Src/Parser/CSharp/cs.ATG | 7 +- 2 files changed, 1240 insertions(+), 1226 deletions(-) diff --git a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs index 3c78839d1b..4e06d4460b 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs +++ b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs @@ -56,23 +56,23 @@ IsGlobalAttrTarget()) { void ExternAliasDirective() { -#line 345 "cs.ATG" +#line 348 "cs.ATG" ExternAliasDirective ead = new ExternAliasDirective { StartLocation = la.Location }; Expect(71); Identifier(); -#line 348 "cs.ATG" +#line 351 "cs.ATG" if (t.val != "alias") Error("Expected 'extern alias'."); Identifier(); -#line 349 "cs.ATG" +#line 352 "cs.ATG" ead.Name = t.val; Expect(11); -#line 350 "cs.ATG" +#line 353 "cs.ATG" ead.EndLocation = t.EndLocation; -#line 351 "cs.ATG" +#line 354 "cs.ATG" compilationUnit.AddChild(ead); } @@ -80,29 +80,40 @@ IsGlobalAttrTarget()) { #line 190 "cs.ATG" string qualident = null; TypeReference aliasedType = null; + string alias = null; Expect(121); -#line 193 "cs.ATG" +#line 194 "cs.ATG" Location startPos = t.Location; + if ( +#line 195 "cs.ATG" +IdentAndDoubleColon()) { + Identifier(); + +#line 195 "cs.ATG" + alias = t.val; + Expect(10); + } Qualident( -#line 194 "cs.ATG" +#line 196 "cs.ATG" out qualident); if (la.kind == 3) { lexer.NextToken(); NonArrayType( -#line 195 "cs.ATG" +#line 197 "cs.ATG" out aliasedType); } Expect(11); -#line 197 "cs.ATG" +#line 199 "cs.ATG" if (qualident != null && qualident.Length > 0) { + string name = (alias != null && alias != "global") ? alias + "." + qualident : qualident; INode node; if (aliasedType != null) { - node = new UsingDeclaration(qualident, aliasedType); + node = new UsingDeclaration(name, aliasedType); } else { - node = new UsingDeclaration(qualident); + node = new UsingDeclaration(name); } node.StartLocation = startPos; node.EndLocation = t.EndLocation; @@ -114,11 +125,11 @@ out aliasedType); void GlobalAttributeSection() { Expect(18); -#line 213 "cs.ATG" +#line 216 "cs.ATG" Location startPos = t.Location; Identifier(); -#line 214 "cs.ATG" +#line 217 "cs.ATG" if (t.val != "assembly" && t.val != "module") Error("global attribute target specifier (assembly or module) expected"); string attributeTarget = t.val; List attributes = new List(); @@ -126,20 +137,20 @@ out aliasedType); Expect(9); Attribute( -#line 219 "cs.ATG" +#line 222 "cs.ATG" out attribute); -#line 219 "cs.ATG" +#line 222 "cs.ATG" attributes.Add(attribute); while ( -#line 220 "cs.ATG" +#line 223 "cs.ATG" NotFinalComma()) { Expect(14); Attribute( -#line 220 "cs.ATG" +#line 223 "cs.ATG" out attribute); -#line 220 "cs.ATG" +#line 223 "cs.ATG" attributes.Add(attribute); } if (la.kind == 14) { @@ -147,7 +158,7 @@ out attribute); } Expect(19); -#line 222 "cs.ATG" +#line 225 "cs.ATG" AttributeSection section = new AttributeSection { AttributeTarget = attributeTarget, Attributes = attributes, @@ -160,7 +171,7 @@ out attribute); void NamespaceMemberDecl() { -#line 318 "cs.ATG" +#line 321 "cs.ATG" AttributeSection section; List attributes = new List(); ModifierList m = new ModifierList(); @@ -169,13 +180,13 @@ out attribute); if (la.kind == 88) { lexer.NextToken(); -#line 324 "cs.ATG" +#line 327 "cs.ATG" Location startPos = t.Location; Qualident( -#line 325 "cs.ATG" +#line 328 "cs.ATG" out qualident); -#line 325 "cs.ATG" +#line 328 "cs.ATG" INode node = new NamespaceDeclaration(qualident); node.StartLocation = startPos; compilationUnit.AddChild(node); @@ -196,104 +207,30 @@ out qualident); lexer.NextToken(); } -#line 335 "cs.ATG" +#line 338 "cs.ATG" node.EndLocation = t.EndLocation; compilationUnit.BlockEnd(); } else if (StartOf(2)) { while (la.kind == 18) { AttributeSection( -#line 339 "cs.ATG" +#line 342 "cs.ATG" out section); -#line 339 "cs.ATG" +#line 342 "cs.ATG" attributes.Add(section); } while (StartOf(3)) { TypeModifier( -#line 340 "cs.ATG" +#line 343 "cs.ATG" m); } TypeDecl( -#line 341 "cs.ATG" +#line 344 "cs.ATG" m, attributes); } else SynErr(146); } - void Qualident( -#line 475 "cs.ATG" -out string qualident) { - Identifier(); - -#line 477 "cs.ATG" - qualidentBuilder.Length = 0; qualidentBuilder.Append(t.val); - while ( -#line 478 "cs.ATG" -DotAndIdent()) { - Expect(15); - Identifier(); - -#line 478 "cs.ATG" - qualidentBuilder.Append('.'); - qualidentBuilder.Append(t.val); - - } - -#line 481 "cs.ATG" - qualident = qualidentBuilder.ToString(); - } - - void NonArrayType( -#line 593 "cs.ATG" -out TypeReference type) { - -#line 595 "cs.ATG" - Location startPos = la.Location; - string name; - int pointer = 0; - type = null; - - if (StartOf(4)) { - ClassType( -#line 601 "cs.ATG" -out type, false); - } else if (StartOf(5)) { - SimpleType( -#line 602 "cs.ATG" -out name); - -#line 602 "cs.ATG" - type = new TypeReference(name, true); - } else if (la.kind == 123) { - lexer.NextToken(); - Expect(6); - -#line 603 "cs.ATG" - pointer = 1; type = new TypeReference("System.Void", true); - } else SynErr(147); - if (la.kind == 12) { - NullableQuestionMark( -#line 606 "cs.ATG" -ref type); - } - while ( -#line 608 "cs.ATG" -IsPointer()) { - Expect(6); - -#line 609 "cs.ATG" - ++pointer; - } - -#line 611 "cs.ATG" - if (type != null) { - type.PointerNestingLevel = pointer; - type.EndLocation = t.EndLocation; - type.StartLocation = startPos; - } - - } - void Identifier() { switch (la.kind) { case 1: { @@ -376,46 +313,120 @@ IsPointer()) { lexer.NextToken(); break; } - default: SynErr(148); break; + default: SynErr(147); break; + } + } + + void Qualident( +#line 478 "cs.ATG" +out string qualident) { + Identifier(); + +#line 480 "cs.ATG" + qualidentBuilder.Length = 0; qualidentBuilder.Append(t.val); + while ( +#line 481 "cs.ATG" +DotAndIdent()) { + Expect(15); + Identifier(); + +#line 481 "cs.ATG" + qualidentBuilder.Append('.'); + qualidentBuilder.Append(t.val); + + } + +#line 484 "cs.ATG" + qualident = qualidentBuilder.ToString(); + } + + void NonArrayType( +#line 596 "cs.ATG" +out TypeReference type) { + +#line 598 "cs.ATG" + Location startPos = la.Location; + string name; + int pointer = 0; + type = null; + + if (StartOf(4)) { + ClassType( +#line 604 "cs.ATG" +out type, false); + } else if (StartOf(5)) { + SimpleType( +#line 605 "cs.ATG" +out name); + +#line 605 "cs.ATG" + type = new TypeReference(name, true); + } else if (la.kind == 123) { + lexer.NextToken(); + Expect(6); + +#line 606 "cs.ATG" + pointer = 1; type = new TypeReference("System.Void", true); + } else SynErr(148); + if (la.kind == 12) { + NullableQuestionMark( +#line 609 "cs.ATG" +ref type); } + while ( +#line 611 "cs.ATG" +IsPointer()) { + Expect(6); + +#line 612 "cs.ATG" + ++pointer; + } + +#line 614 "cs.ATG" + if (type != null) { + type.PointerNestingLevel = pointer; + type.EndLocation = t.EndLocation; + type.StartLocation = startPos; + } + } void Attribute( -#line 232 "cs.ATG" +#line 235 "cs.ATG" out ASTAttribute attribute) { -#line 233 "cs.ATG" +#line 236 "cs.ATG" string qualident; string alias = null; -#line 237 "cs.ATG" +#line 240 "cs.ATG" Location startPos = la.Location; if ( -#line 238 "cs.ATG" +#line 241 "cs.ATG" IdentAndDoubleColon()) { Identifier(); -#line 239 "cs.ATG" +#line 242 "cs.ATG" alias = t.val; Expect(10); } Qualident( -#line 242 "cs.ATG" +#line 245 "cs.ATG" out qualident); -#line 243 "cs.ATG" +#line 246 "cs.ATG" List positional = new List(); List named = new List(); string name = (alias != null && alias != "global") ? alias + "." + qualident : qualident; if (la.kind == 20) { AttributeArguments( -#line 247 "cs.ATG" +#line 250 "cs.ATG" positional, named); } -#line 248 "cs.ATG" +#line 251 "cs.ATG" attribute = new ASTAttribute(name, positional, named); attribute.StartLocation = startPos; attribute.EndLocation = t.EndLocation; @@ -423,10 +434,10 @@ positional, named); } void AttributeArguments( -#line 254 "cs.ATG" +#line 257 "cs.ATG" List positional, List named) { -#line 256 "cs.ATG" +#line 259 "cs.ATG" bool nameFound = false; string name = ""; Expression expr; @@ -434,22 +445,22 @@ List positional, List named) { Expect(20); if (StartOf(6)) { if ( -#line 264 "cs.ATG" +#line 267 "cs.ATG" IsAssignment()) { -#line 264 "cs.ATG" +#line 267 "cs.ATG" nameFound = true; Identifier(); -#line 265 "cs.ATG" +#line 268 "cs.ATG" name = t.val; Expect(3); } Expr( -#line 267 "cs.ATG" +#line 270 "cs.ATG" out expr); -#line 267 "cs.ATG" +#line 270 "cs.ATG" if (expr != null) {if(name == "") positional.Add(expr); else { named.Add(new NamedArgumentExpression(name, expr)); name = ""; } } @@ -457,26 +468,26 @@ out expr); while (la.kind == 14) { lexer.NextToken(); if ( -#line 275 "cs.ATG" +#line 278 "cs.ATG" IsAssignment()) { -#line 275 "cs.ATG" +#line 278 "cs.ATG" nameFound = true; Identifier(); -#line 276 "cs.ATG" +#line 279 "cs.ATG" name = t.val; Expect(3); } else if (StartOf(6)) { -#line 278 "cs.ATG" +#line 281 "cs.ATG" if (nameFound) Error("no positional argument after named argument"); } else SynErr(149); Expr( -#line 279 "cs.ATG" +#line 282 "cs.ATG" out expr); -#line 279 "cs.ATG" +#line 282 "cs.ATG" if (expr != null) { if(name == "") positional.Add(expr); else { named.Add(new NamedArgumentExpression(name, expr)); name = ""; } } @@ -487,68 +498,68 @@ out expr); } void Expr( -#line 1763 "cs.ATG" +#line 1766 "cs.ATG" out Expression expr) { -#line 1764 "cs.ATG" +#line 1767 "cs.ATG" expr = null; Expression expr1 = null, expr2 = null; AssignmentOperatorType op; -#line 1766 "cs.ATG" +#line 1769 "cs.ATG" Location startLocation = la.Location; UnaryExpr( -#line 1767 "cs.ATG" +#line 1770 "cs.ATG" out expr); if (StartOf(7)) { AssignmentOperator( -#line 1770 "cs.ATG" +#line 1773 "cs.ATG" out op); Expr( -#line 1770 "cs.ATG" +#line 1773 "cs.ATG" out expr1); -#line 1770 "cs.ATG" +#line 1773 "cs.ATG" expr = new AssignmentExpression(expr, op, expr1); } else if ( -#line 1771 "cs.ATG" +#line 1774 "cs.ATG" la.kind == Tokens.GreaterThan && Peek(1).kind == Tokens.GreaterEqual) { AssignmentOperator( -#line 1772 "cs.ATG" +#line 1775 "cs.ATG" out op); Expr( -#line 1772 "cs.ATG" +#line 1775 "cs.ATG" out expr1); -#line 1772 "cs.ATG" +#line 1775 "cs.ATG" expr = new AssignmentExpression(expr, op, expr1); } else if (StartOf(8)) { ConditionalOrExpr( -#line 1774 "cs.ATG" +#line 1777 "cs.ATG" ref expr); if (la.kind == 13) { lexer.NextToken(); Expr( -#line 1775 "cs.ATG" +#line 1778 "cs.ATG" out expr1); -#line 1775 "cs.ATG" +#line 1778 "cs.ATG" expr = new BinaryOperatorExpression(expr, BinaryOperatorType.NullCoalescing, expr1); } if (la.kind == 12) { lexer.NextToken(); Expr( -#line 1776 "cs.ATG" +#line 1779 "cs.ATG" out expr1); Expect(9); Expr( -#line 1776 "cs.ATG" +#line 1779 "cs.ATG" out expr2); -#line 1776 "cs.ATG" +#line 1779 "cs.ATG" expr = new ConditionalExpression(expr, expr1, expr2); } } else SynErr(150); -#line 1779 "cs.ATG" +#line 1782 "cs.ATG" if (expr != null) { if (expr.StartLocation.IsEmpty) expr.StartLocation = startLocation; @@ -559,10 +570,10 @@ out expr2); } void AttributeSection( -#line 288 "cs.ATG" +#line 291 "cs.ATG" out AttributeSection section) { -#line 290 "cs.ATG" +#line 293 "cs.ATG" string attributeTarget = ""; List attributes = new List(); ASTAttribute attribute; @@ -570,44 +581,44 @@ out AttributeSection section) { Expect(18); -#line 296 "cs.ATG" +#line 299 "cs.ATG" Location startPos = t.Location; if ( -#line 297 "cs.ATG" +#line 300 "cs.ATG" IsLocalAttrTarget()) { if (la.kind == 69) { lexer.NextToken(); -#line 298 "cs.ATG" +#line 301 "cs.ATG" attributeTarget = "event"; } else if (la.kind == 101) { lexer.NextToken(); -#line 299 "cs.ATG" +#line 302 "cs.ATG" attributeTarget = "return"; } else { Identifier(); -#line 300 "cs.ATG" +#line 303 "cs.ATG" attributeTarget = t.val; } Expect(9); } Attribute( -#line 304 "cs.ATG" +#line 307 "cs.ATG" out attribute); -#line 304 "cs.ATG" +#line 307 "cs.ATG" attributes.Add(attribute); while ( -#line 305 "cs.ATG" +#line 308 "cs.ATG" NotFinalComma()) { Expect(14); Attribute( -#line 305 "cs.ATG" +#line 308 "cs.ATG" out attribute); -#line 305 "cs.ATG" +#line 308 "cs.ATG" attributes.Add(attribute); } if (la.kind == 14) { @@ -615,7 +626,7 @@ out attribute); } Expect(19); -#line 307 "cs.ATG" +#line 310 "cs.ATG" section = new AttributeSection { AttributeTarget = attributeTarget, Attributes = attributes, @@ -626,76 +637,76 @@ out attribute); } void TypeModifier( -#line 686 "cs.ATG" +#line 689 "cs.ATG" ModifierList m) { switch (la.kind) { case 89: { lexer.NextToken(); -#line 688 "cs.ATG" +#line 691 "cs.ATG" m.Add(Modifiers.New, t.Location); break; } case 98: { lexer.NextToken(); -#line 689 "cs.ATG" +#line 692 "cs.ATG" m.Add(Modifiers.Public, t.Location); break; } case 97: { lexer.NextToken(); -#line 690 "cs.ATG" +#line 693 "cs.ATG" m.Add(Modifiers.Protected, t.Location); break; } case 84: { lexer.NextToken(); -#line 691 "cs.ATG" +#line 694 "cs.ATG" m.Add(Modifiers.Internal, t.Location); break; } case 96: { lexer.NextToken(); -#line 692 "cs.ATG" +#line 695 "cs.ATG" m.Add(Modifiers.Private, t.Location); break; } case 119: { lexer.NextToken(); -#line 693 "cs.ATG" +#line 696 "cs.ATG" m.Add(Modifiers.Unsafe, t.Location); break; } case 49: { lexer.NextToken(); -#line 694 "cs.ATG" +#line 697 "cs.ATG" m.Add(Modifiers.Abstract, t.Location); break; } case 103: { lexer.NextToken(); -#line 695 "cs.ATG" +#line 698 "cs.ATG" m.Add(Modifiers.Sealed, t.Location); break; } case 107: { lexer.NextToken(); -#line 696 "cs.ATG" +#line 699 "cs.ATG" m.Add(Modifiers.Static, t.Location); break; } case 126: { lexer.NextToken(); -#line 697 "cs.ATG" +#line 700 "cs.ATG" m.Add(Modifiers.Partial, t.Location); break; } @@ -704,10 +715,10 @@ ModifierList m) { } void TypeDecl( -#line 354 "cs.ATG" +#line 357 "cs.ATG" ModifierList m, List attributes) { -#line 356 "cs.ATG" +#line 359 "cs.ATG" TypeReference type; List names; List p = new List(); @@ -716,11 +727,11 @@ ModifierList m, List attributes) { if (la.kind == 59) { -#line 362 "cs.ATG" +#line 365 "cs.ATG" m.Check(Modifiers.Classes); lexer.NextToken(); -#line 363 "cs.ATG" +#line 366 "cs.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); templates = newType.Templates; compilationUnit.AddChild(newType); @@ -731,28 +742,28 @@ ModifierList m, List attributes) { Identifier(); -#line 371 "cs.ATG" +#line 374 "cs.ATG" newType.Name = t.val; if (la.kind == 23) { TypeParameterList( -#line 374 "cs.ATG" +#line 377 "cs.ATG" templates); } if (la.kind == 9) { ClassBase( -#line 376 "cs.ATG" +#line 379 "cs.ATG" out names); -#line 376 "cs.ATG" +#line 379 "cs.ATG" newType.BaseTypes = names; } while (la.kind == 127) { TypeParameterConstraintsClause( -#line 379 "cs.ATG" +#line 382 "cs.ATG" templates); } -#line 381 "cs.ATG" +#line 384 "cs.ATG" newType.BodyStartLocation = t.EndLocation; Expect(16); ClassBody(); @@ -761,18 +772,18 @@ templates); lexer.NextToken(); } -#line 385 "cs.ATG" +#line 388 "cs.ATG" newType.EndLocation = t.EndLocation; compilationUnit.BlockEnd(); } else if (StartOf(9)) { -#line 388 "cs.ATG" +#line 391 "cs.ATG" m.Check(Modifiers.StructsInterfacesEnumsDelegates); if (la.kind == 109) { lexer.NextToken(); -#line 389 "cs.ATG" +#line 392 "cs.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); templates = newType.Templates; newType.StartLocation = m.GetDeclarationLocation(t.Location); @@ -782,42 +793,42 @@ templates); Identifier(); -#line 396 "cs.ATG" +#line 399 "cs.ATG" newType.Name = t.val; if (la.kind == 23) { TypeParameterList( -#line 399 "cs.ATG" +#line 402 "cs.ATG" templates); } if (la.kind == 9) { StructInterfaces( -#line 401 "cs.ATG" +#line 404 "cs.ATG" out names); -#line 401 "cs.ATG" +#line 404 "cs.ATG" newType.BaseTypes = names; } while (la.kind == 127) { TypeParameterConstraintsClause( -#line 404 "cs.ATG" +#line 407 "cs.ATG" templates); } -#line 407 "cs.ATG" +#line 410 "cs.ATG" newType.BodyStartLocation = t.EndLocation; StructBody(); if (la.kind == 11) { lexer.NextToken(); } -#line 409 "cs.ATG" +#line 412 "cs.ATG" newType.EndLocation = t.EndLocation; compilationUnit.BlockEnd(); } else if (la.kind == 83) { lexer.NextToken(); -#line 413 "cs.ATG" +#line 416 "cs.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); templates = newType.Templates; compilationUnit.AddChild(newType); @@ -827,42 +838,42 @@ templates); Identifier(); -#line 420 "cs.ATG" +#line 423 "cs.ATG" newType.Name = t.val; if (la.kind == 23) { TypeParameterList( -#line 423 "cs.ATG" +#line 426 "cs.ATG" templates); } if (la.kind == 9) { InterfaceBase( -#line 425 "cs.ATG" +#line 428 "cs.ATG" out names); -#line 425 "cs.ATG" +#line 428 "cs.ATG" newType.BaseTypes = names; } while (la.kind == 127) { TypeParameterConstraintsClause( -#line 428 "cs.ATG" +#line 431 "cs.ATG" templates); } -#line 430 "cs.ATG" +#line 433 "cs.ATG" newType.BodyStartLocation = t.EndLocation; InterfaceBody(); if (la.kind == 11) { lexer.NextToken(); } -#line 432 "cs.ATG" +#line 435 "cs.ATG" newType.EndLocation = t.EndLocation; compilationUnit.BlockEnd(); } else if (la.kind == 68) { lexer.NextToken(); -#line 436 "cs.ATG" +#line 439 "cs.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); @@ -871,79 +882,79 @@ templates); Identifier(); -#line 442 "cs.ATG" +#line 445 "cs.ATG" newType.Name = t.val; if (la.kind == 9) { lexer.NextToken(); IntegralType( -#line 443 "cs.ATG" +#line 446 "cs.ATG" out name); -#line 443 "cs.ATG" +#line 446 "cs.ATG" newType.BaseTypes.Add(new TypeReference(name, true)); } -#line 445 "cs.ATG" +#line 448 "cs.ATG" newType.BodyStartLocation = t.EndLocation; EnumBody(); if (la.kind == 11) { lexer.NextToken(); } -#line 447 "cs.ATG" +#line 450 "cs.ATG" newType.EndLocation = t.EndLocation; compilationUnit.BlockEnd(); } else { lexer.NextToken(); -#line 451 "cs.ATG" +#line 454 "cs.ATG" DelegateDeclaration delegateDeclr = new DelegateDeclaration(m.Modifier, attributes); templates = delegateDeclr.Templates; delegateDeclr.StartLocation = m.GetDeclarationLocation(t.Location); if ( -#line 455 "cs.ATG" +#line 458 "cs.ATG" NotVoidPointer()) { Expect(123); -#line 455 "cs.ATG" +#line 458 "cs.ATG" delegateDeclr.ReturnType = new TypeReference("System.Void", true); } else if (StartOf(10)) { Type( -#line 456 "cs.ATG" +#line 459 "cs.ATG" out type); -#line 456 "cs.ATG" +#line 459 "cs.ATG" delegateDeclr.ReturnType = type; } else SynErr(152); Identifier(); -#line 458 "cs.ATG" +#line 461 "cs.ATG" delegateDeclr.Name = t.val; if (la.kind == 23) { TypeParameterList( -#line 461 "cs.ATG" +#line 464 "cs.ATG" templates); } Expect(20); if (StartOf(11)) { FormalParameterList( -#line 463 "cs.ATG" +#line 466 "cs.ATG" p); -#line 463 "cs.ATG" +#line 466 "cs.ATG" delegateDeclr.Parameters = p; } Expect(21); while (la.kind == 127) { TypeParameterConstraintsClause( -#line 467 "cs.ATG" +#line 470 "cs.ATG" templates); } Expect(11); -#line 469 "cs.ATG" +#line 472 "cs.ATG" delegateDeclr.EndLocation = t.EndLocation; compilationUnit.AddChild(delegateDeclr); @@ -952,87 +963,87 @@ templates); } void TypeParameterList( -#line 2344 "cs.ATG" +#line 2347 "cs.ATG" List templates) { -#line 2346 "cs.ATG" +#line 2349 "cs.ATG" AttributeSection section; List attributes = new List(); Expect(23); while (la.kind == 18) { AttributeSection( -#line 2350 "cs.ATG" +#line 2353 "cs.ATG" out section); -#line 2350 "cs.ATG" +#line 2353 "cs.ATG" attributes.Add(section); } Identifier(); -#line 2351 "cs.ATG" +#line 2354 "cs.ATG" templates.Add(new TemplateDefinition(t.val, attributes)); while (la.kind == 14) { lexer.NextToken(); while (la.kind == 18) { AttributeSection( -#line 2352 "cs.ATG" +#line 2355 "cs.ATG" out section); -#line 2352 "cs.ATG" +#line 2355 "cs.ATG" attributes.Add(section); } Identifier(); -#line 2353 "cs.ATG" +#line 2356 "cs.ATG" templates.Add(new TemplateDefinition(t.val, attributes)); } Expect(22); } void ClassBase( -#line 484 "cs.ATG" +#line 487 "cs.ATG" out List names) { -#line 486 "cs.ATG" +#line 489 "cs.ATG" TypeReference typeRef; names = new List(); Expect(9); ClassType( -#line 490 "cs.ATG" +#line 493 "cs.ATG" out typeRef, false); -#line 490 "cs.ATG" +#line 493 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } while (la.kind == 14) { lexer.NextToken(); TypeName( -#line 491 "cs.ATG" +#line 494 "cs.ATG" out typeRef, false); -#line 491 "cs.ATG" +#line 494 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } } } void TypeParameterConstraintsClause( -#line 2357 "cs.ATG" +#line 2360 "cs.ATG" List templates) { -#line 2358 "cs.ATG" +#line 2361 "cs.ATG" string name = ""; TypeReference type; Expect(127); Identifier(); -#line 2361 "cs.ATG" +#line 2364 "cs.ATG" name = t.val; Expect(9); TypeParameterConstraintsClauseBase( -#line 2363 "cs.ATG" +#line 2366 "cs.ATG" out type); -#line 2364 "cs.ATG" +#line 2367 "cs.ATG" TemplateDefinition td = null; foreach (TemplateDefinition d in templates) { if (d.Name == name) { @@ -1045,10 +1056,10 @@ out type); while (la.kind == 14) { lexer.NextToken(); TypeParameterConstraintsClauseBase( -#line 2373 "cs.ATG" +#line 2376 "cs.ATG" out type); -#line 2374 "cs.ATG" +#line 2377 "cs.ATG" td = null; foreach (TemplateDefinition d in templates) { if (d.Name == name) { @@ -1063,109 +1074,109 @@ out type); void ClassBody() { -#line 495 "cs.ATG" +#line 498 "cs.ATG" AttributeSection section; while (StartOf(12)) { -#line 497 "cs.ATG" +#line 500 "cs.ATG" List attributes = new List(); ModifierList m = new ModifierList(); while (!(StartOf(13))) {SynErr(154); lexer.NextToken(); } while (la.kind == 18) { AttributeSection( -#line 501 "cs.ATG" +#line 504 "cs.ATG" out section); -#line 501 "cs.ATG" +#line 504 "cs.ATG" attributes.Add(section); } MemberModifiers( -#line 502 "cs.ATG" +#line 505 "cs.ATG" m); ClassMemberDecl( -#line 503 "cs.ATG" +#line 506 "cs.ATG" m, attributes); } } void StructInterfaces( -#line 507 "cs.ATG" +#line 510 "cs.ATG" out List names) { -#line 509 "cs.ATG" +#line 512 "cs.ATG" TypeReference typeRef; names = new List(); Expect(9); TypeName( -#line 513 "cs.ATG" +#line 516 "cs.ATG" out typeRef, false); -#line 513 "cs.ATG" +#line 516 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } while (la.kind == 14) { lexer.NextToken(); TypeName( -#line 514 "cs.ATG" +#line 517 "cs.ATG" out typeRef, false); -#line 514 "cs.ATG" +#line 517 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } } } void StructBody() { -#line 518 "cs.ATG" +#line 521 "cs.ATG" AttributeSection section; Expect(16); while (StartOf(14)) { -#line 521 "cs.ATG" +#line 524 "cs.ATG" List attributes = new List(); ModifierList m = new ModifierList(); while (la.kind == 18) { AttributeSection( -#line 524 "cs.ATG" +#line 527 "cs.ATG" out section); -#line 524 "cs.ATG" +#line 527 "cs.ATG" attributes.Add(section); } MemberModifiers( -#line 525 "cs.ATG" +#line 528 "cs.ATG" m); StructMemberDecl( -#line 526 "cs.ATG" +#line 529 "cs.ATG" m, attributes); } Expect(17); } void InterfaceBase( -#line 531 "cs.ATG" +#line 534 "cs.ATG" out List names) { -#line 533 "cs.ATG" +#line 536 "cs.ATG" TypeReference typeRef; names = new List(); Expect(9); TypeName( -#line 537 "cs.ATG" +#line 540 "cs.ATG" out typeRef, false); -#line 537 "cs.ATG" +#line 540 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } while (la.kind == 14) { lexer.NextToken(); TypeName( -#line 538 "cs.ATG" +#line 541 "cs.ATG" out typeRef, false); -#line 538 "cs.ATG" +#line 541 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } } } @@ -1180,72 +1191,72 @@ out typeRef, false); } void IntegralType( -#line 708 "cs.ATG" +#line 711 "cs.ATG" out string name) { -#line 708 "cs.ATG" +#line 711 "cs.ATG" name = ""; switch (la.kind) { case 102: { lexer.NextToken(); -#line 710 "cs.ATG" +#line 713 "cs.ATG" name = "System.SByte"; break; } case 54: { lexer.NextToken(); -#line 711 "cs.ATG" +#line 714 "cs.ATG" name = "System.Byte"; break; } case 104: { lexer.NextToken(); -#line 712 "cs.ATG" +#line 715 "cs.ATG" name = "System.Int16"; break; } case 120: { lexer.NextToken(); -#line 713 "cs.ATG" +#line 716 "cs.ATG" name = "System.UInt16"; break; } case 82: { lexer.NextToken(); -#line 714 "cs.ATG" +#line 717 "cs.ATG" name = "System.Int32"; break; } case 116: { lexer.NextToken(); -#line 715 "cs.ATG" +#line 718 "cs.ATG" name = "System.UInt32"; break; } case 87: { lexer.NextToken(); -#line 716 "cs.ATG" +#line 719 "cs.ATG" name = "System.Int64"; break; } case 117: { lexer.NextToken(); -#line 717 "cs.ATG" +#line 720 "cs.ATG" name = "System.UInt64"; break; } case 57: { lexer.NextToken(); -#line 718 "cs.ATG" +#line 721 "cs.ATG" name = "System.Char"; break; } @@ -1255,25 +1266,25 @@ out string name) { void EnumBody() { -#line 547 "cs.ATG" +#line 550 "cs.ATG" FieldDeclaration f; Expect(16); if (StartOf(17)) { EnumMemberDecl( -#line 550 "cs.ATG" +#line 553 "cs.ATG" out f); -#line 550 "cs.ATG" +#line 553 "cs.ATG" compilationUnit.AddChild(f); while ( -#line 551 "cs.ATG" +#line 554 "cs.ATG" NotFinalComma()) { Expect(14); EnumMemberDecl( -#line 552 "cs.ATG" +#line 555 "cs.ATG" out f); -#line 552 "cs.ATG" +#line 555 "cs.ATG" compilationUnit.AddChild(f); } if (la.kind == 14) { @@ -1284,36 +1295,36 @@ out f); } void Type( -#line 558 "cs.ATG" +#line 561 "cs.ATG" out TypeReference type) { TypeWithRestriction( -#line 560 "cs.ATG" +#line 563 "cs.ATG" out type, true, false); } void FormalParameterList( -#line 630 "cs.ATG" +#line 633 "cs.ATG" List parameter) { -#line 633 "cs.ATG" +#line 636 "cs.ATG" ParameterDeclarationExpression p; AttributeSection section; List attributes = new List(); while (la.kind == 18) { AttributeSection( -#line 638 "cs.ATG" +#line 641 "cs.ATG" out section); -#line 638 "cs.ATG" +#line 641 "cs.ATG" attributes.Add(section); } if (StartOf(18)) { FixedParameter( -#line 640 "cs.ATG" +#line 643 "cs.ATG" out p); -#line 640 "cs.ATG" +#line 643 "cs.ATG" bool paramsFound = false; p.Attributes = attributes; parameter.Add(p); @@ -1321,97 +1332,97 @@ out p); while (la.kind == 14) { lexer.NextToken(); -#line 645 "cs.ATG" +#line 648 "cs.ATG" attributes = new List(); if (paramsFound) Error("params array must be at end of parameter list"); while (la.kind == 18) { AttributeSection( -#line 646 "cs.ATG" +#line 649 "cs.ATG" out section); -#line 646 "cs.ATG" +#line 649 "cs.ATG" attributes.Add(section); } if (StartOf(18)) { FixedParameter( -#line 648 "cs.ATG" +#line 651 "cs.ATG" out p); -#line 648 "cs.ATG" +#line 651 "cs.ATG" p.Attributes = attributes; parameter.Add(p); } else if (la.kind == 95) { ParameterArray( -#line 649 "cs.ATG" +#line 652 "cs.ATG" out p); -#line 649 "cs.ATG" +#line 652 "cs.ATG" paramsFound = true; p.Attributes = attributes; parameter.Add(p); } else SynErr(157); } } else if (la.kind == 95) { ParameterArray( -#line 652 "cs.ATG" +#line 655 "cs.ATG" out p); -#line 652 "cs.ATG" +#line 655 "cs.ATG" p.Attributes = attributes; parameter.Add(p); } else SynErr(158); } void ClassType( -#line 700 "cs.ATG" +#line 703 "cs.ATG" out TypeReference typeRef, bool canBeUnbound) { -#line 701 "cs.ATG" +#line 704 "cs.ATG" TypeReference r; typeRef = null; if (StartOf(19)) { TypeName( -#line 703 "cs.ATG" +#line 706 "cs.ATG" out r, canBeUnbound); -#line 703 "cs.ATG" +#line 706 "cs.ATG" typeRef = r; } else if (la.kind == 91) { lexer.NextToken(); -#line 704 "cs.ATG" +#line 707 "cs.ATG" typeRef = new TypeReference("System.Object", true); typeRef.StartLocation = t.Location; } else if (la.kind == 108) { lexer.NextToken(); -#line 705 "cs.ATG" +#line 708 "cs.ATG" typeRef = new TypeReference("System.String", true); typeRef.StartLocation = t.Location; } else SynErr(159); } void TypeName( -#line 2285 "cs.ATG" +#line 2288 "cs.ATG" out TypeReference typeRef, bool canBeUnbound) { -#line 2286 "cs.ATG" +#line 2289 "cs.ATG" List typeArguments = null; string alias = null; string qualident; Location startLocation = la.Location; if ( -#line 2292 "cs.ATG" +#line 2295 "cs.ATG" IdentAndDoubleColon()) { Identifier(); -#line 2293 "cs.ATG" +#line 2296 "cs.ATG" alias = t.val; Expect(10); } Qualident( -#line 2296 "cs.ATG" +#line 2299 "cs.ATG" out qualident); if (la.kind == 23) { TypeArgumentList( -#line 2297 "cs.ATG" +#line 2300 "cs.ATG" out typeArguments, canBeUnbound); } -#line 2299 "cs.ATG" +#line 2302 "cs.ATG" if (alias == null) { typeRef = new TypeReference(qualident, typeArguments); } else if (alias == "global") { @@ -1422,143 +1433,143 @@ out typeArguments, canBeUnbound); } while ( -#line 2308 "cs.ATG" +#line 2311 "cs.ATG" DotAndIdent()) { Expect(15); -#line 2309 "cs.ATG" +#line 2312 "cs.ATG" typeArguments = null; Qualident( -#line 2310 "cs.ATG" +#line 2313 "cs.ATG" out qualident); if (la.kind == 23) { TypeArgumentList( -#line 2311 "cs.ATG" +#line 2314 "cs.ATG" out typeArguments, canBeUnbound); } -#line 2312 "cs.ATG" +#line 2315 "cs.ATG" typeRef = new InnerClassTypeReference(typeRef, qualident, typeArguments); } -#line 2314 "cs.ATG" +#line 2317 "cs.ATG" typeRef.StartLocation = startLocation; } void MemberModifiers( -#line 721 "cs.ATG" +#line 724 "cs.ATG" ModifierList m) { while (StartOf(20)) { switch (la.kind) { case 49: { lexer.NextToken(); -#line 724 "cs.ATG" +#line 727 "cs.ATG" m.Add(Modifiers.Abstract, t.Location); break; } case 71: { lexer.NextToken(); -#line 725 "cs.ATG" +#line 728 "cs.ATG" m.Add(Modifiers.Extern, t.Location); break; } case 84: { lexer.NextToken(); -#line 726 "cs.ATG" +#line 729 "cs.ATG" m.Add(Modifiers.Internal, t.Location); break; } case 89: { lexer.NextToken(); -#line 727 "cs.ATG" +#line 730 "cs.ATG" m.Add(Modifiers.New, t.Location); break; } case 94: { lexer.NextToken(); -#line 728 "cs.ATG" +#line 731 "cs.ATG" m.Add(Modifiers.Override, t.Location); break; } case 96: { lexer.NextToken(); -#line 729 "cs.ATG" +#line 732 "cs.ATG" m.Add(Modifiers.Private, t.Location); break; } case 97: { lexer.NextToken(); -#line 730 "cs.ATG" +#line 733 "cs.ATG" m.Add(Modifiers.Protected, t.Location); break; } case 98: { lexer.NextToken(); -#line 731 "cs.ATG" +#line 734 "cs.ATG" m.Add(Modifiers.Public, t.Location); break; } case 99: { lexer.NextToken(); -#line 732 "cs.ATG" +#line 735 "cs.ATG" m.Add(Modifiers.ReadOnly, t.Location); break; } case 103: { lexer.NextToken(); -#line 733 "cs.ATG" +#line 736 "cs.ATG" m.Add(Modifiers.Sealed, t.Location); break; } case 107: { lexer.NextToken(); -#line 734 "cs.ATG" +#line 737 "cs.ATG" m.Add(Modifiers.Static, t.Location); break; } case 74: { lexer.NextToken(); -#line 735 "cs.ATG" +#line 738 "cs.ATG" m.Add(Modifiers.Fixed, t.Location); break; } case 119: { lexer.NextToken(); -#line 736 "cs.ATG" +#line 739 "cs.ATG" m.Add(Modifiers.Unsafe, t.Location); break; } case 122: { lexer.NextToken(); -#line 737 "cs.ATG" +#line 740 "cs.ATG" m.Add(Modifiers.Virtual, t.Location); break; } case 124: { lexer.NextToken(); -#line 738 "cs.ATG" +#line 741 "cs.ATG" m.Add(Modifiers.Volatile, t.Location); break; } case 126: { lexer.NextToken(); -#line 739 "cs.ATG" +#line 742 "cs.ATG" m.Add(Modifiers.Partial, t.Location); break; } @@ -1567,23 +1578,23 @@ ModifierList m) { } void ClassMemberDecl( -#line 1055 "cs.ATG" +#line 1058 "cs.ATG" ModifierList m, List attributes) { -#line 1056 "cs.ATG" +#line 1059 "cs.ATG" Statement stmt = null; if (StartOf(21)) { StructMemberDecl( -#line 1058 "cs.ATG" +#line 1061 "cs.ATG" m, attributes); } else if (la.kind == 27) { -#line 1059 "cs.ATG" +#line 1062 "cs.ATG" m.Check(Modifiers.Destructors); Location startPos = la.Location; lexer.NextToken(); Identifier(); -#line 1060 "cs.ATG" +#line 1063 "cs.ATG" DestructorDeclaration d = new DestructorDeclaration(t.val, m.Modifier, attributes); d.Modifier = m.Modifier; d.StartLocation = m.GetDeclarationLocation(startPos); @@ -1591,17 +1602,17 @@ m, attributes); Expect(20); Expect(21); -#line 1064 "cs.ATG" +#line 1067 "cs.ATG" d.EndLocation = t.EndLocation; if (la.kind == 16) { Block( -#line 1064 "cs.ATG" +#line 1067 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); } else SynErr(160); -#line 1065 "cs.ATG" +#line 1068 "cs.ATG" d.Body = (BlockStatement)stmt; compilationUnit.AddChild(d); @@ -1609,10 +1620,10 @@ out stmt); } void StructMemberDecl( -#line 743 "cs.ATG" +#line 746 "cs.ATG" ModifierList m, List attributes) { -#line 745 "cs.ATG" +#line 748 "cs.ATG" string qualident = null; TypeReference type; Expression expr; @@ -1624,18 +1635,18 @@ ModifierList m, List attributes) { if (la.kind == 60) { -#line 755 "cs.ATG" +#line 758 "cs.ATG" m.Check(Modifiers.Constants); lexer.NextToken(); -#line 756 "cs.ATG" +#line 759 "cs.ATG" Location startPos = t.Location; Type( -#line 757 "cs.ATG" +#line 760 "cs.ATG" out type); Identifier(); -#line 757 "cs.ATG" +#line 760 "cs.ATG" FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier | Modifiers.Const); fd.StartLocation = m.GetDeclarationLocation(startPos); VariableDeclaration f = new VariableDeclaration(t.val); @@ -1645,16 +1656,16 @@ out type); Expect(3); Expr( -#line 764 "cs.ATG" +#line 767 "cs.ATG" out expr); -#line 764 "cs.ATG" +#line 767 "cs.ATG" f.Initializer = expr; while (la.kind == 14) { lexer.NextToken(); Identifier(); -#line 765 "cs.ATG" +#line 768 "cs.ATG" f = new VariableDeclaration(t.val); f.StartLocation = t.Location; f.TypeReference = type; @@ -1662,63 +1673,63 @@ out expr); Expect(3); Expr( -#line 770 "cs.ATG" +#line 773 "cs.ATG" out expr); -#line 770 "cs.ATG" +#line 773 "cs.ATG" f.EndLocation = t.EndLocation; f.Initializer = expr; } Expect(11); -#line 771 "cs.ATG" +#line 774 "cs.ATG" fd.EndLocation = t.EndLocation; compilationUnit.AddChild(fd); } else if ( -#line 775 "cs.ATG" +#line 778 "cs.ATG" NotVoidPointer()) { -#line 775 "cs.ATG" +#line 778 "cs.ATG" m.Check(Modifiers.PropertysEventsMethods); Expect(123); -#line 776 "cs.ATG" +#line 779 "cs.ATG" Location startPos = t.Location; if ( -#line 777 "cs.ATG" +#line 780 "cs.ATG" IsExplicitInterfaceImplementation()) { TypeName( -#line 778 "cs.ATG" +#line 781 "cs.ATG" out explicitInterface, false); -#line 779 "cs.ATG" +#line 782 "cs.ATG" if (la.kind != Tokens.Dot || Peek(1).kind != Tokens.This) { qualident = TypeReference.StripLastIdentifierFromType(ref explicitInterface); } } else if (StartOf(19)) { Identifier(); -#line 782 "cs.ATG" +#line 785 "cs.ATG" qualident = t.val; } else SynErr(162); if (la.kind == 23) { TypeParameterList( -#line 785 "cs.ATG" +#line 788 "cs.ATG" templates); } Expect(20); if (la.kind == 111) { lexer.NextToken(); -#line 788 "cs.ATG" +#line 791 "cs.ATG" isExtensionMethod = true; /* C# 3.0 */ } if (StartOf(11)) { FormalParameterList( -#line 789 "cs.ATG" +#line 792 "cs.ATG" p); } Expect(21); -#line 790 "cs.ATG" +#line 793 "cs.ATG" MethodDeclaration methodDeclaration = new MethodDeclaration { Name = qualident, Modifier = m.Modifier, @@ -1737,28 +1748,28 @@ p); while (la.kind == 127) { TypeParameterConstraintsClause( -#line 808 "cs.ATG" +#line 811 "cs.ATG" templates); } if (la.kind == 16) { Block( -#line 810 "cs.ATG" +#line 813 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); } else SynErr(163); -#line 810 "cs.ATG" +#line 813 "cs.ATG" compilationUnit.BlockEnd(); methodDeclaration.Body = (BlockStatement)stmt; } else if (la.kind == 69) { -#line 814 "cs.ATG" +#line 817 "cs.ATG" m.Check(Modifiers.PropertysEventsMethods); lexer.NextToken(); -#line 816 "cs.ATG" +#line 819 "cs.ATG" EventDeclaration eventDecl = new EventDeclaration { Modifier = m.Modifier, Attributes = attributes, @@ -1770,113 +1781,113 @@ out stmt); EventRemoveRegion removeBlock = null; Type( -#line 826 "cs.ATG" +#line 829 "cs.ATG" out type); -#line 826 "cs.ATG" +#line 829 "cs.ATG" eventDecl.TypeReference = type; if ( -#line 827 "cs.ATG" +#line 830 "cs.ATG" IsExplicitInterfaceImplementation()) { TypeName( -#line 828 "cs.ATG" +#line 831 "cs.ATG" out explicitInterface, false); -#line 829 "cs.ATG" +#line 832 "cs.ATG" qualident = TypeReference.StripLastIdentifierFromType(ref explicitInterface); -#line 830 "cs.ATG" +#line 833 "cs.ATG" eventDecl.InterfaceImplementations.Add(new InterfaceImplementation(explicitInterface, qualident)); } else if (StartOf(19)) { Identifier(); -#line 832 "cs.ATG" +#line 835 "cs.ATG" qualident = t.val; } else SynErr(164); -#line 834 "cs.ATG" +#line 837 "cs.ATG" eventDecl.Name = qualident; eventDecl.EndLocation = t.EndLocation; if (la.kind == 3) { lexer.NextToken(); Expr( -#line 835 "cs.ATG" +#line 838 "cs.ATG" out expr); -#line 835 "cs.ATG" +#line 838 "cs.ATG" eventDecl.Initializer = expr; } if (la.kind == 16) { lexer.NextToken(); -#line 836 "cs.ATG" +#line 839 "cs.ATG" eventDecl.BodyStart = t.Location; EventAccessorDecls( -#line 837 "cs.ATG" +#line 840 "cs.ATG" out addBlock, out removeBlock); Expect(17); -#line 838 "cs.ATG" +#line 841 "cs.ATG" eventDecl.BodyEnd = t.EndLocation; } if (la.kind == 11) { lexer.NextToken(); } -#line 841 "cs.ATG" +#line 844 "cs.ATG" compilationUnit.BlockEnd(); eventDecl.AddRegion = addBlock; eventDecl.RemoveRegion = removeBlock; } else if ( -#line 847 "cs.ATG" +#line 850 "cs.ATG" IdentAndLPar()) { -#line 847 "cs.ATG" +#line 850 "cs.ATG" m.Check(Modifiers.Constructors | Modifiers.StaticConstructors); Identifier(); -#line 848 "cs.ATG" +#line 851 "cs.ATG" string name = t.val; Location startPos = t.Location; Expect(20); if (StartOf(11)) { -#line 848 "cs.ATG" +#line 851 "cs.ATG" m.Check(Modifiers.Constructors); FormalParameterList( -#line 849 "cs.ATG" +#line 852 "cs.ATG" p); } Expect(21); -#line 851 "cs.ATG" +#line 854 "cs.ATG" ConstructorInitializer init = null; if (la.kind == 9) { -#line 852 "cs.ATG" +#line 855 "cs.ATG" m.Check(Modifiers.Constructors); ConstructorInitializer( -#line 853 "cs.ATG" +#line 856 "cs.ATG" out init); } -#line 855 "cs.ATG" +#line 858 "cs.ATG" ConstructorDeclaration cd = new ConstructorDeclaration(name, m.Modifier, p, init, attributes); cd.StartLocation = startPos; cd.EndLocation = t.EndLocation; if (la.kind == 16) { Block( -#line 860 "cs.ATG" +#line 863 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); } else SynErr(165); -#line 860 "cs.ATG" +#line 863 "cs.ATG" cd.Body = (BlockStatement)stmt; compilationUnit.AddChild(cd); } else if (la.kind == 70 || la.kind == 80) { -#line 863 "cs.ATG" +#line 866 "cs.ATG" m.Check(Modifiers.Operators); if (m.isNone) Error("at least one modifier must be set"); bool isImplicit = true; @@ -1885,45 +1896,45 @@ out stmt); if (la.kind == 80) { lexer.NextToken(); -#line 868 "cs.ATG" +#line 871 "cs.ATG" startPos = t.Location; } else { lexer.NextToken(); -#line 868 "cs.ATG" +#line 871 "cs.ATG" isImplicit = false; startPos = t.Location; } Expect(92); Type( -#line 869 "cs.ATG" +#line 872 "cs.ATG" out type); -#line 869 "cs.ATG" +#line 872 "cs.ATG" TypeReference operatorType = type; Expect(20); Type( -#line 870 "cs.ATG" +#line 873 "cs.ATG" out type); Identifier(); -#line 870 "cs.ATG" +#line 873 "cs.ATG" string varName = t.val; Expect(21); -#line 871 "cs.ATG" +#line 874 "cs.ATG" Location endPos = t.Location; if (la.kind == 16) { Block( -#line 872 "cs.ATG" +#line 875 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); -#line 872 "cs.ATG" +#line 875 "cs.ATG" stmt = null; } else SynErr(166); -#line 875 "cs.ATG" +#line 878 "cs.ATG" List parameters = new List(); parameters.Add(new ParameterDeclarationExpression(type, varName)); OperatorDeclaration operatorDeclaration = new OperatorDeclaration { @@ -1941,61 +1952,61 @@ out stmt); } else if (StartOf(22)) { TypeDecl( -#line 893 "cs.ATG" +#line 896 "cs.ATG" m, attributes); } else if (StartOf(10)) { Type( -#line 895 "cs.ATG" +#line 898 "cs.ATG" out type); -#line 895 "cs.ATG" +#line 898 "cs.ATG" Location startPos = t.Location; if (la.kind == 92) { -#line 897 "cs.ATG" +#line 900 "cs.ATG" OverloadableOperatorType op; m.Check(Modifiers.Operators); if (m.isNone) Error("at least one modifier must be set"); lexer.NextToken(); OverloadableOperator( -#line 901 "cs.ATG" +#line 904 "cs.ATG" out op); -#line 901 "cs.ATG" +#line 904 "cs.ATG" TypeReference firstType, secondType = null; string secondName = null; Expect(20); Type( -#line 902 "cs.ATG" +#line 905 "cs.ATG" out firstType); Identifier(); -#line 902 "cs.ATG" +#line 905 "cs.ATG" string firstName = t.val; if (la.kind == 14) { lexer.NextToken(); Type( -#line 903 "cs.ATG" +#line 906 "cs.ATG" out secondType); Identifier(); -#line 903 "cs.ATG" +#line 906 "cs.ATG" secondName = t.val; } else if (la.kind == 21) { } else SynErr(167); -#line 911 "cs.ATG" +#line 914 "cs.ATG" Location endPos = t.Location; Expect(21); if (la.kind == 16) { Block( -#line 912 "cs.ATG" +#line 915 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); } else SynErr(168); -#line 914 "cs.ATG" +#line 917 "cs.ATG" if (op == OverloadableOperatorType.Add && secondType == null) op = OverloadableOperatorType.UnaryPlus; if (op == OverloadableOperatorType.Subtract && secondType == null) @@ -2017,75 +2028,75 @@ out stmt); compilationUnit.AddChild(operatorDeclaration); } else if ( -#line 936 "cs.ATG" +#line 939 "cs.ATG" IsVarDecl()) { -#line 937 "cs.ATG" +#line 940 "cs.ATG" m.Check(Modifiers.Fields); FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier); fd.StartLocation = m.GetDeclarationLocation(startPos); if ( -#line 941 "cs.ATG" +#line 944 "cs.ATG" m.Contains(Modifiers.Fixed)) { VariableDeclarator( -#line 942 "cs.ATG" +#line 945 "cs.ATG" fd); Expect(18); Expr( -#line 944 "cs.ATG" +#line 947 "cs.ATG" out expr); -#line 944 "cs.ATG" +#line 947 "cs.ATG" if (fd.Fields.Count > 0) fd.Fields[fd.Fields.Count-1].FixedArrayInitialization = expr; Expect(19); while (la.kind == 14) { lexer.NextToken(); VariableDeclarator( -#line 948 "cs.ATG" +#line 951 "cs.ATG" fd); Expect(18); Expr( -#line 950 "cs.ATG" +#line 953 "cs.ATG" out expr); -#line 950 "cs.ATG" +#line 953 "cs.ATG" if (fd.Fields.Count > 0) fd.Fields[fd.Fields.Count-1].FixedArrayInitialization = expr; Expect(19); } } else if (StartOf(19)) { VariableDeclarator( -#line 955 "cs.ATG" +#line 958 "cs.ATG" fd); while (la.kind == 14) { lexer.NextToken(); VariableDeclarator( -#line 956 "cs.ATG" +#line 959 "cs.ATG" fd); } } else SynErr(169); Expect(11); -#line 958 "cs.ATG" +#line 961 "cs.ATG" fd.EndLocation = t.EndLocation; compilationUnit.AddChild(fd); } else if (la.kind == 111) { -#line 961 "cs.ATG" +#line 964 "cs.ATG" m.Check(Modifiers.Indexers); lexer.NextToken(); Expect(18); FormalParameterList( -#line 962 "cs.ATG" +#line 965 "cs.ATG" p); Expect(19); -#line 962 "cs.ATG" +#line 965 "cs.ATG" Location endLocation = t.EndLocation; Expect(16); -#line 963 "cs.ATG" +#line 966 "cs.ATG" IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes); indexer.StartLocation = startPos; indexer.EndLocation = endLocation; @@ -2094,64 +2105,64 @@ p); PropertySetRegion setRegion; AccessorDecls( -#line 970 "cs.ATG" +#line 973 "cs.ATG" out getRegion, out setRegion); Expect(17); -#line 971 "cs.ATG" +#line 974 "cs.ATG" indexer.BodyEnd = t.EndLocation; indexer.GetRegion = getRegion; indexer.SetRegion = setRegion; compilationUnit.AddChild(indexer); } else if ( -#line 976 "cs.ATG" +#line 979 "cs.ATG" IsIdentifierToken(la)) { if ( -#line 977 "cs.ATG" +#line 980 "cs.ATG" IsExplicitInterfaceImplementation()) { TypeName( -#line 978 "cs.ATG" +#line 981 "cs.ATG" out explicitInterface, false); -#line 979 "cs.ATG" +#line 982 "cs.ATG" if (la.kind != Tokens.Dot || Peek(1).kind != Tokens.This) { qualident = TypeReference.StripLastIdentifierFromType(ref explicitInterface); } } else if (StartOf(19)) { Identifier(); -#line 982 "cs.ATG" +#line 985 "cs.ATG" qualident = t.val; } else SynErr(170); -#line 984 "cs.ATG" +#line 987 "cs.ATG" Location qualIdentEndLocation = t.EndLocation; if (la.kind == 16 || la.kind == 20 || la.kind == 23) { if (la.kind == 20 || la.kind == 23) { -#line 988 "cs.ATG" +#line 991 "cs.ATG" m.Check(Modifiers.PropertysEventsMethods); if (la.kind == 23) { TypeParameterList( -#line 990 "cs.ATG" +#line 993 "cs.ATG" templates); } Expect(20); if (la.kind == 111) { lexer.NextToken(); -#line 992 "cs.ATG" +#line 995 "cs.ATG" isExtensionMethod = true; } if (StartOf(11)) { FormalParameterList( -#line 993 "cs.ATG" +#line 996 "cs.ATG" p); } Expect(21); -#line 995 "cs.ATG" +#line 998 "cs.ATG" MethodDeclaration methodDeclaration = new MethodDeclaration { Name = qualident, Modifier = m.Modifier, @@ -2169,23 +2180,23 @@ p); while (la.kind == 127) { TypeParameterConstraintsClause( -#line 1010 "cs.ATG" +#line 1013 "cs.ATG" templates); } if (la.kind == 16) { Block( -#line 1011 "cs.ATG" +#line 1014 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); } else SynErr(171); -#line 1011 "cs.ATG" +#line 1014 "cs.ATG" methodDeclaration.Body = (BlockStatement)stmt; } else { lexer.NextToken(); -#line 1014 "cs.ATG" +#line 1017 "cs.ATG" PropertyDeclaration pDecl = new PropertyDeclaration(qualident, type, m.Modifier, attributes); if (explicitInterface != null) pDecl.InterfaceImplementations.Add(new InterfaceImplementation(explicitInterface, qualident)); @@ -2196,11 +2207,11 @@ out stmt); PropertySetRegion setRegion; AccessorDecls( -#line 1023 "cs.ATG" +#line 1026 "cs.ATG" out getRegion, out setRegion); Expect(17); -#line 1025 "cs.ATG" +#line 1028 "cs.ATG" pDecl.GetRegion = getRegion; pDecl.SetRegion = setRegion; pDecl.BodyEnd = t.EndLocation; @@ -2209,17 +2220,17 @@ out getRegion, out setRegion); } } else if (la.kind == 15) { -#line 1033 "cs.ATG" +#line 1036 "cs.ATG" m.Check(Modifiers.Indexers); lexer.NextToken(); Expect(111); Expect(18); FormalParameterList( -#line 1034 "cs.ATG" +#line 1037 "cs.ATG" p); Expect(19); -#line 1035 "cs.ATG" +#line 1038 "cs.ATG" IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes); indexer.StartLocation = m.GetDeclarationLocation(startPos); indexer.EndLocation = t.EndLocation; @@ -2230,14 +2241,14 @@ p); Expect(16); -#line 1043 "cs.ATG" +#line 1046 "cs.ATG" Location bodyStart = t.Location; AccessorDecls( -#line 1044 "cs.ATG" +#line 1047 "cs.ATG" out getRegion, out setRegion); Expect(17); -#line 1045 "cs.ATG" +#line 1048 "cs.ATG" indexer.BodyStart = bodyStart; indexer.BodyEnd = t.EndLocation; indexer.GetRegion = getRegion; @@ -2251,7 +2262,7 @@ out getRegion, out setRegion); void InterfaceMemberDecl() { -#line 1072 "cs.ATG" +#line 1075 "cs.ATG" TypeReference type; AttributeSection section; @@ -2266,49 +2277,49 @@ out getRegion, out setRegion); while (la.kind == 18) { AttributeSection( -#line 1085 "cs.ATG" +#line 1088 "cs.ATG" out section); -#line 1085 "cs.ATG" +#line 1088 "cs.ATG" attributes.Add(section); } if (la.kind == 89) { lexer.NextToken(); -#line 1086 "cs.ATG" +#line 1089 "cs.ATG" mod = Modifiers.New; startLocation = t.Location; } if ( -#line 1089 "cs.ATG" +#line 1092 "cs.ATG" NotVoidPointer()) { Expect(123); -#line 1089 "cs.ATG" +#line 1092 "cs.ATG" if (startLocation.IsEmpty) startLocation = t.Location; Identifier(); -#line 1090 "cs.ATG" +#line 1093 "cs.ATG" name = t.val; if (la.kind == 23) { TypeParameterList( -#line 1091 "cs.ATG" +#line 1094 "cs.ATG" templates); } Expect(20); if (StartOf(11)) { FormalParameterList( -#line 1092 "cs.ATG" +#line 1095 "cs.ATG" parameters); } Expect(21); while (la.kind == 127) { TypeParameterConstraintsClause( -#line 1093 "cs.ATG" +#line 1096 "cs.ATG" templates); } Expect(11); -#line 1095 "cs.ATG" +#line 1098 "cs.ATG" MethodDeclaration md = new MethodDeclaration { Name = name, Modifier = mod, TypeReference = new TypeReference("System.Void", true), Parameters = parameters, Attributes = attributes, Templates = templates, @@ -2319,37 +2330,37 @@ templates); } else if (StartOf(23)) { if (StartOf(10)) { Type( -#line 1103 "cs.ATG" +#line 1106 "cs.ATG" out type); -#line 1103 "cs.ATG" +#line 1106 "cs.ATG" if (startLocation.IsEmpty) startLocation = t.Location; if (StartOf(19)) { Identifier(); -#line 1105 "cs.ATG" +#line 1108 "cs.ATG" name = t.val; Location qualIdentEndLocation = t.EndLocation; if (la.kind == 20 || la.kind == 23) { if (la.kind == 23) { TypeParameterList( -#line 1109 "cs.ATG" +#line 1112 "cs.ATG" templates); } Expect(20); if (StartOf(11)) { FormalParameterList( -#line 1110 "cs.ATG" +#line 1113 "cs.ATG" parameters); } Expect(21); while (la.kind == 127) { TypeParameterConstraintsClause( -#line 1112 "cs.ATG" +#line 1115 "cs.ATG" templates); } Expect(11); -#line 1113 "cs.ATG" +#line 1116 "cs.ATG" MethodDeclaration md = new MethodDeclaration { Name = name, Modifier = mod, TypeReference = type, Parameters = parameters, Attributes = attributes, Templates = templates, @@ -2359,58 +2370,58 @@ templates); } else if (la.kind == 16) { -#line 1122 "cs.ATG" +#line 1125 "cs.ATG" PropertyDeclaration pd = new PropertyDeclaration(name, type, mod, attributes); compilationUnit.AddChild(pd); lexer.NextToken(); -#line 1125 "cs.ATG" +#line 1128 "cs.ATG" Location bodyStart = t.Location; InterfaceAccessors( -#line 1126 "cs.ATG" +#line 1129 "cs.ATG" out getBlock, out setBlock); Expect(17); -#line 1127 "cs.ATG" +#line 1130 "cs.ATG" pd.GetRegion = getBlock; pd.SetRegion = setBlock; pd.StartLocation = startLocation; pd.EndLocation = qualIdentEndLocation; pd.BodyStart = bodyStart; pd.BodyEnd = t.EndLocation; } else SynErr(175); } else if (la.kind == 111) { lexer.NextToken(); Expect(18); FormalParameterList( -#line 1130 "cs.ATG" +#line 1133 "cs.ATG" parameters); Expect(19); -#line 1131 "cs.ATG" +#line 1134 "cs.ATG" Location bracketEndLocation = t.EndLocation; -#line 1132 "cs.ATG" +#line 1135 "cs.ATG" IndexerDeclaration id = new IndexerDeclaration(type, parameters, mod, attributes); compilationUnit.AddChild(id); Expect(16); -#line 1134 "cs.ATG" +#line 1137 "cs.ATG" Location bodyStart = t.Location; InterfaceAccessors( -#line 1135 "cs.ATG" +#line 1138 "cs.ATG" out getBlock, out setBlock); Expect(17); -#line 1137 "cs.ATG" +#line 1140 "cs.ATG" id.GetRegion = getBlock; id.SetRegion = setBlock; id.StartLocation = startLocation; id.EndLocation = bracketEndLocation; id.BodyStart = bodyStart; id.BodyEnd = t.EndLocation; } else SynErr(176); } else { lexer.NextToken(); -#line 1140 "cs.ATG" +#line 1143 "cs.ATG" if (startLocation.IsEmpty) startLocation = t.Location; Type( -#line 1141 "cs.ATG" +#line 1144 "cs.ATG" out type); Identifier(); -#line 1142 "cs.ATG" +#line 1145 "cs.ATG" EventDeclaration ed = new EventDeclaration { TypeReference = type, Name = t.val, Modifier = mod, Attributes = attributes }; @@ -2418,17 +2429,17 @@ out type); Expect(11); -#line 1148 "cs.ATG" +#line 1151 "cs.ATG" ed.StartLocation = startLocation; ed.EndLocation = t.EndLocation; } } else SynErr(177); } void EnumMemberDecl( -#line 1153 "cs.ATG" +#line 1156 "cs.ATG" out FieldDeclaration f) { -#line 1155 "cs.ATG" +#line 1158 "cs.ATG" Expression expr = null; List attributes = new List(); AttributeSection section = null; @@ -2436,15 +2447,15 @@ out FieldDeclaration f) { while (la.kind == 18) { AttributeSection( -#line 1161 "cs.ATG" +#line 1164 "cs.ATG" out section); -#line 1161 "cs.ATG" +#line 1164 "cs.ATG" attributes.Add(section); } Identifier(); -#line 1162 "cs.ATG" +#line 1165 "cs.ATG" f = new FieldDeclaration(attributes); varDecl = new VariableDeclaration(t.val); f.Fields.Add(varDecl); @@ -2454,19 +2465,19 @@ out section); if (la.kind == 3) { lexer.NextToken(); Expr( -#line 1168 "cs.ATG" +#line 1171 "cs.ATG" out expr); -#line 1168 "cs.ATG" +#line 1171 "cs.ATG" varDecl.Initializer = expr; } } void TypeWithRestriction( -#line 563 "cs.ATG" +#line 566 "cs.ATG" out TypeReference type, bool allowNullable, bool canBeUnbound) { -#line 565 "cs.ATG" +#line 568 "cs.ATG" Location startPos = la.Location; string name; int pointer = 0; @@ -2474,59 +2485,59 @@ out TypeReference type, bool allowNullable, bool canBeUnbound) { if (StartOf(4)) { ClassType( -#line 571 "cs.ATG" +#line 574 "cs.ATG" out type, canBeUnbound); } else if (StartOf(5)) { SimpleType( -#line 572 "cs.ATG" +#line 575 "cs.ATG" out name); -#line 572 "cs.ATG" +#line 575 "cs.ATG" type = new TypeReference(name, true); } else if (la.kind == 123) { lexer.NextToken(); Expect(6); -#line 573 "cs.ATG" +#line 576 "cs.ATG" pointer = 1; type = new TypeReference("System.Void", true); } else SynErr(178); -#line 574 "cs.ATG" +#line 577 "cs.ATG" List r = new List(); if ( -#line 576 "cs.ATG" +#line 579 "cs.ATG" allowNullable && la.kind == Tokens.Question) { NullableQuestionMark( -#line 576 "cs.ATG" +#line 579 "cs.ATG" ref type); } while ( -#line 578 "cs.ATG" +#line 581 "cs.ATG" IsPointerOrDims()) { -#line 578 "cs.ATG" +#line 581 "cs.ATG" int i = 0; if (la.kind == 6) { lexer.NextToken(); -#line 579 "cs.ATG" +#line 582 "cs.ATG" ++pointer; } else if (la.kind == 18) { lexer.NextToken(); while (la.kind == 14) { lexer.NextToken(); -#line 580 "cs.ATG" +#line 583 "cs.ATG" ++i; } Expect(19); -#line 580 "cs.ATG" +#line 583 "cs.ATG" r.Add(i); } else SynErr(179); } -#line 583 "cs.ATG" +#line 586 "cs.ATG" if (type != null) { type.RankSpecifier = r.ToArray(); type.PointerNestingLevel = pointer; @@ -2537,57 +2548,57 @@ IsPointerOrDims()) { } void SimpleType( -#line 619 "cs.ATG" +#line 622 "cs.ATG" out string name) { -#line 620 "cs.ATG" +#line 623 "cs.ATG" name = String.Empty; if (StartOf(24)) { IntegralType( -#line 622 "cs.ATG" +#line 625 "cs.ATG" out name); } else if (la.kind == 75) { lexer.NextToken(); -#line 623 "cs.ATG" +#line 626 "cs.ATG" name = "System.Single"; } else if (la.kind == 66) { lexer.NextToken(); -#line 624 "cs.ATG" +#line 627 "cs.ATG" name = "System.Double"; } else if (la.kind == 62) { lexer.NextToken(); -#line 625 "cs.ATG" +#line 628 "cs.ATG" name = "System.Decimal"; } else if (la.kind == 52) { lexer.NextToken(); -#line 626 "cs.ATG" +#line 629 "cs.ATG" name = "System.Boolean"; } else SynErr(180); } void NullableQuestionMark( -#line 2318 "cs.ATG" +#line 2321 "cs.ATG" ref TypeReference typeRef) { -#line 2319 "cs.ATG" +#line 2322 "cs.ATG" List typeArguments = new List(1); Expect(12); -#line 2323 "cs.ATG" +#line 2326 "cs.ATG" if (typeRef != null) typeArguments.Add(typeRef); typeRef = new TypeReference("System.Nullable", typeArguments) { IsKeyword = true }; } void FixedParameter( -#line 656 "cs.ATG" +#line 659 "cs.ATG" out ParameterDeclarationExpression p) { -#line 658 "cs.ATG" +#line 661 "cs.ATG" TypeReference type; ParameterModifiers mod = ParameterModifiers.In; Location start = la.Location; @@ -2596,82 +2607,82 @@ out ParameterDeclarationExpression p) { if (la.kind == 100) { lexer.NextToken(); -#line 664 "cs.ATG" +#line 667 "cs.ATG" mod = ParameterModifiers.Ref; } else { lexer.NextToken(); -#line 665 "cs.ATG" +#line 668 "cs.ATG" mod = ParameterModifiers.Out; } } Type( -#line 667 "cs.ATG" +#line 670 "cs.ATG" out type); Identifier(); -#line 667 "cs.ATG" +#line 670 "cs.ATG" p = new ParameterDeclarationExpression(type, t.val, mod); p.StartLocation = start; p.EndLocation = t.Location; } void ParameterArray( -#line 670 "cs.ATG" +#line 673 "cs.ATG" out ParameterDeclarationExpression p) { -#line 671 "cs.ATG" +#line 674 "cs.ATG" TypeReference type; Expect(95); Type( -#line 673 "cs.ATG" +#line 676 "cs.ATG" out type); Identifier(); -#line 673 "cs.ATG" +#line 676 "cs.ATG" p = new ParameterDeclarationExpression(type, t.val, ParameterModifiers.Params); } void AccessorModifiers( -#line 676 "cs.ATG" +#line 679 "cs.ATG" out ModifierList m) { -#line 677 "cs.ATG" +#line 680 "cs.ATG" m = new ModifierList(); if (la.kind == 96) { lexer.NextToken(); -#line 679 "cs.ATG" +#line 682 "cs.ATG" m.Add(Modifiers.Private, t.Location); } else if (la.kind == 97) { lexer.NextToken(); -#line 680 "cs.ATG" +#line 683 "cs.ATG" m.Add(Modifiers.Protected, t.Location); if (la.kind == 84) { lexer.NextToken(); -#line 681 "cs.ATG" +#line 684 "cs.ATG" m.Add(Modifiers.Internal, t.Location); } } else if (la.kind == 84) { lexer.NextToken(); -#line 682 "cs.ATG" +#line 685 "cs.ATG" m.Add(Modifiers.Internal, t.Location); if (la.kind == 97) { lexer.NextToken(); -#line 683 "cs.ATG" +#line 686 "cs.ATG" m.Add(Modifiers.Protected, t.Location); } } else SynErr(181); } void Block( -#line 1288 "cs.ATG" +#line 1291 "cs.ATG" out Statement stmt) { Expect(16); -#line 1290 "cs.ATG" +#line 1293 "cs.ATG" BlockStatement blockStmt = new BlockStatement(); blockStmt.StartLocation = t.Location; compilationUnit.BlockStart(blockStmt); @@ -2683,7 +2694,7 @@ out Statement stmt) { while (!(la.kind == 0 || la.kind == 17)) {SynErr(182); lexer.NextToken(); } Expect(17); -#line 1298 "cs.ATG" +#line 1301 "cs.ATG" stmt = blockStmt; blockStmt.EndLocation = t.EndLocation; compilationUnit.BlockEnd(); @@ -2691,10 +2702,10 @@ out Statement stmt) { } void EventAccessorDecls( -#line 1225 "cs.ATG" +#line 1228 "cs.ATG" out EventAddRegion addBlock, out EventRemoveRegion removeBlock) { -#line 1226 "cs.ATG" +#line 1229 "cs.ATG" AttributeSection section; List attributes = new List(); Statement stmt; @@ -2703,93 +2714,93 @@ out EventAddRegion addBlock, out EventRemoveRegion removeBlock) { while (la.kind == 18) { AttributeSection( -#line 1233 "cs.ATG" +#line 1236 "cs.ATG" out section); -#line 1233 "cs.ATG" +#line 1236 "cs.ATG" attributes.Add(section); } if (la.kind == 130) { -#line 1235 "cs.ATG" +#line 1238 "cs.ATG" addBlock = new EventAddRegion(attributes); AddAccessorDecl( -#line 1236 "cs.ATG" +#line 1239 "cs.ATG" out stmt); -#line 1236 "cs.ATG" +#line 1239 "cs.ATG" attributes = new List(); addBlock.Block = (BlockStatement)stmt; while (la.kind == 18) { AttributeSection( -#line 1237 "cs.ATG" +#line 1240 "cs.ATG" out section); -#line 1237 "cs.ATG" +#line 1240 "cs.ATG" attributes.Add(section); } RemoveAccessorDecl( -#line 1238 "cs.ATG" +#line 1241 "cs.ATG" out stmt); -#line 1238 "cs.ATG" +#line 1241 "cs.ATG" removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; } else if (la.kind == 131) { RemoveAccessorDecl( -#line 1240 "cs.ATG" +#line 1243 "cs.ATG" out stmt); -#line 1240 "cs.ATG" +#line 1243 "cs.ATG" removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; attributes = new List(); while (la.kind == 18) { AttributeSection( -#line 1241 "cs.ATG" +#line 1244 "cs.ATG" out section); -#line 1241 "cs.ATG" +#line 1244 "cs.ATG" attributes.Add(section); } AddAccessorDecl( -#line 1242 "cs.ATG" +#line 1245 "cs.ATG" out stmt); -#line 1242 "cs.ATG" +#line 1245 "cs.ATG" addBlock = new EventAddRegion(attributes); addBlock.Block = (BlockStatement)stmt; } else SynErr(183); } void ConstructorInitializer( -#line 1318 "cs.ATG" +#line 1321 "cs.ATG" out ConstructorInitializer ci) { -#line 1319 "cs.ATG" +#line 1322 "cs.ATG" Expression expr; ci = new ConstructorInitializer(); Expect(9); if (la.kind == 51) { lexer.NextToken(); -#line 1323 "cs.ATG" +#line 1326 "cs.ATG" ci.ConstructorInitializerType = ConstructorInitializerType.Base; } else if (la.kind == 111) { lexer.NextToken(); -#line 1324 "cs.ATG" +#line 1327 "cs.ATG" ci.ConstructorInitializerType = ConstructorInitializerType.This; } else SynErr(184); Expect(20); if (StartOf(26)) { Argument( -#line 1327 "cs.ATG" +#line 1330 "cs.ATG" out expr); -#line 1327 "cs.ATG" +#line 1330 "cs.ATG" SafeAdd(ci, ci.Arguments, expr); while (la.kind == 14) { lexer.NextToken(); Argument( -#line 1328 "cs.ATG" +#line 1331 "cs.ATG" out expr); -#line 1328 "cs.ATG" +#line 1331 "cs.ATG" SafeAdd(ci, ci.Arguments, expr); } } @@ -2797,161 +2808,161 @@ out expr); } void OverloadableOperator( -#line 1341 "cs.ATG" +#line 1344 "cs.ATG" out OverloadableOperatorType op) { -#line 1342 "cs.ATG" +#line 1345 "cs.ATG" op = OverloadableOperatorType.None; switch (la.kind) { case 4: { lexer.NextToken(); -#line 1344 "cs.ATG" +#line 1347 "cs.ATG" op = OverloadableOperatorType.Add; break; } case 5: { lexer.NextToken(); -#line 1345 "cs.ATG" +#line 1348 "cs.ATG" op = OverloadableOperatorType.Subtract; break; } case 24: { lexer.NextToken(); -#line 1347 "cs.ATG" +#line 1350 "cs.ATG" op = OverloadableOperatorType.Not; break; } case 27: { lexer.NextToken(); -#line 1348 "cs.ATG" +#line 1351 "cs.ATG" op = OverloadableOperatorType.BitNot; break; } case 31: { lexer.NextToken(); -#line 1350 "cs.ATG" +#line 1353 "cs.ATG" op = OverloadableOperatorType.Increment; break; } case 32: { lexer.NextToken(); -#line 1351 "cs.ATG" +#line 1354 "cs.ATG" op = OverloadableOperatorType.Decrement; break; } case 113: { lexer.NextToken(); -#line 1353 "cs.ATG" +#line 1356 "cs.ATG" op = OverloadableOperatorType.IsTrue; break; } case 72: { lexer.NextToken(); -#line 1354 "cs.ATG" +#line 1357 "cs.ATG" op = OverloadableOperatorType.IsFalse; break; } case 6: { lexer.NextToken(); -#line 1356 "cs.ATG" +#line 1359 "cs.ATG" op = OverloadableOperatorType.Multiply; break; } case 7: { lexer.NextToken(); -#line 1357 "cs.ATG" +#line 1360 "cs.ATG" op = OverloadableOperatorType.Divide; break; } case 8: { lexer.NextToken(); -#line 1358 "cs.ATG" +#line 1361 "cs.ATG" op = OverloadableOperatorType.Modulus; break; } case 28: { lexer.NextToken(); -#line 1360 "cs.ATG" +#line 1363 "cs.ATG" op = OverloadableOperatorType.BitwiseAnd; break; } case 29: { lexer.NextToken(); -#line 1361 "cs.ATG" +#line 1364 "cs.ATG" op = OverloadableOperatorType.BitwiseOr; break; } case 30: { lexer.NextToken(); -#line 1362 "cs.ATG" +#line 1365 "cs.ATG" op = OverloadableOperatorType.ExclusiveOr; break; } case 37: { lexer.NextToken(); -#line 1364 "cs.ATG" +#line 1367 "cs.ATG" op = OverloadableOperatorType.ShiftLeft; break; } case 33: { lexer.NextToken(); -#line 1365 "cs.ATG" +#line 1368 "cs.ATG" op = OverloadableOperatorType.Equality; break; } case 34: { lexer.NextToken(); -#line 1366 "cs.ATG" +#line 1369 "cs.ATG" op = OverloadableOperatorType.InEquality; break; } case 23: { lexer.NextToken(); -#line 1367 "cs.ATG" +#line 1370 "cs.ATG" op = OverloadableOperatorType.LessThan; break; } case 35: { lexer.NextToken(); -#line 1368 "cs.ATG" +#line 1371 "cs.ATG" op = OverloadableOperatorType.GreaterThanOrEqual; break; } case 36: { lexer.NextToken(); -#line 1369 "cs.ATG" +#line 1372 "cs.ATG" op = OverloadableOperatorType.LessThanOrEqual; break; } case 22: { lexer.NextToken(); -#line 1370 "cs.ATG" +#line 1373 "cs.ATG" op = OverloadableOperatorType.GreaterThan; if (la.kind == 22) { lexer.NextToken(); -#line 1370 "cs.ATG" +#line 1373 "cs.ATG" op = OverloadableOperatorType.ShiftRight; } break; @@ -2961,34 +2972,34 @@ out OverloadableOperatorType op) { } void VariableDeclarator( -#line 1280 "cs.ATG" +#line 1283 "cs.ATG" FieldDeclaration parentFieldDeclaration) { -#line 1281 "cs.ATG" +#line 1284 "cs.ATG" Expression expr = null; Identifier(); -#line 1283 "cs.ATG" +#line 1286 "cs.ATG" VariableDeclaration f = new VariableDeclaration(t.val); f.StartLocation = t.Location; if (la.kind == 3) { lexer.NextToken(); VariableInitializer( -#line 1284 "cs.ATG" +#line 1287 "cs.ATG" out expr); -#line 1284 "cs.ATG" +#line 1287 "cs.ATG" f.Initializer = expr; } -#line 1285 "cs.ATG" +#line 1288 "cs.ATG" f.EndLocation = t.EndLocation; SafeAdd(parentFieldDeclaration, parentFieldDeclaration.Fields, f); } void AccessorDecls( -#line 1172 "cs.ATG" +#line 1175 "cs.ATG" out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { -#line 1174 "cs.ATG" +#line 1177 "cs.ATG" List attributes = new List(); AttributeSection section; getBlock = null; @@ -2997,92 +3008,92 @@ out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { while (la.kind == 18) { AttributeSection( -#line 1181 "cs.ATG" +#line 1184 "cs.ATG" out section); -#line 1181 "cs.ATG" +#line 1184 "cs.ATG" attributes.Add(section); } if (la.kind == 84 || la.kind == 96 || la.kind == 97) { AccessorModifiers( -#line 1182 "cs.ATG" +#line 1185 "cs.ATG" out modifiers); } if (la.kind == 128) { GetAccessorDecl( -#line 1184 "cs.ATG" +#line 1187 "cs.ATG" out getBlock, attributes); -#line 1185 "cs.ATG" +#line 1188 "cs.ATG" if (modifiers != null) {getBlock.Modifier = modifiers.Modifier; } if (StartOf(27)) { -#line 1186 "cs.ATG" +#line 1189 "cs.ATG" attributes = new List(); modifiers = null; while (la.kind == 18) { AttributeSection( -#line 1187 "cs.ATG" +#line 1190 "cs.ATG" out section); -#line 1187 "cs.ATG" +#line 1190 "cs.ATG" attributes.Add(section); } if (la.kind == 84 || la.kind == 96 || la.kind == 97) { AccessorModifiers( -#line 1188 "cs.ATG" +#line 1191 "cs.ATG" out modifiers); } SetAccessorDecl( -#line 1189 "cs.ATG" +#line 1192 "cs.ATG" out setBlock, attributes); -#line 1190 "cs.ATG" +#line 1193 "cs.ATG" if (modifiers != null) {setBlock.Modifier = modifiers.Modifier; } } } else if (la.kind == 129) { SetAccessorDecl( -#line 1193 "cs.ATG" +#line 1196 "cs.ATG" out setBlock, attributes); -#line 1194 "cs.ATG" +#line 1197 "cs.ATG" if (modifiers != null) {setBlock.Modifier = modifiers.Modifier; } if (StartOf(28)) { -#line 1195 "cs.ATG" +#line 1198 "cs.ATG" attributes = new List(); modifiers = null; while (la.kind == 18) { AttributeSection( -#line 1196 "cs.ATG" +#line 1199 "cs.ATG" out section); -#line 1196 "cs.ATG" +#line 1199 "cs.ATG" attributes.Add(section); } if (la.kind == 84 || la.kind == 96 || la.kind == 97) { AccessorModifiers( -#line 1197 "cs.ATG" +#line 1200 "cs.ATG" out modifiers); } GetAccessorDecl( -#line 1198 "cs.ATG" +#line 1201 "cs.ATG" out getBlock, attributes); -#line 1199 "cs.ATG" +#line 1202 "cs.ATG" if (modifiers != null) {getBlock.Modifier = modifiers.Modifier; } } } else if (StartOf(19)) { Identifier(); -#line 1201 "cs.ATG" +#line 1204 "cs.ATG" Error("get or set accessor declaration expected"); } else SynErr(186); } void InterfaceAccessors( -#line 1246 "cs.ATG" +#line 1249 "cs.ATG" out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { -#line 1248 "cs.ATG" +#line 1251 "cs.ATG" AttributeSection section; List attributes = new List(); getBlock = null; setBlock = null; @@ -3090,218 +3101,218 @@ out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { while (la.kind == 18) { AttributeSection( -#line 1254 "cs.ATG" +#line 1257 "cs.ATG" out section); -#line 1254 "cs.ATG" +#line 1257 "cs.ATG" attributes.Add(section); } -#line 1255 "cs.ATG" +#line 1258 "cs.ATG" Location startLocation = la.Location; if (la.kind == 128) { lexer.NextToken(); -#line 1257 "cs.ATG" +#line 1260 "cs.ATG" getBlock = new PropertyGetRegion(null, attributes); } else if (la.kind == 129) { lexer.NextToken(); -#line 1258 "cs.ATG" +#line 1261 "cs.ATG" setBlock = new PropertySetRegion(null, attributes); } else SynErr(187); Expect(11); -#line 1261 "cs.ATG" +#line 1264 "cs.ATG" if (getBlock != null) { getBlock.StartLocation = startLocation; getBlock.EndLocation = t.EndLocation; } if (setBlock != null) { setBlock.StartLocation = startLocation; setBlock.EndLocation = t.EndLocation; } attributes = new List(); if (la.kind == 18 || la.kind == 128 || la.kind == 129) { while (la.kind == 18) { AttributeSection( -#line 1265 "cs.ATG" +#line 1268 "cs.ATG" out section); -#line 1265 "cs.ATG" +#line 1268 "cs.ATG" attributes.Add(section); } -#line 1266 "cs.ATG" +#line 1269 "cs.ATG" startLocation = la.Location; if (la.kind == 128) { lexer.NextToken(); -#line 1268 "cs.ATG" +#line 1271 "cs.ATG" if (getBlock != null) Error("get already declared"); else { getBlock = new PropertyGetRegion(null, attributes); lastBlock = getBlock; } } else if (la.kind == 129) { lexer.NextToken(); -#line 1271 "cs.ATG" +#line 1274 "cs.ATG" if (setBlock != null) Error("set already declared"); else { setBlock = new PropertySetRegion(null, attributes); lastBlock = setBlock; } } else SynErr(188); Expect(11); -#line 1276 "cs.ATG" +#line 1279 "cs.ATG" if (lastBlock != null) { lastBlock.StartLocation = startLocation; lastBlock.EndLocation = t.EndLocation; } } } void GetAccessorDecl( -#line 1205 "cs.ATG" +#line 1208 "cs.ATG" out PropertyGetRegion getBlock, List attributes) { -#line 1206 "cs.ATG" +#line 1209 "cs.ATG" Statement stmt = null; Expect(128); -#line 1209 "cs.ATG" +#line 1212 "cs.ATG" Location startLocation = t.Location; if (la.kind == 16) { Block( -#line 1210 "cs.ATG" +#line 1213 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); } else SynErr(189); -#line 1211 "cs.ATG" +#line 1214 "cs.ATG" getBlock = new PropertyGetRegion((BlockStatement)stmt, attributes); -#line 1212 "cs.ATG" +#line 1215 "cs.ATG" getBlock.StartLocation = startLocation; getBlock.EndLocation = t.EndLocation; } void SetAccessorDecl( -#line 1215 "cs.ATG" +#line 1218 "cs.ATG" out PropertySetRegion setBlock, List attributes) { -#line 1216 "cs.ATG" +#line 1219 "cs.ATG" Statement stmt = null; Expect(129); -#line 1219 "cs.ATG" +#line 1222 "cs.ATG" Location startLocation = t.Location; if (la.kind == 16) { Block( -#line 1220 "cs.ATG" +#line 1223 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); } else SynErr(190); -#line 1221 "cs.ATG" +#line 1224 "cs.ATG" setBlock = new PropertySetRegion((BlockStatement)stmt, attributes); -#line 1222 "cs.ATG" +#line 1225 "cs.ATG" setBlock.StartLocation = startLocation; setBlock.EndLocation = t.EndLocation; } void AddAccessorDecl( -#line 1304 "cs.ATG" +#line 1307 "cs.ATG" out Statement stmt) { -#line 1305 "cs.ATG" +#line 1308 "cs.ATG" stmt = null; Expect(130); Block( -#line 1308 "cs.ATG" +#line 1311 "cs.ATG" out stmt); } void RemoveAccessorDecl( -#line 1311 "cs.ATG" +#line 1314 "cs.ATG" out Statement stmt) { -#line 1312 "cs.ATG" +#line 1315 "cs.ATG" stmt = null; Expect(131); Block( -#line 1315 "cs.ATG" +#line 1318 "cs.ATG" out stmt); } void VariableInitializer( -#line 1333 "cs.ATG" +#line 1336 "cs.ATG" out Expression initializerExpression) { -#line 1334 "cs.ATG" +#line 1337 "cs.ATG" TypeReference type = null; Expression expr = null; initializerExpression = null; if (StartOf(6)) { Expr( -#line 1336 "cs.ATG" +#line 1339 "cs.ATG" out initializerExpression); } else if (la.kind == 16) { CollectionInitializer( -#line 1337 "cs.ATG" +#line 1340 "cs.ATG" out initializerExpression); } else if (la.kind == 106) { lexer.NextToken(); Type( -#line 1338 "cs.ATG" +#line 1341 "cs.ATG" out type); Expect(18); Expr( -#line 1338 "cs.ATG" +#line 1341 "cs.ATG" out expr); Expect(19); -#line 1338 "cs.ATG" +#line 1341 "cs.ATG" initializerExpression = new StackAllocExpression(type, expr); } else SynErr(191); } void Statement() { -#line 1481 "cs.ATG" +#line 1484 "cs.ATG" Statement stmt = null; Location startPos = la.Location; while (!(StartOf(29))) {SynErr(192); lexer.NextToken(); } if ( -#line 1488 "cs.ATG" +#line 1491 "cs.ATG" IsLabel()) { Identifier(); -#line 1488 "cs.ATG" +#line 1491 "cs.ATG" compilationUnit.AddChild(new LabelStatement(t.val)); Expect(9); Statement(); } else if (la.kind == 60) { lexer.NextToken(); LocalVariableDecl( -#line 1492 "cs.ATG" +#line 1495 "cs.ATG" out stmt); -#line 1493 "cs.ATG" +#line 1496 "cs.ATG" if (stmt != null) { ((LocalVariableDeclaration)stmt).Modifier |= Modifiers.Const; } Expect(11); -#line 1494 "cs.ATG" +#line 1497 "cs.ATG" compilationUnit.AddChild(stmt); } else if ( -#line 1496 "cs.ATG" +#line 1499 "cs.ATG" IsLocalVarDecl()) { LocalVariableDecl( -#line 1496 "cs.ATG" +#line 1499 "cs.ATG" out stmt); Expect(11); -#line 1496 "cs.ATG" +#line 1499 "cs.ATG" compilationUnit.AddChild(stmt); } else if (StartOf(30)) { EmbeddedStatement( -#line 1498 "cs.ATG" +#line 1501 "cs.ATG" out stmt); -#line 1498 "cs.ATG" +#line 1501 "cs.ATG" compilationUnit.AddChild(stmt); } else SynErr(193); -#line 1504 "cs.ATG" +#line 1507 "cs.ATG" if (stmt != null) { stmt.StartLocation = startPos; stmt.EndLocation = t.EndLocation; @@ -3310,10 +3321,10 @@ out stmt); } void Argument( -#line 1373 "cs.ATG" +#line 1376 "cs.ATG" out Expression argumentexpr) { -#line 1375 "cs.ATG" +#line 1378 "cs.ATG" Expression expr; FieldDirection fd = FieldDirection.None; @@ -3321,51 +3332,51 @@ out Expression argumentexpr) { if (la.kind == 100) { lexer.NextToken(); -#line 1380 "cs.ATG" +#line 1383 "cs.ATG" fd = FieldDirection.Ref; } else { lexer.NextToken(); -#line 1381 "cs.ATG" +#line 1384 "cs.ATG" fd = FieldDirection.Out; } } Expr( -#line 1383 "cs.ATG" +#line 1386 "cs.ATG" out expr); -#line 1384 "cs.ATG" +#line 1387 "cs.ATG" argumentexpr = fd != FieldDirection.None ? argumentexpr = new DirectionExpression(fd, expr) : expr; } void CollectionInitializer( -#line 1404 "cs.ATG" +#line 1407 "cs.ATG" out Expression outExpr) { -#line 1406 "cs.ATG" +#line 1409 "cs.ATG" Expression expr = null; CollectionInitializerExpression initializer = new CollectionInitializerExpression(); Expect(16); -#line 1410 "cs.ATG" +#line 1413 "cs.ATG" initializer.StartLocation = t.Location; if (StartOf(31)) { VariableInitializer( -#line 1411 "cs.ATG" +#line 1414 "cs.ATG" out expr); -#line 1412 "cs.ATG" +#line 1415 "cs.ATG" SafeAdd(initializer, initializer.CreateExpressions, expr); while ( -#line 1413 "cs.ATG" +#line 1416 "cs.ATG" NotFinalComma()) { Expect(14); VariableInitializer( -#line 1414 "cs.ATG" +#line 1417 "cs.ATG" out expr); -#line 1415 "cs.ATG" +#line 1418 "cs.ATG" SafeAdd(initializer, initializer.CreateExpressions, expr); } if (la.kind == 14) { @@ -3374,105 +3385,105 @@ out expr); } Expect(17); -#line 1419 "cs.ATG" +#line 1422 "cs.ATG" initializer.EndLocation = t.Location; outExpr = initializer; } void AssignmentOperator( -#line 1387 "cs.ATG" +#line 1390 "cs.ATG" out AssignmentOperatorType op) { -#line 1388 "cs.ATG" +#line 1391 "cs.ATG" op = AssignmentOperatorType.None; if (la.kind == 3) { lexer.NextToken(); -#line 1390 "cs.ATG" +#line 1393 "cs.ATG" op = AssignmentOperatorType.Assign; } else if (la.kind == 38) { lexer.NextToken(); -#line 1391 "cs.ATG" +#line 1394 "cs.ATG" op = AssignmentOperatorType.Add; } else if (la.kind == 39) { lexer.NextToken(); -#line 1392 "cs.ATG" +#line 1395 "cs.ATG" op = AssignmentOperatorType.Subtract; } else if (la.kind == 40) { lexer.NextToken(); -#line 1393 "cs.ATG" +#line 1396 "cs.ATG" op = AssignmentOperatorType.Multiply; } else if (la.kind == 41) { lexer.NextToken(); -#line 1394 "cs.ATG" +#line 1397 "cs.ATG" op = AssignmentOperatorType.Divide; } else if (la.kind == 42) { lexer.NextToken(); -#line 1395 "cs.ATG" +#line 1398 "cs.ATG" op = AssignmentOperatorType.Modulus; } else if (la.kind == 43) { lexer.NextToken(); -#line 1396 "cs.ATG" +#line 1399 "cs.ATG" op = AssignmentOperatorType.BitwiseAnd; } else if (la.kind == 44) { lexer.NextToken(); -#line 1397 "cs.ATG" +#line 1400 "cs.ATG" op = AssignmentOperatorType.BitwiseOr; } else if (la.kind == 45) { lexer.NextToken(); -#line 1398 "cs.ATG" +#line 1401 "cs.ATG" op = AssignmentOperatorType.ExclusiveOr; } else if (la.kind == 46) { lexer.NextToken(); -#line 1399 "cs.ATG" +#line 1402 "cs.ATG" op = AssignmentOperatorType.ShiftLeft; } else if ( -#line 1400 "cs.ATG" +#line 1403 "cs.ATG" la.kind == Tokens.GreaterThan && Peek(1).kind == Tokens.GreaterEqual) { Expect(22); Expect(35); -#line 1401 "cs.ATG" +#line 1404 "cs.ATG" op = AssignmentOperatorType.ShiftRight; } else SynErr(194); } void CollectionOrObjectInitializer( -#line 1422 "cs.ATG" +#line 1425 "cs.ATG" out Expression outExpr) { -#line 1424 "cs.ATG" +#line 1427 "cs.ATG" Expression expr = null; CollectionInitializerExpression initializer = new CollectionInitializerExpression(); Expect(16); -#line 1428 "cs.ATG" +#line 1431 "cs.ATG" initializer.StartLocation = t.Location; if (StartOf(31)) { ObjectPropertyInitializerOrVariableInitializer( -#line 1429 "cs.ATG" +#line 1432 "cs.ATG" out expr); -#line 1430 "cs.ATG" +#line 1433 "cs.ATG" SafeAdd(initializer, initializer.CreateExpressions, expr); while ( -#line 1431 "cs.ATG" +#line 1434 "cs.ATG" NotFinalComma()) { Expect(14); ObjectPropertyInitializerOrVariableInitializer( -#line 1432 "cs.ATG" +#line 1435 "cs.ATG" out expr); -#line 1433 "cs.ATG" +#line 1436 "cs.ATG" SafeAdd(initializer, initializer.CreateExpressions, expr); } if (la.kind == 14) { @@ -3481,280 +3492,280 @@ out expr); } Expect(17); -#line 1437 "cs.ATG" +#line 1440 "cs.ATG" initializer.EndLocation = t.Location; outExpr = initializer; } void ObjectPropertyInitializerOrVariableInitializer( -#line 1440 "cs.ATG" +#line 1443 "cs.ATG" out Expression expr) { -#line 1441 "cs.ATG" +#line 1444 "cs.ATG" expr = null; if ( -#line 1443 "cs.ATG" +#line 1446 "cs.ATG" IdentAndAsgn()) { Identifier(); -#line 1445 "cs.ATG" +#line 1448 "cs.ATG" NamedArgumentExpression nae = new NamedArgumentExpression(t.val, null); nae.StartLocation = t.Location; Expression r = null; Expect(3); if (la.kind == 16) { CollectionOrObjectInitializer( -#line 1449 "cs.ATG" +#line 1452 "cs.ATG" out r); } else if (StartOf(31)) { VariableInitializer( -#line 1450 "cs.ATG" +#line 1453 "cs.ATG" out r); } else SynErr(195); -#line 1451 "cs.ATG" +#line 1454 "cs.ATG" nae.Expression = r; nae.EndLocation = t.EndLocation; expr = nae; } else if (StartOf(31)) { VariableInitializer( -#line 1453 "cs.ATG" +#line 1456 "cs.ATG" out expr); } else SynErr(196); } void LocalVariableDecl( -#line 1457 "cs.ATG" +#line 1460 "cs.ATG" out Statement stmt) { -#line 1459 "cs.ATG" +#line 1462 "cs.ATG" TypeReference type; VariableDeclaration var = null; LocalVariableDeclaration localVariableDeclaration; Location startPos = la.Location; Type( -#line 1465 "cs.ATG" +#line 1468 "cs.ATG" out type); -#line 1465 "cs.ATG" +#line 1468 "cs.ATG" localVariableDeclaration = new LocalVariableDeclaration(type); localVariableDeclaration.StartLocation = startPos; LocalVariableDeclarator( -#line 1466 "cs.ATG" +#line 1469 "cs.ATG" out var); -#line 1466 "cs.ATG" +#line 1469 "cs.ATG" SafeAdd(localVariableDeclaration, localVariableDeclaration.Variables, var); while (la.kind == 14) { lexer.NextToken(); LocalVariableDeclarator( -#line 1467 "cs.ATG" +#line 1470 "cs.ATG" out var); -#line 1467 "cs.ATG" +#line 1470 "cs.ATG" SafeAdd(localVariableDeclaration, localVariableDeclaration.Variables, var); } -#line 1468 "cs.ATG" +#line 1471 "cs.ATG" stmt = localVariableDeclaration; stmt.EndLocation = t.EndLocation; } void LocalVariableDeclarator( -#line 1471 "cs.ATG" +#line 1474 "cs.ATG" out VariableDeclaration var) { -#line 1472 "cs.ATG" +#line 1475 "cs.ATG" Expression expr = null; Identifier(); -#line 1474 "cs.ATG" +#line 1477 "cs.ATG" var = new VariableDeclaration(t.val); var.StartLocation = t.Location; if (la.kind == 3) { lexer.NextToken(); VariableInitializer( -#line 1475 "cs.ATG" +#line 1478 "cs.ATG" out expr); -#line 1475 "cs.ATG" +#line 1478 "cs.ATG" var.Initializer = expr; } -#line 1476 "cs.ATG" +#line 1479 "cs.ATG" var.EndLocation = t.EndLocation; } void EmbeddedStatement( -#line 1511 "cs.ATG" +#line 1514 "cs.ATG" out Statement statement) { -#line 1513 "cs.ATG" +#line 1516 "cs.ATG" TypeReference type = null; Expression expr = null; Statement embeddedStatement = null; statement = null; -#line 1519 "cs.ATG" +#line 1522 "cs.ATG" Location startLocation = la.Location; if (la.kind == 16) { Block( -#line 1521 "cs.ATG" +#line 1524 "cs.ATG" out statement); } else if (la.kind == 11) { lexer.NextToken(); -#line 1524 "cs.ATG" +#line 1527 "cs.ATG" statement = new EmptyStatement(); } else if ( -#line 1527 "cs.ATG" +#line 1530 "cs.ATG" UnCheckedAndLBrace()) { -#line 1527 "cs.ATG" +#line 1530 "cs.ATG" Statement block; bool isChecked = true; if (la.kind == 58) { lexer.NextToken(); } else if (la.kind == 118) { lexer.NextToken(); -#line 1528 "cs.ATG" +#line 1531 "cs.ATG" isChecked = false; } else SynErr(197); Block( -#line 1529 "cs.ATG" +#line 1532 "cs.ATG" out block); -#line 1529 "cs.ATG" +#line 1532 "cs.ATG" statement = isChecked ? (Statement)new CheckedStatement(block) : (Statement)new UncheckedStatement(block); } else if (la.kind == 79) { IfStatement( -#line 1532 "cs.ATG" +#line 1535 "cs.ATG" out statement); } else if (la.kind == 110) { lexer.NextToken(); -#line 1534 "cs.ATG" +#line 1537 "cs.ATG" List switchSections = new List(); Expect(20); Expr( -#line 1535 "cs.ATG" +#line 1538 "cs.ATG" out expr); Expect(21); Expect(16); SwitchSections( -#line 1536 "cs.ATG" +#line 1539 "cs.ATG" switchSections); Expect(17); -#line 1538 "cs.ATG" +#line 1541 "cs.ATG" statement = new SwitchStatement(expr, switchSections); } else if (la.kind == 125) { lexer.NextToken(); Expect(20); Expr( -#line 1541 "cs.ATG" +#line 1544 "cs.ATG" out expr); Expect(21); EmbeddedStatement( -#line 1542 "cs.ATG" +#line 1545 "cs.ATG" out embeddedStatement); -#line 1543 "cs.ATG" +#line 1546 "cs.ATG" statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.Start); } else if (la.kind == 65) { lexer.NextToken(); EmbeddedStatement( -#line 1545 "cs.ATG" +#line 1548 "cs.ATG" out embeddedStatement); Expect(125); Expect(20); Expr( -#line 1546 "cs.ATG" +#line 1549 "cs.ATG" out expr); Expect(21); Expect(11); -#line 1547 "cs.ATG" +#line 1550 "cs.ATG" statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.End); } else if (la.kind == 76) { lexer.NextToken(); -#line 1549 "cs.ATG" +#line 1552 "cs.ATG" List initializer = null; List iterator = null; Expect(20); if (StartOf(6)) { ForInitializer( -#line 1550 "cs.ATG" +#line 1553 "cs.ATG" out initializer); } Expect(11); if (StartOf(6)) { Expr( -#line 1551 "cs.ATG" +#line 1554 "cs.ATG" out expr); } Expect(11); if (StartOf(6)) { ForIterator( -#line 1552 "cs.ATG" +#line 1555 "cs.ATG" out iterator); } Expect(21); EmbeddedStatement( -#line 1553 "cs.ATG" +#line 1556 "cs.ATG" out embeddedStatement); -#line 1554 "cs.ATG" +#line 1557 "cs.ATG" statement = new ForStatement(initializer, expr, iterator, embeddedStatement); } else if (la.kind == 77) { lexer.NextToken(); Expect(20); Type( -#line 1556 "cs.ATG" +#line 1559 "cs.ATG" out type); Identifier(); -#line 1556 "cs.ATG" +#line 1559 "cs.ATG" string varName = t.val; Expect(81); Expr( -#line 1557 "cs.ATG" +#line 1560 "cs.ATG" out expr); Expect(21); EmbeddedStatement( -#line 1558 "cs.ATG" +#line 1561 "cs.ATG" out embeddedStatement); -#line 1559 "cs.ATG" +#line 1562 "cs.ATG" statement = new ForeachStatement(type, varName , expr, embeddedStatement); } else if (la.kind == 53) { lexer.NextToken(); Expect(11); -#line 1562 "cs.ATG" +#line 1565 "cs.ATG" statement = new BreakStatement(); } else if (la.kind == 61) { lexer.NextToken(); Expect(11); -#line 1563 "cs.ATG" +#line 1566 "cs.ATG" statement = new ContinueStatement(); } else if (la.kind == 78) { GotoStatement( -#line 1564 "cs.ATG" +#line 1567 "cs.ATG" out statement); } else if ( -#line 1566 "cs.ATG" +#line 1569 "cs.ATG" IsYieldStatement()) { Expect(132); if (la.kind == 101) { lexer.NextToken(); Expr( -#line 1567 "cs.ATG" +#line 1570 "cs.ATG" out expr); -#line 1567 "cs.ATG" +#line 1570 "cs.ATG" statement = new YieldStatement(new ReturnStatement(expr)); } else if (la.kind == 53) { lexer.NextToken(); -#line 1568 "cs.ATG" +#line 1571 "cs.ATG" statement = new YieldStatement(new BreakStatement()); } else SynErr(198); Expect(11); @@ -3762,90 +3773,90 @@ out expr); lexer.NextToken(); if (StartOf(6)) { Expr( -#line 1571 "cs.ATG" +#line 1574 "cs.ATG" out expr); } Expect(11); -#line 1571 "cs.ATG" +#line 1574 "cs.ATG" statement = new ReturnStatement(expr); } else if (la.kind == 112) { lexer.NextToken(); if (StartOf(6)) { Expr( -#line 1572 "cs.ATG" +#line 1575 "cs.ATG" out expr); } Expect(11); -#line 1572 "cs.ATG" +#line 1575 "cs.ATG" statement = new ThrowStatement(expr); } else if (StartOf(6)) { StatementExpr( -#line 1575 "cs.ATG" +#line 1578 "cs.ATG" out statement); while (!(la.kind == 0 || la.kind == 11)) {SynErr(199); lexer.NextToken(); } Expect(11); } else if (la.kind == 114) { TryStatement( -#line 1578 "cs.ATG" +#line 1581 "cs.ATG" out statement); } else if (la.kind == 86) { lexer.NextToken(); Expect(20); Expr( -#line 1581 "cs.ATG" +#line 1584 "cs.ATG" out expr); Expect(21); EmbeddedStatement( -#line 1582 "cs.ATG" +#line 1585 "cs.ATG" out embeddedStatement); -#line 1582 "cs.ATG" +#line 1585 "cs.ATG" statement = new LockStatement(expr, embeddedStatement); } else if (la.kind == 121) { -#line 1585 "cs.ATG" +#line 1588 "cs.ATG" Statement resourceAcquisitionStmt = null; lexer.NextToken(); Expect(20); ResourceAcquisition( -#line 1587 "cs.ATG" +#line 1590 "cs.ATG" out resourceAcquisitionStmt); Expect(21); EmbeddedStatement( -#line 1588 "cs.ATG" +#line 1591 "cs.ATG" out embeddedStatement); -#line 1588 "cs.ATG" +#line 1591 "cs.ATG" statement = new UsingStatement(resourceAcquisitionStmt, embeddedStatement); } else if (la.kind == 119) { lexer.NextToken(); Block( -#line 1591 "cs.ATG" +#line 1594 "cs.ATG" out embeddedStatement); -#line 1591 "cs.ATG" +#line 1594 "cs.ATG" statement = new UnsafeStatement(embeddedStatement); } else if (la.kind == 74) { -#line 1593 "cs.ATG" +#line 1596 "cs.ATG" Statement pointerDeclarationStmt = null; lexer.NextToken(); Expect(20); ResourceAcquisition( -#line 1595 "cs.ATG" +#line 1598 "cs.ATG" out pointerDeclarationStmt); Expect(21); EmbeddedStatement( -#line 1596 "cs.ATG" +#line 1599 "cs.ATG" out embeddedStatement); -#line 1596 "cs.ATG" +#line 1599 "cs.ATG" statement = new FixedStatement(pointerDeclarationStmt, embeddedStatement); } else SynErr(200); -#line 1598 "cs.ATG" +#line 1601 "cs.ATG" if (statement != null) { statement.StartLocation = startLocation; statement.EndLocation = t.EndLocation; @@ -3854,10 +3865,10 @@ out embeddedStatement); } void IfStatement( -#line 1605 "cs.ATG" +#line 1608 "cs.ATG" out Statement statement) { -#line 1607 "cs.ATG" +#line 1610 "cs.ATG" Expression expr = null; Statement embeddedStatement = null; statement = null; @@ -3865,26 +3876,26 @@ out Statement statement) { Expect(79); Expect(20); Expr( -#line 1613 "cs.ATG" +#line 1616 "cs.ATG" out expr); Expect(21); EmbeddedStatement( -#line 1614 "cs.ATG" +#line 1617 "cs.ATG" out embeddedStatement); -#line 1615 "cs.ATG" +#line 1618 "cs.ATG" Statement elseStatement = null; if (la.kind == 67) { lexer.NextToken(); EmbeddedStatement( -#line 1616 "cs.ATG" +#line 1619 "cs.ATG" out elseStatement); } -#line 1617 "cs.ATG" +#line 1620 "cs.ATG" statement = elseStatement != null ? new IfElseStatement(expr, embeddedStatement, elseStatement) : new IfElseStatement(expr, embeddedStatement); -#line 1618 "cs.ATG" +#line 1621 "cs.ATG" if (elseStatement is IfElseStatement && (elseStatement as IfElseStatement).TrueStatement.Count == 1) { /* else if-section (otherwise we would have a BlockStatment) */ (statement as IfElseStatement).ElseIfSections.Add( @@ -3897,29 +3908,29 @@ out elseStatement); } void SwitchSections( -#line 1648 "cs.ATG" +#line 1651 "cs.ATG" List switchSections) { -#line 1650 "cs.ATG" +#line 1653 "cs.ATG" SwitchSection switchSection = new SwitchSection(); CaseLabel label; SwitchLabel( -#line 1654 "cs.ATG" +#line 1657 "cs.ATG" out label); -#line 1654 "cs.ATG" +#line 1657 "cs.ATG" SafeAdd(switchSection, switchSection.SwitchLabels, label); -#line 1655 "cs.ATG" +#line 1658 "cs.ATG" compilationUnit.BlockStart(switchSection); while (StartOf(32)) { if (la.kind == 55 || la.kind == 63) { SwitchLabel( -#line 1657 "cs.ATG" +#line 1660 "cs.ATG" out label); -#line 1658 "cs.ATG" +#line 1661 "cs.ATG" if (label != null) { if (switchSection.Children.Count > 0) { // open new section @@ -3935,145 +3946,145 @@ out label); } } -#line 1670 "cs.ATG" +#line 1673 "cs.ATG" compilationUnit.BlockEnd(); switchSections.Add(switchSection); } void ForInitializer( -#line 1629 "cs.ATG" +#line 1632 "cs.ATG" out List initializer) { -#line 1631 "cs.ATG" +#line 1634 "cs.ATG" Statement stmt; initializer = new List(); if ( -#line 1635 "cs.ATG" +#line 1638 "cs.ATG" IsLocalVarDecl()) { LocalVariableDecl( -#line 1635 "cs.ATG" +#line 1638 "cs.ATG" out stmt); -#line 1635 "cs.ATG" +#line 1638 "cs.ATG" initializer.Add(stmt); } else if (StartOf(6)) { StatementExpr( -#line 1636 "cs.ATG" +#line 1639 "cs.ATG" out stmt); -#line 1636 "cs.ATG" +#line 1639 "cs.ATG" initializer.Add(stmt); while (la.kind == 14) { lexer.NextToken(); StatementExpr( -#line 1636 "cs.ATG" +#line 1639 "cs.ATG" out stmt); -#line 1636 "cs.ATG" +#line 1639 "cs.ATG" initializer.Add(stmt); } } else SynErr(201); } void ForIterator( -#line 1639 "cs.ATG" +#line 1642 "cs.ATG" out List iterator) { -#line 1641 "cs.ATG" +#line 1644 "cs.ATG" Statement stmt; iterator = new List(); StatementExpr( -#line 1645 "cs.ATG" +#line 1648 "cs.ATG" out stmt); -#line 1645 "cs.ATG" +#line 1648 "cs.ATG" iterator.Add(stmt); while (la.kind == 14) { lexer.NextToken(); StatementExpr( -#line 1645 "cs.ATG" +#line 1648 "cs.ATG" out stmt); -#line 1645 "cs.ATG" +#line 1648 "cs.ATG" iterator.Add(stmt); } } void GotoStatement( -#line 1727 "cs.ATG" +#line 1730 "cs.ATG" out Statement stmt) { -#line 1728 "cs.ATG" +#line 1731 "cs.ATG" Expression expr; stmt = null; Expect(78); if (StartOf(19)) { Identifier(); -#line 1732 "cs.ATG" +#line 1735 "cs.ATG" stmt = new GotoStatement(t.val); Expect(11); } else if (la.kind == 55) { lexer.NextToken(); Expr( -#line 1733 "cs.ATG" +#line 1736 "cs.ATG" out expr); Expect(11); -#line 1733 "cs.ATG" +#line 1736 "cs.ATG" stmt = new GotoCaseStatement(expr); } else if (la.kind == 63) { lexer.NextToken(); Expect(11); -#line 1734 "cs.ATG" +#line 1737 "cs.ATG" stmt = new GotoCaseStatement(null); } else SynErr(202); } void StatementExpr( -#line 1754 "cs.ATG" +#line 1757 "cs.ATG" out Statement stmt) { -#line 1755 "cs.ATG" +#line 1758 "cs.ATG" Expression expr; Expr( -#line 1757 "cs.ATG" +#line 1760 "cs.ATG" out expr); -#line 1760 "cs.ATG" +#line 1763 "cs.ATG" stmt = new ExpressionStatement(expr); } void TryStatement( -#line 1680 "cs.ATG" +#line 1683 "cs.ATG" out Statement tryStatement) { -#line 1682 "cs.ATG" +#line 1685 "cs.ATG" Statement blockStmt = null, finallyStmt = null; CatchClause catchClause = null; List catchClauses = new List(); Expect(114); Block( -#line 1687 "cs.ATG" +#line 1690 "cs.ATG" out blockStmt); while (la.kind == 56) { CatchClause( -#line 1689 "cs.ATG" +#line 1692 "cs.ATG" out catchClause); -#line 1690 "cs.ATG" +#line 1693 "cs.ATG" if (catchClause != null) catchClauses.Add(catchClause); } if (la.kind == 73) { lexer.NextToken(); Block( -#line 1692 "cs.ATG" +#line 1695 "cs.ATG" out finallyStmt); } -#line 1694 "cs.ATG" +#line 1697 "cs.ATG" tryStatement = new TryCatchStatement(blockStmt, catchClauses, finallyStmt); if (catchClauses != null) { foreach (CatchClause cc in catchClauses) cc.Parent = tryStatement; @@ -4082,59 +4093,59 @@ out finallyStmt); } void ResourceAcquisition( -#line 1738 "cs.ATG" +#line 1741 "cs.ATG" out Statement stmt) { -#line 1740 "cs.ATG" +#line 1743 "cs.ATG" stmt = null; Expression expr; if ( -#line 1745 "cs.ATG" +#line 1748 "cs.ATG" IsLocalVarDecl()) { LocalVariableDecl( -#line 1745 "cs.ATG" +#line 1748 "cs.ATG" out stmt); } else if (StartOf(6)) { Expr( -#line 1746 "cs.ATG" +#line 1749 "cs.ATG" out expr); -#line 1750 "cs.ATG" +#line 1753 "cs.ATG" stmt = new ExpressionStatement(expr); } else SynErr(203); } void SwitchLabel( -#line 1673 "cs.ATG" +#line 1676 "cs.ATG" out CaseLabel label) { -#line 1674 "cs.ATG" +#line 1677 "cs.ATG" Expression expr = null; label = null; if (la.kind == 55) { lexer.NextToken(); Expr( -#line 1676 "cs.ATG" +#line 1679 "cs.ATG" out expr); Expect(9); -#line 1676 "cs.ATG" +#line 1679 "cs.ATG" label = new CaseLabel(expr); } else if (la.kind == 63) { lexer.NextToken(); Expect(9); -#line 1677 "cs.ATG" +#line 1680 "cs.ATG" label = new CaseLabel(); } else SynErr(204); } void CatchClause( -#line 1701 "cs.ATG" +#line 1704 "cs.ATG" out CatchClause catchClause) { Expect(56); -#line 1703 "cs.ATG" +#line 1706 "cs.ATG" string identifier; Statement stmt; TypeReference typeRef; @@ -4143,35 +4154,35 @@ out CatchClause catchClause) { if (la.kind == 16) { Block( -#line 1711 "cs.ATG" +#line 1714 "cs.ATG" out stmt); -#line 1711 "cs.ATG" +#line 1714 "cs.ATG" catchClause = new CatchClause(stmt); } else if (la.kind == 20) { lexer.NextToken(); ClassType( -#line 1714 "cs.ATG" +#line 1717 "cs.ATG" out typeRef, false); -#line 1714 "cs.ATG" +#line 1717 "cs.ATG" identifier = null; if (StartOf(19)) { Identifier(); -#line 1715 "cs.ATG" +#line 1718 "cs.ATG" identifier = t.val; } Expect(21); Block( -#line 1716 "cs.ATG" +#line 1719 "cs.ATG" out stmt); -#line 1717 "cs.ATG" +#line 1720 "cs.ATG" catchClause = new CatchClause(typeRef, identifier, stmt); } else SynErr(205); -#line 1720 "cs.ATG" +#line 1723 "cs.ATG" if (catchClause != null) { catchClause.StartLocation = startPos; catchClause.EndLocation = t.Location; @@ -4180,75 +4191,75 @@ out stmt); } void UnaryExpr( -#line 1789 "cs.ATG" +#line 1792 "cs.ATG" out Expression uExpr) { -#line 1791 "cs.ATG" +#line 1794 "cs.ATG" TypeReference type = null; Expression expr = null; ArrayList expressions = new ArrayList(); uExpr = null; while (StartOf(33) || -#line 1813 "cs.ATG" +#line 1816 "cs.ATG" IsTypeCast()) { if (la.kind == 4) { lexer.NextToken(); -#line 1800 "cs.ATG" +#line 1803 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Plus)); } else if (la.kind == 5) { lexer.NextToken(); -#line 1801 "cs.ATG" +#line 1804 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Minus)); } else if (la.kind == 24) { lexer.NextToken(); -#line 1802 "cs.ATG" +#line 1805 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Not)); } else if (la.kind == 27) { lexer.NextToken(); -#line 1803 "cs.ATG" +#line 1806 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.BitNot)); } else if (la.kind == 6) { lexer.NextToken(); -#line 1804 "cs.ATG" +#line 1807 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Dereference)); } else if (la.kind == 31) { lexer.NextToken(); -#line 1805 "cs.ATG" +#line 1808 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Increment)); } else if (la.kind == 32) { lexer.NextToken(); -#line 1806 "cs.ATG" +#line 1809 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Decrement)); } else if (la.kind == 28) { lexer.NextToken(); -#line 1807 "cs.ATG" +#line 1810 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.AddressOf)); } else { Expect(20); Type( -#line 1813 "cs.ATG" +#line 1816 "cs.ATG" out type); Expect(21); -#line 1813 "cs.ATG" +#line 1816 "cs.ATG" expressions.Add(new CastExpression(type)); } } if ( -#line 1818 "cs.ATG" +#line 1821 "cs.ATG" LastExpressionIsUnaryMinus(expressions) && IsMostNegativeIntegerWithoutTypeSuffix()) { Expect(2); -#line 1821 "cs.ATG" +#line 1824 "cs.ATG" expressions.RemoveAt(expressions.Count - 1); if (t.literalValue is uint) { expr = new PrimitiveExpression(int.MinValue, int.MinValue.ToString()); @@ -4260,11 +4271,11 @@ LastExpressionIsUnaryMinus(expressions) && IsMostNegativeIntegerWithoutTypeSuffi } else if (StartOf(34)) { PrimaryExpr( -#line 1830 "cs.ATG" +#line 1833 "cs.ATG" out expr); } else SynErr(206); -#line 1832 "cs.ATG" +#line 1835 "cs.ATG" for (int i = 0; i < expressions.Count; ++i) { Expression nextExpression = i + 1 < expressions.Count ? (Expression)expressions[i + 1] : expr; if (expressions[i] is CastExpression) { @@ -4282,325 +4293,325 @@ out expr); } void ConditionalOrExpr( -#line 2156 "cs.ATG" +#line 2159 "cs.ATG" ref Expression outExpr) { -#line 2157 "cs.ATG" +#line 2160 "cs.ATG" Expression expr; ConditionalAndExpr( -#line 2159 "cs.ATG" +#line 2162 "cs.ATG" ref outExpr); while (la.kind == 26) { lexer.NextToken(); UnaryExpr( -#line 2159 "cs.ATG" +#line 2162 "cs.ATG" out expr); ConditionalAndExpr( -#line 2159 "cs.ATG" +#line 2162 "cs.ATG" ref expr); -#line 2159 "cs.ATG" +#line 2162 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalOr, expr); } } void PrimaryExpr( -#line 1849 "cs.ATG" +#line 1852 "cs.ATG" out Expression pexpr) { -#line 1851 "cs.ATG" +#line 1854 "cs.ATG" TypeReference type = null; Expression expr; pexpr = null; -#line 1856 "cs.ATG" +#line 1859 "cs.ATG" Location startLocation = la.Location; if (la.kind == 113) { lexer.NextToken(); -#line 1858 "cs.ATG" +#line 1861 "cs.ATG" pexpr = new PrimitiveExpression(true, "true"); } else if (la.kind == 72) { lexer.NextToken(); -#line 1859 "cs.ATG" +#line 1862 "cs.ATG" pexpr = new PrimitiveExpression(false, "false"); } else if (la.kind == 90) { lexer.NextToken(); -#line 1860 "cs.ATG" +#line 1863 "cs.ATG" pexpr = new PrimitiveExpression(null, "null"); } else if (la.kind == 2) { lexer.NextToken(); -#line 1861 "cs.ATG" +#line 1864 "cs.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val) { LiteralFormat = t.literalFormat }; } else if ( -#line 1862 "cs.ATG" +#line 1865 "cs.ATG" StartOfQueryExpression()) { QueryExpression( -#line 1863 "cs.ATG" +#line 1866 "cs.ATG" out pexpr); } else if ( -#line 1864 "cs.ATG" +#line 1867 "cs.ATG" IdentAndDoubleColon()) { Identifier(); -#line 1865 "cs.ATG" +#line 1868 "cs.ATG" type = new TypeReference(t.val); Expect(10); -#line 1866 "cs.ATG" +#line 1869 "cs.ATG" pexpr = new TypeReferenceExpression(type); Identifier(); -#line 1867 "cs.ATG" +#line 1870 "cs.ATG" if (type.Type == "global") { type.IsGlobal = true; type.Type = t.val ?? "?"; } else type.Type += "." + (t.val ?? "?"); } else if (StartOf(19)) { Identifier(); -#line 1871 "cs.ATG" +#line 1874 "cs.ATG" pexpr = new IdentifierExpression(t.val); if (la.kind == 48 || -#line 1874 "cs.ATG" +#line 1877 "cs.ATG" IsGenericInSimpleNameOrMemberAccess()) { if (la.kind == 48) { ShortedLambdaExpression( -#line 1873 "cs.ATG" +#line 1876 "cs.ATG" (IdentifierExpression)pexpr, out pexpr); } else { -#line 1875 "cs.ATG" +#line 1878 "cs.ATG" List typeList; TypeArgumentList( -#line 1876 "cs.ATG" +#line 1879 "cs.ATG" out typeList, false); -#line 1877 "cs.ATG" +#line 1880 "cs.ATG" ((IdentifierExpression)pexpr).TypeArguments = typeList; } } } else if ( -#line 1879 "cs.ATG" +#line 1882 "cs.ATG" IsLambdaExpression()) { LambdaExpression( -#line 1880 "cs.ATG" +#line 1883 "cs.ATG" out pexpr); } else if (la.kind == 20) { lexer.NextToken(); Expr( -#line 1883 "cs.ATG" +#line 1886 "cs.ATG" out expr); Expect(21); -#line 1883 "cs.ATG" +#line 1886 "cs.ATG" pexpr = new ParenthesizedExpression(expr); } else if (StartOf(35)) { -#line 1886 "cs.ATG" +#line 1889 "cs.ATG" string val = null; switch (la.kind) { case 52: { lexer.NextToken(); -#line 1887 "cs.ATG" +#line 1890 "cs.ATG" val = "System.Boolean"; break; } case 54: { lexer.NextToken(); -#line 1888 "cs.ATG" +#line 1891 "cs.ATG" val = "System.Byte"; break; } case 57: { lexer.NextToken(); -#line 1889 "cs.ATG" +#line 1892 "cs.ATG" val = "System.Char"; break; } case 62: { lexer.NextToken(); -#line 1890 "cs.ATG" +#line 1893 "cs.ATG" val = "System.Decimal"; break; } case 66: { lexer.NextToken(); -#line 1891 "cs.ATG" +#line 1894 "cs.ATG" val = "System.Double"; break; } case 75: { lexer.NextToken(); -#line 1892 "cs.ATG" +#line 1895 "cs.ATG" val = "System.Single"; break; } case 82: { lexer.NextToken(); -#line 1893 "cs.ATG" +#line 1896 "cs.ATG" val = "System.Int32"; break; } case 87: { lexer.NextToken(); -#line 1894 "cs.ATG" +#line 1897 "cs.ATG" val = "System.Int64"; break; } case 91: { lexer.NextToken(); -#line 1895 "cs.ATG" +#line 1898 "cs.ATG" val = "System.Object"; break; } case 102: { lexer.NextToken(); -#line 1896 "cs.ATG" +#line 1899 "cs.ATG" val = "System.SByte"; break; } case 104: { lexer.NextToken(); -#line 1897 "cs.ATG" +#line 1900 "cs.ATG" val = "System.Int16"; break; } case 108: { lexer.NextToken(); -#line 1898 "cs.ATG" +#line 1901 "cs.ATG" val = "System.String"; break; } case 116: { lexer.NextToken(); -#line 1899 "cs.ATG" +#line 1902 "cs.ATG" val = "System.UInt32"; break; } case 117: { lexer.NextToken(); -#line 1900 "cs.ATG" +#line 1903 "cs.ATG" val = "System.UInt64"; break; } case 120: { lexer.NextToken(); -#line 1901 "cs.ATG" +#line 1904 "cs.ATG" val = "System.UInt16"; break; } case 123: { lexer.NextToken(); -#line 1902 "cs.ATG" +#line 1905 "cs.ATG" val = "System.Void"; break; } } -#line 1904 "cs.ATG" +#line 1907 "cs.ATG" pexpr = new TypeReferenceExpression(new TypeReference(val, true)) { StartLocation = t.Location, EndLocation = t.EndLocation }; } else if (la.kind == 111) { lexer.NextToken(); -#line 1907 "cs.ATG" +#line 1910 "cs.ATG" pexpr = new ThisReferenceExpression(); pexpr.StartLocation = t.Location; pexpr.EndLocation = t.EndLocation; } else if (la.kind == 51) { lexer.NextToken(); -#line 1909 "cs.ATG" +#line 1912 "cs.ATG" pexpr = new BaseReferenceExpression(); pexpr.StartLocation = t.Location; pexpr.EndLocation = t.EndLocation; } else if (la.kind == 89) { NewExpression( -#line 1912 "cs.ATG" +#line 1915 "cs.ATG" out pexpr); } else if (la.kind == 115) { lexer.NextToken(); Expect(20); if ( -#line 1916 "cs.ATG" +#line 1919 "cs.ATG" NotVoidPointer()) { Expect(123); -#line 1916 "cs.ATG" +#line 1919 "cs.ATG" type = new TypeReference("System.Void", true); } else if (StartOf(10)) { TypeWithRestriction( -#line 1917 "cs.ATG" +#line 1920 "cs.ATG" out type, true, true); } else SynErr(207); Expect(21); -#line 1919 "cs.ATG" +#line 1922 "cs.ATG" pexpr = new TypeOfExpression(type); } else if (la.kind == 63) { lexer.NextToken(); Expect(20); Type( -#line 1921 "cs.ATG" +#line 1924 "cs.ATG" out type); Expect(21); -#line 1921 "cs.ATG" +#line 1924 "cs.ATG" pexpr = new DefaultValueExpression(type); } else if (la.kind == 105) { lexer.NextToken(); Expect(20); Type( -#line 1922 "cs.ATG" +#line 1925 "cs.ATG" out type); Expect(21); -#line 1922 "cs.ATG" +#line 1925 "cs.ATG" pexpr = new SizeOfExpression(type); } else if (la.kind == 58) { lexer.NextToken(); Expect(20); Expr( -#line 1923 "cs.ATG" +#line 1926 "cs.ATG" out expr); Expect(21); -#line 1923 "cs.ATG" +#line 1926 "cs.ATG" pexpr = new CheckedExpression(expr); } else if (la.kind == 118) { lexer.NextToken(); Expect(20); Expr( -#line 1924 "cs.ATG" +#line 1927 "cs.ATG" out expr); Expect(21); -#line 1924 "cs.ATG" +#line 1927 "cs.ATG" pexpr = new UncheckedExpression(expr); } else if (la.kind == 64) { lexer.NextToken(); AnonymousMethodExpr( -#line 1925 "cs.ATG" +#line 1928 "cs.ATG" out expr); -#line 1925 "cs.ATG" +#line 1928 "cs.ATG" pexpr = expr; } else SynErr(208); -#line 1927 "cs.ATG" +#line 1930 "cs.ATG" if (pexpr != null) { if (pexpr.StartLocation.IsEmpty) pexpr.StartLocation = startLocation; @@ -4610,57 +4621,57 @@ out expr); while (StartOf(36)) { -#line 1935 "cs.ATG" +#line 1938 "cs.ATG" startLocation = la.Location; switch (la.kind) { case 31: { lexer.NextToken(); -#line 1937 "cs.ATG" +#line 1940 "cs.ATG" pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostIncrement); break; } case 32: { lexer.NextToken(); -#line 1939 "cs.ATG" +#line 1942 "cs.ATG" pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostDecrement); break; } case 47: { PointerMemberAccess( -#line 1941 "cs.ATG" +#line 1944 "cs.ATG" out pexpr, pexpr); break; } case 15: { MemberAccess( -#line 1942 "cs.ATG" +#line 1945 "cs.ATG" out pexpr, pexpr); break; } case 20: { lexer.NextToken(); -#line 1946 "cs.ATG" +#line 1949 "cs.ATG" List parameters = new List(); -#line 1947 "cs.ATG" +#line 1950 "cs.ATG" pexpr = new InvocationExpression(pexpr, parameters); if (StartOf(26)) { Argument( -#line 1948 "cs.ATG" +#line 1951 "cs.ATG" out expr); -#line 1948 "cs.ATG" +#line 1951 "cs.ATG" SafeAdd(pexpr, parameters, expr); while (la.kind == 14) { lexer.NextToken(); Argument( -#line 1949 "cs.ATG" +#line 1952 "cs.ATG" out expr); -#line 1949 "cs.ATG" +#line 1952 "cs.ATG" SafeAdd(pexpr, parameters, expr); } } @@ -4669,24 +4680,24 @@ out expr); } case 18: { -#line 1955 "cs.ATG" +#line 1958 "cs.ATG" List indices = new List(); pexpr = new IndexerExpression(pexpr, indices); lexer.NextToken(); Expr( -#line 1958 "cs.ATG" +#line 1961 "cs.ATG" out expr); -#line 1958 "cs.ATG" +#line 1961 "cs.ATG" SafeAdd(pexpr, indices, expr); while (la.kind == 14) { lexer.NextToken(); Expr( -#line 1959 "cs.ATG" +#line 1962 "cs.ATG" out expr); -#line 1959 "cs.ATG" +#line 1962 "cs.ATG" SafeAdd(pexpr, indices, expr); } Expect(19); @@ -4694,7 +4705,7 @@ out expr); } } -#line 1962 "cs.ATG" +#line 1965 "cs.ATG" if (pexpr != null) { if (pexpr.StartLocation.IsEmpty) pexpr.StartLocation = startLocation; @@ -4706,83 +4717,83 @@ out expr); } void QueryExpression( -#line 2394 "cs.ATG" +#line 2397 "cs.ATG" out Expression outExpr) { -#line 2395 "cs.ATG" +#line 2398 "cs.ATG" QueryExpression q = new QueryExpression(); outExpr = q; q.StartLocation = la.Location; QueryExpressionFromClause fromClause; QueryExpressionFromClause( -#line 2399 "cs.ATG" +#line 2402 "cs.ATG" out fromClause); -#line 2399 "cs.ATG" +#line 2402 "cs.ATG" q.FromClause = fromClause; QueryExpressionBody( -#line 2400 "cs.ATG" +#line 2403 "cs.ATG" ref q); -#line 2401 "cs.ATG" +#line 2404 "cs.ATG" q.EndLocation = t.EndLocation; outExpr = q; /* set outExpr to q again if QueryExpressionBody changed it (can happen with 'into' clauses) */ } void ShortedLambdaExpression( -#line 2076 "cs.ATG" +#line 2079 "cs.ATG" IdentifierExpression ident, out Expression pexpr) { -#line 2077 "cs.ATG" +#line 2080 "cs.ATG" LambdaExpression lambda = new LambdaExpression(); pexpr = lambda; Expect(48); -#line 2082 "cs.ATG" +#line 2085 "cs.ATG" lambda.StartLocation = ident.StartLocation; SafeAdd(lambda, lambda.Parameters, new ParameterDeclarationExpression(null, ident.Identifier)); lambda.Parameters[0].StartLocation = ident.StartLocation; lambda.Parameters[0].EndLocation = ident.EndLocation; LambdaExpressionBody( -#line 2087 "cs.ATG" +#line 2090 "cs.ATG" lambda); } void TypeArgumentList( -#line 2328 "cs.ATG" +#line 2331 "cs.ATG" out List types, bool canBeUnbound) { -#line 2330 "cs.ATG" +#line 2333 "cs.ATG" types = new List(); TypeReference type = null; Expect(23); if ( -#line 2335 "cs.ATG" +#line 2338 "cs.ATG" canBeUnbound && (la.kind == Tokens.GreaterThan || la.kind == Tokens.Comma)) { -#line 2336 "cs.ATG" +#line 2339 "cs.ATG" types.Add(TypeReference.Null); while (la.kind == 14) { lexer.NextToken(); -#line 2337 "cs.ATG" +#line 2340 "cs.ATG" types.Add(TypeReference.Null); } } else if (StartOf(10)) { Type( -#line 2338 "cs.ATG" +#line 2341 "cs.ATG" out type); -#line 2338 "cs.ATG" +#line 2341 "cs.ATG" if (type != null) { types.Add(type); } while (la.kind == 14) { lexer.NextToken(); Type( -#line 2339 "cs.ATG" +#line 2342 "cs.ATG" out type); -#line 2339 "cs.ATG" +#line 2342 "cs.ATG" if (type != null) { types.Add(type); } } } else SynErr(209); @@ -4790,10 +4801,10 @@ out type); } void LambdaExpression( -#line 2056 "cs.ATG" +#line 2059 "cs.ATG" out Expression outExpr) { -#line 2058 "cs.ATG" +#line 2061 "cs.ATG" LambdaExpression lambda = new LambdaExpression(); lambda.StartLocation = la.Location; ParameterDeclarationExpression p; @@ -4802,33 +4813,33 @@ out Expression outExpr) { Expect(20); if (StartOf(18)) { LambdaExpressionParameter( -#line 2066 "cs.ATG" +#line 2069 "cs.ATG" out p); -#line 2066 "cs.ATG" +#line 2069 "cs.ATG" SafeAdd(lambda, lambda.Parameters, p); while (la.kind == 14) { lexer.NextToken(); LambdaExpressionParameter( -#line 2068 "cs.ATG" +#line 2071 "cs.ATG" out p); -#line 2068 "cs.ATG" +#line 2071 "cs.ATG" SafeAdd(lambda, lambda.Parameters, p); } } Expect(21); Expect(48); LambdaExpressionBody( -#line 2073 "cs.ATG" +#line 2076 "cs.ATG" lambda); } void NewExpression( -#line 2003 "cs.ATG" +#line 2006 "cs.ATG" out Expression pexpr) { -#line 2004 "cs.ATG" +#line 2007 "cs.ATG" pexpr = null; List parameters = new List(); TypeReference type = null; @@ -4837,65 +4848,65 @@ out Expression pexpr) { Expect(89); if (StartOf(10)) { NonArrayType( -#line 2011 "cs.ATG" +#line 2014 "cs.ATG" out type); } if (la.kind == 16 || la.kind == 20) { if (la.kind == 20) { -#line 2017 "cs.ATG" +#line 2020 "cs.ATG" ObjectCreateExpression oce = new ObjectCreateExpression(type, parameters); lexer.NextToken(); -#line 2018 "cs.ATG" +#line 2021 "cs.ATG" if (type == null) Error("Cannot use an anonymous type with arguments for the constructor"); if (StartOf(26)) { Argument( -#line 2019 "cs.ATG" +#line 2022 "cs.ATG" out expr); -#line 2019 "cs.ATG" +#line 2022 "cs.ATG" SafeAdd(oce, parameters, expr); while (la.kind == 14) { lexer.NextToken(); Argument( -#line 2020 "cs.ATG" +#line 2023 "cs.ATG" out expr); -#line 2020 "cs.ATG" +#line 2023 "cs.ATG" SafeAdd(oce, parameters, expr); } } Expect(21); -#line 2022 "cs.ATG" +#line 2025 "cs.ATG" pexpr = oce; if (la.kind == 16) { CollectionOrObjectInitializer( -#line 2023 "cs.ATG" +#line 2026 "cs.ATG" out expr); -#line 2023 "cs.ATG" +#line 2026 "cs.ATG" oce.ObjectInitializer = (CollectionInitializerExpression)expr; } } else { -#line 2024 "cs.ATG" +#line 2027 "cs.ATG" ObjectCreateExpression oce = new ObjectCreateExpression(type, parameters); CollectionOrObjectInitializer( -#line 2025 "cs.ATG" +#line 2028 "cs.ATG" out expr); -#line 2025 "cs.ATG" +#line 2028 "cs.ATG" oce.ObjectInitializer = (CollectionInitializerExpression)expr; -#line 2026 "cs.ATG" +#line 2029 "cs.ATG" pexpr = oce; } } else if (la.kind == 18) { lexer.NextToken(); -#line 2031 "cs.ATG" +#line 2034 "cs.ATG" ArrayCreateExpression ace = new ArrayCreateExpression(type); /* we must not change RankSpecifier on the null type reference*/ if (ace.CreateType.IsNull) { ace.CreateType = new TypeReference(""); } @@ -4906,80 +4917,80 @@ out expr); while (la.kind == 14) { lexer.NextToken(); -#line 2038 "cs.ATG" +#line 2041 "cs.ATG" dims += 1; } Expect(19); -#line 2039 "cs.ATG" +#line 2042 "cs.ATG" ranks.Add(dims); dims = 0; while (la.kind == 18) { lexer.NextToken(); while (la.kind == 14) { lexer.NextToken(); -#line 2040 "cs.ATG" +#line 2043 "cs.ATG" ++dims; } Expect(19); -#line 2040 "cs.ATG" +#line 2043 "cs.ATG" ranks.Add(dims); dims = 0; } -#line 2041 "cs.ATG" +#line 2044 "cs.ATG" ace.CreateType.RankSpecifier = ranks.ToArray(); CollectionInitializer( -#line 2042 "cs.ATG" +#line 2045 "cs.ATG" out expr); -#line 2042 "cs.ATG" +#line 2045 "cs.ATG" ace.ArrayInitializer = (CollectionInitializerExpression)expr; } else if (StartOf(6)) { Expr( -#line 2043 "cs.ATG" +#line 2046 "cs.ATG" out expr); -#line 2043 "cs.ATG" +#line 2046 "cs.ATG" if (expr != null) parameters.Add(expr); while (la.kind == 14) { lexer.NextToken(); -#line 2044 "cs.ATG" +#line 2047 "cs.ATG" dims += 1; Expr( -#line 2045 "cs.ATG" +#line 2048 "cs.ATG" out expr); -#line 2045 "cs.ATG" +#line 2048 "cs.ATG" if (expr != null) parameters.Add(expr); } Expect(19); -#line 2047 "cs.ATG" +#line 2050 "cs.ATG" ranks.Add(dims); ace.Arguments = parameters; dims = 0; while (la.kind == 18) { lexer.NextToken(); while (la.kind == 14) { lexer.NextToken(); -#line 2048 "cs.ATG" +#line 2051 "cs.ATG" ++dims; } Expect(19); -#line 2048 "cs.ATG" +#line 2051 "cs.ATG" ranks.Add(dims); dims = 0; } -#line 2049 "cs.ATG" +#line 2052 "cs.ATG" ace.CreateType.RankSpecifier = ranks.ToArray(); if (la.kind == 16) { CollectionInitializer( -#line 2050 "cs.ATG" +#line 2053 "cs.ATG" out expr); -#line 2050 "cs.ATG" +#line 2053 "cs.ATG" ace.ArrayInitializer = (CollectionInitializerExpression)expr; } } else SynErr(210); @@ -4987,10 +4998,10 @@ out expr); } void AnonymousMethodExpr( -#line 2123 "cs.ATG" +#line 2126 "cs.ATG" out Expression outExpr) { -#line 2125 "cs.ATG" +#line 2128 "cs.ATG" AnonymousMethodExpression expr = new AnonymousMethodExpression(); expr.StartLocation = t.Location; BlockStatement stmt; @@ -5001,59 +5012,59 @@ out Expression outExpr) { lexer.NextToken(); if (StartOf(11)) { FormalParameterList( -#line 2134 "cs.ATG" +#line 2137 "cs.ATG" p); -#line 2134 "cs.ATG" +#line 2137 "cs.ATG" expr.Parameters = p; } Expect(21); -#line 2136 "cs.ATG" +#line 2139 "cs.ATG" expr.HasParameterList = true; } BlockInsideExpression( -#line 2138 "cs.ATG" +#line 2141 "cs.ATG" out stmt); -#line 2138 "cs.ATG" +#line 2141 "cs.ATG" expr.Body = stmt; -#line 2139 "cs.ATG" +#line 2142 "cs.ATG" expr.EndLocation = t.Location; } void PointerMemberAccess( -#line 1991 "cs.ATG" +#line 1994 "cs.ATG" out Expression expr, Expression target) { -#line 1992 "cs.ATG" +#line 1995 "cs.ATG" List typeList; Expect(47); Identifier(); -#line 1996 "cs.ATG" +#line 1999 "cs.ATG" expr = new PointerReferenceExpression(target, t.val); expr.StartLocation = t.Location; expr.EndLocation = t.EndLocation; if ( -#line 1997 "cs.ATG" +#line 2000 "cs.ATG" IsGenericInSimpleNameOrMemberAccess()) { TypeArgumentList( -#line 1998 "cs.ATG" +#line 2001 "cs.ATG" out typeList, false); -#line 1999 "cs.ATG" +#line 2002 "cs.ATG" ((MemberReferenceExpression)expr).TypeArguments = typeList; } } void MemberAccess( -#line 1972 "cs.ATG" +#line 1975 "cs.ATG" out Expression expr, Expression target) { -#line 1973 "cs.ATG" +#line 1976 "cs.ATG" List typeList; -#line 1975 "cs.ATG" +#line 1978 "cs.ATG" if (ShouldConvertTargetExpressionToTypeReference(target)) { TypeReference type = GetTypeReferenceFromExpression(target); if (type != null) { @@ -5063,39 +5074,39 @@ out Expression expr, Expression target) { Expect(15); -#line 1982 "cs.ATG" +#line 1985 "cs.ATG" Location startLocation = t.Location; Identifier(); -#line 1984 "cs.ATG" +#line 1987 "cs.ATG" expr = new MemberReferenceExpression(target, t.val); expr.StartLocation = startLocation; expr.EndLocation = t.EndLocation; if ( -#line 1985 "cs.ATG" +#line 1988 "cs.ATG" IsGenericInSimpleNameOrMemberAccess()) { TypeArgumentList( -#line 1986 "cs.ATG" +#line 1989 "cs.ATG" out typeList, false); -#line 1987 "cs.ATG" +#line 1990 "cs.ATG" ((MemberReferenceExpression)expr).TypeArguments = typeList; } } void LambdaExpressionParameter( -#line 2090 "cs.ATG" +#line 2093 "cs.ATG" out ParameterDeclarationExpression p) { -#line 2091 "cs.ATG" +#line 2094 "cs.ATG" Location start = la.Location; p = null; TypeReference type; ParameterModifiers mod = ParameterModifiers.In; if ( -#line 2096 "cs.ATG" +#line 2099 "cs.ATG" Peek(1).kind == Tokens.Comma || Peek(1).kind == Tokens.CloseParenthesis) { Identifier(); -#line 2098 "cs.ATG" +#line 2101 "cs.ATG" p = new ParameterDeclarationExpression(null, t.val); p.StartLocation = start; p.EndLocation = t.EndLocation; @@ -5104,21 +5115,21 @@ Peek(1).kind == Tokens.Comma || Peek(1).kind == Tokens.CloseParenthesis) { if (la.kind == 100) { lexer.NextToken(); -#line 2101 "cs.ATG" +#line 2104 "cs.ATG" mod = ParameterModifiers.Ref; } else { lexer.NextToken(); -#line 2102 "cs.ATG" +#line 2105 "cs.ATG" mod = ParameterModifiers.Out; } } Type( -#line 2104 "cs.ATG" +#line 2107 "cs.ATG" out type); Identifier(); -#line 2106 "cs.ATG" +#line 2109 "cs.ATG" p = new ParameterDeclarationExpression(type, t.val, mod); p.StartLocation = start; p.EndLocation = t.EndLocation; @@ -5126,263 +5137,263 @@ out type); } void LambdaExpressionBody( -#line 2112 "cs.ATG" +#line 2115 "cs.ATG" LambdaExpression lambda) { -#line 2113 "cs.ATG" +#line 2116 "cs.ATG" Expression expr; BlockStatement stmt; if (la.kind == 16) { BlockInsideExpression( -#line 2116 "cs.ATG" +#line 2119 "cs.ATG" out stmt); -#line 2116 "cs.ATG" +#line 2119 "cs.ATG" lambda.StatementBody = stmt; } else if (StartOf(6)) { Expr( -#line 2117 "cs.ATG" +#line 2120 "cs.ATG" out expr); -#line 2117 "cs.ATG" +#line 2120 "cs.ATG" lambda.ExpressionBody = expr; } else SynErr(213); -#line 2119 "cs.ATG" +#line 2122 "cs.ATG" lambda.EndLocation = t.EndLocation; -#line 2120 "cs.ATG" +#line 2123 "cs.ATG" lambda.ExtendedEndLocation = la.Location; } void BlockInsideExpression( -#line 2142 "cs.ATG" +#line 2145 "cs.ATG" out BlockStatement outStmt) { -#line 2143 "cs.ATG" +#line 2146 "cs.ATG" Statement stmt = null; outStmt = null; -#line 2147 "cs.ATG" +#line 2150 "cs.ATG" if (compilationUnit != null) { Block( -#line 2148 "cs.ATG" +#line 2151 "cs.ATG" out stmt); -#line 2148 "cs.ATG" +#line 2151 "cs.ATG" outStmt = (BlockStatement)stmt; -#line 2149 "cs.ATG" +#line 2152 "cs.ATG" } else { Expect(16); -#line 2151 "cs.ATG" +#line 2154 "cs.ATG" lexer.SkipCurrentBlock(0); Expect(17); -#line 2153 "cs.ATG" +#line 2156 "cs.ATG" } } void ConditionalAndExpr( -#line 2162 "cs.ATG" +#line 2165 "cs.ATG" ref Expression outExpr) { -#line 2163 "cs.ATG" +#line 2166 "cs.ATG" Expression expr; InclusiveOrExpr( -#line 2165 "cs.ATG" +#line 2168 "cs.ATG" ref outExpr); while (la.kind == 25) { lexer.NextToken(); UnaryExpr( -#line 2165 "cs.ATG" +#line 2168 "cs.ATG" out expr); InclusiveOrExpr( -#line 2165 "cs.ATG" +#line 2168 "cs.ATG" ref expr); -#line 2165 "cs.ATG" +#line 2168 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalAnd, expr); } } void InclusiveOrExpr( -#line 2168 "cs.ATG" +#line 2171 "cs.ATG" ref Expression outExpr) { -#line 2169 "cs.ATG" +#line 2172 "cs.ATG" Expression expr; ExclusiveOrExpr( -#line 2171 "cs.ATG" +#line 2174 "cs.ATG" ref outExpr); while (la.kind == 29) { lexer.NextToken(); UnaryExpr( -#line 2171 "cs.ATG" +#line 2174 "cs.ATG" out expr); ExclusiveOrExpr( -#line 2171 "cs.ATG" +#line 2174 "cs.ATG" ref expr); -#line 2171 "cs.ATG" +#line 2174 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseOr, expr); } } void ExclusiveOrExpr( -#line 2174 "cs.ATG" +#line 2177 "cs.ATG" ref Expression outExpr) { -#line 2175 "cs.ATG" +#line 2178 "cs.ATG" Expression expr; AndExpr( -#line 2177 "cs.ATG" +#line 2180 "cs.ATG" ref outExpr); while (la.kind == 30) { lexer.NextToken(); UnaryExpr( -#line 2177 "cs.ATG" +#line 2180 "cs.ATG" out expr); AndExpr( -#line 2177 "cs.ATG" +#line 2180 "cs.ATG" ref expr); -#line 2177 "cs.ATG" +#line 2180 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.ExclusiveOr, expr); } } void AndExpr( -#line 2180 "cs.ATG" +#line 2183 "cs.ATG" ref Expression outExpr) { -#line 2181 "cs.ATG" +#line 2184 "cs.ATG" Expression expr; EqualityExpr( -#line 2183 "cs.ATG" +#line 2186 "cs.ATG" ref outExpr); while (la.kind == 28) { lexer.NextToken(); UnaryExpr( -#line 2183 "cs.ATG" +#line 2186 "cs.ATG" out expr); EqualityExpr( -#line 2183 "cs.ATG" +#line 2186 "cs.ATG" ref expr); -#line 2183 "cs.ATG" +#line 2186 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseAnd, expr); } } void EqualityExpr( -#line 2186 "cs.ATG" +#line 2189 "cs.ATG" ref Expression outExpr) { -#line 2188 "cs.ATG" +#line 2191 "cs.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; RelationalExpr( -#line 2192 "cs.ATG" +#line 2195 "cs.ATG" ref outExpr); while (la.kind == 33 || la.kind == 34) { if (la.kind == 34) { lexer.NextToken(); -#line 2195 "cs.ATG" +#line 2198 "cs.ATG" op = BinaryOperatorType.InEquality; } else { lexer.NextToken(); -#line 2196 "cs.ATG" +#line 2199 "cs.ATG" op = BinaryOperatorType.Equality; } UnaryExpr( -#line 2198 "cs.ATG" +#line 2201 "cs.ATG" out expr); RelationalExpr( -#line 2198 "cs.ATG" +#line 2201 "cs.ATG" ref expr); -#line 2198 "cs.ATG" +#line 2201 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void RelationalExpr( -#line 2202 "cs.ATG" +#line 2205 "cs.ATG" ref Expression outExpr) { -#line 2204 "cs.ATG" +#line 2207 "cs.ATG" TypeReference type; Expression expr; BinaryOperatorType op = BinaryOperatorType.None; ShiftExpr( -#line 2209 "cs.ATG" +#line 2212 "cs.ATG" ref outExpr); while (StartOf(37)) { if (StartOf(38)) { if (la.kind == 23) { lexer.NextToken(); -#line 2211 "cs.ATG" +#line 2214 "cs.ATG" op = BinaryOperatorType.LessThan; } else if (la.kind == 22) { lexer.NextToken(); -#line 2212 "cs.ATG" +#line 2215 "cs.ATG" op = BinaryOperatorType.GreaterThan; } else if (la.kind == 36) { lexer.NextToken(); -#line 2213 "cs.ATG" +#line 2216 "cs.ATG" op = BinaryOperatorType.LessThanOrEqual; } else if (la.kind == 35) { lexer.NextToken(); -#line 2214 "cs.ATG" +#line 2217 "cs.ATG" op = BinaryOperatorType.GreaterThanOrEqual; } else SynErr(214); UnaryExpr( -#line 2216 "cs.ATG" +#line 2219 "cs.ATG" out expr); ShiftExpr( -#line 2217 "cs.ATG" +#line 2220 "cs.ATG" ref expr); -#line 2218 "cs.ATG" +#line 2221 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } else { if (la.kind == 85) { lexer.NextToken(); TypeWithRestriction( -#line 2221 "cs.ATG" +#line 2224 "cs.ATG" out type, false, false); if ( -#line 2222 "cs.ATG" +#line 2225 "cs.ATG" la.kind == Tokens.Question && !IsPossibleExpressionStart(Peek(1).kind)) { NullableQuestionMark( -#line 2223 "cs.ATG" +#line 2226 "cs.ATG" ref type); } -#line 2224 "cs.ATG" +#line 2227 "cs.ATG" outExpr = new TypeOfIsExpression(outExpr, type); } else if (la.kind == 50) { lexer.NextToken(); TypeWithRestriction( -#line 2226 "cs.ATG" +#line 2229 "cs.ATG" out type, false, false); if ( -#line 2227 "cs.ATG" +#line 2230 "cs.ATG" la.kind == Tokens.Question && !IsPossibleExpressionStart(Peek(1).kind)) { NullableQuestionMark( -#line 2228 "cs.ATG" +#line 2231 "cs.ATG" ref type); } -#line 2229 "cs.ATG" +#line 2232 "cs.ATG" outExpr = new CastExpression(type, outExpr, CastType.TryCast); } else SynErr(215); } @@ -5390,83 +5401,83 @@ ref type); } void ShiftExpr( -#line 2234 "cs.ATG" +#line 2237 "cs.ATG" ref Expression outExpr) { -#line 2236 "cs.ATG" +#line 2239 "cs.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; AdditiveExpr( -#line 2240 "cs.ATG" +#line 2243 "cs.ATG" ref outExpr); while (la.kind == 37 || -#line 2243 "cs.ATG" +#line 2246 "cs.ATG" IsShiftRight()) { if (la.kind == 37) { lexer.NextToken(); -#line 2242 "cs.ATG" +#line 2245 "cs.ATG" op = BinaryOperatorType.ShiftLeft; } else { Expect(22); Expect(22); -#line 2244 "cs.ATG" +#line 2247 "cs.ATG" op = BinaryOperatorType.ShiftRight; } UnaryExpr( -#line 2247 "cs.ATG" +#line 2250 "cs.ATG" out expr); AdditiveExpr( -#line 2247 "cs.ATG" +#line 2250 "cs.ATG" ref expr); -#line 2247 "cs.ATG" +#line 2250 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void AdditiveExpr( -#line 2251 "cs.ATG" +#line 2254 "cs.ATG" ref Expression outExpr) { -#line 2253 "cs.ATG" +#line 2256 "cs.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; MultiplicativeExpr( -#line 2257 "cs.ATG" +#line 2260 "cs.ATG" ref outExpr); while (la.kind == 4 || la.kind == 5) { if (la.kind == 4) { lexer.NextToken(); -#line 2260 "cs.ATG" +#line 2263 "cs.ATG" op = BinaryOperatorType.Add; } else { lexer.NextToken(); -#line 2261 "cs.ATG" +#line 2264 "cs.ATG" op = BinaryOperatorType.Subtract; } UnaryExpr( -#line 2263 "cs.ATG" +#line 2266 "cs.ATG" out expr); MultiplicativeExpr( -#line 2263 "cs.ATG" +#line 2266 "cs.ATG" ref expr); -#line 2263 "cs.ATG" +#line 2266 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void MultiplicativeExpr( -#line 2267 "cs.ATG" +#line 2270 "cs.ATG" ref Expression outExpr) { -#line 2269 "cs.ATG" +#line 2272 "cs.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; @@ -5474,82 +5485,82 @@ ref Expression outExpr) { if (la.kind == 6) { lexer.NextToken(); -#line 2275 "cs.ATG" +#line 2278 "cs.ATG" op = BinaryOperatorType.Multiply; } else if (la.kind == 7) { lexer.NextToken(); -#line 2276 "cs.ATG" +#line 2279 "cs.ATG" op = BinaryOperatorType.Divide; } else { lexer.NextToken(); -#line 2277 "cs.ATG" +#line 2280 "cs.ATG" op = BinaryOperatorType.Modulus; } UnaryExpr( -#line 2279 "cs.ATG" +#line 2282 "cs.ATG" out expr); -#line 2279 "cs.ATG" +#line 2282 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void TypeParameterConstraintsClauseBase( -#line 2385 "cs.ATG" +#line 2388 "cs.ATG" out TypeReference type) { -#line 2386 "cs.ATG" +#line 2389 "cs.ATG" TypeReference t; type = null; if (la.kind == 109) { lexer.NextToken(); -#line 2388 "cs.ATG" +#line 2391 "cs.ATG" type = TypeReference.StructConstraint; } else if (la.kind == 59) { lexer.NextToken(); -#line 2389 "cs.ATG" +#line 2392 "cs.ATG" type = TypeReference.ClassConstraint; } else if (la.kind == 89) { lexer.NextToken(); Expect(20); Expect(21); -#line 2390 "cs.ATG" +#line 2393 "cs.ATG" type = TypeReference.NewConstraint; } else if (StartOf(10)) { Type( -#line 2391 "cs.ATG" +#line 2394 "cs.ATG" out t); -#line 2391 "cs.ATG" +#line 2394 "cs.ATG" type = t; } else SynErr(216); } void QueryExpressionFromClause( -#line 2406 "cs.ATG" +#line 2409 "cs.ATG" out QueryExpressionFromClause fc) { -#line 2407 "cs.ATG" +#line 2410 "cs.ATG" fc = new QueryExpressionFromClause(); fc.StartLocation = la.Location; Expect(137); QueryExpressionFromOrJoinClause( -#line 2411 "cs.ATG" +#line 2414 "cs.ATG" fc); -#line 2412 "cs.ATG" +#line 2415 "cs.ATG" fc.EndLocation = t.EndLocation; } void QueryExpressionBody( -#line 2442 "cs.ATG" +#line 2445 "cs.ATG" ref QueryExpression q) { -#line 2443 "cs.ATG" +#line 2446 "cs.ATG" QueryExpressionFromClause fromClause; QueryExpressionWhereClause whereClause; QueryExpressionLetClause letClause; QueryExpressionJoinClause joinClause; QueryExpressionOrderClause orderClause; @@ -5558,249 +5569,249 @@ ref QueryExpression q) { while (StartOf(39)) { if (la.kind == 137) { QueryExpressionFromClause( -#line 2449 "cs.ATG" +#line 2452 "cs.ATG" out fromClause); -#line 2449 "cs.ATG" +#line 2452 "cs.ATG" SafeAdd(q, q.MiddleClauses, fromClause); } else if (la.kind == 127) { QueryExpressionWhereClause( -#line 2450 "cs.ATG" +#line 2453 "cs.ATG" out whereClause); -#line 2450 "cs.ATG" +#line 2453 "cs.ATG" SafeAdd(q, q.MiddleClauses, whereClause); } else if (la.kind == 141) { QueryExpressionLetClause( -#line 2451 "cs.ATG" +#line 2454 "cs.ATG" out letClause); -#line 2451 "cs.ATG" +#line 2454 "cs.ATG" SafeAdd(q, q.MiddleClauses, letClause); } else if (la.kind == 142) { QueryExpressionJoinClause( -#line 2452 "cs.ATG" +#line 2455 "cs.ATG" out joinClause); -#line 2452 "cs.ATG" +#line 2455 "cs.ATG" SafeAdd(q, q.MiddleClauses, joinClause); } else { QueryExpressionOrderByClause( -#line 2453 "cs.ATG" +#line 2456 "cs.ATG" out orderClause); -#line 2453 "cs.ATG" +#line 2456 "cs.ATG" SafeAdd(q, q.MiddleClauses, orderClause); } } if (la.kind == 133) { QueryExpressionSelectClause( -#line 2455 "cs.ATG" +#line 2458 "cs.ATG" out selectClause); -#line 2455 "cs.ATG" +#line 2458 "cs.ATG" q.SelectOrGroupClause = selectClause; } else if (la.kind == 134) { QueryExpressionGroupClause( -#line 2456 "cs.ATG" +#line 2459 "cs.ATG" out groupClause); -#line 2456 "cs.ATG" +#line 2459 "cs.ATG" q.SelectOrGroupClause = groupClause; } else SynErr(217); if (la.kind == 136) { QueryExpressionIntoClause( -#line 2458 "cs.ATG" +#line 2461 "cs.ATG" ref q); } } void QueryExpressionFromOrJoinClause( -#line 2432 "cs.ATG" +#line 2435 "cs.ATG" QueryExpressionFromOrJoinClause fjc) { -#line 2433 "cs.ATG" +#line 2436 "cs.ATG" TypeReference type; Expression expr; -#line 2435 "cs.ATG" +#line 2438 "cs.ATG" fjc.Type = null; if ( -#line 2436 "cs.ATG" +#line 2439 "cs.ATG" IsLocalVarDecl()) { Type( -#line 2436 "cs.ATG" +#line 2439 "cs.ATG" out type); -#line 2436 "cs.ATG" +#line 2439 "cs.ATG" fjc.Type = type; } Identifier(); -#line 2437 "cs.ATG" +#line 2440 "cs.ATG" fjc.Identifier = t.val; Expect(81); Expr( -#line 2439 "cs.ATG" +#line 2442 "cs.ATG" out expr); -#line 2439 "cs.ATG" +#line 2442 "cs.ATG" fjc.InExpression = expr; } void QueryExpressionJoinClause( -#line 2415 "cs.ATG" +#line 2418 "cs.ATG" out QueryExpressionJoinClause jc) { -#line 2416 "cs.ATG" +#line 2419 "cs.ATG" jc = new QueryExpressionJoinClause(); jc.StartLocation = la.Location; Expression expr; Expect(142); QueryExpressionFromOrJoinClause( -#line 2421 "cs.ATG" +#line 2424 "cs.ATG" jc); Expect(143); Expr( -#line 2423 "cs.ATG" +#line 2426 "cs.ATG" out expr); -#line 2423 "cs.ATG" +#line 2426 "cs.ATG" jc.OnExpression = expr; Expect(144); Expr( -#line 2425 "cs.ATG" +#line 2428 "cs.ATG" out expr); -#line 2425 "cs.ATG" +#line 2428 "cs.ATG" jc.EqualsExpression = expr; if (la.kind == 136) { lexer.NextToken(); Identifier(); -#line 2427 "cs.ATG" +#line 2430 "cs.ATG" jc.IntoIdentifier = t.val; } -#line 2429 "cs.ATG" +#line 2432 "cs.ATG" jc.EndLocation = t.EndLocation; } void QueryExpressionWhereClause( -#line 2461 "cs.ATG" +#line 2464 "cs.ATG" out QueryExpressionWhereClause wc) { -#line 2462 "cs.ATG" +#line 2465 "cs.ATG" Expression expr; wc = new QueryExpressionWhereClause(); wc.StartLocation = la.Location; Expect(127); Expr( -#line 2465 "cs.ATG" +#line 2468 "cs.ATG" out expr); -#line 2465 "cs.ATG" +#line 2468 "cs.ATG" wc.Condition = expr; -#line 2466 "cs.ATG" +#line 2469 "cs.ATG" wc.EndLocation = t.EndLocation; } void QueryExpressionLetClause( -#line 2469 "cs.ATG" +#line 2472 "cs.ATG" out QueryExpressionLetClause wc) { -#line 2470 "cs.ATG" +#line 2473 "cs.ATG" Expression expr; wc = new QueryExpressionLetClause(); wc.StartLocation = la.Location; Expect(141); Identifier(); -#line 2473 "cs.ATG" +#line 2476 "cs.ATG" wc.Identifier = t.val; Expect(3); Expr( -#line 2475 "cs.ATG" +#line 2478 "cs.ATG" out expr); -#line 2475 "cs.ATG" +#line 2478 "cs.ATG" wc.Expression = expr; -#line 2476 "cs.ATG" +#line 2479 "cs.ATG" wc.EndLocation = t.EndLocation; } void QueryExpressionOrderByClause( -#line 2479 "cs.ATG" +#line 2482 "cs.ATG" out QueryExpressionOrderClause oc) { -#line 2480 "cs.ATG" +#line 2483 "cs.ATG" QueryExpressionOrdering ordering; oc = new QueryExpressionOrderClause(); oc.StartLocation = la.Location; Expect(140); QueryExpressionOrdering( -#line 2483 "cs.ATG" +#line 2486 "cs.ATG" out ordering); -#line 2483 "cs.ATG" +#line 2486 "cs.ATG" SafeAdd(oc, oc.Orderings, ordering); while (la.kind == 14) { lexer.NextToken(); QueryExpressionOrdering( -#line 2485 "cs.ATG" +#line 2488 "cs.ATG" out ordering); -#line 2485 "cs.ATG" +#line 2488 "cs.ATG" SafeAdd(oc, oc.Orderings, ordering); } -#line 2487 "cs.ATG" +#line 2490 "cs.ATG" oc.EndLocation = t.EndLocation; } void QueryExpressionSelectClause( -#line 2500 "cs.ATG" +#line 2503 "cs.ATG" out QueryExpressionSelectClause sc) { -#line 2501 "cs.ATG" +#line 2504 "cs.ATG" Expression expr; sc = new QueryExpressionSelectClause(); sc.StartLocation = la.Location; Expect(133); Expr( -#line 2504 "cs.ATG" +#line 2507 "cs.ATG" out expr); -#line 2504 "cs.ATG" +#line 2507 "cs.ATG" sc.Projection = expr; -#line 2505 "cs.ATG" +#line 2508 "cs.ATG" sc.EndLocation = t.EndLocation; } void QueryExpressionGroupClause( -#line 2508 "cs.ATG" +#line 2511 "cs.ATG" out QueryExpressionGroupClause gc) { -#line 2509 "cs.ATG" +#line 2512 "cs.ATG" Expression expr; gc = new QueryExpressionGroupClause(); gc.StartLocation = la.Location; Expect(134); Expr( -#line 2512 "cs.ATG" +#line 2515 "cs.ATG" out expr); -#line 2512 "cs.ATG" +#line 2515 "cs.ATG" gc.Projection = expr; Expect(135); Expr( -#line 2514 "cs.ATG" +#line 2517 "cs.ATG" out expr); -#line 2514 "cs.ATG" +#line 2517 "cs.ATG" gc.GroupBy = expr; -#line 2515 "cs.ATG" +#line 2518 "cs.ATG" gc.EndLocation = t.EndLocation; } void QueryExpressionIntoClause( -#line 2518 "cs.ATG" +#line 2521 "cs.ATG" ref QueryExpression q) { -#line 2519 "cs.ATG" +#line 2522 "cs.ATG" QueryExpression firstQuery = q; QueryExpression continuedQuery = new QueryExpression(); continuedQuery.StartLocation = q.StartLocation; @@ -5815,43 +5826,43 @@ ref QueryExpression q) { Expect(136); Identifier(); -#line 2532 "cs.ATG" +#line 2535 "cs.ATG" continuedQuery.FromClause.Identifier = t.val; -#line 2533 "cs.ATG" +#line 2536 "cs.ATG" continuedQuery.FromClause.EndLocation = t.EndLocation; QueryExpressionBody( -#line 2534 "cs.ATG" +#line 2537 "cs.ATG" ref q); } void QueryExpressionOrdering( -#line 2490 "cs.ATG" +#line 2493 "cs.ATG" out QueryExpressionOrdering ordering) { -#line 2491 "cs.ATG" +#line 2494 "cs.ATG" Expression expr; ordering = new QueryExpressionOrdering(); ordering.StartLocation = la.Location; Expr( -#line 2493 "cs.ATG" +#line 2496 "cs.ATG" out expr); -#line 2493 "cs.ATG" +#line 2496 "cs.ATG" ordering.Criteria = expr; if (la.kind == 138 || la.kind == 139) { if (la.kind == 138) { lexer.NextToken(); -#line 2494 "cs.ATG" +#line 2497 "cs.ATG" ordering.Direction = QueryExpressionOrderingDirection.Ascending; } else { lexer.NextToken(); -#line 2495 "cs.ATG" +#line 2498 "cs.ATG" ordering.Direction = QueryExpressionOrderingDirection.Descending; } } -#line 2497 "cs.ATG" +#line 2500 "cs.ATG" ordering.EndLocation = t.EndLocation; } @@ -6014,8 +6025,8 @@ out expr); case 144: s = "\"equals\" expected"; break; case 145: s = "??? expected"; break; case 146: s = "invalid NamespaceMemberDecl"; break; - case 147: s = "invalid NonArrayType"; break; - case 148: s = "invalid Identifier"; break; + case 147: s = "invalid Identifier"; break; + case 148: s = "invalid NonArrayType"; break; case 149: s = "invalid AttributeArguments"; break; case 150: s = "invalid Expr"; break; case 151: s = "invalid TypeModifier"; break; diff --git a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG index 7056dc0f8f..3789947716 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG +++ b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG @@ -188,18 +188,21 @@ CS UsingDirective (. string qualident = null; TypeReference aliasedType = null; + string alias = null; .) = "using" (. Location startPos = t.Location; .) + [ IF (IdentAndDoubleColon()) Identifier (. alias = t.val; .) "::" ] Qualident [ "=" NonArrayType ] ";" (. if (qualident != null && qualident.Length > 0) { + string name = (alias != null && alias != "global") ? alias + "." + qualident : qualident; INode node; if (aliasedType != null) { - node = new UsingDeclaration(qualident, aliasedType); + node = new UsingDeclaration(name, aliasedType); } else { - node = new UsingDeclaration(qualident); + node = new UsingDeclaration(name); } node.StartLocation = startPos; node.EndLocation = t.EndLocation; From 94e34f9d821e31efa9bca59980d8e5645d22e96c Mon Sep 17 00:00:00 2001 From: Matt Ward Date: Sat, 24 Jul 2010 21:22:15 +0000 Subject: [PATCH 3/8] Updated IronRuby to version 1.1 git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@6198 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Ruby/IronRuby/LICENSE.APACHE.html | 214 ++++++++++++++++++ .../Ruby/IronRuby/LICENSE.MSPL.html | 44 ---- .../BackendBindings/Ruby/IronRuby/README.txt | 19 +- .../IronRuby/bin/IronRuby.Libraries.Yaml.dll | Bin 148296 -> 148296 bytes .../Ruby/IronRuby/bin/IronRuby.Libraries.dll | Bin 681800 -> 685384 bytes .../Ruby/IronRuby/bin/IronRuby.dll | Bin 921928 -> 911176 bytes .../Ruby/IronRuby/bin/Microsoft.Dynamic.dll | Bin 944456 -> 948040 bytes .../IronRuby/bin/Microsoft.Scripting.Core.dll | Bin 389960 -> 388424 bytes .../bin/Microsoft.Scripting.Debugging.dll | Bin 58184 -> 57160 bytes ...Microsoft.Scripting.ExtensionAttribute.dll | Bin 11080 -> 0 bytes .../bin/Microsoft.Scripting.Metadata.dll | Bin 0 -> 100680 bytes .../Ruby/IronRuby/bin/Microsoft.Scripting.dll | Bin 165704 -> 148296 bytes .../BackendBindings/Ruby/IronRuby/bin/ir.exe | Bin 12104 -> 13640 bytes .../Ruby/IronRuby/bin/ir.exe.config | 8 +- .../RubyBinding/Project/Src/RubyAstWalker.cs | 64 ++++-- .../RubyBinding/Project/Src/RubyParser.cs | 5 +- .../ParseMethodsWithNoClassTestFixture.cs | 11 +- src/Setup/Files.wxs | 6 +- src/Setup/Setup.wxs | 2 +- 19 files changed, 292 insertions(+), 81 deletions(-) create mode 100644 src/AddIns/BackendBindings/Ruby/IronRuby/LICENSE.APACHE.html delete mode 100644 src/AddIns/BackendBindings/Ruby/IronRuby/LICENSE.MSPL.html delete mode 100644 src/AddIns/BackendBindings/Ruby/IronRuby/bin/Microsoft.Scripting.ExtensionAttribute.dll create mode 100644 src/AddIns/BackendBindings/Ruby/IronRuby/bin/Microsoft.Scripting.Metadata.dll diff --git a/src/AddIns/BackendBindings/Ruby/IronRuby/LICENSE.APACHE.html b/src/AddIns/BackendBindings/Ruby/IronRuby/LICENSE.APACHE.html new file mode 100644 index 0000000000..7b8e3f7693 --- /dev/null +++ b/src/AddIns/BackendBindings/Ruby/IronRuby/LICENSE.APACHE.html @@ -0,0 +1,214 @@ + + + +Apache License, Version 2.0 + + + + +
+

+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/ +

+

+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +

+

1. Definitions.

+

+ "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. +

+

+ "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. +

+

+ "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. +

+

+ "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. +

+

+ "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. +

+

+ "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. +

+

+ "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). +

+

+ "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. +

+

+ "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." +

+

+ "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. +

+

2. Grant of Copyright License. +Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. +

+

3. Grant of Patent License. +Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. +

+

4. Redistribution. +You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: +

    +
  1. You must give any other recipients of the Work or + Derivative Works a copy of this License; and +

  2. + +
  3. You must cause any modified files to carry prominent notices + stating that You changed the files; and +

  4. + +
  5. You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and +

  6. + +
  7. If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License.
  8. +
+ You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. +

+

5. Submission of Contributions. +Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. +

+

6. Trademarks. +This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. +

+

7. Disclaimer of Warranty. +Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. +

+

8. Limitation of Liability. +In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. +

+

9. Accepting Warranty or Additional Liability. +While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. +

+
+ +

See FAQ for answers to frequently asked questions +about this license.

+ + + + diff --git a/src/AddIns/BackendBindings/Ruby/IronRuby/LICENSE.MSPL.html b/src/AddIns/BackendBindings/Ruby/IronRuby/LICENSE.MSPL.html deleted file mode 100644 index 24f7dc671b..0000000000 --- a/src/AddIns/BackendBindings/Ruby/IronRuby/LICENSE.MSPL.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -Microsoft Public License (Ms-PL) - - - - -

This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.

- -

The software is governed by the Microsoft Public License, the terms of which -are below; except for the Ruby Standard libraries which are governed by the -Ruby license. We have included a copy of the Ruby license in the same -directory as this file

- -

1. Definitions

-

The terms “reproduce,” “reproduction,” “derivative works,” and “distribution” have the same meaning here as under U.S. copyright law.

-

A “contribution” is the original software, or any additions or changes to the software.

-

A “contributor” is any person that distributes its contribution under this license.

-

“Licensed patents” are a contributor’s patent claims that read directly on its contribution.

-

2. Grant of Rights

-

(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright -license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.

- -

(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, -royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative -works of the contribution in the software.

- -

3. Conditions and Limitations

(A) No Trademark License- This license does not grant you rights to use any contributors’ name, logo, or trademarks.

-

(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.

-

(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.

-

(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. -If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.

- -

(E) The software is licensed “as-is.” You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional -consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, -fitness for a particular purpose and non-infringement.

- -

See FAQ.html for answers to frequently asked questions -about this license.

- - - - diff --git a/src/AddIns/BackendBindings/Ruby/IronRuby/README.txt b/src/AddIns/BackendBindings/Ruby/IronRuby/README.txt index 48a3c8b33e..6699c251ff 100644 --- a/src/AddIns/BackendBindings/Ruby/IronRuby/README.txt +++ b/src/AddIns/BackendBindings/Ruby/IronRuby/README.txt @@ -7,7 +7,7 @@ Authors: Dino Viehland, and everyone else from the community who reports bugs, builds libraries, and helps enrich IronRuby. -Project Contact: Jimmy Schementi +Project Contact: Jimmy Schementi == About @@ -32,14 +32,15 @@ Will run rubyfile.rb with the IronRuby compiler. == Package - /bin IronRuby binaries, ir.exe, iirb, irake, igem, iri, irdoc, etc. - /lib Ruby standard library, including RubyGems - CHANGELOG.txt Changes for each release - RELEASE.txt Release notes - LICENSE.Ruby.txt Ruby license - LICENSE.CPL.txt Common Public License - LICENSE.MSPL.html Microsoft Public License - README.txt This file + /bin IronRuby binaries, ir.exe, iirb, irake, igem, iri, irdoc, etc. + /lib Ruby standard library, including RubyGems + /silverlight Silverlight binaries and scripts + CHANGELOG.txt Changes for each release + RELEASE.txt Release notes + LICENSE.Ruby.txt Ruby license + LICENSE.CPL.txt Common Public License + LICENSE.APACHE.html Apache License, Version 2.0 + README.txt This file == License diff --git a/src/AddIns/BackendBindings/Ruby/IronRuby/bin/IronRuby.Libraries.Yaml.dll b/src/AddIns/BackendBindings/Ruby/IronRuby/bin/IronRuby.Libraries.Yaml.dll index 44a6de7e6ec548b1769d2d7117ef9f2b157a00bb..bef9a17cdacb2963101e30bfebb3103fad4a391f 100644 GIT binary patch literal 148296 zcmd3P378yJwSP@jPxU%WP0w`ClB6ojOe($1OfnEA3)vtcglr^3m%Y)yaVVzt8{o{pXv$ zb?TgR&)v?w_uNyrZmrpTyJl#b7Qyf3mo@DnT=};|!dDLtg4}3-u2K7B{5w-0s$2b? zsY4g+EjyQ#yz@&tE^^M>aq-38WzNpsPU*nK&fbfiQ`c>DF7kHm?rmsD%kRD|S1ef_r1p%aPfgavG;M~iX{N%CF9YlV-i|ACM;IXU&A;HPy$eYEzqj2$xt3h7 zY0dIqz52H*n&v|8M#9^5?IBh~@K?~am08>z)U^~YS1;AINdfI2xjLGL5>)16tt(7afzla=`HQv?}3qdWu7&% z$EPKyh+8mxC9wtD-D(4tdUL>?Kx>5q$+KJklp zeE+|zIwBjM}9Y6Z;jqkkniu1?I^Cll{Tl@Pj<%Xu|Q_7v1mdGK8>3&_y;993? zmTq{Hflin%?((|n*3h*}7&L;2gp=m+p^f-QakhAh_G}3v05~*7jTamG2E@pQIDbPs=QluqjU{eo@7f$j20%B+Um4RQqfqa zw-A^@Lp0{02@>8S(#@!9m~?+s8-aX`0hV5xi5MAgF&Gk(v1BA_sEkF*OMp$qBCS3X z3l}j*mjY`V-ZETN2~PnOLnX5iQNIwZVD!~Xok9X5GMeBWzUN!%&_`WRhm- z^GMWhph$Z%&#p@KOd5LWi>xs#s4>yr6v&%EZistOibOGC#L$pzik!4pI$~H6J)ZG~ z!DL92rR%MFqqX!02veL;Pz88wDyu$bMMBL~o2cps8;sIRh~A{RXCa2t>s)Wi*0oFA zO~B-K8l@53=CvBjl1N z&}HgE9qBQ{A2xJv8ziWT@U~Of4g}64DDlyVw-c~mC+w07C<(?wSW>#*)E)qLqv-H? zh=8$W7cTpf(z>N95Gk73*BdQ;08qZZ^ch@qZ#P)7Kz>#spT@=A16iZ)q=ON`IP$d~IZ>?k&A@BIJ`5txng_6zr zEIu7`vRV9oCO1VNC0DMqj0rk%m03Z|*WJs3(G7`?F;Qn-Y8c0?O!+?aPYlOnOo~z5 zevX{DGD>cf?#{tIqRxV`p-0AGB}8&_krJ-0N9!_2>zIsSDHryW*1|TWrC=7C6=Ong zmH1|kMpL@KQM(mJ1x8^@e*z=3uNauuq1jJd6(BOLM@`J6X8AQBw6>0e080Wvk6tw` zGOgg6e+*aV)~hK50eLIqH3eeAnowY+_mXMhD=<~;7BXSto=_4Zs{%>ZFtgWi)n*M< z5aPuo|0=wbs=Pt@Bi6^{JBwxu<8Hto$I*a5hDr6Hf*93C> z{*V<-PbaM;o9WHy%jIhj`LLCA58~ROmplr&q#~p>=txW>9nodjd;)5tGH$o)?zN!E z!T}Ot9M{yJU+C+=(xaEIr)&(lexYlluAMk4vz4ybOCMoeDBpx}F+>K*W^ZLDNvEt- zCUzKs>e?d3)Jxx`6ii?fN;$JCMXEg#IjWL#*GAJ=02!iEeIJ}yd3FEyEn0zD5$ z+3+e+;(F;sMu9?yqilSYD2Zt4EJTU9uSG>gOXmZQ`|tt4Rzz;BNa-5h)dzQPa8PEcWEE-05v;5|OQk%yn((Vdq;aH8N z+#OJAWA%{smVg$H1*^p@zcrxL#+pXj+X7lR)>KmN2`II(T+${~qM4*jphQ`e8Pkke zetRG>NUH;s4pQz7D79%7NSm-+c~TBd91C-?S$;=A3({iE!;Ub^?+hrlX~7VgK+UNg z&7{0*;#lpZy*r?V)5?-^IH2T={P*~U7N%?S< za-&KZnK%gQeo{YDrM|NwaW^R+tx`T;pTW*6fUs;QU#e1PSK{4E%A-}vf(qpjDPOKq&ZtoCA>}Jo$~hIv+e!Iq zK*>F)moBQ%t|skY0vbA`P=Xwek@{Fb4eG8spH^$Oh95PQ6up5&Munuv-SFfFLph1B(e+$d5U*RwCM|G zwtqylF;;}M+zNe^SMSHbc|Sn_2EiEe6rv}$%)f;z?WZ93(1jo|uhYvv17d78qF0<2 zC@Vb=0~8HLxz5o?iT3(1&8Rvt#HRr}&>HUr#lQoKpHsH-*EgfQZKNTB(4MZPWk~Dy zX-5>TR}kJWaF?4aLh-2N8QvWhF}V9B?u1J({RkST%R>}CCNjNe$rxl4g=0Q+tq1vN zk#>{p6JN;sWkI&#i7CW%(>*|brlKTK8JN%pzEEjZKB{BkSm{SIJCk9i*O4RICQ`#q3_nd&C=#01M%a9#{ftcotD+)Oeb zhY&F~o#{#5LI(dSTkEKV7pi;6B<7=7Lf z=~77ti4r`VW`=hj@M!>8dcB7EV4c@N*>r7-w&A1dkt*wNJ&Fqh75$ZMN9BB;Wm+86 z;vaC=V|stYC6#Y((cOOql#Ch?I*(1j3iU~RacOVG=4oEW8 zaHJ3X(pFzXTSd@T5ml_xJVXiS#Pr~vG;?vkyi>K4x2n3OexHr}!63I<6Do(uS3D{a z68RHVRtr!>mxWB^r~B1F467lLw~i~gQVO%YoQVdm(BQgLAMHcW8HK`QWbQ{8@%{s4 zLO-e3zKOg{MqbJvL9a@iDlJr*ReH;DMH+zgq=hFx|B2Y;|3WZEnNjaA0MQ-xKy}eQ z*d3(fH^dJtN42LTsH&68A7uj2V#^$3b_ht8|qqFxv5bGmnGb5uXAdI;G z3v^EoI#sVd3cG&_>*)a&qrqy>#~59;mekj;j;SxORE3xS3Q=Q}-I_E*D%d#qE(}yw zV~rLz_)3?K#Fau8lfFXE`!I?VEhJ0l0;6=k{5MEWS`pFkLTeP2D2n49W#$K$QhY=@ zQg^z(aIRJFu^Cm9HRT7aCTX%Xs#qixTT0)7Yzz<8ZUvd9lKC=aB8v2ZuRe{TRI{4U z4VwIJurr0Ikx*2>0M#Bf&uSQDHI(cIJT`+Jnm}o$16HL8Q&|$uA6^}}@}sTkc=_Y3 z{DhUT8phayRzi;p%NW}$;7?-+Rf-q0VufkC6;oOjFE&|;qvnHwW~JlsDp9*a?c}F# zB}4<@krEX^`>@3GhmOAdGL)_nC2sTw>3Q#Ei}=x0oxeiEM?D?oNH^!Vv^2X0K{!FZ z2mveK*J8Q#1XIUnrX}T?AmI|lMdb+WG29ftjsey>nnCXT0T!~ct0hrF}i6t)^W(CQl&Ss;^<((;UQmmCjX8f;-%k8uIhvsuM-q<#8cL zoeYO>j_aZ%hw+fQGM-bhfbcMHB;rb+zj!1OFPL$^VJqWEQCnW(mI2x(;b&o(M<#q0 zM!Y-=!)}F$cNx+dJCWL%9V11ag%Qw4gnsi>b!`61{s zpM_DB4E)zZoESn^6F{E%y!>})Oa7G`QP_jM81TwXg!%|I6Y2+~Y^kFrW=~}~xR(Md z-HE;ld*b?9EFUQzkL5GP=`N#Z?47Ok9{-Xy}1^P;e*&)YO#ErJ$@4ER7|nA z1;m3y30_t0m`dm_()S>6VfUG(`xW-?TI^30_ARy8mnOo>PA}RSSX*#E6zp(3`Mv=$ z3sKWWXHURV4{ZDCLicEIxgI8l1Xx?ZQbhF1(~(#lLk#}f%Uy_Fo`fJ*`f(+7j2CeYRuA{mRc+Cl z{M|NT{)(`GJ?X&5<@5L~9-q53EHW0avzp;_y+U<`P_X03H7SIOD%9iTqG)9D$(U>paVJB1JWR^w zlkqBv4}s9Z{Ak%cEb$OgZ6>M6OyP;s*_;6=)H1^{Gl*%1h-&vpC}y-u%(_z;KjzxF z6i)z95xOtkXfEbHCHBJ2SieNG!!$6h*qo=LmbqDF zejLMGBnsOBqYMnxBU97y(q`nzj0!z2q1%H5t$4WsJXcw;b+{JB2wi6l)J=tNtd2Gl zc28Uwm4% zR`&10HBoR5hU<@i@(SSOX^-@{Ms14Vy?|=PnnizD@aj*rpU;%OqB~u1#^Y zG}~O)mS~-um3_(lz$v56dbRvuQdjwzKl%9l$ZX6dMMHj4iy`^s4=#WNwk$6~?MXE^pg&=$h(2mXqKL}X4=i>pyAx{Q!x9j!gr#2s z2}pVFMtP#)@GhS$vg-W~Xy#Z>9lh=1yHwdwEbW6I)Y{lCdn)_L2GOiWQC4 zJk;{%NU$Mx09<;Z@A!n{@bS%uJh*;-j@pV#8v(Yf z(YF)vUI0+c0(cRCdodz+7tJ2o%P77dMF9Ozpo`l!5uXRUQ`6(7i|NrE+=-j$0eEHf zd2d6#hLaQtjBp#YCXclS7IY_necqkt|gO4C%(F1+V<0p>EBaw70OqfT7EiZwF zgG2HNy%LWG^0+3bgZwFeYD~XJw-QQO(n)}r&zVbXFG`3T3G*1VD^Y~i;NM#*Z_zPD zz>-fd+#fCiUswofE6i!V^{Bzkkt@_r$fDkw)7^WKl+y9fqnrimS9vjnk1d35>g6Q_ z7YPVIQ(|l>!M3qwytI#<&WpW%Y?Ux9Bf}X4WuvB1YG(VL0&Ju-B>?e2WCKz&~I1{!#foj8hjg&NSqiCF4e@?VnF)n$q2Fg6oHLJ)2t zfL|a8H>IX$6bE`5&|f6_R|K=}mk9qzu?YMvh5riiU9VoUxl3fF8{j47a$7vj|j-??$;<_x_|A` z-GAYIT6Z7gHCb|@8|9Tq@ha@em3D9+0%hJ7_~P(N5JqD*s&_g#Feky^VQ3q0<)1#f z0;FPdq|i`W0x@d##*?7>F%nR|({L$78Y6g(XN)kO6E4Takk>|r#|SI=*nF)L;CO#A zWTS*u2IBXEu{@KY;vX z@F1!+HFy}rOhZ%^zb|G)Wrl8u7rIJ2!5vq&^gx5{#QS4$dwdbJ5^w1A6$~?Kj_^$} z`2JNDs;6GzDvU{1Fc{Cffo&7#6IfH84K$T5fOM?lXk4Z8r^TI@!O=f8{{3{cC0g1K zqPrHdF^`wXSno4ViPLx}T}k>n(#_I1>87Ipy`12!o=kM%eMrhLadu?ky||0pPH)tV zF20@Fl=eg6hIPKq6PZ08DU71TUDXnoUdQw$>sT8k@}`vL@706uevo>QQJSc<5AQ&s zSK;w@U%O#S)!WVho+41e?JayYDuER6kWJVYZ9orD%?KZaG$S&>Hr|6~?3Xsa30Vub zaVC{%$fP5KuxvG4@wk!+_Qj33vc)21VJ{xmz^`FD3m!xH@t#?Hpj*{~Ujx}lp*2>p z{J6a_Rg!$sh{a<{2e4aKDFGffP<~hofMQRIr}F!vg&fktY76gMof}J=`IORS3-4QT znvc(UQOO4L$ra9lSiG|1&bQ@};lDGDWa)r0*kWeFwf3yz9rkyximyBnJ z`CykNS@bojb5`pyb$%{t6y^~6)tf;y+|QtOMJa;nS4Ck*3mO4#0W<>2@3%q%?_H^8 zFk^*tEVB@|VahD{C7Qu3cHus2nNUs3Z!9}8;EyImBfD{!+CdcttJKJx7Z4GA)HW;9 zFi3w{v@pUb3vL9A!da1lOic?1P1B^nA%2< z_#B9StxKH`vO`a(_0htjihga2rRyuzSdTp5ktH+{^q^WAP0@uQ_t4IK5PM*%KV4M% zf@r%HsWO8Vu7=|jYuC%@%*Rf+(w`$*8Hxhi7v-h*sZa;|UnY|-znfvdOm()f9T_NU zN0vbC1|a}dP=8#7s?@NG#DiZp73uS5f6x8wP4qMzt@-mIx|ay(nA#KzLaANAiN`jVv^~IWGGbc^6skGAhZ#NP)vj40pFU&TWwb9UMQ)q9*x4mZeG&GvO60KFUU~uihs_SW^9cby*4+pg`(~95f+S$miB2R-e+GM51miVe zy5a1p11)&NnJtkW@iE9o!49_lC~jFt>EiV)Oc`ItV#)RuECa`nVb%Tlg$6Fxw^k+X zN5H70m4}eBjB(Xm#ImV;L|#}{xta4)G}dRCdNdYQV~ckdB4IPhMr1Yjctz@8DpJSS zhqIM)YD>Uu$us)@!WAnS`f`%`DAyW%|2g5oj|tl#KflFvhXJOPZQ_r*GmPNnW>{^E z6XW}}c$qV_ZzqYEn}IAo4F7_8G;?+3sj69AZu`tf099h&^q+wh%!ik+pH)qn;;P)}u=$0kC z=@!c>o-~doj#w?ePc{P439H3k+-oA7KM>0%tyDo5TyfwezysvS7st_?s?l_?9m_s_ zAZ8_zTO}|tpl4IyN%S@%bmma}_-s83!_{h$!J=hg$Z9CG;ZeRtjs