diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Resources/SyntaxModes.xml b/src/Libraries/ICSharpCode.TextEditor/Project/Resources/SyntaxModes.xml index 53066cd47b..ad31d86fef 100644 --- a/src/Libraries/ICSharpCode.TextEditor/Project/Resources/SyntaxModes.xml +++ b/src/Libraries/ICSharpCode.TextEditor/Project/Resources/SyntaxModes.xml @@ -45,5 +45,5 @@ + extensions = ".xml;.xsl;.xslt;.xsd;.manifest;.config;.addin;.xshd;.wxs;.proj;.build;.xfrm"/> diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Resources/XML-Mode.xshd b/src/Libraries/ICSharpCode.TextEditor/Project/Resources/XML-Mode.xshd index ef238d4fb9..a4867f5f16 100644 --- a/src/Libraries/ICSharpCode.TextEditor/Project/Resources/XML-Mode.xshd +++ b/src/Libraries/ICSharpCode.TextEditor/Project/Resources/XML-Mode.xshd @@ -1,6 +1,6 @@ - + diff --git a/src/Libraries/NRefactory/NRefactory.sln b/src/Libraries/NRefactory/NRefactory.sln index 35575343b3..3295a24eb8 100644 --- a/src/Libraries/NRefactory/NRefactory.sln +++ b/src/Libraries/NRefactory/NRefactory.sln @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 9.00 -# SharpDevelop 2.0.0.9999 +# SharpDevelop 2.0.0.382 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactory", "Project\NRefactory.csproj", "{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactoryTests", "Test\NRefactoryTests.csproj", "{870115DD-960A-4406-A6B9-600BCDC36A03}" diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/KeywordList.txt b/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/KeywordList.txt index 03eadf811d..4c299e1127 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/KeywordList.txt +++ b/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/KeywordList.txt @@ -25,6 +25,7 @@ Colon = ":" DoubleColon = "::" Semicolon = ";" Question = "?" +DoubleQuestion = "??" Comma = "," Dot = "." diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs b/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs index 297698b63e..0cc67ac60a 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs @@ -633,6 +633,10 @@ namespace ICSharpCode.NRefactory.Parser.CSharp } return new Token(Tokens.GreaterThan, x, y); case '?': + if (ReaderPeek() == '?') { + ReaderRead(); + return new Token(Tokens.DoubleQuestion, x, y); + } return new Token(Tokens.Question, x, y); case ';': return new Token(Tokens.Semicolon, x, y); diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Tokens.cs b/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Tokens.cs index a09c2ce3a3..983d735fed 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Tokens.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Tokens.cs @@ -29,121 +29,122 @@ namespace ICSharpCode.NRefactory.Parser.CSharp public const int DoubleColon = 10; public const int Semicolon = 11; public const int Question = 12; - public const int Comma = 13; - public const int Dot = 14; - public const int OpenCurlyBrace = 15; - public const int CloseCurlyBrace = 16; - public const int OpenSquareBracket = 17; - public const int CloseSquareBracket = 18; - public const int OpenParenthesis = 19; - public const int CloseParenthesis = 20; - public const int GreaterThan = 21; - public const int LessThan = 22; - public const int Not = 23; - public const int LogicalAnd = 24; - public const int LogicalOr = 25; - public const int BitwiseComplement = 26; - public const int BitwiseAnd = 27; - public const int BitwiseOr = 28; - public const int Xor = 29; - public const int Increment = 30; - public const int Decrement = 31; - public const int Equal = 32; - public const int NotEqual = 33; - public const int GreaterEqual = 34; - public const int LessEqual = 35; - public const int ShiftLeft = 36; - public const int PlusAssign = 37; - public const int MinusAssign = 38; - public const int TimesAssign = 39; - public const int DivAssign = 40; - public const int ModAssign = 41; - public const int BitwiseAndAssign = 42; - public const int BitwiseOrAssign = 43; - public const int XorAssign = 44; - public const int ShiftLeftAssign = 45; - public const int Pointer = 46; + public const int DoubleQuestion = 13; + public const int Comma = 14; + public const int Dot = 15; + public const int OpenCurlyBrace = 16; + public const int CloseCurlyBrace = 17; + public const int OpenSquareBracket = 18; + public const int CloseSquareBracket = 19; + public const int OpenParenthesis = 20; + public const int CloseParenthesis = 21; + public const int GreaterThan = 22; + public const int LessThan = 23; + public const int Not = 24; + public const int LogicalAnd = 25; + public const int LogicalOr = 26; + public const int BitwiseComplement = 27; + public const int BitwiseAnd = 28; + public const int BitwiseOr = 29; + public const int Xor = 30; + public const int Increment = 31; + public const int Decrement = 32; + public const int Equal = 33; + public const int NotEqual = 34; + public const int GreaterEqual = 35; + public const int LessEqual = 36; + public const int ShiftLeft = 37; + public const int PlusAssign = 38; + public const int MinusAssign = 39; + public const int TimesAssign = 40; + public const int DivAssign = 41; + public const int ModAssign = 42; + public const int BitwiseAndAssign = 43; + public const int BitwiseOrAssign = 44; + public const int XorAssign = 45; + public const int ShiftLeftAssign = 46; + public const int Pointer = 47; // ----- keywords ----- - public const int Abstract = 47; - public const int As = 48; - public const int Base = 49; - public const int Bool = 50; - public const int Break = 51; - public const int Byte = 52; - public const int Case = 53; - public const int Catch = 54; - public const int Char = 55; - public const int Checked = 56; - public const int Class = 57; - public const int Const = 58; - public const int Continue = 59; - public const int Decimal = 60; - public const int Default = 61; - public const int Delegate = 62; - public const int Do = 63; - public const int Double = 64; - public const int Else = 65; - public const int Enum = 66; - public const int Event = 67; - public const int Explicit = 68; - public const int Extern = 69; - public const int False = 70; - public const int Finally = 71; - public const int Fixed = 72; - public const int Float = 73; - public const int For = 74; - public const int Foreach = 75; - public const int Goto = 76; - public const int If = 77; - public const int Implicit = 78; - public const int In = 79; - public const int Int = 80; - public const int Interface = 81; - public const int Internal = 82; - public const int Is = 83; - public const int Lock = 84; - public const int Long = 85; - public const int Namespace = 86; - public const int New = 87; - public const int Null = 88; - public const int Object = 89; - public const int Operator = 90; - public const int Out = 91; - public const int Override = 92; - public const int Params = 93; - public const int Private = 94; - public const int Protected = 95; - public const int Public = 96; - public const int Readonly = 97; - public const int Ref = 98; - public const int Return = 99; - public const int Sbyte = 100; - public const int Sealed = 101; - public const int Short = 102; - public const int Sizeof = 103; - public const int Stackalloc = 104; - public const int Static = 105; - public const int String = 106; - public const int Struct = 107; - public const int Switch = 108; - public const int This = 109; - public const int Throw = 110; - public const int True = 111; - public const int Try = 112; - public const int Typeof = 113; - public const int Uint = 114; - public const int Ulong = 115; - public const int Unchecked = 116; - public const int Unsafe = 117; - public const int Ushort = 118; - public const int Using = 119; - public const int Virtual = 120; - public const int Void = 121; - public const int Volatile = 122; - public const int While = 123; + public const int Abstract = 48; + public const int As = 49; + public const int Base = 50; + public const int Bool = 51; + public const int Break = 52; + public const int Byte = 53; + public const int Case = 54; + public const int Catch = 55; + public const int Char = 56; + public const int Checked = 57; + public const int Class = 58; + public const int Const = 59; + public const int Continue = 60; + public const int Decimal = 61; + public const int Default = 62; + public const int Delegate = 63; + public const int Do = 64; + public const int Double = 65; + public const int Else = 66; + public const int Enum = 67; + public const int Event = 68; + public const int Explicit = 69; + public const int Extern = 70; + public const int False = 71; + public const int Finally = 72; + public const int Fixed = 73; + public const int Float = 74; + public const int For = 75; + public const int Foreach = 76; + public const int Goto = 77; + public const int If = 78; + public const int Implicit = 79; + public const int In = 80; + public const int Int = 81; + public const int Interface = 82; + public const int Internal = 83; + public const int Is = 84; + public const int Lock = 85; + public const int Long = 86; + public const int Namespace = 87; + public const int New = 88; + public const int Null = 89; + public const int Object = 90; + public const int Operator = 91; + public const int Out = 92; + public const int Override = 93; + public const int Params = 94; + public const int Private = 95; + public const int Protected = 96; + public const int Public = 97; + public const int Readonly = 98; + public const int Ref = 99; + public const int Return = 100; + public const int Sbyte = 101; + public const int Sealed = 102; + public const int Short = 103; + public const int Sizeof = 104; + public const int Stackalloc = 105; + public const int Static = 106; + public const int String = 107; + public const int Struct = 108; + public const int Switch = 109; + public const int This = 110; + public const int Throw = 111; + public const int True = 112; + public const int Try = 113; + public const int Typeof = 114; + public const int Uint = 115; + public const int Ulong = 116; + public const int Unchecked = 117; + public const int Unsafe = 118; + public const int Ushort = 119; + public const int Using = 120; + public const int Virtual = 121; + public const int Void = 122; + public const int Volatile = 123; + public const int While = 124; - public const int maxToken = 124; + public const int maxToken = 125; static BitArray NewSet(params int[] values) { BitArray bitArray = new BitArray(maxToken); @@ -178,6 +179,7 @@ namespace ICSharpCode.NRefactory.Parser.CSharp "::", ";", "?", + "??", ",", ".", "{", diff --git a/src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/BinaryOperatorExpression.cs b/src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/BinaryOperatorExpression.cs index cd2a46ca17..14d1335a3c 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/BinaryOperatorExpression.cs +++ b/src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/BinaryOperatorExpression.cs @@ -70,6 +70,8 @@ namespace ICSharpCode.NRefactory.Parser.AST AsCast, /// VB-only: Like Like, + /// C#: ?? + NullCoalescing, } public class BinaryOperatorExpression : Expression diff --git a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs index 95e49aef83..7928adf61b 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs +++ b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs @@ -20,7 +20,7 @@ namespace ICSharpCode.NRefactory.Parser.CSharp { internal class Parser : AbstractParser { - const int maxT = 124; + const int maxT = 125; const bool T = true; const bool x = false; @@ -441,13 +441,13 @@ void WriteFullTypeName(StringBuilder b, Expression expr) void CS() { -#line 559 "cs.ATG" +#line 560 "cs.ATG" compilationUnit = new CompilationUnit(); - while (la.kind == 119) { + while (la.kind == 120) { UsingDirective(); } while ( -#line 562 "cs.ATG" +#line 563 "cs.ATG" IsGlobalAttrTarget()) { GlobalAttributeSection(); } @@ -459,25 +459,25 @@ IsGlobalAttrTarget()) { void UsingDirective() { -#line 569 "cs.ATG" +#line 570 "cs.ATG" string qualident = null; TypeReference aliasedType = null; - Expect(119); + Expect(120); -#line 572 "cs.ATG" +#line 573 "cs.ATG" Point startPos = t.Location; Qualident( -#line 573 "cs.ATG" +#line 574 "cs.ATG" out qualident); if (la.kind == 3) { lexer.NextToken(); NonArrayType( -#line 574 "cs.ATG" +#line 575 "cs.ATG" out aliasedType); } Expect(11); -#line 576 "cs.ATG" +#line 577 "cs.ATG" if (qualident != null && qualident.Length > 0) { INode node; if (aliasedType != null) { @@ -493,13 +493,13 @@ out aliasedType); } void GlobalAttributeSection() { - Expect(17); + Expect(18); -#line 592 "cs.ATG" +#line 593 "cs.ATG" Point startPos = t.Location; Expect(1); -#line 593 "cs.ATG" +#line 594 "cs.ATG" if (t.val != "assembly") Error("global attribute target specifier (\"assembly\") expected"); string attributeTarget = t.val; List attributes = new List(); @@ -507,28 +507,28 @@ out aliasedType); Expect(9); Attribute( -#line 598 "cs.ATG" +#line 599 "cs.ATG" out attribute); -#line 598 "cs.ATG" +#line 599 "cs.ATG" attributes.Add(attribute); while ( -#line 599 "cs.ATG" +#line 600 "cs.ATG" NotFinalComma()) { - Expect(13); + Expect(14); Attribute( -#line 599 "cs.ATG" +#line 600 "cs.ATG" out attribute); -#line 599 "cs.ATG" +#line 600 "cs.ATG" attributes.Add(attribute); } - if (la.kind == 13) { + if (la.kind == 14) { lexer.NextToken(); } - Expect(18); + Expect(19); -#line 601 "cs.ATG" +#line 602 "cs.ATG" AttributeSection section = new AttributeSection(attributeTarget, attributes); section.StartLocation = startPos; section.EndLocation = t.EndLocation; @@ -538,293 +538,302 @@ out attribute); void NamespaceMemberDecl() { -#line 685 "cs.ATG" +#line 686 "cs.ATG" AttributeSection section; List attributes = new List(); Modifiers m = new Modifiers(); string qualident; - if (la.kind == 86) { + if (la.kind == 87) { lexer.NextToken(); -#line 691 "cs.ATG" +#line 692 "cs.ATG" Point startPos = t.Location; Qualident( -#line 692 "cs.ATG" +#line 693 "cs.ATG" out qualident); -#line 692 "cs.ATG" +#line 693 "cs.ATG" INode node = new NamespaceDeclaration(qualident); node.StartLocation = startPos; compilationUnit.AddChild(node); compilationUnit.BlockStart(node); - Expect(15); - while (la.kind == 119) { + Expect(16); + while (la.kind == 120) { UsingDirective(); } while (StartOf(1)) { NamespaceMemberDecl(); } - Expect(16); + Expect(17); if (la.kind == 11) { lexer.NextToken(); } -#line 701 "cs.ATG" +#line 702 "cs.ATG" node.EndLocation = t.EndLocation; compilationUnit.BlockEnd(); } else if (StartOf(2)) { - while (la.kind == 17) { + while (la.kind == 18) { AttributeSection( -#line 705 "cs.ATG" +#line 706 "cs.ATG" out section); -#line 705 "cs.ATG" +#line 706 "cs.ATG" attributes.Add(section); } while (StartOf(3)) { TypeModifier( -#line 706 "cs.ATG" +#line 707 "cs.ATG" m); } TypeDecl( -#line 707 "cs.ATG" +#line 708 "cs.ATG" m, attributes); - } else SynErr(125); + } else SynErr(126); } void Qualident( -#line 825 "cs.ATG" +#line 826 "cs.ATG" out string qualident) { Expect(1); -#line 827 "cs.ATG" +#line 828 "cs.ATG" qualidentBuilder.Length = 0; qualidentBuilder.Append(t.val); while ( -#line 828 "cs.ATG" +#line 829 "cs.ATG" DotAndIdent()) { - Expect(14); + Expect(15); Expect(1); -#line 828 "cs.ATG" +#line 829 "cs.ATG" qualidentBuilder.Append('.'); qualidentBuilder.Append(t.val); } -#line 831 "cs.ATG" +#line 832 "cs.ATG" qualident = qualidentBuilder.ToString(); } void NonArrayType( -#line 928 "cs.ATG" +#line 929 "cs.ATG" out TypeReference type) { -#line 930 "cs.ATG" +#line 931 "cs.ATG" string name; int pointer = 0; type = null; - if (la.kind == 1 || la.kind == 89 || la.kind == 106) { + if (la.kind == 1 || la.kind == 90 || la.kind == 107) { ClassType( -#line 935 "cs.ATG" +#line 936 "cs.ATG" out type); } else if (StartOf(4)) { SimpleType( -#line 936 "cs.ATG" +#line 937 "cs.ATG" out name); -#line 936 "cs.ATG" +#line 937 "cs.ATG" type = new TypeReference(name); if (la.kind == 12) { NullableQuestionMark( -#line 937 "cs.ATG" +#line 938 "cs.ATG" ref type); } - } else if (la.kind == 121) { + } else if (la.kind == 122) { lexer.NextToken(); Expect(6); -#line 938 "cs.ATG" +#line 939 "cs.ATG" pointer = 1; type = new TypeReference("void"); - } else SynErr(126); + } else SynErr(127); while ( -#line 941 "cs.ATG" +#line 942 "cs.ATG" IsPointer()) { Expect(6); -#line 942 "cs.ATG" +#line 943 "cs.ATG" ++pointer; } -#line 944 "cs.ATG" +#line 945 "cs.ATG" if (type != null) { type.PointerNestingLevel = pointer; } } void Attribute( -#line 608 "cs.ATG" +#line 609 "cs.ATG" out ASTAttribute attribute) { -#line 609 "cs.ATG" +#line 610 "cs.ATG" string qualident; Qualident( -#line 611 "cs.ATG" +#line 612 "cs.ATG" out qualident); -#line 611 "cs.ATG" +#line 612 "cs.ATG" List positional = new List(); List named = new List(); string name = qualident; - if (la.kind == 19) { + if (la.kind == 20) { AttributeArguments( -#line 615 "cs.ATG" +#line 616 "cs.ATG" positional, named); } -#line 615 "cs.ATG" +#line 616 "cs.ATG" attribute = new ICSharpCode.NRefactory.Parser.AST.Attribute(name, positional, named); } void AttributeArguments( -#line 618 "cs.ATG" +#line 619 "cs.ATG" List positional, List named) { -#line 620 "cs.ATG" +#line 621 "cs.ATG" bool nameFound = false; string name = ""; Expression expr; - Expect(19); + Expect(20); if (StartOf(5)) { if ( -#line 628 "cs.ATG" +#line 629 "cs.ATG" IsAssignment()) { -#line 628 "cs.ATG" +#line 629 "cs.ATG" nameFound = true; lexer.NextToken(); -#line 629 "cs.ATG" +#line 630 "cs.ATG" name = t.val; Expect(3); } Expr( -#line 631 "cs.ATG" +#line 632 "cs.ATG" out expr); -#line 631 "cs.ATG" +#line 632 "cs.ATG" if (expr != null) {if(name == "") positional.Add(expr); else { named.Add(new NamedArgumentExpression(name, expr)); name = ""; } } - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); if ( -#line 639 "cs.ATG" +#line 640 "cs.ATG" IsAssignment()) { -#line 639 "cs.ATG" +#line 640 "cs.ATG" nameFound = true; Expect(1); -#line 640 "cs.ATG" +#line 641 "cs.ATG" name = t.val; Expect(3); } else if (StartOf(5)) { -#line 642 "cs.ATG" +#line 643 "cs.ATG" if (nameFound) Error("no positional argument after named argument"); - } else SynErr(127); + } else SynErr(128); Expr( -#line 643 "cs.ATG" +#line 644 "cs.ATG" out expr); -#line 643 "cs.ATG" +#line 644 "cs.ATG" if (expr != null) { if(name == "") positional.Add(expr); else { named.Add(new NamedArgumentExpression(name, expr)); name = ""; } } } } - Expect(20); + Expect(21); } void Expr( -#line 1899 "cs.ATG" +#line 1900 "cs.ATG" out Expression expr) { -#line 1900 "cs.ATG" +#line 1901 "cs.ATG" expr = null; Expression expr1 = null, expr2 = null; UnaryExpr( -#line 1902 "cs.ATG" +#line 1903 "cs.ATG" out expr); if (StartOf(6)) { ConditionalOrExpr( -#line 1905 "cs.ATG" +#line 1906 "cs.ATG" ref expr); + if (la.kind == 13) { + lexer.NextToken(); + Expr( +#line 1907 "cs.ATG" +out expr1); + +#line 1907 "cs.ATG" + expr = new BinaryOperatorExpression(expr, BinaryOperatorType.NullCoalescing, expr1); + } if (la.kind == 12) { lexer.NextToken(); Expr( -#line 1905 "cs.ATG" +#line 1908 "cs.ATG" out expr1); Expect(9); Expr( -#line 1905 "cs.ATG" +#line 1908 "cs.ATG" out expr2); -#line 1905 "cs.ATG" +#line 1908 "cs.ATG" expr = new ConditionalExpression(expr, expr1, expr2); } } else if (StartOf(7)) { -#line 1907 "cs.ATG" +#line 1910 "cs.ATG" AssignmentOperatorType op; Expression val; AssignmentOperator( -#line 1907 "cs.ATG" +#line 1910 "cs.ATG" out op); Expr( -#line 1907 "cs.ATG" +#line 1910 "cs.ATG" out val); -#line 1907 "cs.ATG" +#line 1910 "cs.ATG" expr = new AssignmentExpression(expr, op, val); - } else SynErr(128); + } else SynErr(129); } void AttributeSection( -#line 652 "cs.ATG" +#line 653 "cs.ATG" out AttributeSection section) { -#line 654 "cs.ATG" +#line 655 "cs.ATG" string attributeTarget = ""; List attributes = new List(); ASTAttribute attribute; - Expect(17); + Expect(18); -#line 660 "cs.ATG" +#line 661 "cs.ATG" Point startPos = t.Location; if ( -#line 661 "cs.ATG" +#line 662 "cs.ATG" IsLocalAttrTarget()) { - if (la.kind == 67) { + if (la.kind == 68) { lexer.NextToken(); -#line 662 "cs.ATG" +#line 663 "cs.ATG" attributeTarget = "event"; - } else if (la.kind == 99) { + } else if (la.kind == 100) { lexer.NextToken(); -#line 663 "cs.ATG" +#line 664 "cs.ATG" attributeTarget = "return"; } else { lexer.NextToken(); -#line 664 "cs.ATG" +#line 665 "cs.ATG" if (t.val != "field" || t.val != "method" || t.val != "module" || t.val != "param" || t.val != "property" || t.val != "type") @@ -836,28 +845,28 @@ IsLocalAttrTarget()) { Expect(9); } Attribute( -#line 674 "cs.ATG" +#line 675 "cs.ATG" out attribute); -#line 674 "cs.ATG" +#line 675 "cs.ATG" attributes.Add(attribute); while ( -#line 675 "cs.ATG" +#line 676 "cs.ATG" NotFinalComma()) { - Expect(13); + Expect(14); Attribute( -#line 675 "cs.ATG" +#line 676 "cs.ATG" out attribute); -#line 675 "cs.ATG" +#line 676 "cs.ATG" attributes.Add(attribute); } - if (la.kind == 13) { + if (la.kind == 14) { lexer.NextToken(); } - Expect(18); + Expect(19); -#line 677 "cs.ATG" +#line 678 "cs.ATG" section = new AttributeSection(attributeTarget, attributes); section.StartLocation = startPos; section.EndLocation = t.EndLocation; @@ -865,101 +874,101 @@ out attribute); } void TypeModifier( -#line 1004 "cs.ATG" +#line 1005 "cs.ATG" Modifiers m) { switch (la.kind) { - case 87: { + case 88: { lexer.NextToken(); -#line 1006 "cs.ATG" +#line 1007 "cs.ATG" m.Add(Modifier.New, t.Location); break; } - case 96: { + case 97: { lexer.NextToken(); -#line 1007 "cs.ATG" +#line 1008 "cs.ATG" m.Add(Modifier.Public, t.Location); break; } - case 95: { + case 96: { lexer.NextToken(); -#line 1008 "cs.ATG" +#line 1009 "cs.ATG" m.Add(Modifier.Protected, t.Location); break; } - case 82: { + case 83: { lexer.NextToken(); -#line 1009 "cs.ATG" +#line 1010 "cs.ATG" m.Add(Modifier.Internal, t.Location); break; } - case 94: { + case 95: { lexer.NextToken(); -#line 1010 "cs.ATG" +#line 1011 "cs.ATG" m.Add(Modifier.Private, t.Location); break; } - case 117: { + case 118: { lexer.NextToken(); -#line 1011 "cs.ATG" +#line 1012 "cs.ATG" m.Add(Modifier.Unsafe, t.Location); break; } - case 47: { + case 48: { lexer.NextToken(); -#line 1012 "cs.ATG" +#line 1013 "cs.ATG" m.Add(Modifier.Abstract, t.Location); break; } - case 101: { + case 102: { lexer.NextToken(); -#line 1013 "cs.ATG" +#line 1014 "cs.ATG" m.Add(Modifier.Sealed, t.Location); break; } - case 105: { + case 106: { lexer.NextToken(); -#line 1014 "cs.ATG" +#line 1015 "cs.ATG" m.Add(Modifier.Static, t.Location); break; } case 1: { lexer.NextToken(); -#line 1015 "cs.ATG" +#line 1016 "cs.ATG" if (t.val == "partial") { m.Add(Modifier.Partial, t.Location); } break; } - default: SynErr(129); break; + default: SynErr(130); break; } } void TypeDecl( -#line 710 "cs.ATG" +#line 711 "cs.ATG" Modifiers m, List attributes) { -#line 712 "cs.ATG" +#line 713 "cs.ATG" TypeReference type; List names; List p = new List(); string name; List templates; - if (la.kind == 57) { + if (la.kind == 58) { -#line 718 "cs.ATG" +#line 719 "cs.ATG" m.Check(Modifier.Classes); lexer.NextToken(); -#line 719 "cs.ATG" +#line 720 "cs.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); templates = newType.Templates; compilationUnit.AddChild(newType); @@ -970,26 +979,26 @@ Modifiers m, List attributes) { Expect(1); -#line 727 "cs.ATG" +#line 728 "cs.ATG" newType.Name = t.val; - if (la.kind == 22) { + if (la.kind == 23) { TypeParameterList( -#line 730 "cs.ATG" +#line 731 "cs.ATG" templates); } if (la.kind == 9) { ClassBase( -#line 732 "cs.ATG" +#line 733 "cs.ATG" out names); -#line 732 "cs.ATG" +#line 733 "cs.ATG" newType.BaseTypes = names; } while ( -#line 735 "cs.ATG" +#line 736 "cs.ATG" IdentIsWhere()) { TypeParameterConstraintsClause( -#line 735 "cs.ATG" +#line 736 "cs.ATG" templates); } ClassBody(); @@ -997,18 +1006,18 @@ templates); lexer.NextToken(); } -#line 738 "cs.ATG" +#line 739 "cs.ATG" newType.EndLocation = t.Location; compilationUnit.BlockEnd(); } else if (StartOf(8)) { -#line 741 "cs.ATG" +#line 742 "cs.ATG" m.Check(Modifier.StructsInterfacesEnumsDelegates); - if (la.kind == 107) { + if (la.kind == 108) { lexer.NextToken(); -#line 742 "cs.ATG" +#line 743 "cs.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); templates = newType.Templates; newType.StartLocation = m.GetDeclarationLocation(t.Location); @@ -1018,26 +1027,26 @@ templates); Expect(1); -#line 749 "cs.ATG" +#line 750 "cs.ATG" newType.Name = t.val; - if (la.kind == 22) { + if (la.kind == 23) { TypeParameterList( -#line 752 "cs.ATG" +#line 753 "cs.ATG" templates); } if (la.kind == 9) { StructInterfaces( -#line 754 "cs.ATG" +#line 755 "cs.ATG" out names); -#line 754 "cs.ATG" +#line 755 "cs.ATG" newType.BaseTypes = names; } while ( -#line 757 "cs.ATG" +#line 758 "cs.ATG" IdentIsWhere()) { TypeParameterConstraintsClause( -#line 757 "cs.ATG" +#line 758 "cs.ATG" templates); } StructBody(); @@ -1045,14 +1054,14 @@ templates); lexer.NextToken(); } -#line 761 "cs.ATG" +#line 762 "cs.ATG" newType.EndLocation = t.Location; compilationUnit.BlockEnd(); - } else if (la.kind == 81) { + } else if (la.kind == 82) { lexer.NextToken(); -#line 765 "cs.ATG" +#line 766 "cs.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); templates = newType.Templates; compilationUnit.AddChild(newType); @@ -1062,26 +1071,26 @@ templates); Expect(1); -#line 772 "cs.ATG" +#line 773 "cs.ATG" newType.Name = t.val; - if (la.kind == 22) { + if (la.kind == 23) { TypeParameterList( -#line 775 "cs.ATG" +#line 776 "cs.ATG" templates); } if (la.kind == 9) { InterfaceBase( -#line 777 "cs.ATG" +#line 778 "cs.ATG" out names); -#line 777 "cs.ATG" +#line 778 "cs.ATG" newType.BaseTypes = names; } while ( -#line 780 "cs.ATG" +#line 781 "cs.ATG" IdentIsWhere()) { TypeParameterConstraintsClause( -#line 780 "cs.ATG" +#line 781 "cs.ATG" templates); } InterfaceBody(); @@ -1089,14 +1098,14 @@ templates); lexer.NextToken(); } -#line 783 "cs.ATG" +#line 784 "cs.ATG" newType.EndLocation = t.Location; compilationUnit.BlockEnd(); - } else if (la.kind == 66) { + } else if (la.kind == 67) { lexer.NextToken(); -#line 787 "cs.ATG" +#line 788 "cs.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); @@ -1105,15 +1114,15 @@ templates); Expect(1); -#line 793 "cs.ATG" +#line 794 "cs.ATG" newType.Name = t.val; if (la.kind == 9) { lexer.NextToken(); IntegralType( -#line 794 "cs.ATG" +#line 795 "cs.ATG" out name); -#line 794 "cs.ATG" +#line 795 "cs.ATG" newType.BaseTypes.Add(new TypeReference(name)); } EnumBody(); @@ -1121,154 +1130,154 @@ out name); lexer.NextToken(); } -#line 797 "cs.ATG" +#line 798 "cs.ATG" newType.EndLocation = t.Location; compilationUnit.BlockEnd(); } else { lexer.NextToken(); -#line 801 "cs.ATG" +#line 802 "cs.ATG" DelegateDeclaration delegateDeclr = new DelegateDeclaration(m.Modifier, attributes); templates = delegateDeclr.Templates; delegateDeclr.StartLocation = m.GetDeclarationLocation(t.Location); if ( -#line 805 "cs.ATG" +#line 806 "cs.ATG" NotVoidPointer()) { - Expect(121); + Expect(122); -#line 805 "cs.ATG" +#line 806 "cs.ATG" delegateDeclr.ReturnType = new TypeReference("void", 0, null); } else if (StartOf(9)) { Type( -#line 806 "cs.ATG" +#line 807 "cs.ATG" out type); -#line 806 "cs.ATG" +#line 807 "cs.ATG" delegateDeclr.ReturnType = type; - } else SynErr(130); + } else SynErr(131); Expect(1); -#line 808 "cs.ATG" +#line 809 "cs.ATG" delegateDeclr.Name = t.val; - if (la.kind == 22) { + if (la.kind == 23) { TypeParameterList( -#line 811 "cs.ATG" +#line 812 "cs.ATG" templates); } - Expect(19); + Expect(20); if (StartOf(10)) { FormalParameterList( -#line 813 "cs.ATG" +#line 814 "cs.ATG" p); -#line 813 "cs.ATG" +#line 814 "cs.ATG" delegateDeclr.Parameters = p; } - Expect(20); + Expect(21); while ( -#line 817 "cs.ATG" +#line 818 "cs.ATG" IdentIsWhere()) { TypeParameterConstraintsClause( -#line 817 "cs.ATG" +#line 818 "cs.ATG" templates); } Expect(11); -#line 819 "cs.ATG" +#line 820 "cs.ATG" delegateDeclr.EndLocation = t.Location; compilationUnit.AddChild(delegateDeclr); } - } else SynErr(131); + } else SynErr(132); } void TypeParameterList( -#line 2295 "cs.ATG" +#line 2298 "cs.ATG" List templates) { -#line 2297 "cs.ATG" +#line 2300 "cs.ATG" AttributeSection section; List attributes = new List(); - Expect(22); - while (la.kind == 17) { + Expect(23); + while (la.kind == 18) { AttributeSection( -#line 2301 "cs.ATG" +#line 2304 "cs.ATG" out section); -#line 2301 "cs.ATG" +#line 2304 "cs.ATG" attributes.Add(section); } Expect(1); -#line 2302 "cs.ATG" +#line 2305 "cs.ATG" templates.Add(new TemplateDefinition(t.val, attributes)); - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); - while (la.kind == 17) { + while (la.kind == 18) { AttributeSection( -#line 2303 "cs.ATG" +#line 2306 "cs.ATG" out section); -#line 2303 "cs.ATG" +#line 2306 "cs.ATG" attributes.Add(section); } Expect(1); -#line 2304 "cs.ATG" +#line 2307 "cs.ATG" templates.Add(new TemplateDefinition(t.val, attributes)); } - Expect(21); + Expect(22); } void ClassBase( -#line 834 "cs.ATG" +#line 835 "cs.ATG" out List names) { -#line 836 "cs.ATG" +#line 837 "cs.ATG" TypeReference typeRef; names = new List(); Expect(9); ClassType( -#line 840 "cs.ATG" +#line 841 "cs.ATG" out typeRef); -#line 840 "cs.ATG" +#line 841 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); TypeName( -#line 841 "cs.ATG" +#line 842 "cs.ATG" out typeRef); -#line 841 "cs.ATG" +#line 842 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } } } void TypeParameterConstraintsClause( -#line 2308 "cs.ATG" +#line 2311 "cs.ATG" List templates) { -#line 2309 "cs.ATG" +#line 2312 "cs.ATG" string name = ""; TypeReference type; Expect(1); -#line 2311 "cs.ATG" +#line 2314 "cs.ATG" if (t.val != "where") Error("where expected"); Expect(1); -#line 2312 "cs.ATG" +#line 2315 "cs.ATG" name = t.val; Expect(9); TypeParameterConstraintsClauseBase( -#line 2314 "cs.ATG" +#line 2317 "cs.ATG" out type); -#line 2315 "cs.ATG" +#line 2318 "cs.ATG" TemplateDefinition td = null; foreach (TemplateDefinition d in templates) { if (d.Name == name) { @@ -1278,13 +1287,13 @@ out type); } if ( td != null) { td.Bases.Add(type); } - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); TypeParameterConstraintsClauseBase( -#line 2324 "cs.ATG" +#line 2327 "cs.ATG" out type); -#line 2325 "cs.ATG" +#line 2328 "cs.ATG" td = null; foreach (TemplateDefinition d in templates) { if (d.Name == name) { @@ -1299,292 +1308,292 @@ out type); void ClassBody() { -#line 845 "cs.ATG" +#line 846 "cs.ATG" AttributeSection section; - Expect(15); + Expect(16); while (StartOf(11)) { -#line 848 "cs.ATG" +#line 849 "cs.ATG" List attributes = new List(); Modifiers m = new Modifiers(); - while (la.kind == 17) { + while (la.kind == 18) { AttributeSection( -#line 851 "cs.ATG" +#line 852 "cs.ATG" out section); -#line 851 "cs.ATG" +#line 852 "cs.ATG" attributes.Add(section); } while (StartOf(12)) { MemberModifier( -#line 852 "cs.ATG" +#line 853 "cs.ATG" m); } ClassMemberDecl( -#line 853 "cs.ATG" +#line 854 "cs.ATG" m, attributes); } - Expect(16); + Expect(17); } void StructInterfaces( -#line 858 "cs.ATG" +#line 859 "cs.ATG" out List names) { -#line 860 "cs.ATG" +#line 861 "cs.ATG" TypeReference typeRef; names = new List(); Expect(9); TypeName( -#line 864 "cs.ATG" +#line 865 "cs.ATG" out typeRef); -#line 864 "cs.ATG" +#line 865 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); TypeName( -#line 865 "cs.ATG" +#line 866 "cs.ATG" out typeRef); -#line 865 "cs.ATG" +#line 866 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } } } void StructBody() { -#line 869 "cs.ATG" +#line 870 "cs.ATG" AttributeSection section; - Expect(15); + Expect(16); while (StartOf(13)) { -#line 872 "cs.ATG" +#line 873 "cs.ATG" List attributes = new List(); Modifiers m = new Modifiers(); - while (la.kind == 17) { + while (la.kind == 18) { AttributeSection( -#line 875 "cs.ATG" +#line 876 "cs.ATG" out section); -#line 875 "cs.ATG" +#line 876 "cs.ATG" attributes.Add(section); } while (StartOf(12)) { MemberModifier( -#line 876 "cs.ATG" +#line 877 "cs.ATG" m); } StructMemberDecl( -#line 877 "cs.ATG" +#line 878 "cs.ATG" m, attributes); } - Expect(16); + Expect(17); } void InterfaceBase( -#line 882 "cs.ATG" +#line 883 "cs.ATG" out List names) { -#line 884 "cs.ATG" +#line 885 "cs.ATG" TypeReference typeRef; names = new List(); Expect(9); TypeName( -#line 888 "cs.ATG" +#line 889 "cs.ATG" out typeRef); -#line 888 "cs.ATG" +#line 889 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); TypeName( -#line 889 "cs.ATG" +#line 890 "cs.ATG" out typeRef); -#line 889 "cs.ATG" +#line 890 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } } } void InterfaceBody() { - Expect(15); + Expect(16); while (StartOf(14)) { InterfaceMemberDecl(); } - Expect(16); + Expect(17); } void IntegralType( -#line 1026 "cs.ATG" +#line 1027 "cs.ATG" out string name) { -#line 1026 "cs.ATG" +#line 1027 "cs.ATG" name = ""; switch (la.kind) { - case 100: { + case 101: { lexer.NextToken(); -#line 1028 "cs.ATG" +#line 1029 "cs.ATG" name = "sbyte"; break; } - case 52: { + case 53: { lexer.NextToken(); -#line 1029 "cs.ATG" +#line 1030 "cs.ATG" name = "byte"; break; } - case 102: { + case 103: { lexer.NextToken(); -#line 1030 "cs.ATG" +#line 1031 "cs.ATG" name = "short"; break; } - case 118: { + case 119: { lexer.NextToken(); -#line 1031 "cs.ATG" +#line 1032 "cs.ATG" name = "ushort"; break; } - case 80: { + case 81: { lexer.NextToken(); -#line 1032 "cs.ATG" +#line 1033 "cs.ATG" name = "int"; break; } - case 114: { + case 115: { lexer.NextToken(); -#line 1033 "cs.ATG" +#line 1034 "cs.ATG" name = "uint"; break; } - case 85: { + case 86: { lexer.NextToken(); -#line 1034 "cs.ATG" +#line 1035 "cs.ATG" name = "long"; break; } - case 115: { + case 116: { lexer.NextToken(); -#line 1035 "cs.ATG" +#line 1036 "cs.ATG" name = "ulong"; break; } - case 55: { + case 56: { lexer.NextToken(); -#line 1036 "cs.ATG" +#line 1037 "cs.ATG" name = "char"; break; } - default: SynErr(132); break; + default: SynErr(133); break; } } void EnumBody() { -#line 895 "cs.ATG" +#line 896 "cs.ATG" FieldDeclaration f; - Expect(15); - if (la.kind == 1 || la.kind == 17) { + Expect(16); + if (la.kind == 1 || la.kind == 18) { EnumMemberDecl( -#line 897 "cs.ATG" +#line 898 "cs.ATG" out f); -#line 897 "cs.ATG" +#line 898 "cs.ATG" compilationUnit.AddChild(f); while ( -#line 898 "cs.ATG" +#line 899 "cs.ATG" NotFinalComma()) { - Expect(13); + Expect(14); EnumMemberDecl( -#line 898 "cs.ATG" +#line 899 "cs.ATG" out f); -#line 898 "cs.ATG" +#line 899 "cs.ATG" compilationUnit.AddChild(f); } - if (la.kind == 13) { + if (la.kind == 14) { lexer.NextToken(); } } - Expect(16); + Expect(17); } void Type( -#line 903 "cs.ATG" +#line 904 "cs.ATG" out TypeReference type) { -#line 905 "cs.ATG" +#line 906 "cs.ATG" string name; int pointer = 0; type = null; - if (la.kind == 1 || la.kind == 89 || la.kind == 106) { + if (la.kind == 1 || la.kind == 90 || la.kind == 107) { ClassType( -#line 910 "cs.ATG" +#line 911 "cs.ATG" out type); } else if (StartOf(4)) { SimpleType( -#line 911 "cs.ATG" +#line 912 "cs.ATG" out name); -#line 911 "cs.ATG" +#line 912 "cs.ATG" type = new TypeReference(name); if (la.kind == 12) { NullableQuestionMark( -#line 912 "cs.ATG" +#line 913 "cs.ATG" ref type); } - } else if (la.kind == 121) { + } else if (la.kind == 122) { lexer.NextToken(); Expect(6); -#line 913 "cs.ATG" +#line 914 "cs.ATG" pointer = 1; type = new TypeReference("void"); - } else SynErr(133); + } else SynErr(134); -#line 914 "cs.ATG" +#line 915 "cs.ATG" List r = new List(); while ( -#line 916 "cs.ATG" +#line 917 "cs.ATG" IsPointerOrDims()) { -#line 916 "cs.ATG" +#line 917 "cs.ATG" int i = 0; if (la.kind == 6) { lexer.NextToken(); -#line 917 "cs.ATG" +#line 918 "cs.ATG" ++pointer; - } else if (la.kind == 17) { + } else if (la.kind == 18) { lexer.NextToken(); - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); -#line 918 "cs.ATG" +#line 919 "cs.ATG" ++i; } - Expect(18); + Expect(19); -#line 918 "cs.ATG" +#line 919 "cs.ATG" r.Add(i); - } else SynErr(134); + } else SynErr(135); } -#line 921 "cs.ATG" +#line 922 "cs.ATG" if (type != null) { type.RankSpecifier = r.ToArray(); type.PointerNestingLevel = pointer; @@ -1593,125 +1602,125 @@ IsPointerOrDims()) { } void FormalParameterList( -#line 958 "cs.ATG" +#line 959 "cs.ATG" List parameter) { -#line 961 "cs.ATG" +#line 962 "cs.ATG" ParameterDeclarationExpression p; AttributeSection section; List attributes = new List(); - while (la.kind == 17) { + while (la.kind == 18) { AttributeSection( -#line 966 "cs.ATG" +#line 967 "cs.ATG" out section); -#line 966 "cs.ATG" +#line 967 "cs.ATG" attributes.Add(section); } if (StartOf(15)) { FixedParameter( -#line 968 "cs.ATG" +#line 969 "cs.ATG" out p); -#line 968 "cs.ATG" +#line 969 "cs.ATG" bool paramsFound = false; p.Attributes = attributes; parameter.Add(p); - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); -#line 973 "cs.ATG" +#line 974 "cs.ATG" attributes = new List(); if (paramsFound) Error("params array must be at end of parameter list"); - while (la.kind == 17) { + while (la.kind == 18) { AttributeSection( -#line 974 "cs.ATG" +#line 975 "cs.ATG" out section); -#line 974 "cs.ATG" +#line 975 "cs.ATG" attributes.Add(section); } if (StartOf(15)) { FixedParameter( -#line 976 "cs.ATG" +#line 977 "cs.ATG" out p); -#line 976 "cs.ATG" +#line 977 "cs.ATG" p.Attributes = attributes; parameter.Add(p); - } else if (la.kind == 93) { + } else if (la.kind == 94) { ParameterArray( -#line 977 "cs.ATG" +#line 978 "cs.ATG" out p); -#line 977 "cs.ATG" +#line 978 "cs.ATG" paramsFound = true; p.Attributes = attributes; parameter.Add(p); - } else SynErr(135); + } else SynErr(136); } - } else if (la.kind == 93) { + } else if (la.kind == 94) { ParameterArray( -#line 980 "cs.ATG" +#line 981 "cs.ATG" out p); -#line 980 "cs.ATG" +#line 981 "cs.ATG" p.Attributes = attributes; parameter.Add(p); - } else SynErr(136); + } else SynErr(137); } void ClassType( -#line 1018 "cs.ATG" +#line 1019 "cs.ATG" out TypeReference typeRef) { -#line 1019 "cs.ATG" +#line 1020 "cs.ATG" TypeReference r; typeRef = null; if (la.kind == 1) { TypeName( -#line 1021 "cs.ATG" +#line 1022 "cs.ATG" out r); -#line 1021 "cs.ATG" +#line 1022 "cs.ATG" typeRef = r; - } else if (la.kind == 89) { + } else if (la.kind == 90) { lexer.NextToken(); -#line 1022 "cs.ATG" +#line 1023 "cs.ATG" typeRef = new TypeReference("object"); - } else if (la.kind == 106) { + } else if (la.kind == 107) { lexer.NextToken(); -#line 1023 "cs.ATG" +#line 1024 "cs.ATG" typeRef = new TypeReference("string"); - } else SynErr(137); + } else SynErr(138); } void TypeName( -#line 2249 "cs.ATG" +#line 2252 "cs.ATG" out TypeReference typeRef) { -#line 2250 "cs.ATG" +#line 2253 "cs.ATG" List typeArguments = null; string alias = null; string qualident; if ( -#line 2255 "cs.ATG" +#line 2258 "cs.ATG" la.kind == Tokens.Identifier && Peek(1).kind == Tokens.DoubleColon) { lexer.NextToken(); -#line 2256 "cs.ATG" +#line 2259 "cs.ATG" alias = t.val; Expect(10); } Qualident( -#line 2259 "cs.ATG" +#line 2262 "cs.ATG" out qualident); - if (la.kind == 22) { + if (la.kind == 23) { TypeArgumentList( -#line 2260 "cs.ATG" +#line 2263 "cs.ATG" out typeArguments); } -#line 2262 "cs.ATG" +#line 2265 "cs.ATG" if (alias == null) { typeRef = new TypeReference(qualident, typeArguments); } else if (alias == "global") { @@ -1723,164 +1732,164 @@ out typeArguments); if (la.kind == 12) { NullableQuestionMark( -#line 2271 "cs.ATG" +#line 2274 "cs.ATG" ref typeRef); } } void MemberModifier( -#line 1039 "cs.ATG" +#line 1040 "cs.ATG" Modifiers m) { switch (la.kind) { - case 47: { + case 48: { lexer.NextToken(); -#line 1041 "cs.ATG" +#line 1042 "cs.ATG" m.Add(Modifier.Abstract, t.Location); break; } - case 69: { + case 70: { lexer.NextToken(); -#line 1042 "cs.ATG" +#line 1043 "cs.ATG" m.Add(Modifier.Extern, t.Location); break; } - case 82: { + case 83: { lexer.NextToken(); -#line 1043 "cs.ATG" +#line 1044 "cs.ATG" m.Add(Modifier.Internal, t.Location); break; } - case 87: { + case 88: { lexer.NextToken(); -#line 1044 "cs.ATG" +#line 1045 "cs.ATG" m.Add(Modifier.New, t.Location); break; } - case 92: { + case 93: { lexer.NextToken(); -#line 1045 "cs.ATG" +#line 1046 "cs.ATG" m.Add(Modifier.Override, t.Location); break; } - case 94: { + case 95: { lexer.NextToken(); -#line 1046 "cs.ATG" +#line 1047 "cs.ATG" m.Add(Modifier.Private, t.Location); break; } - case 95: { + case 96: { lexer.NextToken(); -#line 1047 "cs.ATG" +#line 1048 "cs.ATG" m.Add(Modifier.Protected, t.Location); break; } - case 96: { + case 97: { lexer.NextToken(); -#line 1048 "cs.ATG" +#line 1049 "cs.ATG" m.Add(Modifier.Public, t.Location); break; } - case 97: { + case 98: { lexer.NextToken(); -#line 1049 "cs.ATG" +#line 1050 "cs.ATG" m.Add(Modifier.Readonly, t.Location); break; } - case 101: { + case 102: { lexer.NextToken(); -#line 1050 "cs.ATG" +#line 1051 "cs.ATG" m.Add(Modifier.Sealed, t.Location); break; } - case 105: { + case 106: { lexer.NextToken(); -#line 1051 "cs.ATG" +#line 1052 "cs.ATG" m.Add(Modifier.Static, t.Location); break; } - case 117: { + case 118: { lexer.NextToken(); -#line 1052 "cs.ATG" +#line 1053 "cs.ATG" m.Add(Modifier.Unsafe, t.Location); break; } - case 120: { + case 121: { lexer.NextToken(); -#line 1053 "cs.ATG" +#line 1054 "cs.ATG" m.Add(Modifier.Virtual, t.Location); break; } - case 122: { + case 123: { lexer.NextToken(); -#line 1054 "cs.ATG" +#line 1055 "cs.ATG" m.Add(Modifier.Volatile, t.Location); break; } - default: SynErr(138); break; + default: SynErr(139); break; } } void ClassMemberDecl( -#line 1295 "cs.ATG" +#line 1296 "cs.ATG" Modifiers m, List attributes) { -#line 1296 "cs.ATG" +#line 1297 "cs.ATG" Statement stmt = null; if (StartOf(16)) { StructMemberDecl( -#line 1298 "cs.ATG" +#line 1299 "cs.ATG" m, attributes); - } else if (la.kind == 26) { + } else if (la.kind == 27) { -#line 1299 "cs.ATG" +#line 1300 "cs.ATG" m.Check(Modifier.Destructors); Point startPos = t.Location; lexer.NextToken(); Expect(1); -#line 1300 "cs.ATG" +#line 1301 "cs.ATG" DestructorDeclaration d = new DestructorDeclaration(t.val, m.Modifier, attributes); d.Modifier = m.Modifier; d.StartLocation = m.GetDeclarationLocation(startPos); - Expect(19); Expect(20); + Expect(21); -#line 1304 "cs.ATG" +#line 1305 "cs.ATG" d.EndLocation = t.EndLocation; - if (la.kind == 15) { + if (la.kind == 16) { Block( -#line 1304 "cs.ATG" +#line 1305 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); - } else SynErr(139); + } else SynErr(140); -#line 1305 "cs.ATG" +#line 1306 "cs.ATG" d.Body = (BlockStatement)stmt; compilationUnit.AddChild(d); - } else SynErr(140); + } else SynErr(141); } void StructMemberDecl( -#line 1057 "cs.ATG" +#line 1058 "cs.ATG" Modifiers m, List attributes) { -#line 1059 "cs.ATG" +#line 1060 "cs.ATG" string qualident = null; TypeReference type; Expression expr; @@ -1889,20 +1898,20 @@ Modifiers m, List attributes) { List variableDeclarators = new List(); List templates = new List(); - if (la.kind == 58) { + if (la.kind == 59) { -#line 1068 "cs.ATG" +#line 1069 "cs.ATG" m.Check(Modifier.Constants); lexer.NextToken(); -#line 1069 "cs.ATG" +#line 1070 "cs.ATG" Point startPos = t.Location; Type( -#line 1070 "cs.ATG" +#line 1071 "cs.ATG" out type); Expect(1); -#line 1070 "cs.ATG" +#line 1071 "cs.ATG" FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier | Modifier.Const); fd.StartLocation = m.GetDeclarationLocation(startPos); VariableDeclaration f = new VariableDeclaration(t.val); @@ -1910,58 +1919,58 @@ out type); Expect(3); Expr( -#line 1075 "cs.ATG" +#line 1076 "cs.ATG" out expr); -#line 1075 "cs.ATG" +#line 1076 "cs.ATG" f.Initializer = expr; - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); Expect(1); -#line 1076 "cs.ATG" +#line 1077 "cs.ATG" f = new VariableDeclaration(t.val); fd.Fields.Add(f); Expect(3); Expr( -#line 1079 "cs.ATG" +#line 1080 "cs.ATG" out expr); -#line 1079 "cs.ATG" +#line 1080 "cs.ATG" f.Initializer = expr; } Expect(11); -#line 1080 "cs.ATG" +#line 1081 "cs.ATG" fd.EndLocation = t.EndLocation; compilationUnit.AddChild(fd); } else if ( -#line 1083 "cs.ATG" +#line 1084 "cs.ATG" NotVoidPointer()) { -#line 1083 "cs.ATG" +#line 1084 "cs.ATG" m.Check(Modifier.PropertysEventsMethods); - Expect(121); + Expect(122); -#line 1084 "cs.ATG" +#line 1085 "cs.ATG" Point startPos = t.Location; Qualident( -#line 1085 "cs.ATG" +#line 1086 "cs.ATG" out qualident); - if (la.kind == 22) { + if (la.kind == 23) { TypeParameterList( -#line 1087 "cs.ATG" +#line 1088 "cs.ATG" templates); } - Expect(19); + Expect(20); if (StartOf(10)) { FormalParameterList( -#line 1090 "cs.ATG" +#line 1091 "cs.ATG" p); } - Expect(20); + Expect(21); -#line 1090 "cs.ATG" +#line 1091 "cs.ATG" MethodDeclaration methodDeclaration = new MethodDeclaration(qualident, m.Modifier, new TypeReference("void"), @@ -1974,31 +1983,31 @@ p); compilationUnit.BlockStart(methodDeclaration); while ( -#line 1103 "cs.ATG" +#line 1104 "cs.ATG" IdentIsWhere()) { TypeParameterConstraintsClause( -#line 1103 "cs.ATG" +#line 1104 "cs.ATG" templates); } - if (la.kind == 15) { + if (la.kind == 16) { Block( -#line 1105 "cs.ATG" +#line 1106 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); - } else SynErr(141); + } else SynErr(142); -#line 1105 "cs.ATG" +#line 1106 "cs.ATG" compilationUnit.BlockEnd(); methodDeclaration.Body = (BlockStatement)stmt; - } else if (la.kind == 67) { + } else if (la.kind == 68) { -#line 1109 "cs.ATG" +#line 1110 "cs.ATG" m.Check(Modifier.PropertysEventsMethods); lexer.NextToken(); -#line 1110 "cs.ATG" +#line 1111 "cs.ATG" EventDeclaration eventDecl = new EventDeclaration(m.Modifier, attributes); eventDecl.StartLocation = t.Location; compilationUnit.AddChild(eventDecl); @@ -2007,150 +2016,150 @@ out stmt); EventRemoveRegion removeBlock = null; Type( -#line 1117 "cs.ATG" +#line 1118 "cs.ATG" out type); -#line 1117 "cs.ATG" +#line 1118 "cs.ATG" eventDecl.TypeReference = type; if ( -#line 1119 "cs.ATG" +#line 1120 "cs.ATG" IsVarDecl()) { VariableDeclarator( -#line 1119 "cs.ATG" +#line 1120 "cs.ATG" variableDeclarators); - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); VariableDeclarator( -#line 1120 "cs.ATG" +#line 1121 "cs.ATG" variableDeclarators); } Expect(11); -#line 1120 "cs.ATG" +#line 1121 "cs.ATG" eventDecl.VariableDeclarators = variableDeclarators; eventDecl.EndLocation = t.EndLocation; } else if (la.kind == 1) { Qualident( -#line 1121 "cs.ATG" +#line 1122 "cs.ATG" out qualident); -#line 1121 "cs.ATG" +#line 1122 "cs.ATG" eventDecl.Name = qualident; eventDecl.EndLocation = t.EndLocation; - Expect(15); + Expect(16); -#line 1122 "cs.ATG" +#line 1123 "cs.ATG" eventDecl.BodyStart = t.Location; EventAccessorDecls( -#line 1123 "cs.ATG" +#line 1124 "cs.ATG" out addBlock, out removeBlock); - Expect(16); + Expect(17); -#line 1124 "cs.ATG" +#line 1125 "cs.ATG" eventDecl.BodyEnd = t.EndLocation; - } else SynErr(142); + } else SynErr(143); -#line 1125 "cs.ATG" +#line 1126 "cs.ATG" compilationUnit.BlockEnd(); eventDecl.AddRegion = addBlock; eventDecl.RemoveRegion = removeBlock; } else if ( -#line 1132 "cs.ATG" +#line 1133 "cs.ATG" IdentAndLPar()) { -#line 1132 "cs.ATG" +#line 1133 "cs.ATG" m.Check(Modifier.Constructors | Modifier.StaticConstructors); Expect(1); -#line 1133 "cs.ATG" +#line 1134 "cs.ATG" string name = t.val; Point startPos = t.Location; - Expect(19); + Expect(20); if (StartOf(10)) { -#line 1133 "cs.ATG" +#line 1134 "cs.ATG" m.Check(Modifier.Constructors); FormalParameterList( -#line 1134 "cs.ATG" +#line 1135 "cs.ATG" p); } - Expect(20); + Expect(21); -#line 1136 "cs.ATG" +#line 1137 "cs.ATG" ConstructorInitializer init = null; if (la.kind == 9) { -#line 1137 "cs.ATG" +#line 1138 "cs.ATG" m.Check(Modifier.Constructors); ConstructorInitializer( -#line 1138 "cs.ATG" +#line 1139 "cs.ATG" out init); } -#line 1140 "cs.ATG" +#line 1141 "cs.ATG" ConstructorDeclaration cd = new ConstructorDeclaration(name, m.Modifier, p, init, attributes); cd.StartLocation = startPos; cd.EndLocation = t.EndLocation; - if (la.kind == 15) { + if (la.kind == 16) { Block( -#line 1145 "cs.ATG" +#line 1146 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); - } else SynErr(143); + } else SynErr(144); -#line 1145 "cs.ATG" +#line 1146 "cs.ATG" cd.Body = (BlockStatement)stmt; compilationUnit.AddChild(cd); - } else if (la.kind == 68 || la.kind == 78) { + } else if (la.kind == 69 || la.kind == 79) { -#line 1148 "cs.ATG" +#line 1149 "cs.ATG" m.Check(Modifier.Operators); if (m.isNone) Error("at least one modifier must be set"); bool isImplicit = true; Point startPos = Point.Empty; - if (la.kind == 78) { + if (la.kind == 79) { lexer.NextToken(); -#line 1153 "cs.ATG" +#line 1154 "cs.ATG" startPos = t.Location; } else { lexer.NextToken(); -#line 1153 "cs.ATG" +#line 1154 "cs.ATG" isImplicit = false; startPos = t.Location; } - Expect(90); + Expect(91); Type( -#line 1154 "cs.ATG" +#line 1155 "cs.ATG" out type); -#line 1154 "cs.ATG" +#line 1155 "cs.ATG" TypeReference operatorType = type; - Expect(19); + Expect(20); Type( -#line 1155 "cs.ATG" +#line 1156 "cs.ATG" out type); Expect(1); -#line 1155 "cs.ATG" +#line 1156 "cs.ATG" string varName = t.val; - Expect(20); + Expect(21); -#line 1156 "cs.ATG" +#line 1157 "cs.ATG" Point endPos = t.Location; - if (la.kind == 15) { + if (la.kind == 16) { Block( -#line 1157 "cs.ATG" +#line 1158 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); -#line 1157 "cs.ATG" +#line 1158 "cs.ATG" stmt = null; - } else SynErr(144); + } else SynErr(145); -#line 1160 "cs.ATG" +#line 1161 "cs.ATG" List parameters = new List(); parameters.Add(new ParameterDeclarationExpression(type, varName)); OperatorDeclaration operatorDeclaration = new OperatorDeclaration(m.Modifier, @@ -2166,61 +2175,61 @@ out stmt); } else if (StartOf(17)) { TypeDecl( -#line 1175 "cs.ATG" +#line 1176 "cs.ATG" m, attributes); } else if (StartOf(9)) { Type( -#line 1176 "cs.ATG" +#line 1177 "cs.ATG" out type); -#line 1176 "cs.ATG" +#line 1177 "cs.ATG" Point startPos = t.Location; - if (la.kind == 90) { + if (la.kind == 91) { -#line 1178 "cs.ATG" +#line 1179 "cs.ATG" OverloadableOperatorType op; m.Check(Modifier.Operators); if (m.isNone) Error("at least one modifier must be set"); lexer.NextToken(); OverloadableOperator( -#line 1182 "cs.ATG" +#line 1183 "cs.ATG" out op); -#line 1182 "cs.ATG" +#line 1183 "cs.ATG" TypeReference firstType, secondType = null; string secondName = null; - Expect(19); + Expect(20); Type( -#line 1183 "cs.ATG" +#line 1184 "cs.ATG" out firstType); Expect(1); -#line 1183 "cs.ATG" +#line 1184 "cs.ATG" string firstName = t.val; - if (la.kind == 13) { + if (la.kind == 14) { lexer.NextToken(); Type( -#line 1184 "cs.ATG" +#line 1185 "cs.ATG" out secondType); Expect(1); -#line 1184 "cs.ATG" +#line 1185 "cs.ATG" secondName = t.val; - } else if (la.kind == 20) { - } else SynErr(145); + } else if (la.kind == 21) { + } else SynErr(146); -#line 1192 "cs.ATG" +#line 1193 "cs.ATG" Point endPos = t.Location; - Expect(20); - if (la.kind == 15) { + Expect(21); + if (la.kind == 16) { Block( -#line 1193 "cs.ATG" +#line 1194 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); - } else SynErr(146); + } else SynErr(147); -#line 1195 "cs.ATG" +#line 1196 "cs.ATG" List parameters = new List(); parameters.Add(new ParameterDeclarationExpression(firstType, firstName)); if (secondType != null) { @@ -2237,43 +2246,43 @@ out stmt); compilationUnit.AddChild(operatorDeclaration); } else if ( -#line 1212 "cs.ATG" +#line 1213 "cs.ATG" IsVarDecl()) { -#line 1212 "cs.ATG" +#line 1213 "cs.ATG" m.Check(Modifier.Fields); FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier); fd.StartLocation = m.GetDeclarationLocation(startPos); VariableDeclarator( -#line 1216 "cs.ATG" +#line 1217 "cs.ATG" variableDeclarators); - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); VariableDeclarator( -#line 1217 "cs.ATG" +#line 1218 "cs.ATG" variableDeclarators); } Expect(11); -#line 1218 "cs.ATG" +#line 1219 "cs.ATG" fd.EndLocation = t.EndLocation; fd.Fields = variableDeclarators; compilationUnit.AddChild(fd); - } else if (la.kind == 109) { + } else if (la.kind == 110) { -#line 1221 "cs.ATG" +#line 1222 "cs.ATG" m.Check(Modifier.Indexers); lexer.NextToken(); - Expect(17); + Expect(18); FormalParameterList( -#line 1222 "cs.ATG" +#line 1223 "cs.ATG" p); - Expect(18); + Expect(19); -#line 1222 "cs.ATG" +#line 1223 "cs.ATG" Point endLocation = t.EndLocation; - Expect(15); + Expect(16); -#line 1223 "cs.ATG" +#line 1224 "cs.ATG" IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes); indexer.StartLocation = startPos; indexer.EndLocation = endLocation; @@ -2282,11 +2291,11 @@ p); PropertySetRegion setRegion; AccessorDecls( -#line 1230 "cs.ATG" +#line 1231 "cs.ATG" out getRegion, out setRegion); - Expect(16); + Expect(17); -#line 1231 "cs.ATG" +#line 1232 "cs.ATG" indexer.BodyEnd = t.EndLocation; indexer.GetRegion = getRegion; indexer.SetRegion = setRegion; @@ -2294,30 +2303,30 @@ out getRegion, out setRegion); } else if (la.kind == 1) { Qualident( -#line 1236 "cs.ATG" +#line 1237 "cs.ATG" out qualident); -#line 1236 "cs.ATG" +#line 1237 "cs.ATG" Point qualIdentEndLocation = t.EndLocation; - if (la.kind == 15 || la.kind == 19 || la.kind == 22) { - if (la.kind == 19 || la.kind == 22) { + if (la.kind == 16 || la.kind == 20 || la.kind == 23) { + if (la.kind == 20 || la.kind == 23) { -#line 1239 "cs.ATG" +#line 1240 "cs.ATG" m.Check(Modifier.PropertysEventsMethods); - if (la.kind == 22) { + if (la.kind == 23) { TypeParameterList( -#line 1241 "cs.ATG" +#line 1242 "cs.ATG" templates); } - Expect(19); + Expect(20); if (StartOf(10)) { FormalParameterList( -#line 1242 "cs.ATG" +#line 1243 "cs.ATG" p); } - Expect(20); + Expect(21); -#line 1243 "cs.ATG" +#line 1244 "cs.ATG" MethodDeclaration methodDeclaration = new MethodDeclaration(qualident, m.Modifier, type, @@ -2329,26 +2338,26 @@ p); compilationUnit.AddChild(methodDeclaration); while ( -#line 1253 "cs.ATG" +#line 1254 "cs.ATG" IdentIsWhere()) { TypeParameterConstraintsClause( -#line 1253 "cs.ATG" +#line 1254 "cs.ATG" templates); } - if (la.kind == 15) { + if (la.kind == 16) { Block( -#line 1254 "cs.ATG" +#line 1255 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); - } else SynErr(147); + } else SynErr(148); -#line 1254 "cs.ATG" +#line 1255 "cs.ATG" methodDeclaration.Body = (BlockStatement)stmt; } else { lexer.NextToken(); -#line 1257 "cs.ATG" +#line 1258 "cs.ATG" PropertyDeclaration pDecl = new PropertyDeclaration(qualident, type, m.Modifier, attributes); pDecl.StartLocation = m.GetDeclarationLocation(startPos); pDecl.EndLocation = qualIdentEndLocation; @@ -2357,30 +2366,30 @@ out stmt); PropertySetRegion setRegion; AccessorDecls( -#line 1264 "cs.ATG" +#line 1265 "cs.ATG" out getRegion, out setRegion); - Expect(16); + Expect(17); -#line 1266 "cs.ATG" +#line 1267 "cs.ATG" pDecl.GetRegion = getRegion; pDecl.SetRegion = setRegion; pDecl.BodyEnd = t.EndLocation; compilationUnit.AddChild(pDecl); } - } else if (la.kind == 14) { + } else if (la.kind == 15) { -#line 1274 "cs.ATG" +#line 1275 "cs.ATG" m.Check(Modifier.Indexers); lexer.NextToken(); - Expect(109); - Expect(17); + Expect(110); + Expect(18); FormalParameterList( -#line 1275 "cs.ATG" +#line 1276 "cs.ATG" p); - Expect(18); + Expect(19); -#line 1276 "cs.ATG" +#line 1277 "cs.ATG" IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes); indexer.StartLocation = m.GetDeclarationLocation(startPos); indexer.EndLocation = t.EndLocation; @@ -2388,30 +2397,30 @@ p); PropertyGetRegion getRegion; PropertySetRegion setRegion; - Expect(15); + Expect(16); -#line 1283 "cs.ATG" +#line 1284 "cs.ATG" Point bodyStart = t.Location; AccessorDecls( -#line 1284 "cs.ATG" +#line 1285 "cs.ATG" out getRegion, out setRegion); - Expect(16); + Expect(17); -#line 1285 "cs.ATG" +#line 1286 "cs.ATG" indexer.BodyStart = bodyStart; indexer.BodyEnd = t.EndLocation; indexer.GetRegion = getRegion; indexer.SetRegion = setRegion; compilationUnit.AddChild(indexer); - } else SynErr(148); - } else SynErr(149); - } else SynErr(150); + } else SynErr(149); + } else SynErr(150); + } else SynErr(151); } void InterfaceMemberDecl() { -#line 1312 "cs.ATG" +#line 1313 "cs.ATG" TypeReference type; AttributeSection section; @@ -2424,53 +2433,53 @@ out getRegion, out setRegion); Point startLocation = new Point(-1, -1); List templates = new List(); - while (la.kind == 17) { + while (la.kind == 18) { AttributeSection( -#line 1325 "cs.ATG" +#line 1326 "cs.ATG" out section); -#line 1325 "cs.ATG" +#line 1326 "cs.ATG" attributes.Add(section); } - if (la.kind == 87) { + if (la.kind == 88) { lexer.NextToken(); -#line 1326 "cs.ATG" +#line 1327 "cs.ATG" mod = Modifier.New; startLocation = t.Location; } if ( -#line 1329 "cs.ATG" +#line 1330 "cs.ATG" NotVoidPointer()) { - Expect(121); + Expect(122); -#line 1329 "cs.ATG" +#line 1330 "cs.ATG" if (startLocation.X == -1) startLocation = t.Location; Expect(1); -#line 1329 "cs.ATG" +#line 1330 "cs.ATG" name = t.val; - if (la.kind == 22) { + if (la.kind == 23) { TypeParameterList( -#line 1330 "cs.ATG" +#line 1331 "cs.ATG" templates); } - Expect(19); + Expect(20); if (StartOf(10)) { FormalParameterList( -#line 1331 "cs.ATG" +#line 1332 "cs.ATG" parameters); } - Expect(20); + Expect(21); while ( -#line 1332 "cs.ATG" +#line 1333 "cs.ATG" IdentIsWhere()) { TypeParameterConstraintsClause( -#line 1332 "cs.ATG" +#line 1333 "cs.ATG" templates); } Expect(11); -#line 1334 "cs.ATG" +#line 1335 "cs.ATG" MethodDeclaration md = new MethodDeclaration(name, mod, new TypeReference("void"), parameters, attributes); md.StartLocation = startLocation; md.EndLocation = t.EndLocation; @@ -2480,129 +2489,129 @@ templates); } else if (StartOf(18)) { if (StartOf(9)) { Type( -#line 1341 "cs.ATG" +#line 1342 "cs.ATG" out type); -#line 1341 "cs.ATG" +#line 1342 "cs.ATG" if (startLocation.X == -1) startLocation = t.Location; if (la.kind == 1) { lexer.NextToken(); -#line 1343 "cs.ATG" +#line 1344 "cs.ATG" name = t.val; Point qualIdentEndLocation = t.EndLocation; - if (la.kind == 19 || la.kind == 22) { - if (la.kind == 22) { + if (la.kind == 20 || la.kind == 23) { + if (la.kind == 23) { TypeParameterList( -#line 1347 "cs.ATG" +#line 1348 "cs.ATG" templates); } - Expect(19); + Expect(20); if (StartOf(10)) { FormalParameterList( -#line 1348 "cs.ATG" +#line 1349 "cs.ATG" parameters); } - Expect(20); + Expect(21); while ( -#line 1350 "cs.ATG" +#line 1351 "cs.ATG" IdentIsWhere()) { TypeParameterConstraintsClause( -#line 1350 "cs.ATG" +#line 1351 "cs.ATG" templates); } Expect(11); -#line 1351 "cs.ATG" +#line 1352 "cs.ATG" MethodDeclaration md = new MethodDeclaration(name, mod, type, parameters, attributes); md.StartLocation = startLocation; md.EndLocation = t.EndLocation; md.Templates = templates; compilationUnit.AddChild(md); - } else if (la.kind == 15) { + } else if (la.kind == 16) { -#line 1358 "cs.ATG" +#line 1359 "cs.ATG" PropertyDeclaration pd = new PropertyDeclaration(name, type, mod, attributes); compilationUnit.AddChild(pd); lexer.NextToken(); -#line 1359 "cs.ATG" +#line 1360 "cs.ATG" Point bodyStart = t.Location; InterfaceAccessors( -#line 1359 "cs.ATG" +#line 1360 "cs.ATG" out getBlock, out setBlock); - Expect(16); + Expect(17); -#line 1359 "cs.ATG" +#line 1360 "cs.ATG" pd.GetRegion = getBlock; pd.SetRegion = setBlock; pd.StartLocation = startLocation; pd.EndLocation = qualIdentEndLocation; pd.BodyStart = bodyStart; pd.BodyEnd = t.EndLocation; - } else SynErr(151); - } else if (la.kind == 109) { + } else SynErr(152); + } else if (la.kind == 110) { lexer.NextToken(); - Expect(17); + Expect(18); FormalParameterList( -#line 1362 "cs.ATG" +#line 1363 "cs.ATG" parameters); - Expect(18); + Expect(19); -#line 1362 "cs.ATG" +#line 1363 "cs.ATG" Point bracketEndLocation = t.EndLocation; -#line 1362 "cs.ATG" +#line 1363 "cs.ATG" IndexerDeclaration id = new IndexerDeclaration(type, parameters, mod, attributes); compilationUnit.AddChild(id); - Expect(15); + Expect(16); -#line 1363 "cs.ATG" +#line 1364 "cs.ATG" Point bodyStart = t.Location; InterfaceAccessors( -#line 1363 "cs.ATG" +#line 1364 "cs.ATG" out getBlock, out setBlock); - Expect(16); + Expect(17); -#line 1363 "cs.ATG" +#line 1364 "cs.ATG" id.GetRegion = getBlock; id.SetRegion = setBlock; id.StartLocation = startLocation; id.EndLocation = bracketEndLocation; id.BodyStart = bodyStart; id.BodyEnd = t.EndLocation; - } else SynErr(152); + } else SynErr(153); } else { lexer.NextToken(); -#line 1366 "cs.ATG" +#line 1367 "cs.ATG" if (startLocation.X == -1) startLocation = t.Location; Type( -#line 1366 "cs.ATG" +#line 1367 "cs.ATG" out type); Expect(1); -#line 1366 "cs.ATG" +#line 1367 "cs.ATG" EventDeclaration ed = new EventDeclaration(type, t.val, mod, attributes); compilationUnit.AddChild(ed); Expect(11); -#line 1369 "cs.ATG" +#line 1370 "cs.ATG" ed.StartLocation = startLocation; ed.EndLocation = t.EndLocation; } - } else SynErr(153); + } else SynErr(154); } void EnumMemberDecl( -#line 1374 "cs.ATG" +#line 1375 "cs.ATG" out FieldDeclaration f) { -#line 1376 "cs.ATG" +#line 1377 "cs.ATG" Expression expr = null; List attributes = new List(); AttributeSection section = null; VariableDeclaration varDecl = null; - while (la.kind == 17) { + while (la.kind == 18) { AttributeSection( -#line 1382 "cs.ATG" +#line 1383 "cs.ATG" out section); -#line 1382 "cs.ATG" +#line 1383 "cs.ATG" attributes.Add(section); } Expect(1); -#line 1383 "cs.ATG" +#line 1384 "cs.ATG" f = new FieldDeclaration(attributes); varDecl = new VariableDeclaration(t.val); f.Fields.Add(varDecl); @@ -2611,114 +2620,114 @@ out section); if (la.kind == 3) { lexer.NextToken(); Expr( -#line 1388 "cs.ATG" +#line 1389 "cs.ATG" out expr); -#line 1388 "cs.ATG" +#line 1389 "cs.ATG" varDecl.Initializer = expr; } } void SimpleType( -#line 947 "cs.ATG" +#line 948 "cs.ATG" out string name) { -#line 948 "cs.ATG" +#line 949 "cs.ATG" name = String.Empty; if (StartOf(19)) { IntegralType( -#line 950 "cs.ATG" +#line 951 "cs.ATG" out name); - } else if (la.kind == 73) { + } else if (la.kind == 74) { lexer.NextToken(); -#line 951 "cs.ATG" +#line 952 "cs.ATG" name = "float"; - } else if (la.kind == 64) { + } else if (la.kind == 65) { lexer.NextToken(); -#line 952 "cs.ATG" +#line 953 "cs.ATG" name = "double"; - } else if (la.kind == 60) { + } else if (la.kind == 61) { lexer.NextToken(); -#line 953 "cs.ATG" +#line 954 "cs.ATG" name = "decimal"; - } else if (la.kind == 50) { + } else if (la.kind == 51) { lexer.NextToken(); -#line 954 "cs.ATG" +#line 955 "cs.ATG" name = "bool"; - } else SynErr(154); + } else SynErr(155); } void NullableQuestionMark( -#line 2274 "cs.ATG" +#line 2277 "cs.ATG" ref TypeReference typeRef) { -#line 2275 "cs.ATG" +#line 2278 "cs.ATG" List typeArguments = new List(1); Expect(12); -#line 2279 "cs.ATG" +#line 2282 "cs.ATG" if (typeRef != null) typeArguments.Add(typeRef); typeRef = new TypeReference("System.Nullable", typeArguments); } void FixedParameter( -#line 984 "cs.ATG" +#line 985 "cs.ATG" out ParameterDeclarationExpression p) { -#line 986 "cs.ATG" +#line 987 "cs.ATG" TypeReference type; ParamModifier mod = ParamModifier.In; System.Drawing.Point start = t.Location; - if (la.kind == 91 || la.kind == 98) { - if (la.kind == 98) { + if (la.kind == 92 || la.kind == 99) { + if (la.kind == 99) { lexer.NextToken(); -#line 992 "cs.ATG" +#line 993 "cs.ATG" mod = ParamModifier.Ref; } else { lexer.NextToken(); -#line 993 "cs.ATG" +#line 994 "cs.ATG" mod = ParamModifier.Out; } } Type( -#line 995 "cs.ATG" +#line 996 "cs.ATG" out type); Expect(1); -#line 995 "cs.ATG" +#line 996 "cs.ATG" p = new ParameterDeclarationExpression(type, t.val, mod); p.StartLocation = start; p.EndLocation = t.Location; } void ParameterArray( -#line 998 "cs.ATG" +#line 999 "cs.ATG" out ParameterDeclarationExpression p) { -#line 999 "cs.ATG" +#line 1000 "cs.ATG" TypeReference type; - Expect(93); + Expect(94); Type( -#line 1001 "cs.ATG" +#line 1002 "cs.ATG" out type); Expect(1); -#line 1001 "cs.ATG" +#line 1002 "cs.ATG" p = new ParameterDeclarationExpression(type, t.val, ParamModifier.Params); } void Block( -#line 1505 "cs.ATG" +#line 1506 "cs.ATG" out Statement stmt) { - Expect(15); + Expect(16); -#line 1507 "cs.ATG" +#line 1508 "cs.ATG" BlockStatement blockStmt = new BlockStatement(); blockStmt.StartLocation = t.EndLocation; compilationUnit.BlockStart(blockStmt); @@ -2727,9 +2736,9 @@ out Statement stmt) { while (StartOf(20)) { Statement(); } - Expect(16); + Expect(17); -#line 1514 "cs.ATG" +#line 1515 "cs.ATG" stmt = blockStmt; blockStmt.EndLocation = t.EndLocation; compilationUnit.BlockEnd(); @@ -2737,658 +2746,658 @@ out Statement stmt) { } void VariableDeclarator( -#line 1498 "cs.ATG" +#line 1499 "cs.ATG" List fieldDeclaration) { -#line 1499 "cs.ATG" +#line 1500 "cs.ATG" Expression expr = null; Expect(1); -#line 1501 "cs.ATG" +#line 1502 "cs.ATG" VariableDeclaration f = new VariableDeclaration(t.val); if (la.kind == 3) { lexer.NextToken(); VariableInitializer( -#line 1502 "cs.ATG" +#line 1503 "cs.ATG" out expr); -#line 1502 "cs.ATG" +#line 1503 "cs.ATG" f.Initializer = expr; } -#line 1502 "cs.ATG" +#line 1503 "cs.ATG" fieldDeclaration.Add(f); } void EventAccessorDecls( -#line 1440 "cs.ATG" +#line 1441 "cs.ATG" out EventAddRegion addBlock, out EventRemoveRegion removeBlock) { -#line 1441 "cs.ATG" +#line 1442 "cs.ATG" AttributeSection section; List attributes = new List(); Statement stmt; addBlock = null; removeBlock = null; - while (la.kind == 17) { + while (la.kind == 18) { AttributeSection( -#line 1448 "cs.ATG" +#line 1449 "cs.ATG" out section); -#line 1448 "cs.ATG" +#line 1449 "cs.ATG" attributes.Add(section); } if ( -#line 1450 "cs.ATG" +#line 1451 "cs.ATG" IdentIsAdd()) { -#line 1450 "cs.ATG" +#line 1451 "cs.ATG" addBlock = new EventAddRegion(attributes); AddAccessorDecl( -#line 1451 "cs.ATG" +#line 1452 "cs.ATG" out stmt); -#line 1451 "cs.ATG" +#line 1452 "cs.ATG" attributes = new List(); addBlock.Block = (BlockStatement)stmt; - while (la.kind == 17) { + while (la.kind == 18) { AttributeSection( -#line 1452 "cs.ATG" +#line 1453 "cs.ATG" out section); -#line 1452 "cs.ATG" +#line 1453 "cs.ATG" attributes.Add(section); } RemoveAccessorDecl( -#line 1453 "cs.ATG" +#line 1454 "cs.ATG" out stmt); -#line 1453 "cs.ATG" +#line 1454 "cs.ATG" removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; } else if ( -#line 1454 "cs.ATG" +#line 1455 "cs.ATG" IdentIsRemove()) { RemoveAccessorDecl( -#line 1455 "cs.ATG" +#line 1456 "cs.ATG" out stmt); -#line 1455 "cs.ATG" +#line 1456 "cs.ATG" removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; attributes = new List(); - while (la.kind == 17) { + while (la.kind == 18) { AttributeSection( -#line 1456 "cs.ATG" +#line 1457 "cs.ATG" out section); -#line 1456 "cs.ATG" +#line 1457 "cs.ATG" attributes.Add(section); } AddAccessorDecl( -#line 1457 "cs.ATG" +#line 1458 "cs.ATG" out stmt); -#line 1457 "cs.ATG" +#line 1458 "cs.ATG" addBlock = new EventAddRegion(attributes); addBlock.Block = (BlockStatement)stmt; } else if (la.kind == 1) { lexer.NextToken(); -#line 1458 "cs.ATG" +#line 1459 "cs.ATG" Error("add or remove accessor declaration expected"); - } else SynErr(155); + } else SynErr(156); } void ConstructorInitializer( -#line 1536 "cs.ATG" +#line 1537 "cs.ATG" out ConstructorInitializer ci) { -#line 1537 "cs.ATG" +#line 1538 "cs.ATG" Expression expr; ci = new ConstructorInitializer(); Expect(9); - if (la.kind == 49) { + if (la.kind == 50) { lexer.NextToken(); -#line 1541 "cs.ATG" +#line 1542 "cs.ATG" ci.ConstructorInitializerType = ConstructorInitializerType.Base; - } else if (la.kind == 109) { + } else if (la.kind == 110) { lexer.NextToken(); -#line 1542 "cs.ATG" +#line 1543 "cs.ATG" ci.ConstructorInitializerType = ConstructorInitializerType.This; - } else SynErr(156); - Expect(19); + } else SynErr(157); + Expect(20); if (StartOf(21)) { Argument( -#line 1545 "cs.ATG" +#line 1546 "cs.ATG" out expr); -#line 1545 "cs.ATG" +#line 1546 "cs.ATG" if (expr != null) { ci.Arguments.Add(expr); } - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); Argument( -#line 1545 "cs.ATG" +#line 1546 "cs.ATG" out expr); -#line 1545 "cs.ATG" +#line 1546 "cs.ATG" if (expr != null) { ci.Arguments.Add(expr); } } } - Expect(20); + Expect(21); } void OverloadableOperator( -#line 1557 "cs.ATG" +#line 1558 "cs.ATG" out OverloadableOperatorType op) { -#line 1558 "cs.ATG" +#line 1559 "cs.ATG" op = OverloadableOperatorType.None; switch (la.kind) { case 4: { lexer.NextToken(); -#line 1560 "cs.ATG" +#line 1561 "cs.ATG" op = OverloadableOperatorType.Add; break; } case 5: { lexer.NextToken(); -#line 1561 "cs.ATG" +#line 1562 "cs.ATG" op = OverloadableOperatorType.Subtract; break; } - case 23: { + case 24: { lexer.NextToken(); -#line 1563 "cs.ATG" +#line 1564 "cs.ATG" op = OverloadableOperatorType.Not; break; } - case 26: { + case 27: { lexer.NextToken(); -#line 1564 "cs.ATG" +#line 1565 "cs.ATG" op = OverloadableOperatorType.BitNot; break; } - case 30: { + case 31: { lexer.NextToken(); -#line 1566 "cs.ATG" +#line 1567 "cs.ATG" op = OverloadableOperatorType.Increment; break; } - case 31: { + case 32: { lexer.NextToken(); -#line 1567 "cs.ATG" +#line 1568 "cs.ATG" op = OverloadableOperatorType.Decrement; break; } - case 111: { + case 112: { lexer.NextToken(); -#line 1569 "cs.ATG" +#line 1570 "cs.ATG" op = OverloadableOperatorType.True; break; } - case 70: { + case 71: { lexer.NextToken(); -#line 1570 "cs.ATG" +#line 1571 "cs.ATG" op = OverloadableOperatorType.False; break; } case 6: { lexer.NextToken(); -#line 1572 "cs.ATG" +#line 1573 "cs.ATG" op = OverloadableOperatorType.Multiply; break; } case 7: { lexer.NextToken(); -#line 1573 "cs.ATG" +#line 1574 "cs.ATG" op = OverloadableOperatorType.Divide; break; } case 8: { lexer.NextToken(); -#line 1574 "cs.ATG" +#line 1575 "cs.ATG" op = OverloadableOperatorType.Modulus; break; } - case 27: { + case 28: { lexer.NextToken(); -#line 1576 "cs.ATG" +#line 1577 "cs.ATG" op = OverloadableOperatorType.BitwiseAnd; break; } - case 28: { + case 29: { lexer.NextToken(); -#line 1577 "cs.ATG" +#line 1578 "cs.ATG" op = OverloadableOperatorType.BitwiseOr; break; } - case 29: { + case 30: { lexer.NextToken(); -#line 1578 "cs.ATG" +#line 1579 "cs.ATG" op = OverloadableOperatorType.ExclusiveOr; break; } - case 36: { + case 37: { lexer.NextToken(); -#line 1580 "cs.ATG" +#line 1581 "cs.ATG" op = OverloadableOperatorType.ShiftLeft; break; } - case 32: { + case 33: { lexer.NextToken(); -#line 1581 "cs.ATG" +#line 1582 "cs.ATG" op = OverloadableOperatorType.Equality; break; } - case 33: { + case 34: { lexer.NextToken(); -#line 1582 "cs.ATG" +#line 1583 "cs.ATG" op = OverloadableOperatorType.InEquality; break; } - case 22: { + case 23: { lexer.NextToken(); -#line 1583 "cs.ATG" +#line 1584 "cs.ATG" op = OverloadableOperatorType.LessThan; break; } - case 34: { + case 35: { lexer.NextToken(); -#line 1584 "cs.ATG" +#line 1585 "cs.ATG" op = OverloadableOperatorType.GreaterThanOrEqual; break; } - case 35: { + case 36: { lexer.NextToken(); -#line 1585 "cs.ATG" +#line 1586 "cs.ATG" op = OverloadableOperatorType.LessThanOrEqual; break; } - case 21: { + case 22: { lexer.NextToken(); -#line 1586 "cs.ATG" +#line 1587 "cs.ATG" op = OverloadableOperatorType.GreaterThan; - if (la.kind == 21) { + if (la.kind == 22) { lexer.NextToken(); -#line 1586 "cs.ATG" +#line 1587 "cs.ATG" op = OverloadableOperatorType.ShiftRight; } break; } - default: SynErr(157); break; + default: SynErr(158); break; } } void AccessorDecls( -#line 1392 "cs.ATG" +#line 1393 "cs.ATG" out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { -#line 1394 "cs.ATG" +#line 1395 "cs.ATG" List attributes = new List(); AttributeSection section; getBlock = null; setBlock = null; - while (la.kind == 17) { + while (la.kind == 18) { AttributeSection( -#line 1400 "cs.ATG" +#line 1401 "cs.ATG" out section); -#line 1400 "cs.ATG" +#line 1401 "cs.ATG" attributes.Add(section); } if ( -#line 1402 "cs.ATG" +#line 1403 "cs.ATG" IdentIsGet()) { GetAccessorDecl( -#line 1403 "cs.ATG" +#line 1404 "cs.ATG" out getBlock, attributes); - if (la.kind == 1 || la.kind == 17) { + if (la.kind == 1 || la.kind == 18) { -#line 1404 "cs.ATG" +#line 1405 "cs.ATG" attributes = new List(); - while (la.kind == 17) { + while (la.kind == 18) { AttributeSection( -#line 1405 "cs.ATG" +#line 1406 "cs.ATG" out section); -#line 1405 "cs.ATG" +#line 1406 "cs.ATG" attributes.Add(section); } SetAccessorDecl( -#line 1406 "cs.ATG" +#line 1407 "cs.ATG" out setBlock, attributes); } } else if ( -#line 1408 "cs.ATG" +#line 1409 "cs.ATG" IdentIsSet()) { SetAccessorDecl( -#line 1409 "cs.ATG" +#line 1410 "cs.ATG" out setBlock, attributes); - if (la.kind == 1 || la.kind == 17) { + if (la.kind == 1 || la.kind == 18) { -#line 1410 "cs.ATG" +#line 1411 "cs.ATG" attributes = new List(); - while (la.kind == 17) { + while (la.kind == 18) { AttributeSection( -#line 1411 "cs.ATG" +#line 1412 "cs.ATG" out section); -#line 1411 "cs.ATG" +#line 1412 "cs.ATG" attributes.Add(section); } GetAccessorDecl( -#line 1412 "cs.ATG" +#line 1413 "cs.ATG" out getBlock, attributes); } } else if (la.kind == 1) { lexer.NextToken(); -#line 1414 "cs.ATG" +#line 1415 "cs.ATG" Error("get or set accessor declaration expected"); - } else SynErr(158); + } else SynErr(159); } void InterfaceAccessors( -#line 1462 "cs.ATG" +#line 1463 "cs.ATG" out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { -#line 1464 "cs.ATG" +#line 1465 "cs.ATG" AttributeSection section; List attributes = new List(); getBlock = null; setBlock = null; PropertyGetSetRegion lastBlock = null; - while (la.kind == 17) { + while (la.kind == 18) { AttributeSection( -#line 1470 "cs.ATG" +#line 1471 "cs.ATG" out section); -#line 1470 "cs.ATG" +#line 1471 "cs.ATG" attributes.Add(section); } -#line 1471 "cs.ATG" +#line 1472 "cs.ATG" Point startLocation = la.Location; if ( -#line 1473 "cs.ATG" +#line 1474 "cs.ATG" IdentIsGet()) { Expect(1); -#line 1473 "cs.ATG" +#line 1474 "cs.ATG" getBlock = new PropertyGetRegion(null, attributes); } else if ( -#line 1474 "cs.ATG" +#line 1475 "cs.ATG" IdentIsSet()) { Expect(1); -#line 1474 "cs.ATG" +#line 1475 "cs.ATG" setBlock = new PropertySetRegion(null, attributes); } else if (la.kind == 1) { lexer.NextToken(); -#line 1475 "cs.ATG" +#line 1476 "cs.ATG" Error("set or get expected"); - } else SynErr(159); + } else SynErr(160); Expect(11); -#line 1478 "cs.ATG" +#line 1479 "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 == 1 || la.kind == 17) { - while (la.kind == 17) { + if (la.kind == 1 || la.kind == 18) { + while (la.kind == 18) { AttributeSection( -#line 1482 "cs.ATG" +#line 1483 "cs.ATG" out section); -#line 1482 "cs.ATG" +#line 1483 "cs.ATG" attributes.Add(section); } -#line 1483 "cs.ATG" +#line 1484 "cs.ATG" startLocation = la.Location; if ( -#line 1485 "cs.ATG" +#line 1486 "cs.ATG" IdentIsGet()) { Expect(1); -#line 1485 "cs.ATG" +#line 1486 "cs.ATG" if (getBlock != null) Error("get already declared"); else { getBlock = new PropertyGetRegion(null, attributes); lastBlock = getBlock; } } else if ( -#line 1488 "cs.ATG" +#line 1489 "cs.ATG" IdentIsSet()) { Expect(1); -#line 1488 "cs.ATG" +#line 1489 "cs.ATG" if (setBlock != null) Error("set already declared"); else { setBlock = new PropertySetRegion(null, attributes); lastBlock = setBlock; } } else if (la.kind == 1) { lexer.NextToken(); -#line 1491 "cs.ATG" +#line 1492 "cs.ATG" Error("set or get expected"); - } else SynErr(160); + } else SynErr(161); Expect(11); -#line 1494 "cs.ATG" +#line 1495 "cs.ATG" if (lastBlock != null) { lastBlock.StartLocation = startLocation; lastBlock.EndLocation = t.EndLocation; } } } void GetAccessorDecl( -#line 1418 "cs.ATG" +#line 1419 "cs.ATG" out PropertyGetRegion getBlock, List attributes) { -#line 1419 "cs.ATG" +#line 1420 "cs.ATG" Statement stmt = null; Expect(1); -#line 1422 "cs.ATG" +#line 1423 "cs.ATG" if (t.val != "get") Error("get expected"); -#line 1423 "cs.ATG" +#line 1424 "cs.ATG" Point startLocation = t.Location; - if (la.kind == 15) { + if (la.kind == 16) { Block( -#line 1424 "cs.ATG" +#line 1425 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); - } else SynErr(161); + } else SynErr(162); -#line 1425 "cs.ATG" +#line 1426 "cs.ATG" getBlock = new PropertyGetRegion((BlockStatement)stmt, attributes); -#line 1426 "cs.ATG" +#line 1427 "cs.ATG" getBlock.StartLocation = startLocation; getBlock.EndLocation = t.EndLocation; } void SetAccessorDecl( -#line 1429 "cs.ATG" +#line 1430 "cs.ATG" out PropertySetRegion setBlock, List attributes) { -#line 1430 "cs.ATG" +#line 1431 "cs.ATG" Statement stmt = null; Expect(1); -#line 1433 "cs.ATG" +#line 1434 "cs.ATG" if (t.val != "set") Error("set expected"); -#line 1434 "cs.ATG" +#line 1435 "cs.ATG" Point startLocation = t.Location; - if (la.kind == 15) { + if (la.kind == 16) { Block( -#line 1435 "cs.ATG" +#line 1436 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); - } else SynErr(162); + } else SynErr(163); -#line 1436 "cs.ATG" +#line 1437 "cs.ATG" setBlock = new PropertySetRegion((BlockStatement)stmt, attributes); -#line 1437 "cs.ATG" +#line 1438 "cs.ATG" setBlock.StartLocation = startLocation; setBlock.EndLocation = t.EndLocation; } void AddAccessorDecl( -#line 1520 "cs.ATG" +#line 1521 "cs.ATG" out Statement stmt) { -#line 1521 "cs.ATG" +#line 1522 "cs.ATG" stmt = null; Expect(1); -#line 1524 "cs.ATG" +#line 1525 "cs.ATG" if (t.val != "add") Error("add expected"); Block( -#line 1525 "cs.ATG" +#line 1526 "cs.ATG" out stmt); } void RemoveAccessorDecl( -#line 1528 "cs.ATG" +#line 1529 "cs.ATG" out Statement stmt) { -#line 1529 "cs.ATG" +#line 1530 "cs.ATG" stmt = null; Expect(1); -#line 1532 "cs.ATG" +#line 1533 "cs.ATG" if (t.val != "remove") Error("remove expected"); Block( -#line 1533 "cs.ATG" +#line 1534 "cs.ATG" out stmt); } void VariableInitializer( -#line 1549 "cs.ATG" +#line 1550 "cs.ATG" out Expression initializerExpression) { -#line 1550 "cs.ATG" +#line 1551 "cs.ATG" TypeReference type = null; Expression expr = null; initializerExpression = null; if (StartOf(5)) { Expr( -#line 1552 "cs.ATG" +#line 1553 "cs.ATG" out initializerExpression); - } else if (la.kind == 15) { + } else if (la.kind == 16) { ArrayInitializer( -#line 1553 "cs.ATG" +#line 1554 "cs.ATG" out initializerExpression); - } else if (la.kind == 104) { + } else if (la.kind == 105) { lexer.NextToken(); Type( -#line 1554 "cs.ATG" +#line 1555 "cs.ATG" out type); - Expect(17); + Expect(18); Expr( -#line 1554 "cs.ATG" +#line 1555 "cs.ATG" out expr); - Expect(18); + Expect(19); -#line 1554 "cs.ATG" +#line 1555 "cs.ATG" initializerExpression = new StackAllocExpression(type, expr); - } else SynErr(163); + } else SynErr(164); } void Statement() { -#line 1658 "cs.ATG" +#line 1659 "cs.ATG" TypeReference type; Expression expr; Statement stmt = null; Point startPos = la.Location; if ( -#line 1666 "cs.ATG" +#line 1667 "cs.ATG" IsLabel()) { Expect(1); -#line 1666 "cs.ATG" +#line 1667 "cs.ATG" compilationUnit.AddChild(new LabelStatement(t.val)); Expect(9); Statement(); - } else if (la.kind == 58) { + } else if (la.kind == 59) { lexer.NextToken(); Type( -#line 1669 "cs.ATG" +#line 1670 "cs.ATG" out type); -#line 1669 "cs.ATG" +#line 1670 "cs.ATG" LocalVariableDeclaration var = new LocalVariableDeclaration(type, Modifier.Const); string ident = null; var.StartLocation = t.Location; Expect(1); -#line 1670 "cs.ATG" +#line 1671 "cs.ATG" ident = t.val; Expect(3); Expr( -#line 1671 "cs.ATG" +#line 1672 "cs.ATG" out expr); -#line 1671 "cs.ATG" +#line 1672 "cs.ATG" var.Variables.Add(new VariableDeclaration(ident, expr)); - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); Expect(1); -#line 1672 "cs.ATG" +#line 1673 "cs.ATG" ident = t.val; Expect(3); Expr( -#line 1672 "cs.ATG" +#line 1673 "cs.ATG" out expr); -#line 1672 "cs.ATG" +#line 1673 "cs.ATG" var.Variables.Add(new VariableDeclaration(ident, expr)); } Expect(11); -#line 1673 "cs.ATG" +#line 1674 "cs.ATG" compilationUnit.AddChild(var); } else if ( -#line 1675 "cs.ATG" +#line 1676 "cs.ATG" IsLocalVarDecl()) { LocalVariableDecl( -#line 1675 "cs.ATG" +#line 1676 "cs.ATG" out stmt); Expect(11); -#line 1675 "cs.ATG" +#line 1676 "cs.ATG" compilationUnit.AddChild(stmt); } else if (StartOf(22)) { EmbeddedStatement( -#line 1676 "cs.ATG" +#line 1677 "cs.ATG" out stmt); -#line 1676 "cs.ATG" +#line 1677 "cs.ATG" compilationUnit.AddChild(stmt); - } else SynErr(164); + } else SynErr(165); -#line 1682 "cs.ATG" +#line 1683 "cs.ATG" if (stmt != null) { stmt.StartLocation = startPos; stmt.EndLocation = t.EndLocation; @@ -3397,924 +3406,924 @@ out stmt); } void Argument( -#line 1589 "cs.ATG" +#line 1590 "cs.ATG" out Expression argumentexpr) { -#line 1591 "cs.ATG" +#line 1592 "cs.ATG" Expression expr; FieldDirection fd = FieldDirection.None; - if (la.kind == 91 || la.kind == 98) { - if (la.kind == 98) { + if (la.kind == 92 || la.kind == 99) { + if (la.kind == 99) { lexer.NextToken(); -#line 1596 "cs.ATG" +#line 1597 "cs.ATG" fd = FieldDirection.Ref; } else { lexer.NextToken(); -#line 1597 "cs.ATG" +#line 1598 "cs.ATG" fd = FieldDirection.Out; } } Expr( -#line 1599 "cs.ATG" +#line 1600 "cs.ATG" out expr); -#line 1599 "cs.ATG" +#line 1600 "cs.ATG" argumentexpr = fd != FieldDirection.None ? argumentexpr = new DirectionExpression(fd, expr) : expr; } void ArrayInitializer( -#line 1618 "cs.ATG" +#line 1619 "cs.ATG" out Expression outExpr) { -#line 1620 "cs.ATG" +#line 1621 "cs.ATG" Expression expr = null; ArrayInitializerExpression initializer = new ArrayInitializerExpression(); - Expect(15); + Expect(16); if (StartOf(23)) { VariableInitializer( -#line 1625 "cs.ATG" +#line 1626 "cs.ATG" out expr); -#line 1625 "cs.ATG" +#line 1626 "cs.ATG" if (expr != null) { initializer.CreateExpressions.Add(expr); } while ( -#line 1625 "cs.ATG" +#line 1626 "cs.ATG" NotFinalComma()) { - Expect(13); + Expect(14); VariableInitializer( -#line 1625 "cs.ATG" +#line 1626 "cs.ATG" out expr); -#line 1625 "cs.ATG" +#line 1626 "cs.ATG" if (expr != null) { initializer.CreateExpressions.Add(expr); } } - if (la.kind == 13) { + if (la.kind == 14) { lexer.NextToken(); } } - Expect(16); + Expect(17); -#line 1626 "cs.ATG" +#line 1627 "cs.ATG" outExpr = initializer; } void AssignmentOperator( -#line 1602 "cs.ATG" +#line 1603 "cs.ATG" out AssignmentOperatorType op) { -#line 1603 "cs.ATG" +#line 1604 "cs.ATG" op = AssignmentOperatorType.None; switch (la.kind) { case 3: { lexer.NextToken(); -#line 1605 "cs.ATG" - op = AssignmentOperatorType.Assign; - break; - } - case 37: { - lexer.NextToken(); - #line 1606 "cs.ATG" - op = AssignmentOperatorType.Add; + op = AssignmentOperatorType.Assign; break; } case 38: { lexer.NextToken(); #line 1607 "cs.ATG" - op = AssignmentOperatorType.Subtract; + op = AssignmentOperatorType.Add; break; } case 39: { lexer.NextToken(); #line 1608 "cs.ATG" - op = AssignmentOperatorType.Multiply; + op = AssignmentOperatorType.Subtract; break; } case 40: { lexer.NextToken(); #line 1609 "cs.ATG" - op = AssignmentOperatorType.Divide; + op = AssignmentOperatorType.Multiply; break; } case 41: { lexer.NextToken(); #line 1610 "cs.ATG" - op = AssignmentOperatorType.Modulus; + op = AssignmentOperatorType.Divide; break; } case 42: { lexer.NextToken(); #line 1611 "cs.ATG" - op = AssignmentOperatorType.BitwiseAnd; + op = AssignmentOperatorType.Modulus; break; } case 43: { lexer.NextToken(); #line 1612 "cs.ATG" - op = AssignmentOperatorType.BitwiseOr; + op = AssignmentOperatorType.BitwiseAnd; break; } case 44: { lexer.NextToken(); #line 1613 "cs.ATG" - op = AssignmentOperatorType.ExclusiveOr; + op = AssignmentOperatorType.BitwiseOr; break; } case 45: { lexer.NextToken(); #line 1614 "cs.ATG" - op = AssignmentOperatorType.ShiftLeft; + op = AssignmentOperatorType.ExclusiveOr; break; } - case 21: { + case 46: { lexer.NextToken(); - Expect(34); #line 1615 "cs.ATG" + op = AssignmentOperatorType.ShiftLeft; + break; + } + case 22: { + lexer.NextToken(); + Expect(35); + +#line 1616 "cs.ATG" op = AssignmentOperatorType.ShiftRight; break; } - default: SynErr(165); break; + default: SynErr(166); break; } } void LocalVariableDecl( -#line 1629 "cs.ATG" +#line 1630 "cs.ATG" out Statement stmt) { -#line 1631 "cs.ATG" +#line 1632 "cs.ATG" TypeReference type; VariableDeclaration var = null; LocalVariableDeclaration localVariableDeclaration; Type( -#line 1636 "cs.ATG" +#line 1637 "cs.ATG" out type); -#line 1636 "cs.ATG" +#line 1637 "cs.ATG" localVariableDeclaration = new LocalVariableDeclaration(type); localVariableDeclaration.StartLocation = t.Location; LocalVariableDeclarator( -#line 1637 "cs.ATG" +#line 1638 "cs.ATG" out var); -#line 1637 "cs.ATG" +#line 1638 "cs.ATG" localVariableDeclaration.Variables.Add(var); - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); LocalVariableDeclarator( -#line 1638 "cs.ATG" +#line 1639 "cs.ATG" out var); -#line 1638 "cs.ATG" +#line 1639 "cs.ATG" localVariableDeclaration.Variables.Add(var); } -#line 1639 "cs.ATG" +#line 1640 "cs.ATG" stmt = localVariableDeclaration; } void LocalVariableDeclarator( -#line 1642 "cs.ATG" +#line 1643 "cs.ATG" out VariableDeclaration var) { -#line 1643 "cs.ATG" +#line 1644 "cs.ATG" Expression expr = null; Expect(1); -#line 1646 "cs.ATG" +#line 1647 "cs.ATG" var = new VariableDeclaration(t.val); if (la.kind == 3) { lexer.NextToken(); VariableInitializer( -#line 1646 "cs.ATG" +#line 1647 "cs.ATG" out expr); -#line 1646 "cs.ATG" +#line 1647 "cs.ATG" var.Initializer = expr; } } void EmbeddedStatement( -#line 1689 "cs.ATG" +#line 1690 "cs.ATG" out Statement statement) { -#line 1691 "cs.ATG" +#line 1692 "cs.ATG" TypeReference type = null; Expression expr = null; Statement embeddedStatement = null; statement = null; - if (la.kind == 15) { + if (la.kind == 16) { Block( -#line 1697 "cs.ATG" +#line 1698 "cs.ATG" out statement); } else if (la.kind == 11) { lexer.NextToken(); -#line 1699 "cs.ATG" +#line 1700 "cs.ATG" statement = new EmptyStatement(); } else if ( -#line 1701 "cs.ATG" +#line 1702 "cs.ATG" UnCheckedAndLBrace()) { -#line 1701 "cs.ATG" +#line 1702 "cs.ATG" Statement block; bool isChecked = true; - if (la.kind == 56) { + if (la.kind == 57) { lexer.NextToken(); - } else if (la.kind == 116) { + } else if (la.kind == 117) { lexer.NextToken(); -#line 1702 "cs.ATG" +#line 1703 "cs.ATG" isChecked = false; - } else SynErr(166); + } else SynErr(167); Block( -#line 1703 "cs.ATG" +#line 1704 "cs.ATG" out block); -#line 1703 "cs.ATG" +#line 1704 "cs.ATG" statement = isChecked ? (Statement)new CheckedStatement(block) : (Statement)new UncheckedStatement(block); - } else if (la.kind == 77) { + } else if (la.kind == 78) { lexer.NextToken(); -#line 1705 "cs.ATG" +#line 1706 "cs.ATG" Statement elseStatement = null; - Expect(19); + Expect(20); Expr( -#line 1706 "cs.ATG" +#line 1707 "cs.ATG" out expr); - Expect(20); + Expect(21); EmbeddedStatement( -#line 1707 "cs.ATG" +#line 1708 "cs.ATG" out embeddedStatement); - if (la.kind == 65) { + if (la.kind == 66) { lexer.NextToken(); EmbeddedStatement( -#line 1708 "cs.ATG" +#line 1709 "cs.ATG" out elseStatement); } -#line 1709 "cs.ATG" +#line 1710 "cs.ATG" statement = elseStatement != null ? (Statement)new IfElseStatement(expr, embeddedStatement, elseStatement) : (Statement)new IfElseStatement(expr, embeddedStatement); - } else if (la.kind == 108) { + } else if (la.kind == 109) { lexer.NextToken(); -#line 1710 "cs.ATG" +#line 1711 "cs.ATG" ArrayList switchSections = new ArrayList(); SwitchSection switchSection; - Expect(19); + Expect(20); Expr( -#line 1711 "cs.ATG" +#line 1712 "cs.ATG" out expr); - Expect(20); - Expect(15); - while (la.kind == 53 || la.kind == 61) { + Expect(21); + Expect(16); + while (la.kind == 54 || la.kind == 62) { SwitchSection( -#line 1712 "cs.ATG" +#line 1713 "cs.ATG" out switchSection); -#line 1712 "cs.ATG" +#line 1713 "cs.ATG" switchSections.Add(switchSection); } - Expect(16); + Expect(17); -#line 1713 "cs.ATG" +#line 1714 "cs.ATG" statement = new SwitchStatement(expr, switchSections); - } else if (la.kind == 123) { + } else if (la.kind == 124) { lexer.NextToken(); - Expect(19); + Expect(20); Expr( -#line 1715 "cs.ATG" +#line 1716 "cs.ATG" out expr); - Expect(20); + Expect(21); EmbeddedStatement( -#line 1717 "cs.ATG" +#line 1718 "cs.ATG" out embeddedStatement); -#line 1717 "cs.ATG" +#line 1718 "cs.ATG" statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.Start); - } else if (la.kind == 63) { + } else if (la.kind == 64) { lexer.NextToken(); EmbeddedStatement( -#line 1718 "cs.ATG" +#line 1719 "cs.ATG" out embeddedStatement); - Expect(123); - Expect(19); + Expect(124); + Expect(20); Expr( -#line 1719 "cs.ATG" +#line 1720 "cs.ATG" out expr); - Expect(20); + Expect(21); Expect(11); -#line 1719 "cs.ATG" +#line 1720 "cs.ATG" statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.End); - } else if (la.kind == 74) { + } else if (la.kind == 75) { lexer.NextToken(); -#line 1720 "cs.ATG" +#line 1721 "cs.ATG" ArrayList initializer = null; ArrayList iterator = null; - Expect(19); + Expect(20); if (StartOf(5)) { ForInitializer( -#line 1721 "cs.ATG" +#line 1722 "cs.ATG" out initializer); } Expect(11); if (StartOf(5)) { Expr( -#line 1722 "cs.ATG" +#line 1723 "cs.ATG" out expr); } Expect(11); if (StartOf(5)) { ForIterator( -#line 1723 "cs.ATG" +#line 1724 "cs.ATG" out iterator); } - Expect(20); + Expect(21); EmbeddedStatement( -#line 1724 "cs.ATG" +#line 1725 "cs.ATG" out embeddedStatement); -#line 1724 "cs.ATG" +#line 1725 "cs.ATG" statement = new ForStatement(initializer, expr, iterator, embeddedStatement); - } else if (la.kind == 75) { + } else if (la.kind == 76) { lexer.NextToken(); - Expect(19); + Expect(20); Type( -#line 1725 "cs.ATG" +#line 1726 "cs.ATG" out type); Expect(1); -#line 1725 "cs.ATG" +#line 1726 "cs.ATG" string varName = t.val; Point start = t.Location; - Expect(79); + Expect(80); Expr( -#line 1726 "cs.ATG" +#line 1727 "cs.ATG" out expr); - Expect(20); + Expect(21); EmbeddedStatement( -#line 1727 "cs.ATG" +#line 1728 "cs.ATG" out embeddedStatement); -#line 1727 "cs.ATG" +#line 1728 "cs.ATG" statement = new ForeachStatement(type, varName , expr, embeddedStatement); statement.EndLocation = t.EndLocation; - } else if (la.kind == 51) { + } else if (la.kind == 52) { lexer.NextToken(); Expect(11); -#line 1731 "cs.ATG" +#line 1732 "cs.ATG" statement = new BreakStatement(); - } else if (la.kind == 59) { + } else if (la.kind == 60) { lexer.NextToken(); Expect(11); -#line 1732 "cs.ATG" +#line 1733 "cs.ATG" statement = new ContinueStatement(); - } else if (la.kind == 76) { + } else if (la.kind == 77) { GotoStatement( -#line 1733 "cs.ATG" +#line 1734 "cs.ATG" out statement); } else if ( -#line 1734 "cs.ATG" +#line 1735 "cs.ATG" IsYieldStatement()) { Expect(1); - if (la.kind == 99) { + if (la.kind == 100) { lexer.NextToken(); Expr( -#line 1734 "cs.ATG" +#line 1735 "cs.ATG" out expr); -#line 1734 "cs.ATG" +#line 1735 "cs.ATG" statement = new YieldStatement(new ReturnStatement(expr)); - } else if (la.kind == 51) { + } else if (la.kind == 52) { lexer.NextToken(); -#line 1735 "cs.ATG" +#line 1736 "cs.ATG" statement = new YieldStatement(new BreakStatement()); - } else SynErr(167); + } else SynErr(168); Expect(11); - } else if (la.kind == 99) { + } else if (la.kind == 100) { lexer.NextToken(); if (StartOf(5)) { Expr( -#line 1736 "cs.ATG" +#line 1737 "cs.ATG" out expr); } Expect(11); -#line 1736 "cs.ATG" +#line 1737 "cs.ATG" statement = new ReturnStatement(expr); - } else if (la.kind == 110) { + } else if (la.kind == 111) { lexer.NextToken(); if (StartOf(5)) { Expr( -#line 1737 "cs.ATG" +#line 1738 "cs.ATG" out expr); } Expect(11); -#line 1737 "cs.ATG" +#line 1738 "cs.ATG" statement = new ThrowStatement(expr); } else if (StartOf(5)) { StatementExpr( -#line 1739 "cs.ATG" +#line 1740 "cs.ATG" out statement); Expect(11); - } else if (la.kind == 112) { + } else if (la.kind == 113) { TryStatement( -#line 1741 "cs.ATG" +#line 1742 "cs.ATG" out statement); - } else if (la.kind == 84) { + } else if (la.kind == 85) { lexer.NextToken(); - Expect(19); + Expect(20); Expr( -#line 1743 "cs.ATG" +#line 1744 "cs.ATG" out expr); - Expect(20); + Expect(21); EmbeddedStatement( -#line 1744 "cs.ATG" +#line 1745 "cs.ATG" out embeddedStatement); -#line 1744 "cs.ATG" +#line 1745 "cs.ATG" statement = new LockStatement(expr, embeddedStatement); - } else if (la.kind == 119) { + } else if (la.kind == 120) { -#line 1746 "cs.ATG" +#line 1747 "cs.ATG" Statement resourceAcquisitionStmt = null; lexer.NextToken(); - Expect(19); + Expect(20); ResourceAcquisition( -#line 1748 "cs.ATG" +#line 1749 "cs.ATG" out resourceAcquisitionStmt); - Expect(20); + Expect(21); EmbeddedStatement( -#line 1749 "cs.ATG" +#line 1750 "cs.ATG" out embeddedStatement); -#line 1749 "cs.ATG" +#line 1750 "cs.ATG" statement = new UsingStatement(resourceAcquisitionStmt, embeddedStatement); - } else if (la.kind == 117) { + } else if (la.kind == 118) { lexer.NextToken(); Block( -#line 1751 "cs.ATG" +#line 1752 "cs.ATG" out embeddedStatement); -#line 1751 "cs.ATG" +#line 1752 "cs.ATG" statement = new UnsafeStatement(embeddedStatement); - } else if (la.kind == 72) { + } else if (la.kind == 73) { lexer.NextToken(); - Expect(19); + Expect(20); Type( -#line 1754 "cs.ATG" +#line 1755 "cs.ATG" out type); -#line 1754 "cs.ATG" +#line 1755 "cs.ATG" if (type.PointerNestingLevel == 0) Error("can only fix pointer types"); ArrayList pointerDeclarators = new ArrayList(1); Expect(1); -#line 1757 "cs.ATG" +#line 1758 "cs.ATG" string identifier = t.val; Expect(3); Expr( -#line 1758 "cs.ATG" +#line 1759 "cs.ATG" out expr); -#line 1758 "cs.ATG" +#line 1759 "cs.ATG" pointerDeclarators.Add(new VariableDeclaration(identifier, expr)); - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); Expect(1); -#line 1760 "cs.ATG" +#line 1761 "cs.ATG" identifier = t.val; Expect(3); Expr( -#line 1761 "cs.ATG" +#line 1762 "cs.ATG" out expr); -#line 1761 "cs.ATG" +#line 1762 "cs.ATG" pointerDeclarators.Add(new VariableDeclaration(identifier, expr)); } - Expect(20); + Expect(21); EmbeddedStatement( -#line 1763 "cs.ATG" +#line 1764 "cs.ATG" out embeddedStatement); -#line 1763 "cs.ATG" +#line 1764 "cs.ATG" statement = new FixedStatement(type, pointerDeclarators, embeddedStatement); - } else SynErr(168); + } else SynErr(169); } void SwitchSection( -#line 1785 "cs.ATG" +#line 1786 "cs.ATG" out SwitchSection stmt) { -#line 1787 "cs.ATG" +#line 1788 "cs.ATG" SwitchSection switchSection = new SwitchSection(); CaseLabel label; SwitchLabel( -#line 1791 "cs.ATG" +#line 1792 "cs.ATG" out label); -#line 1791 "cs.ATG" +#line 1792 "cs.ATG" switchSection.SwitchLabels.Add(label); - while (la.kind == 53 || la.kind == 61) { + while (la.kind == 54 || la.kind == 62) { SwitchLabel( -#line 1793 "cs.ATG" +#line 1794 "cs.ATG" out label); -#line 1793 "cs.ATG" +#line 1794 "cs.ATG" switchSection.SwitchLabels.Add(label); } -#line 1795 "cs.ATG" +#line 1796 "cs.ATG" compilationUnit.BlockStart(switchSection); Statement(); while (StartOf(20)) { Statement(); } -#line 1798 "cs.ATG" +#line 1799 "cs.ATG" compilationUnit.BlockEnd(); stmt = switchSection; } void ForInitializer( -#line 1766 "cs.ATG" +#line 1767 "cs.ATG" out ArrayList initializer) { -#line 1768 "cs.ATG" +#line 1769 "cs.ATG" Statement stmt; initializer = new ArrayList(); if ( -#line 1772 "cs.ATG" +#line 1773 "cs.ATG" IsLocalVarDecl()) { LocalVariableDecl( -#line 1772 "cs.ATG" +#line 1773 "cs.ATG" out stmt); -#line 1772 "cs.ATG" +#line 1773 "cs.ATG" initializer.Add(stmt); } else if (StartOf(5)) { StatementExpr( -#line 1773 "cs.ATG" +#line 1774 "cs.ATG" out stmt); -#line 1773 "cs.ATG" +#line 1774 "cs.ATG" initializer.Add(stmt); - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); StatementExpr( -#line 1773 "cs.ATG" +#line 1774 "cs.ATG" out stmt); -#line 1773 "cs.ATG" +#line 1774 "cs.ATG" initializer.Add(stmt); } - } else SynErr(169); + } else SynErr(170); } void ForIterator( -#line 1776 "cs.ATG" +#line 1777 "cs.ATG" out ArrayList iterator) { -#line 1778 "cs.ATG" +#line 1779 "cs.ATG" Statement stmt; iterator = new ArrayList(); StatementExpr( -#line 1782 "cs.ATG" +#line 1783 "cs.ATG" out stmt); -#line 1782 "cs.ATG" +#line 1783 "cs.ATG" iterator.Add(stmt); - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); StatementExpr( -#line 1782 "cs.ATG" +#line 1783 "cs.ATG" out stmt); -#line 1782 "cs.ATG" +#line 1783 "cs.ATG" iterator.Add(stmt); } } void GotoStatement( -#line 1853 "cs.ATG" +#line 1854 "cs.ATG" out Statement stmt) { -#line 1854 "cs.ATG" +#line 1855 "cs.ATG" Expression expr; stmt = null; - Expect(76); + Expect(77); if (la.kind == 1) { lexer.NextToken(); -#line 1858 "cs.ATG" +#line 1859 "cs.ATG" stmt = new GotoStatement(t.val); Expect(11); - } else if (la.kind == 53) { + } else if (la.kind == 54) { lexer.NextToken(); Expr( -#line 1859 "cs.ATG" +#line 1860 "cs.ATG" out expr); Expect(11); -#line 1859 "cs.ATG" +#line 1860 "cs.ATG" stmt = new GotoCaseStatement(expr); - } else if (la.kind == 61) { + } else if (la.kind == 62) { lexer.NextToken(); Expect(11); -#line 1860 "cs.ATG" +#line 1861 "cs.ATG" stmt = new GotoCaseStatement(null); - } else SynErr(170); + } else SynErr(171); } void StatementExpr( -#line 1880 "cs.ATG" +#line 1881 "cs.ATG" out Statement stmt) { -#line 1885 "cs.ATG" +#line 1886 "cs.ATG" bool mustBeAssignment = la.kind == Tokens.Plus || la.kind == Tokens.Minus || la.kind == Tokens.Not || la.kind == Tokens.BitwiseComplement || la.kind == Tokens.Times || la.kind == Tokens.BitwiseAnd || IsTypeCast(); Expression expr = null; UnaryExpr( -#line 1891 "cs.ATG" +#line 1892 "cs.ATG" out expr); if (StartOf(7)) { -#line 1894 "cs.ATG" +#line 1895 "cs.ATG" AssignmentOperatorType op; Expression val; AssignmentOperator( -#line 1894 "cs.ATG" +#line 1895 "cs.ATG" out op); Expr( -#line 1894 "cs.ATG" +#line 1895 "cs.ATG" out val); -#line 1894 "cs.ATG" +#line 1895 "cs.ATG" expr = new AssignmentExpression(expr, op, val); - } else if (la.kind == 11 || la.kind == 13 || la.kind == 20) { + } else if (la.kind == 11 || la.kind == 14 || la.kind == 21) { -#line 1895 "cs.ATG" +#line 1896 "cs.ATG" if (mustBeAssignment) Error("error in assignment."); - } else SynErr(171); + } else SynErr(172); -#line 1896 "cs.ATG" +#line 1897 "cs.ATG" stmt = new StatementExpression(expr); } void TryStatement( -#line 1810 "cs.ATG" +#line 1811 "cs.ATG" out Statement tryStatement) { -#line 1812 "cs.ATG" +#line 1813 "cs.ATG" Statement blockStmt = null, finallyStmt = null; ArrayList catchClauses = null; - Expect(112); + Expect(113); Block( -#line 1816 "cs.ATG" +#line 1817 "cs.ATG" out blockStmt); - if (la.kind == 54) { + if (la.kind == 55) { CatchClauses( -#line 1818 "cs.ATG" +#line 1819 "cs.ATG" out catchClauses); - if (la.kind == 71) { + if (la.kind == 72) { lexer.NextToken(); Block( -#line 1818 "cs.ATG" +#line 1819 "cs.ATG" out finallyStmt); } - } else if (la.kind == 71) { + } else if (la.kind == 72) { lexer.NextToken(); Block( -#line 1819 "cs.ATG" +#line 1820 "cs.ATG" out finallyStmt); - } else SynErr(172); + } else SynErr(173); -#line 1822 "cs.ATG" +#line 1823 "cs.ATG" tryStatement = new TryCatchStatement(blockStmt, catchClauses, finallyStmt); } void ResourceAcquisition( -#line 1864 "cs.ATG" +#line 1865 "cs.ATG" out Statement stmt) { -#line 1866 "cs.ATG" +#line 1867 "cs.ATG" stmt = null; Expression expr; if ( -#line 1871 "cs.ATG" +#line 1872 "cs.ATG" IsLocalVarDecl()) { LocalVariableDecl( -#line 1871 "cs.ATG" +#line 1872 "cs.ATG" out stmt); } else if (StartOf(5)) { Expr( -#line 1872 "cs.ATG" +#line 1873 "cs.ATG" out expr); -#line 1876 "cs.ATG" +#line 1877 "cs.ATG" stmt = new StatementExpression(expr); - } else SynErr(173); + } else SynErr(174); } void SwitchLabel( -#line 1803 "cs.ATG" +#line 1804 "cs.ATG" out CaseLabel label) { -#line 1804 "cs.ATG" +#line 1805 "cs.ATG" Expression expr = null; label = null; - if (la.kind == 53) { + if (la.kind == 54) { lexer.NextToken(); Expr( -#line 1806 "cs.ATG" +#line 1807 "cs.ATG" out expr); Expect(9); -#line 1806 "cs.ATG" +#line 1807 "cs.ATG" label = new CaseLabel(expr); - } else if (la.kind == 61) { + } else if (la.kind == 62) { lexer.NextToken(); Expect(9); -#line 1807 "cs.ATG" +#line 1808 "cs.ATG" label = new CaseLabel(); - } else SynErr(174); + } else SynErr(175); } void CatchClauses( -#line 1827 "cs.ATG" +#line 1828 "cs.ATG" out ArrayList catchClauses) { -#line 1829 "cs.ATG" +#line 1830 "cs.ATG" catchClauses = new ArrayList(); - Expect(54); + Expect(55); -#line 1832 "cs.ATG" +#line 1833 "cs.ATG" string identifier; Statement stmt; TypeReference typeRef; - if (la.kind == 15) { + if (la.kind == 16) { Block( -#line 1838 "cs.ATG" +#line 1839 "cs.ATG" out stmt); -#line 1838 "cs.ATG" +#line 1839 "cs.ATG" catchClauses.Add(new CatchClause(stmt)); - } else if (la.kind == 19) { + } else if (la.kind == 20) { lexer.NextToken(); ClassType( -#line 1840 "cs.ATG" +#line 1841 "cs.ATG" out typeRef); -#line 1840 "cs.ATG" +#line 1841 "cs.ATG" identifier = null; if (la.kind == 1) { lexer.NextToken(); -#line 1841 "cs.ATG" +#line 1842 "cs.ATG" identifier = t.val; } - Expect(20); + Expect(21); Block( -#line 1842 "cs.ATG" +#line 1843 "cs.ATG" out stmt); -#line 1843 "cs.ATG" +#line 1844 "cs.ATG" catchClauses.Add(new CatchClause(typeRef, identifier, stmt)); while ( -#line 1844 "cs.ATG" +#line 1845 "cs.ATG" IsTypedCatch()) { - Expect(54); - Expect(19); + Expect(55); + Expect(20); ClassType( -#line 1844 "cs.ATG" +#line 1845 "cs.ATG" out typeRef); -#line 1844 "cs.ATG" +#line 1845 "cs.ATG" identifier = null; if (la.kind == 1) { lexer.NextToken(); -#line 1845 "cs.ATG" +#line 1846 "cs.ATG" identifier = t.val; } - Expect(20); + Expect(21); Block( -#line 1846 "cs.ATG" +#line 1847 "cs.ATG" out stmt); -#line 1847 "cs.ATG" +#line 1848 "cs.ATG" catchClauses.Add(new CatchClause(typeRef, identifier, stmt)); } - if (la.kind == 54) { + if (la.kind == 55) { lexer.NextToken(); Block( -#line 1849 "cs.ATG" +#line 1850 "cs.ATG" out stmt); -#line 1849 "cs.ATG" +#line 1850 "cs.ATG" catchClauses.Add(new CatchClause(stmt)); } - } else SynErr(175); + } else SynErr(176); } void UnaryExpr( -#line 1912 "cs.ATG" +#line 1915 "cs.ATG" out Expression uExpr) { -#line 1914 "cs.ATG" +#line 1917 "cs.ATG" TypeReference type = null; Expression expr; ArrayList expressions = new ArrayList(); uExpr = null; while (StartOf(24) || -#line 1938 "cs.ATG" +#line 1941 "cs.ATG" IsTypeCast()) { if (la.kind == 4) { lexer.NextToken(); -#line 1923 "cs.ATG" +#line 1926 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Plus)); } else if (la.kind == 5) { lexer.NextToken(); -#line 1924 "cs.ATG" +#line 1927 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Minus)); - } else if (la.kind == 23) { + } else if (la.kind == 24) { lexer.NextToken(); -#line 1925 "cs.ATG" +#line 1928 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Not)); - } else if (la.kind == 26) { + } else if (la.kind == 27) { lexer.NextToken(); -#line 1926 "cs.ATG" +#line 1929 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.BitNot)); } else if (la.kind == 6) { lexer.NextToken(); -#line 1927 "cs.ATG" +#line 1930 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Star)); - } else if (la.kind == 30) { + } else if (la.kind == 31) { lexer.NextToken(); -#line 1928 "cs.ATG" +#line 1931 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Increment)); - } else if (la.kind == 31) { + } else if (la.kind == 32) { lexer.NextToken(); -#line 1929 "cs.ATG" +#line 1932 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Decrement)); - } else if (la.kind == 27) { + } else if (la.kind == 28) { lexer.NextToken(); -#line 1930 "cs.ATG" +#line 1933 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.BitWiseAnd)); } else { - Expect(19); + Expect(20); Type( -#line 1938 "cs.ATG" +#line 1941 "cs.ATG" out type); - Expect(20); + Expect(21); -#line 1938 "cs.ATG" +#line 1941 "cs.ATG" expressions.Add(new CastExpression(type)); } } PrimaryExpr( -#line 1942 "cs.ATG" +#line 1945 "cs.ATG" out expr); -#line 1942 "cs.ATG" +#line 1945 "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) { @@ -4332,910 +4341,910 @@ out expr); } void ConditionalOrExpr( -#line 2127 "cs.ATG" +#line 2130 "cs.ATG" ref Expression outExpr) { -#line 2128 "cs.ATG" +#line 2131 "cs.ATG" Expression expr; ConditionalAndExpr( -#line 2130 "cs.ATG" +#line 2133 "cs.ATG" ref outExpr); - while (la.kind == 25) { + while (la.kind == 26) { lexer.NextToken(); UnaryExpr( -#line 2130 "cs.ATG" +#line 2133 "cs.ATG" out expr); ConditionalAndExpr( -#line 2130 "cs.ATG" +#line 2133 "cs.ATG" ref expr); -#line 2130 "cs.ATG" +#line 2133 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalOr, expr); } } void PrimaryExpr( -#line 1959 "cs.ATG" +#line 1962 "cs.ATG" out Expression pexpr) { -#line 1961 "cs.ATG" +#line 1964 "cs.ATG" TypeReference type = null; List typeList = null; bool isArrayCreation = false; Expression expr; pexpr = null; - if (la.kind == 111) { + if (la.kind == 112) { lexer.NextToken(); -#line 1969 "cs.ATG" +#line 1972 "cs.ATG" pexpr = new PrimitiveExpression(true, "true"); - } else if (la.kind == 70) { + } else if (la.kind == 71) { lexer.NextToken(); -#line 1970 "cs.ATG" +#line 1973 "cs.ATG" pexpr = new PrimitiveExpression(false, "false"); - } else if (la.kind == 88) { + } else if (la.kind == 89) { lexer.NextToken(); -#line 1971 "cs.ATG" +#line 1974 "cs.ATG" pexpr = new PrimitiveExpression(null, "null"); } else if (la.kind == 2) { lexer.NextToken(); -#line 1972 "cs.ATG" +#line 1975 "cs.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val); } else if ( -#line 1973 "cs.ATG" +#line 1976 "cs.ATG" la.kind == Tokens.Identifier && Peek(1).kind == Tokens.DoubleColon) { TypeName( -#line 1974 "cs.ATG" +#line 1977 "cs.ATG" out type); -#line 1974 "cs.ATG" +#line 1977 "cs.ATG" pexpr = new TypeReferenceExpression(type); } else if (la.kind == 1) { lexer.NextToken(); -#line 1976 "cs.ATG" +#line 1979 "cs.ATG" pexpr = new IdentifierExpression(t.val); - } else if (la.kind == 19) { + } else if (la.kind == 20) { lexer.NextToken(); Expr( -#line 1978 "cs.ATG" +#line 1981 "cs.ATG" out expr); - Expect(20); + Expect(21); -#line 1978 "cs.ATG" +#line 1981 "cs.ATG" pexpr = new ParenthesizedExpression(expr); } else if (StartOf(25)) { -#line 1980 "cs.ATG" +#line 1983 "cs.ATG" string val = null; switch (la.kind) { - case 50: { + case 51: { lexer.NextToken(); -#line 1982 "cs.ATG" +#line 1985 "cs.ATG" val = "bool"; break; } - case 52: { + case 53: { lexer.NextToken(); -#line 1983 "cs.ATG" +#line 1986 "cs.ATG" val = "byte"; break; } - case 55: { + case 56: { lexer.NextToken(); -#line 1984 "cs.ATG" +#line 1987 "cs.ATG" val = "char"; break; } - case 60: { + case 61: { lexer.NextToken(); -#line 1985 "cs.ATG" +#line 1988 "cs.ATG" val = "decimal"; break; } - case 64: { + case 65: { lexer.NextToken(); -#line 1986 "cs.ATG" +#line 1989 "cs.ATG" val = "double"; break; } - case 73: { + case 74: { lexer.NextToken(); -#line 1987 "cs.ATG" +#line 1990 "cs.ATG" val = "float"; break; } - case 80: { + case 81: { lexer.NextToken(); -#line 1988 "cs.ATG" +#line 1991 "cs.ATG" val = "int"; break; } - case 85: { + case 86: { lexer.NextToken(); -#line 1989 "cs.ATG" +#line 1992 "cs.ATG" val = "long"; break; } - case 89: { + case 90: { lexer.NextToken(); -#line 1990 "cs.ATG" +#line 1993 "cs.ATG" val = "object"; break; } - case 100: { + case 101: { lexer.NextToken(); -#line 1991 "cs.ATG" +#line 1994 "cs.ATG" val = "sbyte"; break; } - case 102: { + case 103: { lexer.NextToken(); -#line 1992 "cs.ATG" +#line 1995 "cs.ATG" val = "short"; break; } - case 106: { + case 107: { lexer.NextToken(); -#line 1993 "cs.ATG" +#line 1996 "cs.ATG" val = "string"; break; } - case 114: { + case 115: { lexer.NextToken(); -#line 1994 "cs.ATG" +#line 1997 "cs.ATG" val = "uint"; break; } - case 115: { + case 116: { lexer.NextToken(); -#line 1995 "cs.ATG" +#line 1998 "cs.ATG" val = "ulong"; break; } - case 118: { + case 119: { lexer.NextToken(); -#line 1996 "cs.ATG" +#line 1999 "cs.ATG" val = "ushort"; break; } } -#line 1997 "cs.ATG" +#line 2000 "cs.ATG" t.val = ""; - Expect(14); + Expect(15); Expect(1); -#line 1997 "cs.ATG" +#line 2000 "cs.ATG" pexpr = new FieldReferenceExpression(new TypeReferenceExpression(val), t.val); - } else if (la.kind == 109) { + } else if (la.kind == 110) { lexer.NextToken(); -#line 1999 "cs.ATG" +#line 2002 "cs.ATG" pexpr = new ThisReferenceExpression(); - } else if (la.kind == 49) { + } else if (la.kind == 50) { lexer.NextToken(); -#line 2001 "cs.ATG" +#line 2004 "cs.ATG" Expression retExpr = new BaseReferenceExpression(); - if (la.kind == 14) { + if (la.kind == 15) { lexer.NextToken(); Expect(1); -#line 2003 "cs.ATG" +#line 2006 "cs.ATG" retExpr = new FieldReferenceExpression(retExpr, t.val); - } else if (la.kind == 17) { + } else if (la.kind == 18) { lexer.NextToken(); Expr( -#line 2004 "cs.ATG" +#line 2007 "cs.ATG" out expr); -#line 2004 "cs.ATG" +#line 2007 "cs.ATG" ArrayList indices = new ArrayList(); if (expr != null) { indices.Add(expr); } - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); Expr( -#line 2005 "cs.ATG" +#line 2008 "cs.ATG" out expr); -#line 2005 "cs.ATG" +#line 2008 "cs.ATG" if (expr != null) { indices.Add(expr); } } - Expect(18); + Expect(19); -#line 2006 "cs.ATG" +#line 2009 "cs.ATG" retExpr = new IndexerExpression(retExpr, indices); - } else SynErr(176); + } else SynErr(177); -#line 2007 "cs.ATG" +#line 2010 "cs.ATG" pexpr = retExpr; - } else if (la.kind == 87) { + } else if (la.kind == 88) { lexer.NextToken(); NonArrayType( -#line 2008 "cs.ATG" +#line 2011 "cs.ATG" out type); -#line 2008 "cs.ATG" +#line 2011 "cs.ATG" ArrayList parameters = new ArrayList(); - if (la.kind == 19) { + if (la.kind == 20) { lexer.NextToken(); -#line 2013 "cs.ATG" +#line 2016 "cs.ATG" ObjectCreateExpression oce = new ObjectCreateExpression(type, parameters); if (StartOf(21)) { Argument( -#line 2014 "cs.ATG" +#line 2017 "cs.ATG" out expr); -#line 2014 "cs.ATG" +#line 2017 "cs.ATG" if (expr != null) { parameters.Add(expr); } - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); Argument( -#line 2015 "cs.ATG" +#line 2018 "cs.ATG" out expr); -#line 2015 "cs.ATG" +#line 2018 "cs.ATG" if (expr != null) { parameters.Add(expr); } } } - Expect(20); + Expect(21); -#line 2017 "cs.ATG" +#line 2020 "cs.ATG" pexpr = oce; - } else if (la.kind == 17) { + } else if (la.kind == 18) { -#line 2019 "cs.ATG" +#line 2022 "cs.ATG" isArrayCreation = true; ArrayCreateExpression ace = new ArrayCreateExpression(type); pexpr = ace; lexer.NextToken(); -#line 2020 "cs.ATG" +#line 2023 "cs.ATG" int dims = 0; ArrayList rank = new ArrayList(); ArrayList parameterExpression = new ArrayList(); if (StartOf(5)) { Expr( -#line 2024 "cs.ATG" +#line 2027 "cs.ATG" out expr); -#line 2024 "cs.ATG" +#line 2027 "cs.ATG" if (expr != null) { parameterExpression.Add(expr); } - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); Expr( -#line 2026 "cs.ATG" +#line 2029 "cs.ATG" out expr); -#line 2026 "cs.ATG" +#line 2029 "cs.ATG" if (expr != null) { parameterExpression.Add(expr); } } - Expect(18); + Expect(19); -#line 2028 "cs.ATG" +#line 2031 "cs.ATG" parameters.Add(new ArrayCreationParameter(parameterExpression)); ace.Parameters = parameters; while ( -#line 2031 "cs.ATG" +#line 2034 "cs.ATG" IsDims()) { - Expect(17); + Expect(18); -#line 2031 "cs.ATG" +#line 2034 "cs.ATG" dims =0; - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); -#line 2032 "cs.ATG" +#line 2035 "cs.ATG" dims++; } -#line 2032 "cs.ATG" +#line 2035 "cs.ATG" rank.Add(dims); parameters.Add(new ArrayCreationParameter(dims)); - Expect(18); + Expect(19); } -#line 2036 "cs.ATG" +#line 2039 "cs.ATG" if (rank.Count > 0) { ace.Rank = (int[])rank.ToArray(typeof (int)); } - if (la.kind == 15) { + if (la.kind == 16) { ArrayInitializer( -#line 2040 "cs.ATG" +#line 2043 "cs.ATG" out expr); -#line 2040 "cs.ATG" +#line 2043 "cs.ATG" ace.ArrayInitializer = (ArrayInitializerExpression)expr; } - } else if (la.kind == 13 || la.kind == 18) { - while (la.kind == 13) { + } else if (la.kind == 14 || la.kind == 19) { + while (la.kind == 14) { lexer.NextToken(); -#line 2042 "cs.ATG" +#line 2045 "cs.ATG" dims++; } -#line 2043 "cs.ATG" +#line 2046 "cs.ATG" parameters.Add(new ArrayCreationParameter(dims)); - Expect(18); + Expect(19); while ( -#line 2045 "cs.ATG" +#line 2048 "cs.ATG" IsDims()) { - Expect(17); + Expect(18); -#line 2045 "cs.ATG" +#line 2048 "cs.ATG" dims =0; - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); -#line 2045 "cs.ATG" +#line 2048 "cs.ATG" dims++; } -#line 2045 "cs.ATG" +#line 2048 "cs.ATG" parameters.Add(new ArrayCreationParameter(dims)); - Expect(18); + Expect(19); } ArrayInitializer( -#line 2045 "cs.ATG" +#line 2048 "cs.ATG" out expr); -#line 2045 "cs.ATG" +#line 2048 "cs.ATG" ace.ArrayInitializer = (ArrayInitializerExpression)expr; ace.Parameters = parameters; - } else SynErr(177); - } else SynErr(178); - } else if (la.kind == 113) { + } else SynErr(178); + } else SynErr(179); + } else if (la.kind == 114) { lexer.NextToken(); - Expect(19); + Expect(20); if ( -#line 2051 "cs.ATG" +#line 2054 "cs.ATG" NotVoidPointer()) { - Expect(121); + Expect(122); -#line 2051 "cs.ATG" +#line 2054 "cs.ATG" type = new TypeReference("void"); } else if (StartOf(9)) { Type( -#line 2052 "cs.ATG" +#line 2055 "cs.ATG" out type); - } else SynErr(179); - Expect(20); + } else SynErr(180); + Expect(21); -#line 2053 "cs.ATG" +#line 2056 "cs.ATG" pexpr = new TypeOfExpression(type); - } else if (la.kind == 103) { + } else if (la.kind == 104) { lexer.NextToken(); - Expect(19); + Expect(20); Type( -#line 2054 "cs.ATG" +#line 2057 "cs.ATG" out type); - Expect(20); + Expect(21); -#line 2054 "cs.ATG" +#line 2057 "cs.ATG" pexpr = new SizeOfExpression(type); - } else if (la.kind == 56) { + } else if (la.kind == 57) { lexer.NextToken(); - Expect(19); + Expect(20); Expr( -#line 2055 "cs.ATG" +#line 2058 "cs.ATG" out expr); - Expect(20); + Expect(21); -#line 2055 "cs.ATG" +#line 2058 "cs.ATG" pexpr = new CheckedExpression(expr); - } else if (la.kind == 116) { + } else if (la.kind == 117) { lexer.NextToken(); - Expect(19); + Expect(20); Expr( -#line 2056 "cs.ATG" +#line 2059 "cs.ATG" out expr); - Expect(20); + Expect(21); -#line 2056 "cs.ATG" +#line 2059 "cs.ATG" pexpr = new UncheckedExpression(expr); - } else if (la.kind == 62) { + } else if (la.kind == 63) { lexer.NextToken(); AnonymousMethodExpr( -#line 2057 "cs.ATG" +#line 2060 "cs.ATG" out expr); -#line 2057 "cs.ATG" +#line 2060 "cs.ATG" pexpr = expr; - } else SynErr(180); + } else SynErr(181); while (StartOf(26) || -#line 2078 "cs.ATG" +#line 2081 "cs.ATG" IsGenericFollowedBy(Tokens.Dot) && IsTypeReferenceExpression(pexpr) || -#line 2086 "cs.ATG" +#line 2089 "cs.ATG" IsGenericFollowedBy(Tokens.OpenParenthesis)) { - if (la.kind == 30 || la.kind == 31) { - if (la.kind == 30) { + if (la.kind == 31 || la.kind == 32) { + if (la.kind == 31) { lexer.NextToken(); -#line 2061 "cs.ATG" +#line 2064 "cs.ATG" pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostIncrement); - } else if (la.kind == 31) { + } else if (la.kind == 32) { lexer.NextToken(); -#line 2062 "cs.ATG" +#line 2065 "cs.ATG" pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostDecrement); - } else SynErr(181); - } else if (la.kind == 46) { + } else SynErr(182); + } else if (la.kind == 47) { lexer.NextToken(); Expect(1); -#line 2065 "cs.ATG" +#line 2068 "cs.ATG" pexpr = new PointerReferenceExpression(pexpr, t.val); - } else if (la.kind == 14) { + } else if (la.kind == 15) { lexer.NextToken(); Expect(1); -#line 2066 "cs.ATG" +#line 2069 "cs.ATG" pexpr = new FieldReferenceExpression(pexpr, t.val); } else if ( -#line 2078 "cs.ATG" +#line 2081 "cs.ATG" IsGenericFollowedBy(Tokens.Dot) && IsTypeReferenceExpression(pexpr)) { TypeArgumentList( -#line 2079 "cs.ATG" +#line 2082 "cs.ATG" out typeList); - Expect(14); + Expect(15); Expect(1); -#line 2080 "cs.ATG" +#line 2083 "cs.ATG" pexpr = new FieldReferenceExpression(GetTypeReferenceExpression(pexpr, typeList), t.val); - } else if (la.kind == 19) { + } else if (la.kind == 20) { lexer.NextToken(); -#line 2082 "cs.ATG" +#line 2085 "cs.ATG" ArrayList parameters = new ArrayList(); if (StartOf(21)) { Argument( -#line 2083 "cs.ATG" +#line 2086 "cs.ATG" out expr); -#line 2083 "cs.ATG" +#line 2086 "cs.ATG" if (expr != null) {parameters.Add(expr);} - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); Argument( -#line 2084 "cs.ATG" +#line 2087 "cs.ATG" out expr); -#line 2084 "cs.ATG" +#line 2087 "cs.ATG" if (expr != null) {parameters.Add(expr);} } } - Expect(20); + Expect(21); -#line 2085 "cs.ATG" +#line 2088 "cs.ATG" pexpr = new InvocationExpression(pexpr, parameters); } else if ( -#line 2086 "cs.ATG" +#line 2089 "cs.ATG" IsGenericFollowedBy(Tokens.OpenParenthesis)) { TypeArgumentList( -#line 2086 "cs.ATG" +#line 2089 "cs.ATG" out typeList); - Expect(19); + Expect(20); -#line 2087 "cs.ATG" +#line 2090 "cs.ATG" ArrayList parameters = new ArrayList(); if (StartOf(21)) { Argument( -#line 2088 "cs.ATG" +#line 2091 "cs.ATG" out expr); -#line 2088 "cs.ATG" +#line 2091 "cs.ATG" if (expr != null) {parameters.Add(expr);} - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); Argument( -#line 2089 "cs.ATG" +#line 2092 "cs.ATG" out expr); -#line 2089 "cs.ATG" +#line 2092 "cs.ATG" if (expr != null) {parameters.Add(expr);} } } - Expect(20); + Expect(21); -#line 2090 "cs.ATG" +#line 2093 "cs.ATG" pexpr = new InvocationExpression(pexpr, parameters, typeList); } else { -#line 2092 "cs.ATG" +#line 2095 "cs.ATG" if (isArrayCreation) Error("element access not allow on array creation"); ArrayList indices = new ArrayList(); lexer.NextToken(); Expr( -#line 2095 "cs.ATG" +#line 2098 "cs.ATG" out expr); -#line 2095 "cs.ATG" +#line 2098 "cs.ATG" if (expr != null) { indices.Add(expr); } - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); Expr( -#line 2096 "cs.ATG" +#line 2099 "cs.ATG" out expr); -#line 2096 "cs.ATG" +#line 2099 "cs.ATG" if (expr != null) { indices.Add(expr); } } - Expect(18); + Expect(19); -#line 2097 "cs.ATG" +#line 2100 "cs.ATG" pexpr = new IndexerExpression(pexpr, indices); } } } void AnonymousMethodExpr( -#line 2101 "cs.ATG" +#line 2104 "cs.ATG" out Expression outExpr) { -#line 2103 "cs.ATG" +#line 2106 "cs.ATG" AnonymousMethodExpression expr = new AnonymousMethodExpression(); expr.StartLocation = t.Location; Statement stmt; List p = new List(); outExpr = expr; - if (la.kind == 19) { + if (la.kind == 20) { lexer.NextToken(); if (StartOf(10)) { FormalParameterList( -#line 2112 "cs.ATG" +#line 2115 "cs.ATG" p); -#line 2112 "cs.ATG" +#line 2115 "cs.ATG" expr.Parameters = p; } - Expect(20); + Expect(21); } -#line 2117 "cs.ATG" +#line 2120 "cs.ATG" if (compilationUnit != null) { Block( -#line 2118 "cs.ATG" +#line 2121 "cs.ATG" out stmt); -#line 2118 "cs.ATG" +#line 2121 "cs.ATG" expr.Body = (BlockStatement)stmt; -#line 2119 "cs.ATG" +#line 2122 "cs.ATG" } else { - Expect(15); + Expect(16); -#line 2121 "cs.ATG" +#line 2124 "cs.ATG" lexer.SkipCurrentBlock(); - Expect(16); + Expect(17); -#line 2123 "cs.ATG" +#line 2126 "cs.ATG" } -#line 2124 "cs.ATG" +#line 2127 "cs.ATG" expr.EndLocation = t.Location; } void TypeArgumentList( -#line 2284 "cs.ATG" +#line 2287 "cs.ATG" out List types) { -#line 2286 "cs.ATG" +#line 2289 "cs.ATG" types = new List(); TypeReference type = null; - Expect(22); + Expect(23); Type( -#line 2290 "cs.ATG" +#line 2293 "cs.ATG" out type); -#line 2290 "cs.ATG" +#line 2293 "cs.ATG" types.Add(type); - while (la.kind == 13) { + while (la.kind == 14) { lexer.NextToken(); Type( -#line 2291 "cs.ATG" +#line 2294 "cs.ATG" out type); -#line 2291 "cs.ATG" +#line 2294 "cs.ATG" types.Add(type); } - Expect(21); + Expect(22); } void ConditionalAndExpr( -#line 2133 "cs.ATG" +#line 2136 "cs.ATG" ref Expression outExpr) { -#line 2134 "cs.ATG" +#line 2137 "cs.ATG" Expression expr; InclusiveOrExpr( -#line 2136 "cs.ATG" +#line 2139 "cs.ATG" ref outExpr); - while (la.kind == 24) { + while (la.kind == 25) { lexer.NextToken(); UnaryExpr( -#line 2136 "cs.ATG" +#line 2139 "cs.ATG" out expr); InclusiveOrExpr( -#line 2136 "cs.ATG" +#line 2139 "cs.ATG" ref expr); -#line 2136 "cs.ATG" +#line 2139 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalAnd, expr); } } void InclusiveOrExpr( -#line 2139 "cs.ATG" +#line 2142 "cs.ATG" ref Expression outExpr) { -#line 2140 "cs.ATG" +#line 2143 "cs.ATG" Expression expr; ExclusiveOrExpr( -#line 2142 "cs.ATG" +#line 2145 "cs.ATG" ref outExpr); - while (la.kind == 28) { + while (la.kind == 29) { lexer.NextToken(); UnaryExpr( -#line 2142 "cs.ATG" +#line 2145 "cs.ATG" out expr); ExclusiveOrExpr( -#line 2142 "cs.ATG" +#line 2145 "cs.ATG" ref expr); -#line 2142 "cs.ATG" +#line 2145 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseOr, expr); } } void ExclusiveOrExpr( -#line 2145 "cs.ATG" +#line 2148 "cs.ATG" ref Expression outExpr) { -#line 2146 "cs.ATG" +#line 2149 "cs.ATG" Expression expr; AndExpr( -#line 2148 "cs.ATG" +#line 2151 "cs.ATG" ref outExpr); - while (la.kind == 29) { + while (la.kind == 30) { lexer.NextToken(); UnaryExpr( -#line 2148 "cs.ATG" +#line 2151 "cs.ATG" out expr); AndExpr( -#line 2148 "cs.ATG" +#line 2151 "cs.ATG" ref expr); -#line 2148 "cs.ATG" +#line 2151 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.ExclusiveOr, expr); } } void AndExpr( -#line 2151 "cs.ATG" +#line 2154 "cs.ATG" ref Expression outExpr) { -#line 2152 "cs.ATG" +#line 2155 "cs.ATG" Expression expr; EqualityExpr( -#line 2154 "cs.ATG" +#line 2157 "cs.ATG" ref outExpr); - while (la.kind == 27) { + while (la.kind == 28) { lexer.NextToken(); UnaryExpr( -#line 2154 "cs.ATG" +#line 2157 "cs.ATG" out expr); EqualityExpr( -#line 2154 "cs.ATG" +#line 2157 "cs.ATG" ref expr); -#line 2154 "cs.ATG" +#line 2157 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseAnd, expr); } } void EqualityExpr( -#line 2157 "cs.ATG" +#line 2160 "cs.ATG" ref Expression outExpr) { -#line 2159 "cs.ATG" +#line 2162 "cs.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; RelationalExpr( -#line 2163 "cs.ATG" +#line 2166 "cs.ATG" ref outExpr); - while (la.kind == 32 || la.kind == 33) { - if (la.kind == 33) { + while (la.kind == 33 || la.kind == 34) { + if (la.kind == 34) { lexer.NextToken(); -#line 2166 "cs.ATG" +#line 2169 "cs.ATG" op = BinaryOperatorType.InEquality; } else { lexer.NextToken(); -#line 2167 "cs.ATG" +#line 2170 "cs.ATG" op = BinaryOperatorType.Equality; } UnaryExpr( -#line 2169 "cs.ATG" +#line 2172 "cs.ATG" out expr); RelationalExpr( -#line 2169 "cs.ATG" +#line 2172 "cs.ATG" ref expr); -#line 2169 "cs.ATG" +#line 2172 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void RelationalExpr( -#line 2173 "cs.ATG" +#line 2176 "cs.ATG" ref Expression outExpr) { -#line 2175 "cs.ATG" +#line 2178 "cs.ATG" TypeReference type; Expression expr; BinaryOperatorType op = BinaryOperatorType.None; ShiftExpr( -#line 2180 "cs.ATG" +#line 2183 "cs.ATG" ref outExpr); while (StartOf(27)) { if (StartOf(28)) { - if (la.kind == 22) { + if (la.kind == 23) { lexer.NextToken(); -#line 2183 "cs.ATG" +#line 2186 "cs.ATG" op = BinaryOperatorType.LessThan; - } else if (la.kind == 21) { + } else if (la.kind == 22) { lexer.NextToken(); -#line 2184 "cs.ATG" +#line 2187 "cs.ATG" op = BinaryOperatorType.GreaterThan; - } else if (la.kind == 35) { + } else if (la.kind == 36) { lexer.NextToken(); -#line 2185 "cs.ATG" +#line 2188 "cs.ATG" op = BinaryOperatorType.LessThanOrEqual; - } else if (la.kind == 34) { + } else if (la.kind == 35) { lexer.NextToken(); -#line 2186 "cs.ATG" +#line 2189 "cs.ATG" op = BinaryOperatorType.GreaterThanOrEqual; - } else SynErr(182); + } else SynErr(183); UnaryExpr( -#line 2188 "cs.ATG" +#line 2191 "cs.ATG" out expr); ShiftExpr( -#line 2188 "cs.ATG" +#line 2191 "cs.ATG" ref expr); -#line 2188 "cs.ATG" +#line 2191 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } else { - if (la.kind == 83) { + if (la.kind == 84) { lexer.NextToken(); -#line 2191 "cs.ATG" +#line 2194 "cs.ATG" op = BinaryOperatorType.TypeCheck; - } else if (la.kind == 48) { + } else if (la.kind == 49) { lexer.NextToken(); -#line 2192 "cs.ATG" +#line 2195 "cs.ATG" op = BinaryOperatorType.AsCast; - } else SynErr(183); + } else SynErr(184); Type( -#line 2194 "cs.ATG" +#line 2197 "cs.ATG" out type); -#line 2194 "cs.ATG" +#line 2197 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, new TypeReferenceExpression(type)); } } } void ShiftExpr( -#line 2198 "cs.ATG" +#line 2201 "cs.ATG" ref Expression outExpr) { -#line 2200 "cs.ATG" +#line 2203 "cs.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; AdditiveExpr( -#line 2204 "cs.ATG" -ref outExpr); - while (la.kind == 36 || #line 2207 "cs.ATG" +ref outExpr); + while (la.kind == 37 || +#line 2210 "cs.ATG" IsShiftRight()) { - if (la.kind == 36) { + if (la.kind == 37) { lexer.NextToken(); -#line 2206 "cs.ATG" +#line 2209 "cs.ATG" op = BinaryOperatorType.ShiftLeft; } else { - Expect(21); - Expect(21); + Expect(22); + Expect(22); -#line 2208 "cs.ATG" +#line 2211 "cs.ATG" op = BinaryOperatorType.ShiftRight; } UnaryExpr( -#line 2211 "cs.ATG" +#line 2214 "cs.ATG" out expr); AdditiveExpr( -#line 2211 "cs.ATG" +#line 2214 "cs.ATG" ref expr); -#line 2211 "cs.ATG" +#line 2214 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void AdditiveExpr( -#line 2215 "cs.ATG" +#line 2218 "cs.ATG" ref Expression outExpr) { -#line 2217 "cs.ATG" +#line 2220 "cs.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; MultiplicativeExpr( -#line 2221 "cs.ATG" +#line 2224 "cs.ATG" ref outExpr); while (la.kind == 4 || la.kind == 5) { if (la.kind == 4) { lexer.NextToken(); -#line 2224 "cs.ATG" +#line 2227 "cs.ATG" op = BinaryOperatorType.Add; } else { lexer.NextToken(); -#line 2225 "cs.ATG" +#line 2228 "cs.ATG" op = BinaryOperatorType.Subtract; } UnaryExpr( -#line 2227 "cs.ATG" +#line 2230 "cs.ATG" out expr); MultiplicativeExpr( -#line 2227 "cs.ATG" +#line 2230 "cs.ATG" ref expr); -#line 2227 "cs.ATG" +#line 2230 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void MultiplicativeExpr( -#line 2231 "cs.ATG" +#line 2234 "cs.ATG" ref Expression outExpr) { -#line 2233 "cs.ATG" +#line 2236 "cs.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; @@ -5243,59 +5252,59 @@ ref Expression outExpr) { if (la.kind == 6) { lexer.NextToken(); -#line 2239 "cs.ATG" +#line 2242 "cs.ATG" op = BinaryOperatorType.Multiply; } else if (la.kind == 7) { lexer.NextToken(); -#line 2240 "cs.ATG" +#line 2243 "cs.ATG" op = BinaryOperatorType.Divide; } else { lexer.NextToken(); -#line 2241 "cs.ATG" +#line 2244 "cs.ATG" op = BinaryOperatorType.Modulus; } UnaryExpr( -#line 2243 "cs.ATG" +#line 2246 "cs.ATG" out expr); -#line 2243 "cs.ATG" +#line 2246 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void TypeParameterConstraintsClauseBase( -#line 2336 "cs.ATG" +#line 2339 "cs.ATG" out TypeReference type) { -#line 2337 "cs.ATG" +#line 2340 "cs.ATG" TypeReference t; type = null; - if (la.kind == 107) { + if (la.kind == 108) { lexer.NextToken(); -#line 2339 "cs.ATG" +#line 2342 "cs.ATG" type = new TypeReference("struct"); - } else if (la.kind == 57) { + } else if (la.kind == 58) { lexer.NextToken(); -#line 2340 "cs.ATG" +#line 2343 "cs.ATG" type = new TypeReference("struct"); - } else if (la.kind == 87) { + } else if (la.kind == 88) { lexer.NextToken(); - Expect(19); Expect(20); + Expect(21); -#line 2341 "cs.ATG" +#line 2344 "cs.ATG" type = new TypeReference("struct"); } else if (StartOf(9)) { Type( -#line 2342 "cs.ATG" +#line 2345 "cs.ATG" out t); -#line 2342 "cs.ATG" +#line 2345 "cs.ATG" type = t; - } else SynErr(184); + } else SynErr(185); } @@ -5360,135 +5369,135 @@ out t); case 10: s = "\"::\" expected"; break; case 11: s = "\";\" expected"; break; case 12: s = "\"?\" expected"; break; - case 13: s = "\",\" expected"; break; - case 14: s = "\".\" expected"; break; - case 15: s = "\"{\" expected"; break; - case 16: s = "\"}\" expected"; break; - case 17: s = "\"[\" expected"; break; - case 18: s = "\"]\" expected"; break; - case 19: s = "\"(\" expected"; break; - case 20: s = "\")\" expected"; break; - case 21: s = "\">\" expected"; break; - case 22: s = "\"<\" expected"; break; - case 23: s = "\"!\" expected"; break; - case 24: s = "\"&&\" expected"; break; - case 25: s = "\"||\" expected"; break; - case 26: s = "\"~\" expected"; break; - case 27: s = "\"&\" expected"; break; - case 28: s = "\"|\" expected"; break; - case 29: s = "\"^\" expected"; break; - case 30: s = "\"++\" expected"; break; - case 31: s = "\"--\" expected"; break; - case 32: s = "\"==\" expected"; break; - case 33: s = "\"!=\" expected"; break; - case 34: s = "\">=\" expected"; break; - case 35: s = "\"<=\" expected"; break; - case 36: s = "\"<<\" expected"; break; - case 37: s = "\"+=\" expected"; break; - case 38: s = "\"-=\" expected"; break; - case 39: s = "\"*=\" expected"; break; - case 40: s = "\"/=\" expected"; break; - case 41: s = "\"%=\" expected"; break; - case 42: s = "\"&=\" expected"; break; - case 43: s = "\"|=\" expected"; break; - case 44: s = "\"^=\" expected"; break; - case 45: s = "\"<<=\" expected"; break; - case 46: s = "\"->\" expected"; break; - case 47: s = "\"abstract\" expected"; break; - case 48: s = "\"as\" expected"; break; - case 49: s = "\"base\" expected"; break; - case 50: s = "\"bool\" expected"; break; - case 51: s = "\"break\" expected"; break; - case 52: s = "\"byte\" expected"; break; - case 53: s = "\"case\" expected"; break; - case 54: s = "\"catch\" expected"; break; - case 55: s = "\"char\" expected"; break; - case 56: s = "\"checked\" expected"; break; - case 57: s = "\"class\" expected"; break; - case 58: s = "\"const\" expected"; break; - case 59: s = "\"continue\" expected"; break; - case 60: s = "\"decimal\" expected"; break; - case 61: s = "\"default\" expected"; break; - case 62: s = "\"delegate\" expected"; break; - case 63: s = "\"do\" expected"; break; - case 64: s = "\"double\" expected"; break; - case 65: s = "\"else\" expected"; break; - case 66: s = "\"enum\" expected"; break; - case 67: s = "\"event\" expected"; break; - case 68: s = "\"explicit\" expected"; break; - case 69: s = "\"extern\" expected"; break; - case 70: s = "\"false\" expected"; break; - case 71: s = "\"finally\" expected"; break; - case 72: s = "\"fixed\" expected"; break; - case 73: s = "\"float\" expected"; break; - case 74: s = "\"for\" expected"; break; - case 75: s = "\"foreach\" expected"; break; - case 76: s = "\"goto\" expected"; break; - case 77: s = "\"if\" expected"; break; - case 78: s = "\"implicit\" expected"; break; - case 79: s = "\"in\" expected"; break; - case 80: s = "\"int\" expected"; break; - case 81: s = "\"interface\" expected"; break; - case 82: s = "\"internal\" expected"; break; - case 83: s = "\"is\" expected"; break; - case 84: s = "\"lock\" expected"; break; - case 85: s = "\"long\" expected"; break; - case 86: s = "\"namespace\" expected"; break; - case 87: s = "\"new\" expected"; break; - case 88: s = "\"null\" expected"; break; - case 89: s = "\"object\" expected"; break; - case 90: s = "\"operator\" expected"; break; - case 91: s = "\"out\" expected"; break; - case 92: s = "\"override\" expected"; break; - case 93: s = "\"params\" expected"; break; - case 94: s = "\"private\" expected"; break; - case 95: s = "\"protected\" expected"; break; - case 96: s = "\"public\" expected"; break; - case 97: s = "\"readonly\" expected"; break; - case 98: s = "\"ref\" expected"; break; - case 99: s = "\"return\" expected"; break; - case 100: s = "\"sbyte\" expected"; break; - case 101: s = "\"sealed\" expected"; break; - case 102: s = "\"short\" expected"; break; - case 103: s = "\"sizeof\" expected"; break; - case 104: s = "\"stackalloc\" expected"; break; - case 105: s = "\"static\" expected"; break; - case 106: s = "\"string\" expected"; break; - case 107: s = "\"struct\" expected"; break; - case 108: s = "\"switch\" expected"; break; - case 109: s = "\"this\" expected"; break; - case 110: s = "\"throw\" expected"; break; - case 111: s = "\"true\" expected"; break; - case 112: s = "\"try\" expected"; break; - case 113: s = "\"typeof\" expected"; break; - case 114: s = "\"uint\" expected"; break; - case 115: s = "\"ulong\" expected"; break; - case 116: s = "\"unchecked\" expected"; break; - case 117: s = "\"unsafe\" expected"; break; - case 118: s = "\"ushort\" expected"; break; - case 119: s = "\"using\" expected"; break; - case 120: s = "\"virtual\" expected"; break; - case 121: s = "\"void\" expected"; break; - case 122: s = "\"volatile\" expected"; break; - case 123: s = "\"while\" expected"; break; - case 124: s = "??? expected"; break; - case 125: s = "invalid NamespaceMemberDecl"; break; - case 126: s = "invalid NonArrayType"; break; - case 127: s = "invalid AttributeArguments"; break; - case 128: s = "invalid Expr"; break; - case 129: s = "invalid TypeModifier"; break; - case 130: s = "invalid TypeDecl"; break; + case 13: s = "\"??\" expected"; break; + case 14: s = "\",\" expected"; break; + case 15: s = "\".\" expected"; break; + case 16: s = "\"{\" expected"; break; + case 17: s = "\"}\" expected"; break; + case 18: s = "\"[\" expected"; break; + case 19: s = "\"]\" expected"; break; + case 20: s = "\"(\" expected"; break; + case 21: s = "\")\" expected"; break; + case 22: s = "\">\" expected"; break; + case 23: s = "\"<\" expected"; break; + case 24: s = "\"!\" expected"; break; + case 25: s = "\"&&\" expected"; break; + case 26: s = "\"||\" expected"; break; + case 27: s = "\"~\" expected"; break; + case 28: s = "\"&\" expected"; break; + case 29: s = "\"|\" expected"; break; + case 30: s = "\"^\" expected"; break; + case 31: s = "\"++\" expected"; break; + case 32: s = "\"--\" expected"; break; + case 33: s = "\"==\" expected"; break; + case 34: s = "\"!=\" expected"; break; + case 35: s = "\">=\" expected"; break; + case 36: s = "\"<=\" expected"; break; + case 37: s = "\"<<\" expected"; break; + case 38: s = "\"+=\" expected"; break; + case 39: s = "\"-=\" expected"; break; + case 40: s = "\"*=\" expected"; break; + case 41: s = "\"/=\" expected"; break; + case 42: s = "\"%=\" expected"; break; + case 43: s = "\"&=\" expected"; break; + case 44: s = "\"|=\" expected"; break; + case 45: s = "\"^=\" expected"; break; + case 46: s = "\"<<=\" expected"; break; + case 47: s = "\"->\" expected"; break; + case 48: s = "\"abstract\" expected"; break; + case 49: s = "\"as\" expected"; break; + case 50: s = "\"base\" expected"; break; + case 51: s = "\"bool\" expected"; break; + case 52: s = "\"break\" expected"; break; + case 53: s = "\"byte\" expected"; break; + case 54: s = "\"case\" expected"; break; + case 55: s = "\"catch\" expected"; break; + case 56: s = "\"char\" expected"; break; + case 57: s = "\"checked\" expected"; break; + case 58: s = "\"class\" expected"; break; + case 59: s = "\"const\" expected"; break; + case 60: s = "\"continue\" expected"; break; + case 61: s = "\"decimal\" expected"; break; + case 62: s = "\"default\" expected"; break; + case 63: s = "\"delegate\" expected"; break; + case 64: s = "\"do\" expected"; break; + case 65: s = "\"double\" expected"; break; + case 66: s = "\"else\" expected"; break; + case 67: s = "\"enum\" expected"; break; + case 68: s = "\"event\" expected"; break; + case 69: s = "\"explicit\" expected"; break; + case 70: s = "\"extern\" expected"; break; + case 71: s = "\"false\" expected"; break; + case 72: s = "\"finally\" expected"; break; + case 73: s = "\"fixed\" expected"; break; + case 74: s = "\"float\" expected"; break; + case 75: s = "\"for\" expected"; break; + case 76: s = "\"foreach\" expected"; break; + case 77: s = "\"goto\" expected"; break; + case 78: s = "\"if\" expected"; break; + case 79: s = "\"implicit\" expected"; break; + case 80: s = "\"in\" expected"; break; + case 81: s = "\"int\" expected"; break; + case 82: s = "\"interface\" expected"; break; + case 83: s = "\"internal\" expected"; break; + case 84: s = "\"is\" expected"; break; + case 85: s = "\"lock\" expected"; break; + case 86: s = "\"long\" expected"; break; + case 87: s = "\"namespace\" expected"; break; + case 88: s = "\"new\" expected"; break; + case 89: s = "\"null\" expected"; break; + case 90: s = "\"object\" expected"; break; + case 91: s = "\"operator\" expected"; break; + case 92: s = "\"out\" expected"; break; + case 93: s = "\"override\" expected"; break; + case 94: s = "\"params\" expected"; break; + case 95: s = "\"private\" expected"; break; + case 96: s = "\"protected\" expected"; break; + case 97: s = "\"public\" expected"; break; + case 98: s = "\"readonly\" expected"; break; + case 99: s = "\"ref\" expected"; break; + case 100: s = "\"return\" expected"; break; + case 101: s = "\"sbyte\" expected"; break; + case 102: s = "\"sealed\" expected"; break; + case 103: s = "\"short\" expected"; break; + case 104: s = "\"sizeof\" expected"; break; + case 105: s = "\"stackalloc\" expected"; break; + case 106: s = "\"static\" expected"; break; + case 107: s = "\"string\" expected"; break; + case 108: s = "\"struct\" expected"; break; + case 109: s = "\"switch\" expected"; break; + case 110: s = "\"this\" expected"; break; + case 111: s = "\"throw\" expected"; break; + case 112: s = "\"true\" expected"; break; + case 113: s = "\"try\" expected"; break; + case 114: s = "\"typeof\" expected"; break; + case 115: s = "\"uint\" expected"; break; + case 116: s = "\"ulong\" expected"; break; + case 117: s = "\"unchecked\" expected"; break; + case 118: s = "\"unsafe\" expected"; break; + case 119: s = "\"ushort\" expected"; break; + case 120: s = "\"using\" expected"; break; + case 121: s = "\"virtual\" expected"; break; + case 122: s = "\"void\" expected"; break; + case 123: s = "\"volatile\" expected"; break; + case 124: s = "\"while\" expected"; break; + case 125: s = "??? expected"; break; + case 126: s = "invalid NamespaceMemberDecl"; break; + case 127: s = "invalid NonArrayType"; break; + case 128: s = "invalid AttributeArguments"; break; + case 129: s = "invalid Expr"; break; + case 130: s = "invalid TypeModifier"; break; case 131: s = "invalid TypeDecl"; break; - case 132: s = "invalid IntegralType"; break; - case 133: s = "invalid Type"; break; + case 132: s = "invalid TypeDecl"; break; + case 133: s = "invalid IntegralType"; break; case 134: s = "invalid Type"; break; - case 135: s = "invalid FormalParameterList"; break; + case 135: s = "invalid Type"; break; case 136: s = "invalid FormalParameterList"; break; - case 137: s = "invalid ClassType"; break; - case 138: s = "invalid MemberModifier"; break; - case 139: s = "invalid ClassMemberDecl"; break; + case 137: s = "invalid FormalParameterList"; break; + case 138: s = "invalid ClassType"; break; + case 139: s = "invalid MemberModifier"; break; case 140: s = "invalid ClassMemberDecl"; break; - case 141: s = "invalid StructMemberDecl"; break; + case 141: s = "invalid ClassMemberDecl"; break; case 142: s = "invalid StructMemberDecl"; break; case 143: s = "invalid StructMemberDecl"; break; case 144: s = "invalid StructMemberDecl"; break; @@ -5498,40 +5507,41 @@ out t); case 148: s = "invalid StructMemberDecl"; break; case 149: s = "invalid StructMemberDecl"; break; case 150: s = "invalid StructMemberDecl"; break; - case 151: s = "invalid InterfaceMemberDecl"; break; + case 151: s = "invalid StructMemberDecl"; break; case 152: s = "invalid InterfaceMemberDecl"; break; case 153: s = "invalid InterfaceMemberDecl"; break; - case 154: s = "invalid SimpleType"; break; - case 155: s = "invalid EventAccessorDecls"; break; - case 156: s = "invalid ConstructorInitializer"; break; - case 157: s = "invalid OverloadableOperator"; break; - case 158: s = "invalid AccessorDecls"; break; - case 159: s = "invalid InterfaceAccessors"; break; + case 154: s = "invalid InterfaceMemberDecl"; break; + case 155: s = "invalid SimpleType"; break; + case 156: s = "invalid EventAccessorDecls"; break; + case 157: s = "invalid ConstructorInitializer"; break; + case 158: s = "invalid OverloadableOperator"; break; + case 159: s = "invalid AccessorDecls"; break; case 160: s = "invalid InterfaceAccessors"; break; - case 161: s = "invalid GetAccessorDecl"; break; - case 162: s = "invalid SetAccessorDecl"; break; - case 163: s = "invalid VariableInitializer"; break; - case 164: s = "invalid Statement"; break; - case 165: s = "invalid AssignmentOperator"; break; - case 166: s = "invalid EmbeddedStatement"; break; + case 161: s = "invalid InterfaceAccessors"; break; + case 162: s = "invalid GetAccessorDecl"; break; + case 163: s = "invalid SetAccessorDecl"; break; + case 164: s = "invalid VariableInitializer"; break; + case 165: s = "invalid Statement"; break; + case 166: s = "invalid AssignmentOperator"; break; case 167: s = "invalid EmbeddedStatement"; break; case 168: s = "invalid EmbeddedStatement"; break; - case 169: s = "invalid ForInitializer"; break; - case 170: s = "invalid GotoStatement"; break; - case 171: s = "invalid StatementExpr"; break; - case 172: s = "invalid TryStatement"; break; - case 173: s = "invalid ResourceAcquisition"; break; - case 174: s = "invalid SwitchLabel"; break; - case 175: s = "invalid CatchClauses"; break; - case 176: s = "invalid PrimaryExpr"; break; + case 169: s = "invalid EmbeddedStatement"; break; + case 170: s = "invalid ForInitializer"; break; + case 171: s = "invalid GotoStatement"; break; + case 172: s = "invalid StatementExpr"; break; + case 173: s = "invalid TryStatement"; break; + case 174: s = "invalid ResourceAcquisition"; break; + case 175: s = "invalid SwitchLabel"; break; + case 176: s = "invalid CatchClauses"; break; case 177: s = "invalid PrimaryExpr"; break; case 178: s = "invalid PrimaryExpr"; break; case 179: s = "invalid PrimaryExpr"; break; case 180: s = "invalid PrimaryExpr"; break; case 181: s = "invalid PrimaryExpr"; break; - case 182: s = "invalid RelationalExpr"; break; + case 182: s = "invalid PrimaryExpr"; break; case 183: s = "invalid RelationalExpr"; break; - case 184: s = "invalid TypeParameterConstraintsClauseBase"; break; + case 184: s = "invalid RelationalExpr"; break; + case 185: s = "invalid TypeParameterConstraintsClauseBase"; break; default: s = "error " + errorNumber; break; } @@ -5544,35 +5554,35 @@ out t); } static bool[,] set = { - {T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,x, x,x,T,T, x,x,x,x, x,x,T,T, T,x,x,x, x,T,x,x, x,T,x,T, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,x, x,x,x,T, x,x,x,x, x,x,T,T, T,x,x,x, x,T,x,x, x,T,x,T, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,x, x,x,T,T, T,x,x,x, x,T,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, T,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,T,x, x,x,x,x, x,x}, - {x,T,T,x, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,T, x,x,T,T, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,x, T,x,x,T, T,x,x,x, T,x,T,x, T,x,x,x, x,x,T,x, x,T,x,x, x,x,x,x, T,x,x,x, x,T,x,T, T,T,x,x, x,x,x,x, x,x,x,x, T,x,T,T, x,x,T,x, x,T,x,T, x,T,T,T, T,x,T,x, x,x,x,x, x,x}, - {x,x,x,x, T,T,T,T, T,T,x,T, T,T,x,x, T,x,T,x, T,T,T,x, T,T,x,T, T,T,x,x, T,T,T,T, T,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x}, - {x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,T, T,T,T,T, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, T,x,x,x, x,T,x,x, x,T,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,x,T,x, x,x,x,x, x,x,T,T, x,x,T,x, x,T,x,x, x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, T,x,x,x, x,T,x,x, x,T,x,T, x,T,x,x, x,x,T,x, T,x,T,x, x,x,T,x, x,x,x,x, x,x,T,T, x,x,T,x, x,T,x,x, x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,T,x, T,x,x,T, x,T,T,x, T,x,T,x, T,x,T,T, T,T,x,x, x,T,x,x, x,x,T,x, T,T,T,x, x,T,x,T, x,T,x,x, T,x,T,T, T,T,x,x, T,T,T,x, x,T,T,T, x,x,x,x, x,x,T,T, x,T,T,x, T,T,T,x, x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,x, T,x,T,T, T,T,x,x, x,T,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,T,x,x, T,x,T,x, x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,T,x, T,x,x,T, x,T,T,x, T,x,T,x, T,x,T,T, T,T,x,x, x,T,x,x, x,x,T,x, T,T,T,x, x,T,x,T, x,T,x,x, T,x,T,T, T,T,x,x, T,T,T,x, x,T,T,T, x,x,x,x, x,x,T,T, x,T,T,x, T,T,T,x, x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,T, x,x,x,x, T,x,x,x, T,x,x,T, x,x,x,x, x,T,x,x, x,x,x,x, T,x,x,x, x,T,x,T, x,T,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,x,T,x, x,x,x,x, x,x,T,T, x,x,T,x, x,T,x,x, x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, T,x,x,x, x,T,x,x, x,T,x,T, x,x,x,x, x,x,T,x, T,x,T,x, x,x,T,x, x,x,x,x, x,x,T,T, x,x,T,x, x,T,x,x, x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,T, x,T,T,x, T,x,T,x, T,x,T,T, T,x,x,x, x,T,x,x, x,x,T,x, T,T,x,x, x,T,x,x, x,T,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,x,T,T, x,x,x,x, x,x,T,T, x,x,T,x, x,T,x,x, x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,T, x,x,x,x, T,x,x,x, T,x,x,T, x,x,x,x, x,T,x,x, x,x,x,x, T,x,x,x, x,T,x,x, x,T,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,x,T,x, x,x,x,x, x,x,T,T, x,x,T,x, x,T,x,x, x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,T,x, x,x,x,x, x,x}, - {x,T,T,x, T,T,T,x, x,x,x,T, x,x,x,T, x,x,x,T, x,x,x,T, x,x,T,T, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,T, T,x,x,T, T,x,T,T, T,x,T,T, T,x,x,x, x,x,T,x, T,T,T,T, T,T,x,x, T,x,x,x, T,T,x,T, T,T,x,x, x,x,x,x, x,x,x,T, T,x,T,T, x,x,T,x, T,T,T,T, T,T,T,T, T,T,T,T, x,x,x,T, x,x}, - {x,T,T,x, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,T, x,x,T,T, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,x, T,x,x,T, T,x,x,x, T,x,T,x, T,x,x,x, x,x,T,x, x,T,x,x, x,x,x,x, T,x,x,x, x,T,x,T, T,T,x,T, x,x,x,x, x,x,T,x, T,x,T,T, x,x,T,x, x,T,x,T, x,T,T,T, T,x,T,x, x,x,x,x, x,x}, - {x,T,T,x, T,T,T,x, x,x,x,T, x,x,x,T, x,x,x,T, x,x,x,T, x,x,T,T, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,T, T,x,x,T, T,x,x,T, T,x,T,T, T,x,x,x, x,x,T,x, T,T,T,T, T,T,x,x, T,x,x,x, T,T,x,T, T,T,x,x, x,x,x,x, x,x,x,T, T,x,T,T, x,x,T,x, T,T,T,T, T,T,T,T, T,T,T,T, x,x,x,T, x,x}, - {x,T,T,x, T,T,T,x, x,x,x,x, x,x,x,T, x,x,x,T, x,x,x,T, x,x,T,T, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,x, T,x,x,T, T,x,x,x, T,x,T,x, T,x,x,x, x,x,T,x, x,T,x,x, x,x,x,x, T,x,x,x, x,T,x,T, T,T,x,x, x,x,x,x, x,x,x,x, T,x,T,T, T,x,T,x, x,T,x,T, x,T,T,T, T,x,T,x, x,x,x,x, x,x}, - {x,x,x,x, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,T,T, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, T,x,x,x, x,T,x,x, x,T,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,x,T,x, x,x,x,x, x,x,T,T, x,x,T,x, x,x,x,x, x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,T,x,T, x,x,x,x, x,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x} + {T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, + {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,x,T, T,x,x,x, x,x,x,T, T,T,x,x, x,x,T,x, x,x,T,x, T,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x}, + {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,x,x, T,x,x,x, x,x,x,T, T,T,x,x, x,x,T,x, x,x,T,x, T,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x}, + {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,x, x,x,x,T, T,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x}, + {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,T,x,x, T,x,x,x, x,T,x,x, x,T,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,T,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,T, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,T, x,x,x,x, x,x,x}, + {x,T,T,x, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,T,x,x, T,T,x,x, x,T,x,T, x,T,x,x, x,x,x,T, x,x,T,x, x,x,x,x, x,T,x,x, x,x,T,x, T,T,T,x, x,x,x,x, x,x,x,x, x,T,x,T, T,x,x,T, x,x,T,x, T,x,T,T, T,T,x,T, x,x,x,x, x,x,x}, + {x,x,x,x, T,T,T,T, T,T,x,T, T,T,T,x, x,T,x,T, x,T,T,T, x,T,T,x, T,T,T,x, x,T,T,T, T,T,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, + {x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,T,T,T, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, + {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, + {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,T,x,x, T,x,x,x, x,T,x,x, x,T,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,x, x,T,x,T, x,x,x,T, x,x,x,x, x,x,x,T, T,x,x,T, x,x,T,x, x,x,x}, + {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,T,x,x, T,x,x,x, x,T,x,x, x,T,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,T,x,x, x,x,T,x, x,x,T,x, T,x,T,x, x,x,x,T, x,T,x,T, x,x,x,T, x,x,x,x, x,x,x,T, T,x,x,T, x,x,T,x, x,x,x}, + {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,T, x,T,x,x, T,x,T,T, x,T,x,T, x,T,x,T, T,T,T,x, x,x,T,x, x,x,x,T, x,T,T,T, x,x,T,x, T,x,T,x, x,T,x,T, T,T,T,x, x,T,T,T, x,x,T,T, T,x,x,x, x,x,x,T, T,x,T,T, x,T,T,T, x,x,x}, + {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,x, x,T,x,T, T,T,T,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,T,x, x,T,x,T, x,x,x}, + {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,T, x,T,x,x, T,x,T,T, x,T,x,T, x,T,x,T, T,T,T,x, x,x,T,x, x,x,x,T, x,T,T,T, x,x,T,x, T,x,T,x, x,T,x,T, T,T,T,x, x,T,T,T, x,x,T,T, T,x,x,x, x,x,x,T, T,x,T,T, x,T,T,T, x,x,x}, + {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,T,x,x, T,x,x,x, x,T,x,x, x,T,x,x, T,x,x,x, x,x,T,x, x,x,x,x, x,T,x,x, x,x,T,x, T,x,T,x, x,x,x,x, x,x,x,x, x,T,x,T, x,x,x,T, x,x,x,x, x,x,x,T, T,x,x,T, x,x,T,x, x,x,x}, + {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,T,x,x, T,x,x,x, x,T,x,x, x,T,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,T,x,x, x,x,T,x, x,x,T,x, T,x,x,x, x,x,x,T, x,T,x,T, x,x,x,T, x,x,x,x, x,x,x,T, T,x,x,T, x,x,T,x, x,x,x}, + {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,T,x,x, T,x,T,T, x,T,x,T, x,T,x,T, T,T,x,x, x,x,T,x, x,x,x,T, x,T,T,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,x, x,T,x,T, x,x,x,T, T,x,x,x, x,x,x,T, T,x,x,T, x,x,T,x, x,x,x}, + {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, + {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,T,x,x, T,x,x,x, x,T,x,x, x,T,x,x, T,x,x,x, x,x,T,x, x,x,x,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,x, x,T,x,T, x,x,x,T, x,x,x,x, x,x,x,T, T,x,x,T, x,x,T,x, x,x,x}, + {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,T, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,T, x,x,x,x, x,x,x}, + {x,T,T,x, T,T,T,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,T,x,x, T,T,x,T, T,T,x,T, T,T,x,x, x,x,x,T, x,T,T,T, T,T,T,x, x,T,x,x, x,T,T,x, T,T,T,x, x,x,x,x, x,x,x,x, T,T,x,T, T,x,x,T, x,T,T,T, T,T,T,T, T,T,T,T, T,x,x,x, T,x,x}, + {x,T,T,x, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,T,x,x, T,T,x,x, x,T,x,T, x,T,x,x, x,x,x,T, x,x,T,x, x,x,x,x, x,T,x,x, x,x,T,x, T,T,T,x, T,x,x,x, x,x,x,T, x,T,x,T, T,x,x,T, x,x,T,x, T,x,T,T, T,T,x,T, x,x,x,x, x,x,x}, + {x,T,T,x, T,T,T,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,T,x,x, T,T,x,x, T,T,x,T, T,T,x,x, x,x,x,T, x,T,T,T, T,T,T,x, x,T,x,x, x,T,T,x, T,T,T,x, x,x,x,x, x,x,x,x, T,T,x,T, T,x,x,T, x,T,T,T, T,T,T,T, T,T,T,T, T,x,x,x, T,x,x}, + {x,T,T,x, T,T,T,x, x,x,x,x, x,x,x,x, T,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,T,x,x, T,T,x,x, x,T,x,T, x,T,x,x, x,x,x,T, x,x,T,x, x,x,x,x, x,T,x,x, x,x,T,x, T,T,T,x, x,x,x,x, x,x,x,x, x,T,x,T, T,T,x,T, x,x,T,x, T,x,T,T, T,T,x,T, x,x,x,x, x,x,x}, + {x,x,x,x, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, + {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,T,x,x, T,x,x,x, x,T,x,x, x,T,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,x, x,T,x,T, x,x,x,T, x,x,x,x, x,x,x,T, T,x,x,T, x,x,x,x, x,x,x}, + {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,T,x, T,x,x,x, x,x,x,x, x,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, + {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, + {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x} }; } // end Parser diff --git a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG index 8f0e5d2709..4bd34b6092 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG +++ b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG @@ -433,6 +433,7 @@ TOKENS "::" ";" "?" + "??" "," "." "{" @@ -1902,7 +1903,9 @@ Expr UnaryExpr /*--- conditional expression: */ ( - ConditionalOrExpr [ "?" Expr ":" Expr (. expr = new ConditionalExpression(expr, expr1, expr2); .) ] + ConditionalOrExpr + [ "??" Expr (. expr = new BinaryOperatorExpression(expr, BinaryOperatorType.NullCoalescing, expr1); .) ] + [ "?" Expr ":" Expr (. expr = new ConditionalExpression(expr, expr1, expr2); .) ] /*--- assignment: */ | (. AssignmentOperatorType op; Expression val; .) AssignmentOperator Expr (. expr = new AssignmentExpression(expr, op, val); .) ) diff --git a/src/Libraries/NRefactory/Test/Lexer/CSharp/CustomLexerTests.cs b/src/Libraries/NRefactory/Test/Lexer/CSharp/CustomLexerTests.cs new file mode 100644 index 0000000000..f50b202dac --- /dev/null +++ b/src/Libraries/NRefactory/Test/Lexer/CSharp/CustomLexerTests.cs @@ -0,0 +1,59 @@ +// +// 2002-2005 AlphaSierraPapa +// GNU General Public License +// +// $Revision$ +// + +using System; +using System.IO; +using NUnit.Framework; +using ICSharpCode.NRefactory.Parser; +using ICSharpCode.NRefactory.Parser.CSharp; +using ICSharpCode.NRefactory.PrettyPrinter; + +namespace ICSharpCode.NRefactory.Tests.Lexer.CSharp +{ + [TestFixture] + public sealed class CustomLexerTests + { + ILexer GenerateLexer(StringReader sr) + { + return ParserFactory.CreateLexer(SupportedLanguages.CSharp, sr); + } + + [Test] + public void TestEmptyBlock() + { + ILexer lexer = GenerateLexer(new StringReader("{}+")); + Assert.AreEqual(Tokens.OpenCurlyBrace, lexer.NextToken().kind); + Assert.AreEqual(Tokens.CloseCurlyBrace, lexer.NextToken().kind); + Assert.AreEqual(Tokens.Plus, lexer.NextToken().kind); + Assert.AreEqual(Tokens.EOF, lexer.NextToken().kind); + } + + [Test] + public void TestSkippedEmptyBlock() + { + ILexer lexer = GenerateLexer(new StringReader("{}+")); + Assert.AreEqual(Tokens.OpenCurlyBrace, lexer.NextToken().kind); + lexer.NextToken(); + lexer.SkipCurrentBlock(); + Assert.AreEqual(Tokens.CloseCurlyBrace, lexer.LookAhead.kind); + Assert.AreEqual(Tokens.Plus, lexer.NextToken().kind); + Assert.AreEqual(Tokens.EOF, lexer.NextToken().kind); + } + + [Test] + public void TestSkippedNonEmptyBlock() + { + ILexer lexer = GenerateLexer(new StringReader("{ TestMethod('}'); /* }}} */ while(1) {break;} }+")); + Assert.AreEqual(Tokens.OpenCurlyBrace, lexer.NextToken().kind); + lexer.NextToken(); + lexer.SkipCurrentBlock(); + Assert.AreEqual(Tokens.CloseCurlyBrace, lexer.LookAhead.kind); + Assert.AreEqual(Tokens.Plus, lexer.NextToken().kind); + Assert.AreEqual(Tokens.EOF, lexer.NextToken().kind); + } + } +} diff --git a/src/Libraries/NRefactory/Test/Lexer/CSharp/LexerTest.cs b/src/Libraries/NRefactory/Test/Lexer/CSharp/LexerTests.cs similarity index 92% rename from src/Libraries/NRefactory/Test/Lexer/CSharp/LexerTest.cs rename to src/Libraries/NRefactory/Test/Lexer/CSharp/LexerTests.cs index 66b4cae747..162296960d 100644 --- a/src/Libraries/NRefactory/Test/Lexer/CSharp/LexerTest.cs +++ b/src/Libraries/NRefactory/Test/Lexer/CSharp/LexerTests.cs @@ -92,6 +92,13 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.CSharp Assert.AreEqual(Tokens.Question, lexer.NextToken().kind); } + [Test] + public void TestDoubleQuestion() + { + ILexer lexer = GenerateLexer(new StringReader("??")); + Assert.AreEqual(Tokens.DoubleQuestion, lexer.NextToken().kind); + } + [Test] public void TestComma() { @@ -119,41 +126,7 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.CSharp ILexer lexer = GenerateLexer(new StringReader("}")); Assert.AreEqual(Tokens.CloseCurlyBrace, lexer.NextToken().kind); } - - [Test] - public void TestEmptyBlock() - { - ILexer lexer = GenerateLexer(new StringReader("{}+")); - Assert.AreEqual(Tokens.OpenCurlyBrace, lexer.NextToken().kind); - Assert.AreEqual(Tokens.CloseCurlyBrace, lexer.NextToken().kind); - Assert.AreEqual(Tokens.Plus, lexer.NextToken().kind); - Assert.AreEqual(Tokens.EOF, lexer.NextToken().kind); - } - - [Test] - public void TestSkippedEmptyBlock() - { - ILexer lexer = GenerateLexer(new StringReader("{}+")); - Assert.AreEqual(Tokens.OpenCurlyBrace, lexer.NextToken().kind); - lexer.NextToken(); - lexer.SkipCurrentBlock(); - Assert.AreEqual(Tokens.CloseCurlyBrace, lexer.LookAhead.kind); - Assert.AreEqual(Tokens.Plus, lexer.NextToken().kind); - Assert.AreEqual(Tokens.EOF, lexer.NextToken().kind); - } - - [Test] - public void TestSkippedNonEmptyBlock() - { - ILexer lexer = GenerateLexer(new StringReader("{ TestMethod('}'); /* }}} */ while(1) {break;} }+")); - Assert.AreEqual(Tokens.OpenCurlyBrace, lexer.NextToken().kind); - lexer.NextToken(); - lexer.SkipCurrentBlock(); - Assert.AreEqual(Tokens.CloseCurlyBrace, lexer.LookAhead.kind); - Assert.AreEqual(Tokens.Plus, lexer.NextToken().kind); - Assert.AreEqual(Tokens.EOF, lexer.NextToken().kind); - } - + [Test] public void TestOpenSquareBracket() { @@ -294,13 +267,6 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.CSharp Assert.AreEqual(Tokens.ShiftLeft, lexer.NextToken().kind); } -// [Test] -// public void TestShiftRight() -// { -// ILexer lexer = GenerateLexer(new StringReader(">>")); -// Assert.AreEqual(Tokens.ShiftRight, lexer.NextToken().kind); -// } - [Test] public void TestPlusAssign() { @@ -364,13 +330,6 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.CSharp Assert.AreEqual(Tokens.ShiftLeftAssign, lexer.NextToken().kind); } -// [Test] -// public void TestShiftRightAssign() -// { -// ILexer lexer = GenerateLexer(new StringReader(">>=")); -// Assert.AreEqual(Tokens.ShiftRightAssign, lexer.NextToken().kind); -// } - [Test()] public void TestAbstract() { diff --git a/src/Libraries/NRefactory/Test/NRefactoryTests.csproj b/src/Libraries/NRefactory/Test/NRefactoryTests.csproj index 42919d2bea..8797eabd57 100644 --- a/src/Libraries/NRefactory/Test/NRefactoryTests.csproj +++ b/src/Libraries/NRefactory/Test/NRefactoryTests.csproj @@ -37,7 +37,7 @@ - + @@ -129,6 +129,7 @@ + diff --git a/src/Libraries/NRefactory/Test/Parser/Expressions/BinaryOperatorExpressionTests.cs b/src/Libraries/NRefactory/Test/Parser/Expressions/BinaryOperatorExpressionTests.cs index 2270efaf58..70f71d5f64 100644 --- a/src/Libraries/NRefactory/Test/Parser/Expressions/BinaryOperatorExpressionTests.cs +++ b/src/Libraries/NRefactory/Test/Parser/Expressions/BinaryOperatorExpressionTests.cs @@ -136,6 +136,12 @@ namespace ICSharpCode.NRefactory.Tests.AST CSharpTestBinaryOperatorExpressionTest("a >> b", BinaryOperatorType.ShiftRight); } + [Test] + public void CSharpNullCoalescingTest() + { + CSharpTestBinaryOperatorExpressionTest("a ?? b", BinaryOperatorType.NullCoalescing); + } + [Test] public void CSharpISTest() { diff --git a/src/Libraries/NRefactory/Test/Parser/Expressions/ConditionalExpressionTests.cs b/src/Libraries/NRefactory/Test/Parser/Expressions/ConditionalExpressionTests.cs index f603131469..bb14330949 100644 --- a/src/Libraries/NRefactory/Test/Parser/Expressions/ConditionalExpressionTests.cs +++ b/src/Libraries/NRefactory/Test/Parser/Expressions/ConditionalExpressionTests.cs @@ -26,10 +26,21 @@ namespace ICSharpCode.NRefactory.Tests.AST Assert.IsTrue(ce.TrueExpression is InvocationExpression); Assert.IsTrue(ce.FalseExpression is FieldReferenceExpression); } + + [Test] + public void CSharpConditionalIsExpressionTest() + { + // (as is b?) ERROR (conflict with nullables, SD2-419) + ConditionalExpression ce = (ConditionalExpression)ParseUtilCSharp.ParseExpression("a is b ? a() : a.B", typeof(ConditionalExpression)); + + Assert.IsTrue(ce.Condition is BinaryOperatorExpression); + Assert.IsTrue(ce.TrueExpression is InvocationExpression); + Assert.IsTrue(ce.FalseExpression is FieldReferenceExpression); + } #endregion #region VB.NET - // No VB.NET representation + // No VB.NET representation #endregion } }