diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/CSharp-Mode.xshd b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/CSharp-Mode.xshd index cf23ceb3ab..2117bba5ef 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/CSharp-Mode.xshd +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/CSharp-Mode.xshd @@ -169,6 +169,7 @@ equals var dynamic + await @@ -238,6 +239,7 @@ static virtual volatile + async diff --git a/src/Libraries/NRefactory/NRefactoryASTGenerator/AST/Expressions.cs b/src/Libraries/NRefactory/NRefactoryASTGenerator/AST/Expressions.cs index 80b603d95d..108fcd3791 100644 --- a/src/Libraries/NRefactory/NRefactoryASTGenerator/AST/Expressions.cs +++ b/src/Libraries/NRefactory/NRefactoryASTGenerator/AST/Expressions.cs @@ -175,6 +175,7 @@ namespace NRefactoryASTGenerator.Ast List parameters; BlockStatement body; bool hasParameterList; + bool isAsync; } [IncludeMember("public Location ExtendedEndLocation { get; set; }")] @@ -183,6 +184,7 @@ namespace NRefactoryASTGenerator.Ast Statement statementBody; Expression expressionBody; TypeReference returnType; + bool isAsync; } class CheckedExpression : Expression { diff --git a/src/Libraries/NRefactory/Project/Src/Ast/Enums.cs b/src/Libraries/NRefactory/Project/Src/Ast/Enums.cs index 2b16510520..29fc3fc8cc 100644 --- a/src/Libraries/NRefactory/Project/Src/Ast/Enums.cs +++ b/src/Libraries/NRefactory/Project/Src/Ast/Enums.cs @@ -47,6 +47,8 @@ namespace ICSharpCode.NRefactory.Ast /// Only for VB properties. WriteOnly = 0x400000, // VB specific + Async = 0x800000, + Visibility = Private | Public | Protected | Internal, Classes = New | Visibility | Abstract | Sealed | Partial | Static, VBModules = Visibility, @@ -250,7 +252,9 @@ namespace ICSharpCode.NRefactory.Ast /// Dereferencing pointer Dereference, /// Get address of - AddressOf + AddressOf, + + Await } public enum ContinueType diff --git a/src/Libraries/NRefactory/Project/Src/Ast/Generated.cs b/src/Libraries/NRefactory/Project/Src/Ast/Generated.cs index 1ce85dd0fe..2c9047ce17 100644 --- a/src/Libraries/NRefactory/Project/Src/Ast/Generated.cs +++ b/src/Libraries/NRefactory/Project/Src/Ast/Generated.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.1 +// Runtime Version:4.0.30319.235 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -88,6 +88,8 @@ namespace ICSharpCode.NRefactory.Ast { bool hasParameterList; + bool isAsync; + public List Parameters { get { return parameters; @@ -116,6 +118,15 @@ namespace ICSharpCode.NRefactory.Ast { } } + public bool IsAsync { + get { + return isAsync; + } + set { + isAsync = value; + } + } + public AnonymousMethodExpression() { parameters = new List(); body = BlockStatement.Null; @@ -126,7 +137,8 @@ namespace ICSharpCode.NRefactory.Ast { } public override string ToString() { - return string.Format("[AnonymousMethodExpression Parameters={0} Body={1} HasParameterList={2}]", GetCollectionString(Parameters), Body, HasParameterList); + return string.Format("[AnonymousMethodExpression Parameters={0} Body={1} HasParameterList={2} IsAsync={" + + "3}]", GetCollectionString(Parameters), Body, HasParameterList, IsAsync); } } @@ -2421,9 +2433,9 @@ namespace ICSharpCode.NRefactory.Ast { elseIfSections = new List(); } - public bool HasElseStatements { + public bool HasElseIfSections { get { - return falseStatement.Count > 0; + return elseIfSections.Count > 0; } } @@ -2436,12 +2448,6 @@ namespace ICSharpCode.NRefactory.Ast { if (falseStatement != null) falseStatement.Parent = this; } - public bool HasElseIfSections { - get { - return elseIfSections.Count > 0; - } - } - public IfElseStatement(Expression condition, Statement trueStatement) : this(condition) { @@ -2449,6 +2455,12 @@ namespace ICSharpCode.NRefactory.Ast { if (trueStatement != null) trueStatement.Parent = this; } + public bool HasElseStatements { + get { + return falseStatement.Count > 0; + } + } + public override object AcceptVisitor(IAstVisitor visitor, object data) { return visitor.VisitIfElseStatement(this, data); } @@ -2617,6 +2629,8 @@ namespace ICSharpCode.NRefactory.Ast { TypeReference returnType; + bool isAsync; + public List Parameters { get { return parameters; @@ -2656,6 +2670,15 @@ namespace ICSharpCode.NRefactory.Ast { } } + public bool IsAsync { + get { + return isAsync; + } + set { + isAsync = value; + } + } + public LambdaExpression() { parameters = new List(); statementBody = Statement.Null; @@ -2671,7 +2694,7 @@ public Location ExtendedEndLocation { get; set; } public override string ToString() { return string.Format("[LambdaExpression Parameters={0} StatementBody={1} ExpressionBody={2} ReturnType=" + - "{3}]", GetCollectionString(Parameters), StatementBody, ExpressionBody, ReturnType); + "{3} IsAsync={4}]", GetCollectionString(Parameters), StatementBody, ExpressionBody, ReturnType, IsAsync); } } diff --git a/src/Libraries/NRefactory/Project/Src/IAstVisitor.cs b/src/Libraries/NRefactory/Project/Src/IAstVisitor.cs index b0bc662112..8dc26b65f5 100644 --- a/src/Libraries/NRefactory/Project/Src/IAstVisitor.cs +++ b/src/Libraries/NRefactory/Project/Src/IAstVisitor.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.1 +// Runtime Version:4.0.30319.235 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/KeywordList.txt b/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/KeywordList.txt index 238b175542..e4c9fe3856 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/KeywordList.txt +++ b/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/KeywordList.txt @@ -174,11 +174,13 @@ LambdaArrow = "=>" "join" "on" "equals" +"async" +"await" #Sets # When changing IdentifierTokens, ensure you also change the "Identifier" production in cs.ATG -IdentifierTokens(Identifier, "partial", "where", "get", "set", "add", "remove", "yield", "select", "group", "by", "into", "from", "ascending", "descending", "orderby", "let", "join", "on", "equals") +IdentifierTokens(Identifier, "partial", "where", "get", "set", "add", "remove", "yield", "select", "group", "by", "into", "from", "ascending", "descending", "orderby", "let", "join", "on", "equals", "async", "await") OverloadableUnaryOp("-", "!", "~", "++", "--", "true", "false") OverloadableBinaryOp("+", "-", "*", "/", "%", "&", "|", "^", "<<", "==", "!=", ">", "<", ">=", "<=") @@ -201,11 +203,11 @@ KCCTypeDeclarationStart("public", "internal", @TypeDeclarationKW, @KCCClassModif KCCMemberVisibilityModifiers("protected", "private", "public", "internal") SimpleTypeName(@TypeKW, @IdentifierTokens, "void") GlobalLevel("namespace", "using", "extern", @KCCTypeDeclarationStart) -ExpressionStart("base", "delegate", "false", "new", "null", "sizeof", "this", "true", "typeof", "checked", "unchecked", "from", "default") +ExpressionStart("base", "delegate", "false", "new", "null", "sizeof", "this", "true", "typeof", "checked", "unchecked", "from", "default", "await") ExpressionContent("as", "is", "out", "ref", "in") # interfaces cannot have inner classes etc., the only keyword (expect for type names) that may appear in them is "event" InterfaceLevel("event") -TypeLevel(@KCCTypeDeclarationStart, @KCCMemberVisibilityModifiers, "const", "event", "explicit", "extern", "fixed", "implicit", "new", "operator", "override", "readonly", "virtual", "volatile") +TypeLevel(@KCCTypeDeclarationStart, @KCCMemberVisibilityModifiers, "const", "event", "explicit", "extern", "fixed", "implicit", "new", "operator", "override", "readonly", "virtual", "volatile", "async") StatementStart(@ExpressionStart, @ExpressionContent, "break", "case", "catch", "checked", "unchecked", "const", "continue", "default", "do", "else", "finally", "fixed", "for", "foreach", "goto", "if", "lock", "return", "stackalloc", "switch", "throw", "try", "unsafe", "using", "while", "yield") QueryExpressionClauseStart("from", "let", "where", "join", "orderby", "group", "select") InPropertyDeclaration(@KCCMemberVisibilityModifiers, "get", "set") diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Keywords.cs b/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Keywords.cs index 3f28c5e735..9a3f7f0ef4 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Keywords.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Keywords.cs @@ -1,6 +1,3 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) - // this file was autogenerated by a tool. using System; @@ -104,7 +101,9 @@ namespace ICSharpCode.NRefactory.Parser.CSharp "let", "join", "on", - "equals" + "equals", + "async", + "await" }; static LookupTable keywords = new LookupTable(true); diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Tokens.cs b/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Tokens.cs index 339a043aa2..78c2b6cef2 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Tokens.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Tokens.cs @@ -1,6 +1,3 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) - // this file was autogenerated by a tool. using System; using System.Collections; @@ -159,8 +156,10 @@ namespace ICSharpCode.NRefactory.Parser.CSharp public const int Join = 142; public const int On = 143; new public const int Equals = 144; + public const int Async = 145; + public const int Await = 146; - public const int MaxToken = 145; + public const int MaxToken = 147; static BitArray NewSet(params int[] values) { BitArray bitArray = new BitArray(MaxToken); @@ -169,28 +168,28 @@ namespace ICSharpCode.NRefactory.Parser.CSharp } return bitArray; } - public static BitArray IdentifierTokens = NewSet(Identifier, Partial, Where, Get, Set, Add, Remove, Yield, Select, Group, By, Into, From, Ascending, Descending, Orderby, Let, Join, On, Equals); + public static BitArray IdentifierTokens = NewSet(Identifier, Partial, Where, Get, Set, Add, Remove, Yield, Select, Group, By, Into, From, Ascending, Descending, Orderby, Let, Join, On, Equals, Async, Await); public static BitArray OverloadableUnaryOp = NewSet(Minus, Not, BitwiseComplement, Increment, Decrement, True, False); public static BitArray OverloadableBinaryOp = NewSet(Plus, Minus, Times, Div, Mod, BitwiseAnd, BitwiseOr, Xor, ShiftLeft, Equal, NotEqual, GreaterThan, LessThan, GreaterEqual, LessEqual); public static BitArray TypeKW = NewSet(Char, Bool, Object, String, Sbyte, Byte, Short, Ushort, Int, Uint, Long, Ulong, Float, Double, Decimal); public static BitArray UnaryHead = NewSet(Plus, Minus, Not, BitwiseComplement, Times, Increment, Decrement, BitwiseAnd); public static BitArray AssnStartOp = NewSet(Plus, Minus, Not, BitwiseComplement, Times); - public static BitArray CastFollower = NewSet(Char, Bool, Object, String, Sbyte, Byte, Short, Ushort, Int, Uint, Long, Ulong, Float, Double, Decimal, Identifier, Partial, Where, Get, Set, Add, Remove, Yield, Select, Group, By, Into, From, Ascending, Descending, Orderby, Let, Join, On, Equals, Void, Literal, OpenParenthesis, BitwiseComplement, Not, Base, Delegate, False, New, Null, Sizeof, This, True, Typeof, Checked, Unchecked, From, Default); + public static BitArray CastFollower = NewSet(Char, Bool, Object, String, Sbyte, Byte, Short, Ushort, Int, Uint, Long, Ulong, Float, Double, Decimal, Identifier, Partial, Where, Get, Set, Add, Remove, Yield, Select, Group, By, Into, From, Ascending, Descending, Orderby, Let, Join, On, Equals, Async, Await, Void, Literal, OpenParenthesis, BitwiseComplement, Not, Base, Delegate, False, New, Null, Sizeof, This, True, Typeof, Checked, Unchecked, From, Default, Await); public static BitArray AssgnOps = NewSet(Assign, PlusAssign, MinusAssign, TimesAssign, DivAssign, ModAssign, BitwiseAndAssign, BitwiseOrAssign, ShiftLeftAssign); public static BitArray UnaryOp = NewSet(Plus, Minus, Not, BitwiseComplement, Times, Increment, Decrement, BitwiseAnd); public static BitArray TypeDeclarationKW = NewSet(Class, Interface, Struct, Enum, Delegate); public static BitArray GenericFollower = NewSet(OpenParenthesis, CloseParenthesis, CloseSquareBracket, CloseCurlyBrace, Colon, Semicolon, Comma, Dot, Question, Equal, NotEqual); - public static BitArray ValidInsideTypeName = NewSet(Identifier, Partial, Where, Get, Set, Add, Remove, Yield, Select, Group, By, Into, From, Ascending, Descending, Orderby, Let, Join, On, Equals, Char, Bool, Object, String, Sbyte, Byte, Short, Ushort, Int, Uint, Long, Ulong, Float, Double, Decimal, LessThan, GreaterThan, Dot, Question, OpenSquareBracket, Comma, CloseSquareBracket, Times, DoubleColon); + public static BitArray ValidInsideTypeName = NewSet(Identifier, Partial, Where, Get, Set, Add, Remove, Yield, Select, Group, By, Into, From, Ascending, Descending, Orderby, Let, Join, On, Equals, Async, Await, Char, Bool, Object, String, Sbyte, Byte, Short, Ushort, Int, Uint, Long, Ulong, Float, Double, Decimal, LessThan, GreaterThan, Dot, Question, OpenSquareBracket, Comma, CloseSquareBracket, Times, DoubleColon); public static BitArray KCCClassModifiers = NewSet(Abstract, Sealed, Static, Unsafe, Partial); public static BitArray KCCTypeDeclarationStart = NewSet(Public, Internal, Class, Interface, Struct, Enum, Delegate, Abstract, Sealed, Static, Unsafe, Partial); public static BitArray KCCMemberVisibilityModifiers = NewSet(Protected, Private, Public, Internal); - public static BitArray SimpleTypeName = NewSet(Char, Bool, Object, String, Sbyte, Byte, Short, Ushort, Int, Uint, Long, Ulong, Float, Double, Decimal, Identifier, Partial, Where, Get, Set, Add, Remove, Yield, Select, Group, By, Into, From, Ascending, Descending, Orderby, Let, Join, On, Equals, Void); + public static BitArray SimpleTypeName = NewSet(Char, Bool, Object, String, Sbyte, Byte, Short, Ushort, Int, Uint, Long, Ulong, Float, Double, Decimal, Identifier, Partial, Where, Get, Set, Add, Remove, Yield, Select, Group, By, Into, From, Ascending, Descending, Orderby, Let, Join, On, Equals, Async, Await, Void); public static BitArray GlobalLevel = NewSet(Namespace, Using, Extern, Public, Internal, Class, Interface, Struct, Enum, Delegate, Abstract, Sealed, Static, Unsafe, Partial); - public static BitArray ExpressionStart = NewSet(Base, Delegate, False, New, Null, Sizeof, This, True, Typeof, Checked, Unchecked, From, Default); + public static BitArray ExpressionStart = NewSet(Base, Delegate, False, New, Null, Sizeof, This, True, Typeof, Checked, Unchecked, From, Default, Await); public static BitArray ExpressionContent = NewSet(As, Is, Out, Ref, In); public static BitArray InterfaceLevel = NewSet(Event); - public static BitArray TypeLevel = NewSet(Public, Internal, Class, Interface, Struct, Enum, Delegate, Abstract, Sealed, Static, Unsafe, Partial, Protected, Private, Public, Internal, Const, Event, Explicit, Extern, Fixed, Implicit, New, Operator, Override, Readonly, Virtual, Volatile); - public static BitArray StatementStart = NewSet(Base, Delegate, False, New, Null, Sizeof, This, True, Typeof, Checked, Unchecked, From, Default, As, Is, Out, Ref, In, Break, Case, Catch, Checked, Unchecked, Const, Continue, Default, Do, Else, Finally, Fixed, For, Foreach, Goto, If, Lock, Return, Stackalloc, Switch, Throw, Try, Unsafe, Using, While, Yield); + public static BitArray TypeLevel = NewSet(Public, Internal, Class, Interface, Struct, Enum, Delegate, Abstract, Sealed, Static, Unsafe, Partial, Protected, Private, Public, Internal, Const, Event, Explicit, Extern, Fixed, Implicit, New, Operator, Override, Readonly, Virtual, Volatile, Async); + public static BitArray StatementStart = NewSet(Base, Delegate, False, New, Null, Sizeof, This, True, Typeof, Checked, Unchecked, From, Default, Await, As, Is, Out, Ref, In, Break, Case, Catch, Checked, Unchecked, Const, Continue, Default, Do, Else, Finally, Fixed, For, Foreach, Goto, If, Lock, Return, Stackalloc, Switch, Throw, Try, Unsafe, Using, While, Yield); public static BitArray QueryExpressionClauseStart = NewSet(From, Let, Where, Join, Orderby, Group, Select); public static BitArray InPropertyDeclaration = NewSet(Protected, Private, Public, Internal, Get, Set); public static BitArray InEventDeclaration = NewSet(Add, Remove); @@ -344,6 +343,8 @@ namespace ICSharpCode.NRefactory.Parser.CSharp "join", "on", "equals", + "async", + "await", }; public static string GetTokenString(int token) { diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Keywords.cs b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Keywords.cs index 248eb4b8ec..a3e707176d 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Keywords.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Keywords.cs @@ -1,6 +1,3 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) - // this file was autogenerated by a tool. using System; diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Tokens.cs b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Tokens.cs index 2cf730c48b..9b49a86213 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Tokens.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Tokens.cs @@ -1,6 +1,3 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) - // this file was autogenerated by a tool. using System; using System.Collections; diff --git a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs index 89562922a8..db20ad098c 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 { partial class Parser : AbstractParser { - const int maxT = 145; + const int maxT = 147; const bool T = true; const bool x = false; @@ -35,7 +35,7 @@ partial class Parser : AbstractParser void CS() { -#line 180 "cs.ATG" +#line 182 "cs.ATG" lexer.NextToken(); // get the first token compilationUnit = new CompilationUnit(); BlockStart(compilationUnit); @@ -47,7 +47,7 @@ partial class Parser : AbstractParser UsingDirective(); } while ( -#line 187 "cs.ATG" +#line 189 "cs.ATG" IsGlobalAttrTarget()) { GlobalAttributeSection(); } @@ -59,57 +59,57 @@ IsGlobalAttrTarget()) { void ExternAliasDirective() { -#line 360 "cs.ATG" +#line 362 "cs.ATG" ExternAliasDirective ead = new ExternAliasDirective { StartLocation = la.Location }; Expect(71); Identifier(); -#line 363 "cs.ATG" +#line 365 "cs.ATG" if (t.val != "alias") Error("Expected 'extern alias'."); Identifier(); -#line 364 "cs.ATG" +#line 366 "cs.ATG" ead.Name = t.val; Expect(11); -#line 365 "cs.ATG" +#line 367 "cs.ATG" ead.EndLocation = t.EndLocation; -#line 366 "cs.ATG" +#line 368 "cs.ATG" AddChild(ead); } void UsingDirective() { -#line 194 "cs.ATG" +#line 196 "cs.ATG" string qualident = null; TypeReference aliasedType = null; string alias = null; Expect(121); -#line 198 "cs.ATG" +#line 200 "cs.ATG" Location startPos = t.Location; if ( -#line 199 "cs.ATG" +#line 201 "cs.ATG" IdentAndDoubleColon()) { Identifier(); -#line 199 "cs.ATG" +#line 201 "cs.ATG" alias = t.val; Expect(10); } Qualident( -#line 200 "cs.ATG" +#line 202 "cs.ATG" out qualident); if (la.kind == 3) { lexer.NextToken(); NonArrayType( -#line 201 "cs.ATG" +#line 203 "cs.ATG" out aliasedType); } Expect(11); -#line 203 "cs.ATG" +#line 205 "cs.ATG" if (qualident != null && qualident.Length > 0) { string name = (alias != null && alias != "global") ? alias + "." + qualident : qualident; INode node; @@ -128,11 +128,11 @@ out aliasedType); void GlobalAttributeSection() { Expect(18); -#line 220 "cs.ATG" +#line 222 "cs.ATG" Location startPos = t.Location; Identifier(); -#line 221 "cs.ATG" +#line 223 "cs.ATG" if (t.val != "assembly" && t.val != "module") Error("global attribute target specifier (assembly or module) expected"); string attributeTarget = t.val; List attributes = new List(); @@ -140,20 +140,20 @@ out aliasedType); Expect(9); Attribute( -#line 226 "cs.ATG" +#line 228 "cs.ATG" out attribute); -#line 226 "cs.ATG" +#line 228 "cs.ATG" attributes.Add(attribute); while ( -#line 227 "cs.ATG" +#line 229 "cs.ATG" NotFinalComma()) { Expect(14); Attribute( -#line 227 "cs.ATG" +#line 229 "cs.ATG" out attribute); -#line 227 "cs.ATG" +#line 229 "cs.ATG" attributes.Add(attribute); } if (la.kind == 14) { @@ -161,7 +161,7 @@ out attribute); } Expect(19); -#line 229 "cs.ATG" +#line 231 "cs.ATG" AttributeSection section = new AttributeSection { AttributeTarget = attributeTarget, Attributes = attributes, @@ -174,7 +174,7 @@ out attribute); void NamespaceMemberDecl() { -#line 333 "cs.ATG" +#line 335 "cs.ATG" AttributeSection section; List attributes = new List(); ModifierList m = new ModifierList(); @@ -183,13 +183,13 @@ out attribute); if (la.kind == 88) { lexer.NextToken(); -#line 339 "cs.ATG" +#line 341 "cs.ATG" Location startPos = t.Location; Qualident( -#line 340 "cs.ATG" +#line 342 "cs.ATG" out qualident); -#line 340 "cs.ATG" +#line 342 "cs.ATG" INode node = new NamespaceDeclaration(qualident); node.StartLocation = startPos; AddChild(node); @@ -210,28 +210,28 @@ out qualident); lexer.NextToken(); } -#line 350 "cs.ATG" +#line 352 "cs.ATG" node.EndLocation = t.EndLocation; BlockEnd(); } else if (StartOf(2)) { while (la.kind == 18) { AttributeSection( -#line 354 "cs.ATG" +#line 356 "cs.ATG" out section); -#line 354 "cs.ATG" +#line 356 "cs.ATG" attributes.Add(section); } while (StartOf(3)) { TypeModifier( -#line 355 "cs.ATG" +#line 357 "cs.ATG" m); } TypeDecl( -#line 356 "cs.ATG" +#line 358 "cs.ATG" m, attributes); - } else SynErr(146); + } else SynErr(148); } void Identifier() { @@ -316,38 +316,46 @@ m, attributes); lexer.NextToken(); break; } - default: SynErr(147); break; + case 145: { + lexer.NextToken(); + break; + } + case 146: { + lexer.NextToken(); + break; + } + default: SynErr(149); break; } } void Qualident( -#line 490 "cs.ATG" +#line 492 "cs.ATG" out string qualident) { Identifier(); -#line 492 "cs.ATG" +#line 494 "cs.ATG" qualidentBuilder.Length = 0; qualidentBuilder.Append(t.val); while ( -#line 493 "cs.ATG" +#line 495 "cs.ATG" DotAndIdent()) { Expect(15); Identifier(); -#line 493 "cs.ATG" +#line 495 "cs.ATG" qualidentBuilder.Append('.'); qualidentBuilder.Append(t.val); } -#line 496 "cs.ATG" +#line 498 "cs.ATG" qualident = qualidentBuilder.ToString(); } void NonArrayType( -#line 608 "cs.ATG" +#line 610 "cs.ATG" out TypeReference type) { -#line 610 "cs.ATG" +#line 612 "cs.ATG" Location startPos = la.Location; string name; int pointer = 0; @@ -355,37 +363,37 @@ out TypeReference type) { if (StartOf(4)) { ClassType( -#line 616 "cs.ATG" +#line 618 "cs.ATG" out type, false); } else if (StartOf(5)) { SimpleType( -#line 617 "cs.ATG" +#line 619 "cs.ATG" out name); -#line 617 "cs.ATG" +#line 619 "cs.ATG" type = new TypeReference(name, true); } else if (la.kind == 123) { lexer.NextToken(); Expect(6); -#line 618 "cs.ATG" +#line 620 "cs.ATG" pointer = 1; type = new TypeReference("System.Void", true); - } else SynErr(148); + } else SynErr(150); if (la.kind == 12) { NullableQuestionMark( -#line 621 "cs.ATG" +#line 623 "cs.ATG" ref type); } while ( -#line 623 "cs.ATG" +#line 625 "cs.ATG" IsPointer()) { Expect(6); -#line 624 "cs.ATG" +#line 626 "cs.ATG" ++pointer; } -#line 626 "cs.ATG" +#line 628 "cs.ATG" if (type != null) { type.PointerNestingLevel = pointer; type.EndLocation = t.EndLocation; @@ -395,41 +403,41 @@ IsPointer()) { } void Attribute( -#line 239 "cs.ATG" +#line 241 "cs.ATG" out ASTAttribute attribute) { -#line 240 "cs.ATG" +#line 242 "cs.ATG" string qualident; string alias = null; -#line 244 "cs.ATG" +#line 246 "cs.ATG" Location startPos = la.Location; if ( -#line 245 "cs.ATG" +#line 247 "cs.ATG" IdentAndDoubleColon()) { Identifier(); -#line 246 "cs.ATG" +#line 248 "cs.ATG" alias = t.val; Expect(10); } Qualident( -#line 249 "cs.ATG" +#line 251 "cs.ATG" out qualident); -#line 250 "cs.ATG" +#line 252 "cs.ATG" List positional = new List(); List named = new List(); string name = (alias != null && alias != "global") ? alias + "." + qualident : qualident; if (la.kind == 20) { AttributeArguments( -#line 254 "cs.ATG" +#line 256 "cs.ATG" positional, named); } -#line 255 "cs.ATG" +#line 257 "cs.ATG" attribute = new ASTAttribute(name, positional, named); attribute.StartLocation = startPos; attribute.EndLocation = t.EndLocation; @@ -437,17 +445,17 @@ positional, named); } void AttributeArguments( -#line 261 "cs.ATG" +#line 263 "cs.ATG" List positional, List named) { Expect(20); if (StartOf(6)) { AttributeArgument( -#line 265 "cs.ATG" +#line 267 "cs.ATG" positional, named); while (la.kind == 14) { lexer.NextToken(); AttributeArgument( -#line 268 "cs.ATG" +#line 270 "cs.ATG" positional, named); } } @@ -455,37 +463,37 @@ positional, named); } void AttributeArgument( -#line 274 "cs.ATG" +#line 276 "cs.ATG" List positional, List named) { -#line 275 "cs.ATG" +#line 277 "cs.ATG" string name = null; bool isNamed = false; Expression expr; Location startLocation = la.Location; if ( -#line 278 "cs.ATG" +#line 280 "cs.ATG" IsAssignment()) { -#line 278 "cs.ATG" +#line 280 "cs.ATG" isNamed = true; Identifier(); -#line 279 "cs.ATG" +#line 281 "cs.ATG" name = t.val; Expect(3); } else if ( -#line 282 "cs.ATG" +#line 284 "cs.ATG" IdentAndColon()) { Identifier(); -#line 283 "cs.ATG" +#line 285 "cs.ATG" name = t.val; Expect(9); } else if (StartOf(6)) { - } else SynErr(149); + } else SynErr(151); Expr( -#line 287 "cs.ATG" +#line 289 "cs.ATG" out expr); -#line 289 "cs.ATG" +#line 291 "cs.ATG" if (expr != null) { if (isNamed) { named.Add(new NamedArgumentExpression(name, expr) { StartLocation = startLocation, EndLocation = t.EndLocation }); @@ -501,68 +509,68 @@ out expr); } void Expr( -#line 1805 "cs.ATG" +#line 1808 "cs.ATG" out Expression expr) { -#line 1806 "cs.ATG" +#line 1809 "cs.ATG" expr = null; Expression expr1 = null, expr2 = null; AssignmentOperatorType op; -#line 1808 "cs.ATG" +#line 1811 "cs.ATG" Location startLocation = la.Location; UnaryExpr( -#line 1809 "cs.ATG" +#line 1812 "cs.ATG" out expr); if (StartOf(7)) { AssignmentOperator( -#line 1812 "cs.ATG" +#line 1815 "cs.ATG" out op); Expr( -#line 1812 "cs.ATG" +#line 1815 "cs.ATG" out expr1); -#line 1812 "cs.ATG" +#line 1815 "cs.ATG" expr = new AssignmentExpression(expr, op, expr1); } else if ( -#line 1813 "cs.ATG" +#line 1816 "cs.ATG" la.kind == Tokens.GreaterThan && Peek(1).kind == Tokens.GreaterEqual) { AssignmentOperator( -#line 1814 "cs.ATG" +#line 1817 "cs.ATG" out op); Expr( -#line 1814 "cs.ATG" +#line 1817 "cs.ATG" out expr1); -#line 1814 "cs.ATG" +#line 1817 "cs.ATG" expr = new AssignmentExpression(expr, op, expr1); } else if (StartOf(8)) { ConditionalOrExpr( -#line 1816 "cs.ATG" +#line 1819 "cs.ATG" ref expr); if (la.kind == 13) { lexer.NextToken(); Expr( -#line 1817 "cs.ATG" +#line 1820 "cs.ATG" out expr1); -#line 1817 "cs.ATG" +#line 1820 "cs.ATG" expr = new BinaryOperatorExpression(expr, BinaryOperatorType.NullCoalescing, expr1); } if (la.kind == 12) { lexer.NextToken(); Expr( -#line 1818 "cs.ATG" +#line 1821 "cs.ATG" out expr1); Expect(9); Expr( -#line 1818 "cs.ATG" +#line 1821 "cs.ATG" out expr2); -#line 1818 "cs.ATG" +#line 1821 "cs.ATG" expr = new ConditionalExpression(expr, expr1, expr2); } - } else SynErr(150); + } else SynErr(152); -#line 1821 "cs.ATG" +#line 1824 "cs.ATG" if (expr != null) { if (expr.StartLocation.IsEmpty) expr.StartLocation = startLocation; @@ -573,10 +581,10 @@ out expr2); } void AttributeSection( -#line 303 "cs.ATG" +#line 305 "cs.ATG" out AttributeSection section) { -#line 305 "cs.ATG" +#line 307 "cs.ATG" string attributeTarget = ""; List attributes = new List(); ASTAttribute attribute; @@ -584,44 +592,44 @@ out AttributeSection section) { Expect(18); -#line 311 "cs.ATG" +#line 313 "cs.ATG" Location startPos = t.Location; if ( -#line 312 "cs.ATG" +#line 314 "cs.ATG" IsLocalAttrTarget()) { if (la.kind == 69) { lexer.NextToken(); -#line 313 "cs.ATG" +#line 315 "cs.ATG" attributeTarget = "event"; } else if (la.kind == 101) { lexer.NextToken(); -#line 314 "cs.ATG" +#line 316 "cs.ATG" attributeTarget = "return"; } else { Identifier(); -#line 315 "cs.ATG" +#line 317 "cs.ATG" attributeTarget = t.val; } Expect(9); } Attribute( -#line 319 "cs.ATG" +#line 321 "cs.ATG" out attribute); -#line 319 "cs.ATG" +#line 321 "cs.ATG" attributes.Add(attribute); while ( -#line 320 "cs.ATG" +#line 322 "cs.ATG" NotFinalComma()) { Expect(14); Attribute( -#line 320 "cs.ATG" +#line 322 "cs.ATG" out attribute); -#line 320 "cs.ATG" +#line 322 "cs.ATG" attributes.Add(attribute); } if (la.kind == 14) { @@ -629,7 +637,7 @@ out attribute); } Expect(19); -#line 322 "cs.ATG" +#line 324 "cs.ATG" section = new AttributeSection { AttributeTarget = attributeTarget, Attributes = attributes, @@ -640,88 +648,88 @@ out attribute); } void TypeModifier( -#line 693 "cs.ATG" +#line 695 "cs.ATG" ModifierList m) { switch (la.kind) { case 89: { lexer.NextToken(); -#line 695 "cs.ATG" +#line 697 "cs.ATG" m.Add(Modifiers.New, t.Location); break; } case 98: { lexer.NextToken(); -#line 696 "cs.ATG" +#line 698 "cs.ATG" m.Add(Modifiers.Public, t.Location); break; } case 97: { lexer.NextToken(); -#line 697 "cs.ATG" +#line 699 "cs.ATG" m.Add(Modifiers.Protected, t.Location); break; } case 84: { lexer.NextToken(); -#line 698 "cs.ATG" +#line 700 "cs.ATG" m.Add(Modifiers.Internal, t.Location); break; } case 96: { lexer.NextToken(); -#line 699 "cs.ATG" +#line 701 "cs.ATG" m.Add(Modifiers.Private, t.Location); break; } case 119: { lexer.NextToken(); -#line 700 "cs.ATG" +#line 702 "cs.ATG" m.Add(Modifiers.Unsafe, t.Location); break; } case 49: { lexer.NextToken(); -#line 701 "cs.ATG" +#line 703 "cs.ATG" m.Add(Modifiers.Abstract, t.Location); break; } case 103: { lexer.NextToken(); -#line 702 "cs.ATG" +#line 704 "cs.ATG" m.Add(Modifiers.Sealed, t.Location); break; } case 107: { lexer.NextToken(); -#line 703 "cs.ATG" +#line 705 "cs.ATG" m.Add(Modifiers.Static, t.Location); break; } case 126: { lexer.NextToken(); -#line 704 "cs.ATG" +#line 706 "cs.ATG" m.Add(Modifiers.Partial, t.Location); break; } - default: SynErr(151); break; + default: SynErr(153); break; } } void TypeDecl( -#line 369 "cs.ATG" +#line 371 "cs.ATG" ModifierList m, List attributes) { -#line 371 "cs.ATG" +#line 373 "cs.ATG" TypeReference type; List names; List p = new List(); @@ -730,11 +738,11 @@ ModifierList m, List attributes) { if (la.kind == 59) { -#line 377 "cs.ATG" +#line 379 "cs.ATG" m.Check(Modifiers.Classes); lexer.NextToken(); -#line 378 "cs.ATG" +#line 380 "cs.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); templates = newType.Templates; AddChild(newType); @@ -745,28 +753,28 @@ ModifierList m, List attributes) { Identifier(); -#line 386 "cs.ATG" +#line 388 "cs.ATG" newType.Name = t.val; if (la.kind == 23) { TypeParameterList( -#line 389 "cs.ATG" +#line 391 "cs.ATG" templates); } if (la.kind == 9) { ClassBase( -#line 391 "cs.ATG" +#line 393 "cs.ATG" out names); -#line 391 "cs.ATG" +#line 393 "cs.ATG" newType.BaseTypes = names; } while (la.kind == 127) { TypeParameterConstraintsClause( -#line 394 "cs.ATG" +#line 396 "cs.ATG" templates); } -#line 396 "cs.ATG" +#line 398 "cs.ATG" newType.BodyStartLocation = t.EndLocation; Expect(16); ClassBody(); @@ -775,18 +783,18 @@ templates); lexer.NextToken(); } -#line 400 "cs.ATG" +#line 402 "cs.ATG" newType.EndLocation = t.EndLocation; BlockEnd(); } else if (StartOf(9)) { -#line 403 "cs.ATG" +#line 405 "cs.ATG" m.Check(Modifiers.StructsInterfacesEnumsDelegates); if (la.kind == 109) { lexer.NextToken(); -#line 404 "cs.ATG" +#line 406 "cs.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); templates = newType.Templates; newType.StartLocation = m.GetDeclarationLocation(t.Location); @@ -796,42 +804,42 @@ templates); Identifier(); -#line 411 "cs.ATG" +#line 413 "cs.ATG" newType.Name = t.val; if (la.kind == 23) { TypeParameterList( -#line 414 "cs.ATG" +#line 416 "cs.ATG" templates); } if (la.kind == 9) { StructInterfaces( -#line 416 "cs.ATG" +#line 418 "cs.ATG" out names); -#line 416 "cs.ATG" +#line 418 "cs.ATG" newType.BaseTypes = names; } while (la.kind == 127) { TypeParameterConstraintsClause( -#line 419 "cs.ATG" +#line 421 "cs.ATG" templates); } -#line 422 "cs.ATG" +#line 424 "cs.ATG" newType.BodyStartLocation = t.EndLocation; StructBody(); if (la.kind == 11) { lexer.NextToken(); } -#line 424 "cs.ATG" +#line 426 "cs.ATG" newType.EndLocation = t.EndLocation; BlockEnd(); } else if (la.kind == 83) { lexer.NextToken(); -#line 428 "cs.ATG" +#line 430 "cs.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); templates = newType.Templates; AddChild(newType); @@ -841,42 +849,42 @@ templates); Identifier(); -#line 435 "cs.ATG" +#line 437 "cs.ATG" newType.Name = t.val; if (la.kind == 23) { TypeParameterList( -#line 438 "cs.ATG" +#line 440 "cs.ATG" templates); } if (la.kind == 9) { InterfaceBase( -#line 440 "cs.ATG" +#line 442 "cs.ATG" out names); -#line 440 "cs.ATG" +#line 442 "cs.ATG" newType.BaseTypes = names; } while (la.kind == 127) { TypeParameterConstraintsClause( -#line 443 "cs.ATG" +#line 445 "cs.ATG" templates); } -#line 445 "cs.ATG" +#line 447 "cs.ATG" newType.BodyStartLocation = t.EndLocation; InterfaceBody(); if (la.kind == 11) { lexer.NextToken(); } -#line 447 "cs.ATG" +#line 449 "cs.ATG" newType.EndLocation = t.EndLocation; BlockEnd(); } else if (la.kind == 68) { lexer.NextToken(); -#line 451 "cs.ATG" +#line 453 "cs.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); AddChild(newType); BlockStart(newType); @@ -885,155 +893,155 @@ templates); Identifier(); -#line 457 "cs.ATG" +#line 459 "cs.ATG" newType.Name = t.val; if (la.kind == 9) { lexer.NextToken(); IntegralType( -#line 458 "cs.ATG" +#line 460 "cs.ATG" out name); -#line 458 "cs.ATG" +#line 460 "cs.ATG" newType.BaseTypes.Add(new TypeReference(name, true)); } -#line 460 "cs.ATG" +#line 462 "cs.ATG" newType.BodyStartLocation = t.EndLocation; EnumBody(); if (la.kind == 11) { lexer.NextToken(); } -#line 462 "cs.ATG" +#line 464 "cs.ATG" newType.EndLocation = t.EndLocation; BlockEnd(); } else { lexer.NextToken(); -#line 466 "cs.ATG" +#line 468 "cs.ATG" DelegateDeclaration delegateDeclr = new DelegateDeclaration(m.Modifier, attributes); templates = delegateDeclr.Templates; delegateDeclr.StartLocation = m.GetDeclarationLocation(t.Location); if ( -#line 470 "cs.ATG" +#line 472 "cs.ATG" NotVoidPointer()) { Expect(123); -#line 470 "cs.ATG" +#line 472 "cs.ATG" delegateDeclr.ReturnType = new TypeReference("System.Void", true); } else if (StartOf(10)) { Type( -#line 471 "cs.ATG" +#line 473 "cs.ATG" out type); -#line 471 "cs.ATG" +#line 473 "cs.ATG" delegateDeclr.ReturnType = type; - } else SynErr(152); + } else SynErr(154); Identifier(); -#line 473 "cs.ATG" +#line 475 "cs.ATG" delegateDeclr.Name = t.val; if (la.kind == 23) { TypeParameterList( -#line 476 "cs.ATG" +#line 478 "cs.ATG" templates); } Expect(20); if (StartOf(11)) { FormalParameterList( -#line 478 "cs.ATG" +#line 480 "cs.ATG" p); -#line 478 "cs.ATG" +#line 480 "cs.ATG" delegateDeclr.Parameters = p; } Expect(21); while (la.kind == 127) { TypeParameterConstraintsClause( -#line 482 "cs.ATG" +#line 484 "cs.ATG" templates); } Expect(11); -#line 484 "cs.ATG" +#line 486 "cs.ATG" delegateDeclr.EndLocation = t.EndLocation; AddChild(delegateDeclr); } - } else SynErr(153); + } else SynErr(155); } void TypeParameterList( -#line 2377 "cs.ATG" +#line 2397 "cs.ATG" List templates) { -#line 2379 "cs.ATG" +#line 2399 "cs.ATG" TemplateDefinition template; Expect(23); VariantTypeParameter( -#line 2383 "cs.ATG" +#line 2403 "cs.ATG" out template); -#line 2383 "cs.ATG" +#line 2403 "cs.ATG" templates.Add(template); while (la.kind == 14) { lexer.NextToken(); VariantTypeParameter( -#line 2385 "cs.ATG" +#line 2405 "cs.ATG" out template); -#line 2385 "cs.ATG" +#line 2405 "cs.ATG" templates.Add(template); } Expect(22); } void ClassBase( -#line 499 "cs.ATG" +#line 501 "cs.ATG" out List names) { -#line 501 "cs.ATG" +#line 503 "cs.ATG" TypeReference typeRef; names = new List(); Expect(9); ClassType( -#line 505 "cs.ATG" +#line 507 "cs.ATG" out typeRef, false); -#line 505 "cs.ATG" +#line 507 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } while (la.kind == 14) { lexer.NextToken(); TypeName( -#line 506 "cs.ATG" +#line 508 "cs.ATG" out typeRef, false); -#line 506 "cs.ATG" +#line 508 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } } } void TypeParameterConstraintsClause( -#line 2405 "cs.ATG" +#line 2425 "cs.ATG" List templates) { -#line 2406 "cs.ATG" +#line 2426 "cs.ATG" string name = ""; TypeReference type; Expect(127); Identifier(); -#line 2409 "cs.ATG" +#line 2429 "cs.ATG" name = t.val; Expect(9); TypeParameterConstraintsClauseBase( -#line 2411 "cs.ATG" +#line 2431 "cs.ATG" out type); -#line 2412 "cs.ATG" +#line 2432 "cs.ATG" TemplateDefinition td = null; foreach (TemplateDefinition d in templates) { if (d.Name == name) { @@ -1046,10 +1054,10 @@ out type); while (la.kind == 14) { lexer.NextToken(); TypeParameterConstraintsClauseBase( -#line 2421 "cs.ATG" +#line 2441 "cs.ATG" out type); -#line 2422 "cs.ATG" +#line 2442 "cs.ATG" td = null; foreach (TemplateDefinition d in templates) { if (d.Name == name) { @@ -1064,109 +1072,109 @@ out type); void ClassBody() { -#line 510 "cs.ATG" +#line 512 "cs.ATG" AttributeSection section; while (StartOf(12)) { -#line 512 "cs.ATG" +#line 514 "cs.ATG" List attributes = new List(); ModifierList m = new ModifierList(); - while (!(StartOf(13))) {SynErr(154); lexer.NextToken(); } + while (!(StartOf(13))) {SynErr(156); lexer.NextToken(); } while (la.kind == 18) { AttributeSection( -#line 516 "cs.ATG" +#line 518 "cs.ATG" out section); -#line 516 "cs.ATG" +#line 518 "cs.ATG" attributes.Add(section); } MemberModifiers( -#line 517 "cs.ATG" +#line 519 "cs.ATG" m); ClassMemberDecl( -#line 518 "cs.ATG" +#line 520 "cs.ATG" m, attributes); } } void StructInterfaces( -#line 522 "cs.ATG" +#line 524 "cs.ATG" out List names) { -#line 524 "cs.ATG" +#line 526 "cs.ATG" TypeReference typeRef; names = new List(); Expect(9); TypeName( -#line 528 "cs.ATG" +#line 530 "cs.ATG" out typeRef, false); -#line 528 "cs.ATG" +#line 530 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } while (la.kind == 14) { lexer.NextToken(); TypeName( -#line 529 "cs.ATG" +#line 531 "cs.ATG" out typeRef, false); -#line 529 "cs.ATG" +#line 531 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } } } void StructBody() { -#line 533 "cs.ATG" +#line 535 "cs.ATG" AttributeSection section; Expect(16); while (StartOf(14)) { -#line 536 "cs.ATG" +#line 538 "cs.ATG" List attributes = new List(); ModifierList m = new ModifierList(); while (la.kind == 18) { AttributeSection( -#line 539 "cs.ATG" +#line 541 "cs.ATG" out section); -#line 539 "cs.ATG" +#line 541 "cs.ATG" attributes.Add(section); } MemberModifiers( -#line 540 "cs.ATG" +#line 542 "cs.ATG" m); StructMemberDecl( -#line 541 "cs.ATG" +#line 543 "cs.ATG" m, attributes); } Expect(17); } void InterfaceBase( -#line 546 "cs.ATG" +#line 548 "cs.ATG" out List names) { -#line 548 "cs.ATG" +#line 550 "cs.ATG" TypeReference typeRef; names = new List(); Expect(9); TypeName( -#line 552 "cs.ATG" +#line 554 "cs.ATG" out typeRef, false); -#line 552 "cs.ATG" +#line 554 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } while (la.kind == 14) { lexer.NextToken(); TypeName( -#line 553 "cs.ATG" +#line 555 "cs.ATG" out typeRef, false); -#line 553 "cs.ATG" +#line 555 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } } } @@ -1174,107 +1182,107 @@ out typeRef, false); void InterfaceBody() { Expect(16); while (StartOf(15)) { - while (!(StartOf(16))) {SynErr(155); lexer.NextToken(); } + while (!(StartOf(16))) {SynErr(157); lexer.NextToken(); } InterfaceMemberDecl(); } Expect(17); } void IntegralType( -#line 715 "cs.ATG" +#line 717 "cs.ATG" out string name) { -#line 715 "cs.ATG" +#line 717 "cs.ATG" name = ""; switch (la.kind) { case 102: { lexer.NextToken(); -#line 717 "cs.ATG" +#line 719 "cs.ATG" name = "System.SByte"; break; } case 54: { lexer.NextToken(); -#line 718 "cs.ATG" +#line 720 "cs.ATG" name = "System.Byte"; break; } case 104: { lexer.NextToken(); -#line 719 "cs.ATG" +#line 721 "cs.ATG" name = "System.Int16"; break; } case 120: { lexer.NextToken(); -#line 720 "cs.ATG" +#line 722 "cs.ATG" name = "System.UInt16"; break; } case 82: { lexer.NextToken(); -#line 721 "cs.ATG" +#line 723 "cs.ATG" name = "System.Int32"; break; } case 116: { lexer.NextToken(); -#line 722 "cs.ATG" +#line 724 "cs.ATG" name = "System.UInt32"; break; } case 87: { lexer.NextToken(); -#line 723 "cs.ATG" +#line 725 "cs.ATG" name = "System.Int64"; break; } case 117: { lexer.NextToken(); -#line 724 "cs.ATG" +#line 726 "cs.ATG" name = "System.UInt64"; break; } case 57: { lexer.NextToken(); -#line 725 "cs.ATG" +#line 727 "cs.ATG" name = "System.Char"; break; } - default: SynErr(156); break; + default: SynErr(158); break; } } void EnumBody() { -#line 562 "cs.ATG" +#line 564 "cs.ATG" FieldDeclaration f; Expect(16); if (StartOf(17)) { EnumMemberDecl( -#line 565 "cs.ATG" +#line 567 "cs.ATG" out f); -#line 565 "cs.ATG" +#line 567 "cs.ATG" AddChild(f); while ( -#line 566 "cs.ATG" +#line 568 "cs.ATG" NotFinalComma()) { Expect(14); EnumMemberDecl( -#line 567 "cs.ATG" +#line 569 "cs.ATG" out f); -#line 567 "cs.ATG" +#line 569 "cs.ATG" AddChild(f); } if (la.kind == 14) { @@ -1285,115 +1293,115 @@ out f); } void Type( -#line 573 "cs.ATG" +#line 575 "cs.ATG" out TypeReference type) { TypeWithRestriction( -#line 575 "cs.ATG" +#line 577 "cs.ATG" out type, true, false); } void FormalParameterList( -#line 645 "cs.ATG" +#line 647 "cs.ATG" List parameter) { -#line 648 "cs.ATG" +#line 650 "cs.ATG" ParameterDeclarationExpression p; AttributeSection section; List attributes = new List(); while (la.kind == 18) { AttributeSection( -#line 653 "cs.ATG" +#line 655 "cs.ATG" out section); -#line 653 "cs.ATG" +#line 655 "cs.ATG" attributes.Add(section); } FixedParameter( -#line 654 "cs.ATG" +#line 656 "cs.ATG" out p); -#line 654 "cs.ATG" +#line 656 "cs.ATG" p.Attributes = attributes; parameter.Add(p); while (la.kind == 14) { lexer.NextToken(); -#line 658 "cs.ATG" +#line 660 "cs.ATG" attributes = new List(); while (la.kind == 18) { AttributeSection( -#line 659 "cs.ATG" +#line 661 "cs.ATG" out section); -#line 659 "cs.ATG" +#line 661 "cs.ATG" attributes.Add(section); } FixedParameter( -#line 660 "cs.ATG" +#line 662 "cs.ATG" out p); -#line 660 "cs.ATG" +#line 662 "cs.ATG" p.Attributes = attributes; parameter.Add(p); } } void ClassType( -#line 707 "cs.ATG" +#line 709 "cs.ATG" out TypeReference typeRef, bool canBeUnbound) { -#line 708 "cs.ATG" +#line 710 "cs.ATG" TypeReference r; typeRef = null; if (StartOf(18)) { TypeName( -#line 710 "cs.ATG" +#line 712 "cs.ATG" out r, canBeUnbound); -#line 710 "cs.ATG" +#line 712 "cs.ATG" typeRef = r; } else if (la.kind == 91) { lexer.NextToken(); -#line 711 "cs.ATG" +#line 713 "cs.ATG" typeRef = new TypeReference("System.Object", true); typeRef.StartLocation = t.Location; typeRef.EndLocation = t.EndLocation; } else if (la.kind == 108) { lexer.NextToken(); -#line 712 "cs.ATG" +#line 714 "cs.ATG" typeRef = new TypeReference("System.String", true); typeRef.StartLocation = t.Location; typeRef.EndLocation = t.EndLocation; - } else SynErr(157); + } else SynErr(159); } void TypeName( -#line 2318 "cs.ATG" +#line 2338 "cs.ATG" out TypeReference typeRef, bool canBeUnbound) { -#line 2319 "cs.ATG" +#line 2339 "cs.ATG" List typeArguments = null; string alias = null; string qualident; Location startLocation = la.Location; if ( -#line 2325 "cs.ATG" +#line 2345 "cs.ATG" IdentAndDoubleColon()) { Identifier(); -#line 2326 "cs.ATG" +#line 2346 "cs.ATG" alias = t.val; Expect(10); } Qualident( -#line 2329 "cs.ATG" +#line 2349 "cs.ATG" out qualident); if (la.kind == 23) { TypeArgumentList( -#line 2330 "cs.ATG" +#line 2350 "cs.ATG" out typeArguments, canBeUnbound); } -#line 2332 "cs.ATG" +#line 2352 "cs.ATG" if (alias == null) { typeRef = new TypeReference(qualident, typeArguments); } else if (alias == "global") { @@ -1404,168 +1412,175 @@ out typeArguments, canBeUnbound); } while ( -#line 2341 "cs.ATG" +#line 2361 "cs.ATG" DotAndIdent()) { Expect(15); -#line 2342 "cs.ATG" +#line 2362 "cs.ATG" typeArguments = null; Qualident( -#line 2343 "cs.ATG" +#line 2363 "cs.ATG" out qualident); if (la.kind == 23) { TypeArgumentList( -#line 2344 "cs.ATG" +#line 2364 "cs.ATG" out typeArguments, canBeUnbound); } -#line 2345 "cs.ATG" +#line 2365 "cs.ATG" typeRef = new InnerClassTypeReference(typeRef, qualident, typeArguments); } -#line 2347 "cs.ATG" +#line 2367 "cs.ATG" typeRef.StartLocation = startLocation; typeRef.EndLocation = t.EndLocation; } void MemberModifiers( -#line 728 "cs.ATG" +#line 730 "cs.ATG" ModifierList m) { while (StartOf(19)) { switch (la.kind) { case 49: { lexer.NextToken(); -#line 731 "cs.ATG" +#line 733 "cs.ATG" m.Add(Modifiers.Abstract, t.Location); break; } case 71: { lexer.NextToken(); -#line 732 "cs.ATG" +#line 734 "cs.ATG" m.Add(Modifiers.Extern, t.Location); break; } case 84: { lexer.NextToken(); -#line 733 "cs.ATG" +#line 735 "cs.ATG" m.Add(Modifiers.Internal, t.Location); break; } case 89: { lexer.NextToken(); -#line 734 "cs.ATG" +#line 736 "cs.ATG" m.Add(Modifiers.New, t.Location); break; } case 94: { lexer.NextToken(); -#line 735 "cs.ATG" +#line 737 "cs.ATG" m.Add(Modifiers.Override, t.Location); break; } case 96: { lexer.NextToken(); -#line 736 "cs.ATG" +#line 738 "cs.ATG" m.Add(Modifiers.Private, t.Location); break; } case 97: { lexer.NextToken(); -#line 737 "cs.ATG" +#line 739 "cs.ATG" m.Add(Modifiers.Protected, t.Location); break; } case 98: { lexer.NextToken(); -#line 738 "cs.ATG" +#line 740 "cs.ATG" m.Add(Modifiers.Public, t.Location); break; } case 99: { lexer.NextToken(); -#line 739 "cs.ATG" +#line 741 "cs.ATG" m.Add(Modifiers.ReadOnly, t.Location); break; } case 103: { lexer.NextToken(); -#line 740 "cs.ATG" +#line 742 "cs.ATG" m.Add(Modifiers.Sealed, t.Location); break; } case 107: { lexer.NextToken(); -#line 741 "cs.ATG" +#line 743 "cs.ATG" m.Add(Modifiers.Static, t.Location); break; } case 74: { lexer.NextToken(); -#line 742 "cs.ATG" +#line 744 "cs.ATG" m.Add(Modifiers.Fixed, t.Location); break; } case 119: { lexer.NextToken(); -#line 743 "cs.ATG" +#line 745 "cs.ATG" m.Add(Modifiers.Unsafe, t.Location); break; } case 122: { lexer.NextToken(); -#line 744 "cs.ATG" +#line 746 "cs.ATG" m.Add(Modifiers.Virtual, t.Location); break; } case 124: { lexer.NextToken(); -#line 745 "cs.ATG" +#line 747 "cs.ATG" m.Add(Modifiers.Volatile, t.Location); break; } case 126: { lexer.NextToken(); -#line 746 "cs.ATG" +#line 748 "cs.ATG" m.Add(Modifiers.Partial, t.Location); break; } + case 145: { + lexer.NextToken(); + +#line 749 "cs.ATG" + m.Add(Modifiers.Async, t.Location); + break; + } } } } void ClassMemberDecl( -#line 1081 "cs.ATG" +#line 1084 "cs.ATG" ModifierList m, List attributes) { -#line 1082 "cs.ATG" +#line 1085 "cs.ATG" BlockStatement stmt = null; if (StartOf(20)) { StructMemberDecl( -#line 1084 "cs.ATG" +#line 1087 "cs.ATG" m, attributes); } else if (la.kind == 27) { -#line 1085 "cs.ATG" +#line 1088 "cs.ATG" m.Check(Modifiers.Destructors); Location startPos = la.Location; lexer.NextToken(); Identifier(); -#line 1086 "cs.ATG" +#line 1089 "cs.ATG" DestructorDeclaration d = new DestructorDeclaration(t.val, m.Modifier, attributes); d.Modifier = m.Modifier; d.StartLocation = m.GetDeclarationLocation(startPos); @@ -1573,28 +1588,28 @@ m, attributes); Expect(20); Expect(21); -#line 1090 "cs.ATG" +#line 1093 "cs.ATG" d.EndLocation = t.EndLocation; if (la.kind == 16) { Block( -#line 1090 "cs.ATG" +#line 1093 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); - } else SynErr(158); + } else SynErr(160); -#line 1091 "cs.ATG" +#line 1094 "cs.ATG" d.Body = stmt; AddChild(d); - } else SynErr(159); + } else SynErr(161); } void StructMemberDecl( -#line 750 "cs.ATG" +#line 753 "cs.ATG" ModifierList m, List attributes) { -#line 752 "cs.ATG" +#line 755 "cs.ATG" string qualident = null; TypeReference type; Expression expr; @@ -1606,18 +1621,18 @@ ModifierList m, List attributes) { if (la.kind == 60) { -#line 762 "cs.ATG" +#line 765 "cs.ATG" m.Check(Modifiers.Constants); lexer.NextToken(); -#line 763 "cs.ATG" +#line 766 "cs.ATG" Location startPos = t.Location; Type( -#line 764 "cs.ATG" +#line 767 "cs.ATG" out type); Identifier(); -#line 764 "cs.ATG" +#line 767 "cs.ATG" FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier | Modifiers.Const); fd.StartLocation = m.GetDeclarationLocation(startPos); VariableDeclaration f = new VariableDeclaration(t.val); @@ -1627,16 +1642,16 @@ out type); Expect(3); Expr( -#line 771 "cs.ATG" +#line 774 "cs.ATG" out expr); -#line 771 "cs.ATG" +#line 774 "cs.ATG" f.Initializer = expr; while (la.kind == 14) { lexer.NextToken(); Identifier(); -#line 772 "cs.ATG" +#line 775 "cs.ATG" f = new VariableDeclaration(t.val); f.StartLocation = t.Location; f.TypeReference = type; @@ -1644,63 +1659,63 @@ out expr); Expect(3); Expr( -#line 777 "cs.ATG" +#line 780 "cs.ATG" out expr); -#line 777 "cs.ATG" +#line 780 "cs.ATG" f.EndLocation = t.EndLocation; f.Initializer = expr; } Expect(11); -#line 778 "cs.ATG" +#line 781 "cs.ATG" fd.EndLocation = t.EndLocation; AddChild(fd); } else if ( -#line 782 "cs.ATG" +#line 785 "cs.ATG" NotVoidPointer()) { -#line 782 "cs.ATG" +#line 785 "cs.ATG" m.Check(Modifiers.PropertysEventsMethods); Expect(123); -#line 783 "cs.ATG" +#line 786 "cs.ATG" Location startPos = t.Location; if ( -#line 784 "cs.ATG" +#line 787 "cs.ATG" IsExplicitInterfaceImplementation()) { TypeName( -#line 785 "cs.ATG" +#line 788 "cs.ATG" out explicitInterface, false); -#line 786 "cs.ATG" +#line 789 "cs.ATG" if (la.kind != Tokens.Dot || Peek(1).kind != Tokens.This) { qualident = TypeReference.StripLastIdentifierFromType(ref explicitInterface); } } else if (StartOf(18)) { Identifier(); -#line 789 "cs.ATG" +#line 792 "cs.ATG" qualident = t.val; - } else SynErr(160); + } else SynErr(162); if (la.kind == 23) { TypeParameterList( -#line 792 "cs.ATG" +#line 795 "cs.ATG" templates); } Expect(20); if (la.kind == 111) { lexer.NextToken(); -#line 795 "cs.ATG" +#line 798 "cs.ATG" isExtensionMethod = true; /* C# 3.0 */ } if (StartOf(11)) { FormalParameterList( -#line 796 "cs.ATG" +#line 799 "cs.ATG" p); } Expect(21); -#line 797 "cs.ATG" +#line 800 "cs.ATG" MethodDeclaration methodDeclaration = new MethodDeclaration { Name = qualident, Modifier = m.Modifier, @@ -1719,28 +1734,28 @@ p); while (la.kind == 127) { TypeParameterConstraintsClause( -#line 815 "cs.ATG" +#line 818 "cs.ATG" templates); } if (la.kind == 16) { Block( -#line 817 "cs.ATG" +#line 820 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); - } else SynErr(161); + } else SynErr(163); -#line 817 "cs.ATG" +#line 820 "cs.ATG" BlockEnd(); methodDeclaration.Body = (BlockStatement)stmt; } else if (la.kind == 69) { -#line 821 "cs.ATG" +#line 824 "cs.ATG" m.Check(Modifiers.PropertysEventsMethods); lexer.NextToken(); -#line 823 "cs.ATG" +#line 826 "cs.ATG" EventDeclaration eventDecl = new EventDeclaration { Modifier = m.Modifier, Attributes = attributes, @@ -1752,44 +1767,44 @@ out stmt); EventRemoveRegion removeBlock = null; Type( -#line 833 "cs.ATG" +#line 836 "cs.ATG" out type); -#line 833 "cs.ATG" +#line 836 "cs.ATG" eventDecl.TypeReference = type; if ( -#line 834 "cs.ATG" +#line 837 "cs.ATG" IsExplicitInterfaceImplementation()) { TypeName( -#line 835 "cs.ATG" +#line 838 "cs.ATG" out explicitInterface, false); -#line 836 "cs.ATG" +#line 839 "cs.ATG" qualident = TypeReference.StripLastIdentifierFromType(ref explicitInterface); -#line 837 "cs.ATG" +#line 840 "cs.ATG" eventDecl.InterfaceImplementations.Add(new InterfaceImplementation(explicitInterface, qualident)); } else if (StartOf(18)) { Identifier(); -#line 839 "cs.ATG" +#line 842 "cs.ATG" qualident = t.val; if (la.kind == 3) { lexer.NextToken(); Expr( -#line 840 "cs.ATG" +#line 843 "cs.ATG" out expr); -#line 840 "cs.ATG" +#line 843 "cs.ATG" eventDecl.Initializer = expr; } while (la.kind == 14) { lexer.NextToken(); -#line 844 "cs.ATG" +#line 847 "cs.ATG" eventDecl.Name = qualident; eventDecl.EndLocation = t.EndLocation; BlockEnd(); -#line 846 "cs.ATG" +#line 849 "cs.ATG" eventDecl = new EventDeclaration { Modifier = eventDecl.Modifier, Attributes = eventDecl.Attributes, @@ -1801,94 +1816,94 @@ out expr); Identifier(); -#line 855 "cs.ATG" +#line 858 "cs.ATG" qualident = t.val; if (la.kind == 3) { lexer.NextToken(); Expr( -#line 856 "cs.ATG" +#line 859 "cs.ATG" out expr); -#line 856 "cs.ATG" +#line 859 "cs.ATG" eventDecl.Initializer = expr; } } - } else SynErr(162); + } else SynErr(164); -#line 859 "cs.ATG" +#line 862 "cs.ATG" eventDecl.Name = qualident; eventDecl.EndLocation = t.EndLocation; if (la.kind == 16) { lexer.NextToken(); -#line 860 "cs.ATG" +#line 863 "cs.ATG" eventDecl.BodyStart = t.Location; EventAccessorDecls( -#line 861 "cs.ATG" +#line 864 "cs.ATG" out addBlock, out removeBlock); Expect(17); -#line 862 "cs.ATG" +#line 865 "cs.ATG" eventDecl.BodyEnd = t.EndLocation; } if (la.kind == 11) { lexer.NextToken(); } -#line 865 "cs.ATG" +#line 868 "cs.ATG" BlockEnd(); eventDecl.AddRegion = addBlock; eventDecl.RemoveRegion = removeBlock; } else if ( -#line 871 "cs.ATG" +#line 874 "cs.ATG" IdentAndLPar()) { -#line 871 "cs.ATG" +#line 874 "cs.ATG" m.Check(Modifiers.Constructors | Modifiers.StaticConstructors); Identifier(); -#line 872 "cs.ATG" +#line 875 "cs.ATG" string name = t.val; Location startPos = t.Location; Expect(20); if (StartOf(11)) { -#line 872 "cs.ATG" +#line 875 "cs.ATG" m.Check(Modifiers.Constructors); FormalParameterList( -#line 873 "cs.ATG" +#line 876 "cs.ATG" p); } Expect(21); -#line 875 "cs.ATG" +#line 878 "cs.ATG" ConstructorInitializer init = null; if (la.kind == 9) { -#line 876 "cs.ATG" +#line 879 "cs.ATG" m.Check(Modifiers.Constructors); ConstructorInitializer( -#line 877 "cs.ATG" +#line 880 "cs.ATG" out init); } -#line 879 "cs.ATG" +#line 882 "cs.ATG" ConstructorDeclaration cd = new ConstructorDeclaration(name, m.Modifier, p, init, attributes); cd.StartLocation = startPos; cd.EndLocation = t.EndLocation; if (la.kind == 16) { Block( -#line 884 "cs.ATG" +#line 887 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); - } else SynErr(163); + } else SynErr(165); -#line 884 "cs.ATG" +#line 887 "cs.ATG" cd.Body = (BlockStatement)stmt; AddChild(cd); } else if (la.kind == 70 || la.kind == 80) { -#line 887 "cs.ATG" +#line 890 "cs.ATG" m.Check(Modifiers.Operators); if (m.isNone) Error("at least one modifier must be set"); bool isImplicit = true; @@ -1897,45 +1912,45 @@ out stmt); if (la.kind == 80) { lexer.NextToken(); -#line 892 "cs.ATG" +#line 895 "cs.ATG" startPos = t.Location; } else { lexer.NextToken(); -#line 892 "cs.ATG" +#line 895 "cs.ATG" isImplicit = false; startPos = t.Location; } Expect(92); Type( -#line 893 "cs.ATG" +#line 896 "cs.ATG" out type); -#line 893 "cs.ATG" +#line 896 "cs.ATG" TypeReference operatorType = type; Expect(20); Type( -#line 894 "cs.ATG" +#line 897 "cs.ATG" out type); Identifier(); -#line 894 "cs.ATG" +#line 897 "cs.ATG" string varName = t.val; Expect(21); -#line 895 "cs.ATG" +#line 898 "cs.ATG" Location endPos = t.Location; if (la.kind == 16) { Block( -#line 896 "cs.ATG" +#line 899 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); -#line 896 "cs.ATG" +#line 899 "cs.ATG" stmt = null; - } else SynErr(164); + } else SynErr(166); -#line 899 "cs.ATG" +#line 902 "cs.ATG" List parameters = new List(); parameters.Add(new ParameterDeclarationExpression(type, varName)); OperatorDeclaration operatorDeclaration = new OperatorDeclaration { @@ -1953,67 +1968,67 @@ out stmt); } else if (StartOf(21)) { TypeDecl( -#line 917 "cs.ATG" +#line 920 "cs.ATG" m, attributes); } else if (StartOf(10)) { Type( -#line 919 "cs.ATG" +#line 922 "cs.ATG" out type); -#line 919 "cs.ATG" +#line 922 "cs.ATG" Location startPos = t.Location; if (la.kind == 92) { -#line 921 "cs.ATG" +#line 924 "cs.ATG" OverloadableOperatorType op; m.Check(Modifiers.Operators); if (m.isNone) Error("at least one modifier must be set"); lexer.NextToken(); OverloadableOperator( -#line 925 "cs.ATG" +#line 928 "cs.ATG" out op); -#line 925 "cs.ATG" +#line 928 "cs.ATG" TypeReference firstType, secondType = null; string secondName = null; Expect(20); -#line 926 "cs.ATG" +#line 929 "cs.ATG" Location firstStart = la.Location, secondStart = Location.Empty, secondEnd = Location.Empty; Type( -#line 926 "cs.ATG" +#line 929 "cs.ATG" out firstType); Identifier(); -#line 926 "cs.ATG" +#line 929 "cs.ATG" string firstName = t.val; Location firstEnd = t.EndLocation; if (la.kind == 14) { lexer.NextToken(); -#line 927 "cs.ATG" +#line 930 "cs.ATG" secondStart = la.Location; Type( -#line 927 "cs.ATG" +#line 930 "cs.ATG" out secondType); Identifier(); -#line 927 "cs.ATG" +#line 930 "cs.ATG" secondName = t.val; secondEnd = t.EndLocation; } else if (la.kind == 21) { - } else SynErr(165); + } else SynErr(167); -#line 935 "cs.ATG" +#line 938 "cs.ATG" Location endPos = t.Location; Expect(21); if (la.kind == 16) { Block( -#line 936 "cs.ATG" +#line 939 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); - } else SynErr(166); + } else SynErr(168); -#line 938 "cs.ATG" +#line 941 "cs.ATG" if (op == OverloadableOperatorType.Add && secondType == null) op = OverloadableOperatorType.UnaryPlus; if (op == OverloadableOperatorType.Subtract && secondType == null) @@ -2035,75 +2050,75 @@ out stmt); AddChild(operatorDeclaration); } else if ( -#line 960 "cs.ATG" +#line 963 "cs.ATG" IsVarDecl()) { -#line 961 "cs.ATG" +#line 964 "cs.ATG" m.Check(Modifiers.Fields); FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier); fd.StartLocation = m.GetDeclarationLocation(startPos); if ( -#line 965 "cs.ATG" +#line 968 "cs.ATG" m.Contains(Modifiers.Fixed)) { VariableDeclarator( -#line 966 "cs.ATG" +#line 969 "cs.ATG" fd); Expect(18); Expr( -#line 968 "cs.ATG" +#line 971 "cs.ATG" out expr); -#line 968 "cs.ATG" +#line 971 "cs.ATG" if (fd.Fields.Count > 0) fd.Fields[fd.Fields.Count-1].FixedArrayInitialization = expr; Expect(19); while (la.kind == 14) { lexer.NextToken(); VariableDeclarator( -#line 972 "cs.ATG" +#line 975 "cs.ATG" fd); Expect(18); Expr( -#line 974 "cs.ATG" +#line 977 "cs.ATG" out expr); -#line 974 "cs.ATG" +#line 977 "cs.ATG" if (fd.Fields.Count > 0) fd.Fields[fd.Fields.Count-1].FixedArrayInitialization = expr; Expect(19); } } else if (StartOf(18)) { VariableDeclarator( -#line 979 "cs.ATG" +#line 982 "cs.ATG" fd); while (la.kind == 14) { lexer.NextToken(); VariableDeclarator( -#line 980 "cs.ATG" +#line 983 "cs.ATG" fd); } - } else SynErr(167); + } else SynErr(169); Expect(11); -#line 982 "cs.ATG" +#line 985 "cs.ATG" fd.EndLocation = t.EndLocation; AddChild(fd); } else if (la.kind == 111) { -#line 985 "cs.ATG" +#line 988 "cs.ATG" m.Check(Modifiers.Indexers); lexer.NextToken(); Expect(18); FormalParameterList( -#line 986 "cs.ATG" +#line 989 "cs.ATG" p); Expect(19); -#line 986 "cs.ATG" +#line 989 "cs.ATG" Location endLocation = t.EndLocation; Expect(16); -#line 987 "cs.ATG" +#line 990 "cs.ATG" PropertyDeclaration indexer = new PropertyDeclaration(m.Modifier | Modifiers.Default, attributes, "Item", p); indexer.StartLocation = startPos; indexer.EndLocation = endLocation; @@ -2113,64 +2128,64 @@ p); PropertySetRegion setRegion; AccessorDecls( -#line 995 "cs.ATG" +#line 998 "cs.ATG" out getRegion, out setRegion); Expect(17); -#line 996 "cs.ATG" +#line 999 "cs.ATG" indexer.BodyEnd = t.EndLocation; indexer.GetRegion = getRegion; indexer.SetRegion = setRegion; AddChild(indexer); } else if ( -#line 1001 "cs.ATG" +#line 1004 "cs.ATG" IsIdentifierToken(la)) { if ( -#line 1002 "cs.ATG" +#line 1005 "cs.ATG" IsExplicitInterfaceImplementation()) { TypeName( -#line 1003 "cs.ATG" +#line 1006 "cs.ATG" out explicitInterface, false); -#line 1004 "cs.ATG" +#line 1007 "cs.ATG" if (la.kind != Tokens.Dot || Peek(1).kind != Tokens.This) { qualident = TypeReference.StripLastIdentifierFromType(ref explicitInterface); } } else if (StartOf(18)) { Identifier(); -#line 1007 "cs.ATG" +#line 1010 "cs.ATG" qualident = t.val; - } else SynErr(168); + } else SynErr(170); -#line 1009 "cs.ATG" +#line 1012 "cs.ATG" Location qualIdentEndLocation = t.EndLocation; if (la.kind == 16 || la.kind == 20 || la.kind == 23) { if (la.kind == 20 || la.kind == 23) { -#line 1013 "cs.ATG" +#line 1016 "cs.ATG" m.Check(Modifiers.PropertysEventsMethods); if (la.kind == 23) { TypeParameterList( -#line 1015 "cs.ATG" +#line 1018 "cs.ATG" templates); } Expect(20); if (la.kind == 111) { lexer.NextToken(); -#line 1017 "cs.ATG" +#line 1020 "cs.ATG" isExtensionMethod = true; } if (StartOf(11)) { FormalParameterList( -#line 1018 "cs.ATG" +#line 1021 "cs.ATG" p); } Expect(21); -#line 1020 "cs.ATG" +#line 1023 "cs.ATG" MethodDeclaration methodDeclaration = new MethodDeclaration { Name = qualident, Modifier = m.Modifier, @@ -2188,23 +2203,23 @@ p); while (la.kind == 127) { TypeParameterConstraintsClause( -#line 1035 "cs.ATG" +#line 1038 "cs.ATG" templates); } if (la.kind == 16) { Block( -#line 1036 "cs.ATG" +#line 1039 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); - } else SynErr(169); + } else SynErr(171); -#line 1036 "cs.ATG" +#line 1039 "cs.ATG" methodDeclaration.Body = (BlockStatement)stmt; } else { lexer.NextToken(); -#line 1039 "cs.ATG" +#line 1042 "cs.ATG" PropertyDeclaration pDecl = new PropertyDeclaration(qualident, type, m.Modifier, attributes); if (explicitInterface != null) pDecl.InterfaceImplementations.Add(new InterfaceImplementation(explicitInterface, qualident)); @@ -2215,11 +2230,11 @@ out stmt); PropertySetRegion setRegion; AccessorDecls( -#line 1048 "cs.ATG" +#line 1051 "cs.ATG" out getRegion, out setRegion); Expect(17); -#line 1050 "cs.ATG" +#line 1053 "cs.ATG" pDecl.GetRegion = getRegion; pDecl.SetRegion = setRegion; pDecl.BodyEnd = t.EndLocation; @@ -2228,17 +2243,17 @@ out getRegion, out setRegion); } } else if (la.kind == 15) { -#line 1058 "cs.ATG" +#line 1061 "cs.ATG" m.Check(Modifiers.Indexers); lexer.NextToken(); Expect(111); Expect(18); FormalParameterList( -#line 1059 "cs.ATG" +#line 1062 "cs.ATG" p); Expect(19); -#line 1060 "cs.ATG" +#line 1063 "cs.ATG" PropertyDeclaration indexer = new PropertyDeclaration(m.Modifier | Modifiers.Default, attributes, "Item", p); indexer.StartLocation = m.GetDeclarationLocation(startPos); indexer.EndLocation = t.EndLocation; @@ -2250,28 +2265,28 @@ p); Expect(16); -#line 1069 "cs.ATG" +#line 1072 "cs.ATG" Location bodyStart = t.Location; AccessorDecls( -#line 1070 "cs.ATG" +#line 1073 "cs.ATG" out getRegion, out setRegion); Expect(17); -#line 1071 "cs.ATG" +#line 1074 "cs.ATG" indexer.BodyStart = bodyStart; indexer.BodyEnd = t.EndLocation; indexer.GetRegion = getRegion; indexer.SetRegion = setRegion; AddChild(indexer); - } else SynErr(170); - } else SynErr(171); - } else SynErr(172); + } else SynErr(172); + } else SynErr(173); + } else SynErr(174); } void InterfaceMemberDecl() { -#line 1098 "cs.ATG" +#line 1101 "cs.ATG" TypeReference type; AttributeSection section; @@ -2286,49 +2301,49 @@ out getRegion, out setRegion); while (la.kind == 18) { AttributeSection( -#line 1111 "cs.ATG" +#line 1114 "cs.ATG" out section); -#line 1111 "cs.ATG" +#line 1114 "cs.ATG" attributes.Add(section); } if (la.kind == 89) { lexer.NextToken(); -#line 1112 "cs.ATG" +#line 1115 "cs.ATG" mod = Modifiers.New; startLocation = t.Location; } if ( -#line 1115 "cs.ATG" +#line 1118 "cs.ATG" NotVoidPointer()) { Expect(123); -#line 1115 "cs.ATG" +#line 1118 "cs.ATG" if (startLocation.IsEmpty) startLocation = t.Location; Identifier(); -#line 1116 "cs.ATG" +#line 1119 "cs.ATG" name = t.val; if (la.kind == 23) { TypeParameterList( -#line 1117 "cs.ATG" +#line 1120 "cs.ATG" templates); } Expect(20); if (StartOf(11)) { FormalParameterList( -#line 1118 "cs.ATG" +#line 1121 "cs.ATG" parameters); } Expect(21); while (la.kind == 127) { TypeParameterConstraintsClause( -#line 1119 "cs.ATG" +#line 1122 "cs.ATG" templates); } Expect(11); -#line 1121 "cs.ATG" +#line 1124 "cs.ATG" MethodDeclaration md = new MethodDeclaration { Name = name, Modifier = mod, TypeReference = new TypeReference("System.Void", true), Parameters = parameters, Attributes = attributes, Templates = templates, @@ -2339,37 +2354,37 @@ templates); } else if (StartOf(22)) { if (StartOf(10)) { Type( -#line 1129 "cs.ATG" +#line 1132 "cs.ATG" out type); -#line 1129 "cs.ATG" +#line 1132 "cs.ATG" if (startLocation.IsEmpty) startLocation = t.Location; if (StartOf(18)) { Identifier(); -#line 1131 "cs.ATG" +#line 1134 "cs.ATG" name = t.val; Location qualIdentEndLocation = t.EndLocation; if (la.kind == 20 || la.kind == 23) { if (la.kind == 23) { TypeParameterList( -#line 1135 "cs.ATG" +#line 1138 "cs.ATG" templates); } Expect(20); if (StartOf(11)) { FormalParameterList( -#line 1136 "cs.ATG" +#line 1139 "cs.ATG" parameters); } Expect(21); while (la.kind == 127) { TypeParameterConstraintsClause( -#line 1138 "cs.ATG" +#line 1141 "cs.ATG" templates); } Expect(11); -#line 1139 "cs.ATG" +#line 1142 "cs.ATG" MethodDeclaration md = new MethodDeclaration { Name = name, Modifier = mod, TypeReference = type, Parameters = parameters, Attributes = attributes, Templates = templates, @@ -2379,59 +2394,59 @@ templates); } else if (la.kind == 16) { -#line 1148 "cs.ATG" +#line 1151 "cs.ATG" PropertyDeclaration pd = new PropertyDeclaration(name, type, mod, attributes); AddChild(pd); lexer.NextToken(); -#line 1151 "cs.ATG" +#line 1154 "cs.ATG" Location bodyStart = t.Location; InterfaceAccessors( -#line 1152 "cs.ATG" +#line 1155 "cs.ATG" out getBlock, out setBlock); Expect(17); -#line 1153 "cs.ATG" +#line 1156 "cs.ATG" pd.GetRegion = getBlock; pd.SetRegion = setBlock; pd.StartLocation = startLocation; pd.EndLocation = qualIdentEndLocation; pd.BodyStart = bodyStart; pd.BodyEnd = t.EndLocation; - } else SynErr(173); + } else SynErr(175); } else if (la.kind == 111) { lexer.NextToken(); Expect(18); FormalParameterList( -#line 1156 "cs.ATG" +#line 1159 "cs.ATG" parameters); Expect(19); -#line 1157 "cs.ATG" +#line 1160 "cs.ATG" Location bracketEndLocation = t.EndLocation; -#line 1158 "cs.ATG" +#line 1161 "cs.ATG" PropertyDeclaration id = new PropertyDeclaration(mod | Modifiers.Default, attributes, "Item", parameters); id.TypeReference = type; AddChild(id); Expect(16); -#line 1161 "cs.ATG" +#line 1164 "cs.ATG" Location bodyStart = t.Location; InterfaceAccessors( -#line 1162 "cs.ATG" +#line 1165 "cs.ATG" out getBlock, out setBlock); Expect(17); -#line 1164 "cs.ATG" +#line 1167 "cs.ATG" id.GetRegion = getBlock; id.SetRegion = setBlock; id.StartLocation = startLocation; id.EndLocation = bracketEndLocation; id.BodyStart = bodyStart; id.BodyEnd = t.EndLocation; - } else SynErr(174); + } else SynErr(176); } else { lexer.NextToken(); -#line 1167 "cs.ATG" +#line 1170 "cs.ATG" if (startLocation.IsEmpty) startLocation = t.Location; Type( -#line 1168 "cs.ATG" +#line 1171 "cs.ATG" out type); Identifier(); -#line 1169 "cs.ATG" +#line 1172 "cs.ATG" EventDeclaration ed = new EventDeclaration { TypeReference = type, Name = t.val, Modifier = mod, Attributes = attributes }; @@ -2439,17 +2454,17 @@ out type); Expect(11); -#line 1175 "cs.ATG" +#line 1178 "cs.ATG" ed.StartLocation = startLocation; ed.EndLocation = t.EndLocation; } - } else SynErr(175); + } else SynErr(177); } void EnumMemberDecl( -#line 1180 "cs.ATG" +#line 1183 "cs.ATG" out FieldDeclaration f) { -#line 1182 "cs.ATG" +#line 1185 "cs.ATG" Expression expr = null; List attributes = new List(); AttributeSection section = null; @@ -2457,15 +2472,15 @@ out FieldDeclaration f) { while (la.kind == 18) { AttributeSection( -#line 1188 "cs.ATG" +#line 1191 "cs.ATG" out section); -#line 1188 "cs.ATG" +#line 1191 "cs.ATG" attributes.Add(section); } Identifier(); -#line 1189 "cs.ATG" +#line 1192 "cs.ATG" f = new FieldDeclaration(attributes); varDecl = new VariableDeclaration(t.val); f.Fields.Add(varDecl); @@ -2475,19 +2490,19 @@ out section); if (la.kind == 3) { lexer.NextToken(); Expr( -#line 1195 "cs.ATG" +#line 1198 "cs.ATG" out expr); -#line 1195 "cs.ATG" +#line 1198 "cs.ATG" varDecl.Initializer = expr; } } void TypeWithRestriction( -#line 578 "cs.ATG" +#line 580 "cs.ATG" out TypeReference type, bool allowNullable, bool canBeUnbound) { -#line 580 "cs.ATG" +#line 582 "cs.ATG" Location startPos = la.Location; string name; int pointer = 0; @@ -2495,59 +2510,59 @@ out TypeReference type, bool allowNullable, bool canBeUnbound) { if (StartOf(4)) { ClassType( -#line 586 "cs.ATG" +#line 588 "cs.ATG" out type, canBeUnbound); } else if (StartOf(5)) { SimpleType( -#line 587 "cs.ATG" +#line 589 "cs.ATG" out name); -#line 587 "cs.ATG" +#line 589 "cs.ATG" type = new TypeReference(name, true); type.StartLocation = startPos; type.EndLocation = t.EndLocation; } else if (la.kind == 123) { lexer.NextToken(); Expect(6); -#line 588 "cs.ATG" +#line 590 "cs.ATG" pointer = 1; type = new TypeReference("System.Void", true); type.StartLocation = startPos; type.EndLocation = t.EndLocation; - } else SynErr(176); + } else SynErr(178); -#line 589 "cs.ATG" +#line 591 "cs.ATG" List r = new List(); if ( -#line 591 "cs.ATG" +#line 593 "cs.ATG" allowNullable && la.kind == Tokens.Question) { NullableQuestionMark( -#line 591 "cs.ATG" +#line 593 "cs.ATG" ref type); } while ( -#line 593 "cs.ATG" +#line 595 "cs.ATG" IsPointerOrDims()) { -#line 593 "cs.ATG" +#line 595 "cs.ATG" int i = 0; if (la.kind == 6) { lexer.NextToken(); -#line 594 "cs.ATG" +#line 596 "cs.ATG" ++pointer; } else if (la.kind == 18) { lexer.NextToken(); while (la.kind == 14) { lexer.NextToken(); -#line 595 "cs.ATG" +#line 597 "cs.ATG" ++i; } Expect(19); -#line 595 "cs.ATG" +#line 597 "cs.ATG" r.Add(i); - } else SynErr(177); + } else SynErr(179); } -#line 598 "cs.ATG" +#line 600 "cs.ATG" if (type != null) { type.RankSpecifier = r.ToArray(); type.PointerNestingLevel = pointer; @@ -2558,57 +2573,57 @@ IsPointerOrDims()) { } void SimpleType( -#line 634 "cs.ATG" +#line 636 "cs.ATG" out string name) { -#line 635 "cs.ATG" +#line 637 "cs.ATG" name = String.Empty; if (StartOf(23)) { IntegralType( -#line 637 "cs.ATG" +#line 639 "cs.ATG" out name); } else if (la.kind == 75) { lexer.NextToken(); -#line 638 "cs.ATG" +#line 640 "cs.ATG" name = "System.Single"; } else if (la.kind == 66) { lexer.NextToken(); -#line 639 "cs.ATG" +#line 641 "cs.ATG" name = "System.Double"; } else if (la.kind == 62) { lexer.NextToken(); -#line 640 "cs.ATG" +#line 642 "cs.ATG" name = "System.Decimal"; } else if (la.kind == 52) { lexer.NextToken(); -#line 641 "cs.ATG" +#line 643 "cs.ATG" name = "System.Boolean"; - } else SynErr(178); + } else SynErr(180); } void NullableQuestionMark( -#line 2351 "cs.ATG" +#line 2371 "cs.ATG" ref TypeReference typeRef) { -#line 2352 "cs.ATG" +#line 2372 "cs.ATG" List typeArguments = new List(1); Expect(12); -#line 2356 "cs.ATG" +#line 2376 "cs.ATG" if (typeRef != null) typeArguments.Add(typeRef); typeRef = new TypeReference("System.Nullable", typeArguments) { IsKeyword = true }; } void FixedParameter( -#line 664 "cs.ATG" +#line 666 "cs.ATG" out ParameterDeclarationExpression p) { -#line 666 "cs.ATG" +#line 668 "cs.ATG" TypeReference type; ParameterModifiers mod = ParameterModifiers.In; Location start = la.Location; @@ -2618,83 +2633,83 @@ out ParameterDeclarationExpression p) { if (la.kind == 100) { lexer.NextToken(); -#line 673 "cs.ATG" +#line 675 "cs.ATG" mod = ParameterModifiers.Ref; } else if (la.kind == 93) { lexer.NextToken(); -#line 674 "cs.ATG" +#line 676 "cs.ATG" mod = ParameterModifiers.Out; } else { lexer.NextToken(); -#line 675 "cs.ATG" +#line 677 "cs.ATG" mod = ParameterModifiers.Params; } } Type( -#line 677 "cs.ATG" +#line 679 "cs.ATG" out type); Identifier(); -#line 678 "cs.ATG" +#line 680 "cs.ATG" p = new ParameterDeclarationExpression(type, t.val, mod); if (la.kind == 3) { lexer.NextToken(); Expr( -#line 679 "cs.ATG" +#line 681 "cs.ATG" out expr); -#line 679 "cs.ATG" +#line 681 "cs.ATG" p.DefaultValue = expr; p.ParamModifier |= ParameterModifiers.Optional; } -#line 680 "cs.ATG" +#line 682 "cs.ATG" p.StartLocation = start; p.EndLocation = t.EndLocation; } void AccessorModifiers( -#line 683 "cs.ATG" +#line 685 "cs.ATG" out ModifierList m) { -#line 684 "cs.ATG" +#line 686 "cs.ATG" m = new ModifierList(); if (la.kind == 96) { lexer.NextToken(); -#line 686 "cs.ATG" +#line 688 "cs.ATG" m.Add(Modifiers.Private, t.Location); } else if (la.kind == 97) { lexer.NextToken(); -#line 687 "cs.ATG" +#line 689 "cs.ATG" m.Add(Modifiers.Protected, t.Location); if (la.kind == 84) { lexer.NextToken(); -#line 688 "cs.ATG" +#line 690 "cs.ATG" m.Add(Modifiers.Internal, t.Location); } } else if (la.kind == 84) { lexer.NextToken(); -#line 689 "cs.ATG" +#line 691 "cs.ATG" m.Add(Modifiers.Internal, t.Location); if (la.kind == 97) { lexer.NextToken(); -#line 690 "cs.ATG" +#line 692 "cs.ATG" m.Add(Modifiers.Protected, t.Location); } - } else SynErr(179); + } else SynErr(181); } void Block( -#line 1315 "cs.ATG" +#line 1318 "cs.ATG" out BlockStatement stmt) { Expect(16); -#line 1317 "cs.ATG" +#line 1320 "cs.ATG" BlockStatement blockStmt = new BlockStatement(); blockStmt.StartLocation = t.Location; BlockStart(blockStmt); @@ -2703,10 +2718,10 @@ out BlockStatement stmt) { while (StartOf(24)) { Statement(); } - while (!(la.kind == 0 || la.kind == 17)) {SynErr(180); lexer.NextToken(); } + while (!(la.kind == 0 || la.kind == 17)) {SynErr(182); lexer.NextToken(); } Expect(17); -#line 1325 "cs.ATG" +#line 1328 "cs.ATG" stmt = blockStmt; blockStmt.EndLocation = t.EndLocation; BlockEnd(); @@ -2714,10 +2729,10 @@ out BlockStatement stmt) { } void EventAccessorDecls( -#line 1252 "cs.ATG" +#line 1255 "cs.ATG" out EventAddRegion addBlock, out EventRemoveRegion removeBlock) { -#line 1253 "cs.ATG" +#line 1256 "cs.ATG" AttributeSection section; List attributes = new List(); BlockStatement stmt; @@ -2726,93 +2741,93 @@ out EventAddRegion addBlock, out EventRemoveRegion removeBlock) { while (la.kind == 18) { AttributeSection( -#line 1260 "cs.ATG" +#line 1263 "cs.ATG" out section); -#line 1260 "cs.ATG" +#line 1263 "cs.ATG" attributes.Add(section); } if (la.kind == 130) { -#line 1262 "cs.ATG" +#line 1265 "cs.ATG" addBlock = new EventAddRegion(attributes); AddAccessorDecl( -#line 1263 "cs.ATG" +#line 1266 "cs.ATG" out stmt); -#line 1263 "cs.ATG" +#line 1266 "cs.ATG" attributes = new List(); addBlock.Block = stmt; while (la.kind == 18) { AttributeSection( -#line 1264 "cs.ATG" +#line 1267 "cs.ATG" out section); -#line 1264 "cs.ATG" +#line 1267 "cs.ATG" attributes.Add(section); } RemoveAccessorDecl( -#line 1265 "cs.ATG" +#line 1268 "cs.ATG" out stmt); -#line 1265 "cs.ATG" +#line 1268 "cs.ATG" removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = stmt; } else if (la.kind == 131) { RemoveAccessorDecl( -#line 1267 "cs.ATG" +#line 1270 "cs.ATG" out stmt); -#line 1267 "cs.ATG" +#line 1270 "cs.ATG" removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = stmt; attributes = new List(); while (la.kind == 18) { AttributeSection( -#line 1268 "cs.ATG" +#line 1271 "cs.ATG" out section); -#line 1268 "cs.ATG" +#line 1271 "cs.ATG" attributes.Add(section); } AddAccessorDecl( -#line 1269 "cs.ATG" +#line 1272 "cs.ATG" out stmt); -#line 1269 "cs.ATG" +#line 1272 "cs.ATG" addBlock = new EventAddRegion(attributes); addBlock.Block = stmt; - } else SynErr(181); + } else SynErr(183); } void ConstructorInitializer( -#line 1345 "cs.ATG" +#line 1348 "cs.ATG" out ConstructorInitializer ci) { -#line 1346 "cs.ATG" +#line 1349 "cs.ATG" Expression expr; ci = new ConstructorInitializer(); Expect(9); if (la.kind == 51) { lexer.NextToken(); -#line 1350 "cs.ATG" +#line 1353 "cs.ATG" ci.ConstructorInitializerType = ConstructorInitializerType.Base; } else if (la.kind == 111) { lexer.NextToken(); -#line 1351 "cs.ATG" +#line 1354 "cs.ATG" ci.ConstructorInitializerType = ConstructorInitializerType.This; - } else SynErr(182); + } else SynErr(184); Expect(20); if (StartOf(25)) { Argument( -#line 1354 "cs.ATG" +#line 1357 "cs.ATG" out expr); -#line 1354 "cs.ATG" +#line 1357 "cs.ATG" SafeAdd(ci, ci.Arguments, expr); while (la.kind == 14) { lexer.NextToken(); Argument( -#line 1355 "cs.ATG" +#line 1358 "cs.ATG" out expr); -#line 1355 "cs.ATG" +#line 1358 "cs.ATG" SafeAdd(ci, ci.Arguments, expr); } } @@ -2820,198 +2835,198 @@ out expr); } void OverloadableOperator( -#line 1368 "cs.ATG" +#line 1371 "cs.ATG" out OverloadableOperatorType op) { -#line 1369 "cs.ATG" +#line 1372 "cs.ATG" op = OverloadableOperatorType.None; switch (la.kind) { case 4: { lexer.NextToken(); -#line 1371 "cs.ATG" +#line 1374 "cs.ATG" op = OverloadableOperatorType.Add; break; } case 5: { lexer.NextToken(); -#line 1372 "cs.ATG" +#line 1375 "cs.ATG" op = OverloadableOperatorType.Subtract; break; } case 24: { lexer.NextToken(); -#line 1374 "cs.ATG" +#line 1377 "cs.ATG" op = OverloadableOperatorType.Not; break; } case 27: { lexer.NextToken(); -#line 1375 "cs.ATG" +#line 1378 "cs.ATG" op = OverloadableOperatorType.BitNot; break; } case 31: { lexer.NextToken(); -#line 1377 "cs.ATG" +#line 1380 "cs.ATG" op = OverloadableOperatorType.Increment; break; } case 32: { lexer.NextToken(); -#line 1378 "cs.ATG" +#line 1381 "cs.ATG" op = OverloadableOperatorType.Decrement; break; } case 113: { lexer.NextToken(); -#line 1380 "cs.ATG" +#line 1383 "cs.ATG" op = OverloadableOperatorType.IsTrue; break; } case 72: { lexer.NextToken(); -#line 1381 "cs.ATG" +#line 1384 "cs.ATG" op = OverloadableOperatorType.IsFalse; break; } case 6: { lexer.NextToken(); -#line 1383 "cs.ATG" +#line 1386 "cs.ATG" op = OverloadableOperatorType.Multiply; break; } case 7: { lexer.NextToken(); -#line 1384 "cs.ATG" +#line 1387 "cs.ATG" op = OverloadableOperatorType.Divide; break; } case 8: { lexer.NextToken(); -#line 1385 "cs.ATG" +#line 1388 "cs.ATG" op = OverloadableOperatorType.Modulus; break; } case 28: { lexer.NextToken(); -#line 1387 "cs.ATG" +#line 1390 "cs.ATG" op = OverloadableOperatorType.BitwiseAnd; break; } case 29: { lexer.NextToken(); -#line 1388 "cs.ATG" +#line 1391 "cs.ATG" op = OverloadableOperatorType.BitwiseOr; break; } case 30: { lexer.NextToken(); -#line 1389 "cs.ATG" +#line 1392 "cs.ATG" op = OverloadableOperatorType.ExclusiveOr; break; } case 37: { lexer.NextToken(); -#line 1391 "cs.ATG" +#line 1394 "cs.ATG" op = OverloadableOperatorType.ShiftLeft; break; } case 33: { lexer.NextToken(); -#line 1392 "cs.ATG" +#line 1395 "cs.ATG" op = OverloadableOperatorType.Equality; break; } case 34: { lexer.NextToken(); -#line 1393 "cs.ATG" +#line 1396 "cs.ATG" op = OverloadableOperatorType.InEquality; break; } case 23: { lexer.NextToken(); -#line 1394 "cs.ATG" +#line 1397 "cs.ATG" op = OverloadableOperatorType.LessThan; break; } case 35: { lexer.NextToken(); -#line 1395 "cs.ATG" +#line 1398 "cs.ATG" op = OverloadableOperatorType.GreaterThanOrEqual; break; } case 36: { lexer.NextToken(); -#line 1396 "cs.ATG" +#line 1399 "cs.ATG" op = OverloadableOperatorType.LessThanOrEqual; break; } case 22: { lexer.NextToken(); -#line 1397 "cs.ATG" +#line 1400 "cs.ATG" op = OverloadableOperatorType.GreaterThan; if (la.kind == 22) { lexer.NextToken(); -#line 1397 "cs.ATG" +#line 1400 "cs.ATG" op = OverloadableOperatorType.ShiftRight; } break; } - default: SynErr(183); break; + default: SynErr(185); break; } } void VariableDeclarator( -#line 1307 "cs.ATG" +#line 1310 "cs.ATG" FieldDeclaration parentFieldDeclaration) { -#line 1308 "cs.ATG" +#line 1311 "cs.ATG" Expression expr = null; Identifier(); -#line 1310 "cs.ATG" +#line 1313 "cs.ATG" VariableDeclaration f = new VariableDeclaration(t.val); f.StartLocation = t.Location; if (la.kind == 3) { lexer.NextToken(); VariableInitializer( -#line 1311 "cs.ATG" +#line 1314 "cs.ATG" out expr); -#line 1311 "cs.ATG" +#line 1314 "cs.ATG" f.Initializer = expr; } -#line 1312 "cs.ATG" +#line 1315 "cs.ATG" f.EndLocation = t.EndLocation; SafeAdd(parentFieldDeclaration, parentFieldDeclaration.Fields, f); } void AccessorDecls( -#line 1199 "cs.ATG" +#line 1202 "cs.ATG" out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { -#line 1201 "cs.ATG" +#line 1204 "cs.ATG" List attributes = new List(); AttributeSection section; getBlock = null; @@ -3020,92 +3035,92 @@ out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { while (la.kind == 18) { AttributeSection( -#line 1208 "cs.ATG" +#line 1211 "cs.ATG" out section); -#line 1208 "cs.ATG" +#line 1211 "cs.ATG" attributes.Add(section); } if (la.kind == 84 || la.kind == 96 || la.kind == 97) { AccessorModifiers( -#line 1209 "cs.ATG" +#line 1212 "cs.ATG" out modifiers); } if (la.kind == 128) { GetAccessorDecl( -#line 1211 "cs.ATG" +#line 1214 "cs.ATG" out getBlock, attributes); -#line 1212 "cs.ATG" +#line 1215 "cs.ATG" if (modifiers != null) {getBlock.Modifier = modifiers.Modifier; } if (StartOf(26)) { -#line 1213 "cs.ATG" +#line 1216 "cs.ATG" attributes = new List(); modifiers = null; while (la.kind == 18) { AttributeSection( -#line 1214 "cs.ATG" +#line 1217 "cs.ATG" out section); -#line 1214 "cs.ATG" +#line 1217 "cs.ATG" attributes.Add(section); } if (la.kind == 84 || la.kind == 96 || la.kind == 97) { AccessorModifiers( -#line 1215 "cs.ATG" +#line 1218 "cs.ATG" out modifiers); } SetAccessorDecl( -#line 1216 "cs.ATG" +#line 1219 "cs.ATG" out setBlock, attributes); -#line 1217 "cs.ATG" +#line 1220 "cs.ATG" if (modifiers != null) {setBlock.Modifier = modifiers.Modifier; } } } else if (la.kind == 129) { SetAccessorDecl( -#line 1220 "cs.ATG" +#line 1223 "cs.ATG" out setBlock, attributes); -#line 1221 "cs.ATG" +#line 1224 "cs.ATG" if (modifiers != null) {setBlock.Modifier = modifiers.Modifier; } if (StartOf(27)) { -#line 1222 "cs.ATG" +#line 1225 "cs.ATG" attributes = new List(); modifiers = null; while (la.kind == 18) { AttributeSection( -#line 1223 "cs.ATG" +#line 1226 "cs.ATG" out section); -#line 1223 "cs.ATG" +#line 1226 "cs.ATG" attributes.Add(section); } if (la.kind == 84 || la.kind == 96 || la.kind == 97) { AccessorModifiers( -#line 1224 "cs.ATG" +#line 1227 "cs.ATG" out modifiers); } GetAccessorDecl( -#line 1225 "cs.ATG" +#line 1228 "cs.ATG" out getBlock, attributes); -#line 1226 "cs.ATG" +#line 1229 "cs.ATG" if (modifiers != null) {getBlock.Modifier = modifiers.Modifier; } } } else if (StartOf(18)) { Identifier(); -#line 1228 "cs.ATG" +#line 1231 "cs.ATG" Error("get or set accessor declaration expected"); - } else SynErr(184); + } else SynErr(186); } void InterfaceAccessors( -#line 1273 "cs.ATG" +#line 1276 "cs.ATG" out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { -#line 1275 "cs.ATG" +#line 1278 "cs.ATG" AttributeSection section; List attributes = new List(); getBlock = null; setBlock = null; @@ -3113,218 +3128,218 @@ out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { while (la.kind == 18) { AttributeSection( -#line 1281 "cs.ATG" +#line 1284 "cs.ATG" out section); -#line 1281 "cs.ATG" +#line 1284 "cs.ATG" attributes.Add(section); } -#line 1282 "cs.ATG" +#line 1285 "cs.ATG" Location startLocation = la.Location; if (la.kind == 128) { lexer.NextToken(); -#line 1284 "cs.ATG" +#line 1287 "cs.ATG" getBlock = new PropertyGetRegion(null, attributes); } else if (la.kind == 129) { lexer.NextToken(); -#line 1285 "cs.ATG" +#line 1288 "cs.ATG" setBlock = new PropertySetRegion(null, attributes); - } else SynErr(185); + } else SynErr(187); Expect(11); -#line 1288 "cs.ATG" +#line 1291 "cs.ATG" if (getBlock != null) { getBlock.StartLocation = startLocation; getBlock.EndLocation = t.EndLocation; } if (setBlock != null) { setBlock.StartLocation = startLocation; setBlock.EndLocation = t.EndLocation; } attributes = new List(); if (la.kind == 18 || la.kind == 128 || la.kind == 129) { while (la.kind == 18) { AttributeSection( -#line 1292 "cs.ATG" +#line 1295 "cs.ATG" out section); -#line 1292 "cs.ATG" +#line 1295 "cs.ATG" attributes.Add(section); } -#line 1293 "cs.ATG" +#line 1296 "cs.ATG" startLocation = la.Location; if (la.kind == 128) { lexer.NextToken(); -#line 1295 "cs.ATG" +#line 1298 "cs.ATG" if (getBlock != null) Error("get already declared"); else { getBlock = new PropertyGetRegion(null, attributes); lastBlock = getBlock; } } else if (la.kind == 129) { lexer.NextToken(); -#line 1298 "cs.ATG" +#line 1301 "cs.ATG" if (setBlock != null) Error("set already declared"); else { setBlock = new PropertySetRegion(null, attributes); lastBlock = setBlock; } - } else SynErr(186); + } else SynErr(188); Expect(11); -#line 1303 "cs.ATG" +#line 1306 "cs.ATG" if (lastBlock != null) { lastBlock.StartLocation = startLocation; lastBlock.EndLocation = t.EndLocation; } } } void GetAccessorDecl( -#line 1232 "cs.ATG" +#line 1235 "cs.ATG" out PropertyGetRegion getBlock, List attributes) { -#line 1233 "cs.ATG" +#line 1236 "cs.ATG" BlockStatement stmt = null; Expect(128); -#line 1236 "cs.ATG" +#line 1239 "cs.ATG" Location startLocation = t.Location; if (la.kind == 16) { Block( -#line 1237 "cs.ATG" +#line 1240 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); - } else SynErr(187); + } else SynErr(189); -#line 1238 "cs.ATG" +#line 1241 "cs.ATG" getBlock = new PropertyGetRegion(stmt, attributes); -#line 1239 "cs.ATG" +#line 1242 "cs.ATG" getBlock.StartLocation = startLocation; getBlock.EndLocation = t.EndLocation; } void SetAccessorDecl( -#line 1242 "cs.ATG" +#line 1245 "cs.ATG" out PropertySetRegion setBlock, List attributes) { -#line 1243 "cs.ATG" +#line 1246 "cs.ATG" BlockStatement stmt = null; Expect(129); -#line 1246 "cs.ATG" +#line 1249 "cs.ATG" Location startLocation = t.Location; if (la.kind == 16) { Block( -#line 1247 "cs.ATG" +#line 1250 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); - } else SynErr(188); + } else SynErr(190); -#line 1248 "cs.ATG" +#line 1251 "cs.ATG" setBlock = new PropertySetRegion(stmt, attributes); -#line 1249 "cs.ATG" +#line 1252 "cs.ATG" setBlock.StartLocation = startLocation; setBlock.EndLocation = t.EndLocation; } void AddAccessorDecl( -#line 1331 "cs.ATG" +#line 1334 "cs.ATG" out BlockStatement stmt) { -#line 1332 "cs.ATG" +#line 1335 "cs.ATG" stmt = null; Expect(130); Block( -#line 1335 "cs.ATG" +#line 1338 "cs.ATG" out stmt); } void RemoveAccessorDecl( -#line 1338 "cs.ATG" +#line 1341 "cs.ATG" out BlockStatement stmt) { -#line 1339 "cs.ATG" +#line 1342 "cs.ATG" stmt = null; Expect(131); Block( -#line 1342 "cs.ATG" +#line 1345 "cs.ATG" out stmt); } void VariableInitializer( -#line 1360 "cs.ATG" +#line 1363 "cs.ATG" out Expression initializerExpression) { -#line 1361 "cs.ATG" +#line 1364 "cs.ATG" TypeReference type = null; Expression expr = null; initializerExpression = null; if (StartOf(6)) { Expr( -#line 1363 "cs.ATG" +#line 1366 "cs.ATG" out initializerExpression); } else if (la.kind == 16) { CollectionInitializer( -#line 1364 "cs.ATG" +#line 1367 "cs.ATG" out initializerExpression); } else if (la.kind == 106) { lexer.NextToken(); Type( -#line 1365 "cs.ATG" +#line 1368 "cs.ATG" out type); Expect(18); Expr( -#line 1365 "cs.ATG" +#line 1368 "cs.ATG" out expr); Expect(19); -#line 1365 "cs.ATG" +#line 1368 "cs.ATG" initializerExpression = new StackAllocExpression(type, expr); - } else SynErr(189); + } else SynErr(191); } void Statement() { -#line 1522 "cs.ATG" +#line 1525 "cs.ATG" Statement stmt = null; Location startPos = la.Location; - while (!(StartOf(28))) {SynErr(190); lexer.NextToken(); } + while (!(StartOf(28))) {SynErr(192); lexer.NextToken(); } if ( -#line 1529 "cs.ATG" +#line 1532 "cs.ATG" IsLabel()) { Identifier(); -#line 1529 "cs.ATG" +#line 1532 "cs.ATG" AddChild(new LabelStatement(t.val)); Expect(9); Statement(); } else if (la.kind == 60) { lexer.NextToken(); LocalVariableDecl( -#line 1533 "cs.ATG" +#line 1536 "cs.ATG" out stmt); -#line 1534 "cs.ATG" +#line 1537 "cs.ATG" if (stmt != null) { ((LocalVariableDeclaration)stmt).Modifier |= Modifiers.Const; } Expect(11); -#line 1535 "cs.ATG" +#line 1538 "cs.ATG" AddChild(stmt); } else if ( -#line 1537 "cs.ATG" +#line 1540 "cs.ATG" IsLocalVarDecl()) { LocalVariableDecl( -#line 1537 "cs.ATG" +#line 1540 "cs.ATG" out stmt); Expect(11); -#line 1537 "cs.ATG" +#line 1540 "cs.ATG" AddChild(stmt); } else if (StartOf(29)) { EmbeddedStatement( -#line 1539 "cs.ATG" +#line 1542 "cs.ATG" out stmt); -#line 1539 "cs.ATG" +#line 1542 "cs.ATG" AddChild(stmt); - } else SynErr(191); + } else SynErr(193); -#line 1545 "cs.ATG" +#line 1548 "cs.ATG" if (stmt != null) { stmt.StartLocation = startPos; stmt.EndLocation = t.EndLocation; @@ -3333,63 +3348,63 @@ out stmt); } void Argument( -#line 1400 "cs.ATG" +#line 1403 "cs.ATG" out Expression argumentexpr) { -#line 1401 "cs.ATG" +#line 1404 "cs.ATG" argumentexpr = null; if ( -#line 1403 "cs.ATG" +#line 1406 "cs.ATG" IdentAndColon()) { -#line 1404 "cs.ATG" +#line 1407 "cs.ATG" Token ident; Expression expr; Identifier(); -#line 1405 "cs.ATG" +#line 1408 "cs.ATG" ident = t; Expect(9); ArgumentValue( -#line 1407 "cs.ATG" +#line 1410 "cs.ATG" out expr); -#line 1408 "cs.ATG" +#line 1411 "cs.ATG" argumentexpr = new NamedArgumentExpression(ident.val, expr) { StartLocation = ident.Location, EndLocation = t.EndLocation }; } else if (StartOf(25)) { ArgumentValue( -#line 1410 "cs.ATG" +#line 1413 "cs.ATG" out argumentexpr); - } else SynErr(192); + } else SynErr(194); } void CollectionInitializer( -#line 1444 "cs.ATG" +#line 1447 "cs.ATG" out Expression outExpr) { -#line 1446 "cs.ATG" +#line 1449 "cs.ATG" Expression expr = null; CollectionInitializerExpression initializer = new CollectionInitializerExpression(); Expect(16); -#line 1450 "cs.ATG" +#line 1453 "cs.ATG" initializer.StartLocation = t.Location; if (StartOf(30)) { VariableInitializer( -#line 1451 "cs.ATG" +#line 1454 "cs.ATG" out expr); -#line 1452 "cs.ATG" +#line 1455 "cs.ATG" SafeAdd(initializer, initializer.CreateExpressions, expr); while ( -#line 1453 "cs.ATG" +#line 1456 "cs.ATG" NotFinalComma()) { Expect(14); VariableInitializer( -#line 1454 "cs.ATG" +#line 1457 "cs.ATG" out expr); -#line 1455 "cs.ATG" +#line 1458 "cs.ATG" SafeAdd(initializer, initializer.CreateExpressions, expr); } if (la.kind == 14) { @@ -3398,15 +3413,15 @@ out expr); } Expect(17); -#line 1459 "cs.ATG" +#line 1462 "cs.ATG" initializer.EndLocation = t.Location; outExpr = initializer; } void ArgumentValue( -#line 1413 "cs.ATG" +#line 1416 "cs.ATG" out Expression argumentexpr) { -#line 1415 "cs.ATG" +#line 1418 "cs.ATG" Expression expr; FieldDirection fd = FieldDirection.None; @@ -3414,118 +3429,118 @@ out Expression argumentexpr) { if (la.kind == 100) { lexer.NextToken(); -#line 1420 "cs.ATG" +#line 1423 "cs.ATG" fd = FieldDirection.Ref; } else { lexer.NextToken(); -#line 1421 "cs.ATG" +#line 1424 "cs.ATG" fd = FieldDirection.Out; } } Expr( -#line 1423 "cs.ATG" +#line 1426 "cs.ATG" out expr); -#line 1424 "cs.ATG" +#line 1427 "cs.ATG" argumentexpr = fd != FieldDirection.None ? argumentexpr = new DirectionExpression(fd, expr) : expr; } void AssignmentOperator( -#line 1427 "cs.ATG" +#line 1430 "cs.ATG" out AssignmentOperatorType op) { -#line 1428 "cs.ATG" +#line 1431 "cs.ATG" op = AssignmentOperatorType.None; if (la.kind == 3) { lexer.NextToken(); -#line 1430 "cs.ATG" +#line 1433 "cs.ATG" op = AssignmentOperatorType.Assign; } else if (la.kind == 38) { lexer.NextToken(); -#line 1431 "cs.ATG" +#line 1434 "cs.ATG" op = AssignmentOperatorType.Add; } else if (la.kind == 39) { lexer.NextToken(); -#line 1432 "cs.ATG" +#line 1435 "cs.ATG" op = AssignmentOperatorType.Subtract; } else if (la.kind == 40) { lexer.NextToken(); -#line 1433 "cs.ATG" +#line 1436 "cs.ATG" op = AssignmentOperatorType.Multiply; } else if (la.kind == 41) { lexer.NextToken(); -#line 1434 "cs.ATG" +#line 1437 "cs.ATG" op = AssignmentOperatorType.Divide; } else if (la.kind == 42) { lexer.NextToken(); -#line 1435 "cs.ATG" +#line 1438 "cs.ATG" op = AssignmentOperatorType.Modulus; } else if (la.kind == 43) { lexer.NextToken(); -#line 1436 "cs.ATG" +#line 1439 "cs.ATG" op = AssignmentOperatorType.BitwiseAnd; } else if (la.kind == 44) { lexer.NextToken(); -#line 1437 "cs.ATG" +#line 1440 "cs.ATG" op = AssignmentOperatorType.BitwiseOr; } else if (la.kind == 45) { lexer.NextToken(); -#line 1438 "cs.ATG" +#line 1441 "cs.ATG" op = AssignmentOperatorType.ExclusiveOr; } else if (la.kind == 46) { lexer.NextToken(); -#line 1439 "cs.ATG" +#line 1442 "cs.ATG" op = AssignmentOperatorType.ShiftLeft; } else if ( -#line 1440 "cs.ATG" +#line 1443 "cs.ATG" la.kind == Tokens.GreaterThan && Peek(1).kind == Tokens.GreaterEqual) { Expect(22); Expect(35); -#line 1441 "cs.ATG" +#line 1444 "cs.ATG" op = AssignmentOperatorType.ShiftRight; - } else SynErr(193); + } else SynErr(195); } void CollectionOrObjectInitializer( -#line 1462 "cs.ATG" +#line 1465 "cs.ATG" out Expression outExpr) { -#line 1464 "cs.ATG" +#line 1467 "cs.ATG" Expression expr = null; CollectionInitializerExpression initializer = new CollectionInitializerExpression(); Expect(16); -#line 1468 "cs.ATG" +#line 1471 "cs.ATG" initializer.StartLocation = t.Location; if (StartOf(30)) { ObjectPropertyInitializerOrVariableInitializer( -#line 1469 "cs.ATG" +#line 1472 "cs.ATG" out expr); -#line 1470 "cs.ATG" +#line 1473 "cs.ATG" SafeAdd(initializer, initializer.CreateExpressions, expr); while ( -#line 1471 "cs.ATG" +#line 1474 "cs.ATG" NotFinalComma()) { Expect(14); ObjectPropertyInitializerOrVariableInitializer( -#line 1472 "cs.ATG" +#line 1475 "cs.ATG" out expr); -#line 1473 "cs.ATG" +#line 1476 "cs.ATG" SafeAdd(initializer, initializer.CreateExpressions, expr); } if (la.kind == 14) { @@ -3534,22 +3549,22 @@ out expr); } Expect(17); -#line 1477 "cs.ATG" +#line 1480 "cs.ATG" initializer.EndLocation = t.Location; outExpr = initializer; } void ObjectPropertyInitializerOrVariableInitializer( -#line 1480 "cs.ATG" +#line 1483 "cs.ATG" out Expression expr) { -#line 1481 "cs.ATG" +#line 1484 "cs.ATG" expr = null; if ( -#line 1483 "cs.ATG" +#line 1486 "cs.ATG" IdentAndAsgn()) { Identifier(); -#line 1485 "cs.ATG" +#line 1488 "cs.ATG" MemberInitializerExpression mie = new MemberInitializerExpression(t.val, null); mie.StartLocation = t.Location; mie.IsKey = true; @@ -3557,88 +3572,88 @@ IdentAndAsgn()) { Expect(3); if (la.kind == 16) { CollectionOrObjectInitializer( -#line 1490 "cs.ATG" +#line 1493 "cs.ATG" out r); } else if (StartOf(30)) { VariableInitializer( -#line 1491 "cs.ATG" +#line 1494 "cs.ATG" out r); - } else SynErr(194); + } else SynErr(196); -#line 1492 "cs.ATG" +#line 1495 "cs.ATG" mie.Expression = r; mie.EndLocation = t.EndLocation; expr = mie; } else if (StartOf(30)) { VariableInitializer( -#line 1494 "cs.ATG" +#line 1497 "cs.ATG" out expr); - } else SynErr(195); + } else SynErr(197); } void LocalVariableDecl( -#line 1498 "cs.ATG" +#line 1501 "cs.ATG" out Statement stmt) { -#line 1500 "cs.ATG" +#line 1503 "cs.ATG" TypeReference type; VariableDeclaration var = null; LocalVariableDeclaration localVariableDeclaration; Location startPos = la.Location; Type( -#line 1506 "cs.ATG" +#line 1509 "cs.ATG" out type); -#line 1506 "cs.ATG" +#line 1509 "cs.ATG" localVariableDeclaration = new LocalVariableDeclaration(type); localVariableDeclaration.StartLocation = startPos; LocalVariableDeclarator( -#line 1507 "cs.ATG" +#line 1510 "cs.ATG" out var); -#line 1507 "cs.ATG" +#line 1510 "cs.ATG" SafeAdd(localVariableDeclaration, localVariableDeclaration.Variables, var); while (la.kind == 14) { lexer.NextToken(); LocalVariableDeclarator( -#line 1508 "cs.ATG" +#line 1511 "cs.ATG" out var); -#line 1508 "cs.ATG" +#line 1511 "cs.ATG" SafeAdd(localVariableDeclaration, localVariableDeclaration.Variables, var); } -#line 1509 "cs.ATG" +#line 1512 "cs.ATG" stmt = localVariableDeclaration; stmt.EndLocation = t.EndLocation; } void LocalVariableDeclarator( -#line 1512 "cs.ATG" +#line 1515 "cs.ATG" out VariableDeclaration var) { -#line 1513 "cs.ATG" +#line 1516 "cs.ATG" Expression expr = null; Identifier(); -#line 1515 "cs.ATG" +#line 1518 "cs.ATG" var = new VariableDeclaration(t.val); var.StartLocation = t.Location; if (la.kind == 3) { lexer.NextToken(); VariableInitializer( -#line 1516 "cs.ATG" +#line 1519 "cs.ATG" out expr); -#line 1516 "cs.ATG" +#line 1519 "cs.ATG" var.Initializer = expr; } -#line 1517 "cs.ATG" +#line 1520 "cs.ATG" var.EndLocation = t.EndLocation; } void EmbeddedStatement( -#line 1552 "cs.ATG" +#line 1555 "cs.ATG" out Statement statement) { -#line 1554 "cs.ATG" +#line 1557 "cs.ATG" TypeReference type = null; Expression expr = null; Statement embeddedStatement = null; @@ -3646,264 +3661,264 @@ out Statement statement) { statement = null; -#line 1561 "cs.ATG" +#line 1564 "cs.ATG" Location startLocation = la.Location; if (la.kind == 16) { Block( -#line 1563 "cs.ATG" +#line 1566 "cs.ATG" out block); -#line 1563 "cs.ATG" +#line 1566 "cs.ATG" statement = block; } else if (la.kind == 11) { lexer.NextToken(); -#line 1566 "cs.ATG" +#line 1569 "cs.ATG" statement = new EmptyStatement(); } else if ( -#line 1569 "cs.ATG" +#line 1572 "cs.ATG" UnCheckedAndLBrace()) { -#line 1569 "cs.ATG" +#line 1572 "cs.ATG" bool isChecked = true; if (la.kind == 58) { lexer.NextToken(); } else if (la.kind == 118) { lexer.NextToken(); -#line 1570 "cs.ATG" +#line 1573 "cs.ATG" isChecked = false; - } else SynErr(196); + } else SynErr(198); Block( -#line 1571 "cs.ATG" +#line 1574 "cs.ATG" out block); -#line 1571 "cs.ATG" +#line 1574 "cs.ATG" statement = isChecked ? (Statement)new CheckedStatement(block) : (Statement)new UncheckedStatement(block); } else if (la.kind == 79) { IfStatement( -#line 1574 "cs.ATG" +#line 1577 "cs.ATG" out statement); } else if (la.kind == 110) { lexer.NextToken(); -#line 1576 "cs.ATG" +#line 1579 "cs.ATG" List switchSections = new List(); Expect(20); Expr( -#line 1577 "cs.ATG" +#line 1580 "cs.ATG" out expr); Expect(21); Expect(16); SwitchSections( -#line 1578 "cs.ATG" +#line 1581 "cs.ATG" switchSections); Expect(17); -#line 1580 "cs.ATG" +#line 1583 "cs.ATG" statement = new SwitchStatement(expr, switchSections); } else if (la.kind == 125) { lexer.NextToken(); Expect(20); Expr( -#line 1583 "cs.ATG" +#line 1586 "cs.ATG" out expr); Expect(21); EmbeddedStatement( -#line 1584 "cs.ATG" +#line 1587 "cs.ATG" out embeddedStatement); -#line 1585 "cs.ATG" +#line 1588 "cs.ATG" statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.Start); } else if (la.kind == 65) { lexer.NextToken(); EmbeddedStatement( -#line 1587 "cs.ATG" +#line 1590 "cs.ATG" out embeddedStatement); Expect(125); Expect(20); Expr( -#line 1588 "cs.ATG" +#line 1591 "cs.ATG" out expr); Expect(21); Expect(11); -#line 1589 "cs.ATG" +#line 1592 "cs.ATG" statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.End); } else if (la.kind == 76) { lexer.NextToken(); -#line 1591 "cs.ATG" +#line 1594 "cs.ATG" List initializer = null; List iterator = null; Expect(20); if (StartOf(6)) { ForInitializer( -#line 1592 "cs.ATG" +#line 1595 "cs.ATG" out initializer); } Expect(11); if (StartOf(6)) { Expr( -#line 1593 "cs.ATG" +#line 1596 "cs.ATG" out expr); } Expect(11); if (StartOf(6)) { ForIterator( -#line 1594 "cs.ATG" +#line 1597 "cs.ATG" out iterator); } Expect(21); EmbeddedStatement( -#line 1595 "cs.ATG" +#line 1598 "cs.ATG" out embeddedStatement); -#line 1596 "cs.ATG" +#line 1599 "cs.ATG" statement = new ForStatement(initializer, expr, iterator, embeddedStatement); } else if (la.kind == 77) { lexer.NextToken(); Expect(20); Type( -#line 1598 "cs.ATG" +#line 1601 "cs.ATG" out type); Identifier(); -#line 1598 "cs.ATG" +#line 1601 "cs.ATG" string varName = t.val; Expect(81); Expr( -#line 1599 "cs.ATG" +#line 1602 "cs.ATG" out expr); Expect(21); EmbeddedStatement( -#line 1600 "cs.ATG" +#line 1603 "cs.ATG" out embeddedStatement); -#line 1601 "cs.ATG" +#line 1604 "cs.ATG" statement = new ForeachStatement(type, varName , expr, embeddedStatement); } else if (la.kind == 53) { lexer.NextToken(); Expect(11); -#line 1604 "cs.ATG" +#line 1607 "cs.ATG" statement = new BreakStatement(); } else if (la.kind == 61) { lexer.NextToken(); Expect(11); -#line 1605 "cs.ATG" +#line 1608 "cs.ATG" statement = new ContinueStatement(); } else if (la.kind == 78) { GotoStatement( -#line 1606 "cs.ATG" +#line 1609 "cs.ATG" out statement); } else if ( -#line 1608 "cs.ATG" +#line 1611 "cs.ATG" IsYieldStatement()) { Expect(132); if (la.kind == 101) { lexer.NextToken(); Expr( -#line 1609 "cs.ATG" +#line 1612 "cs.ATG" out expr); -#line 1609 "cs.ATG" +#line 1612 "cs.ATG" statement = new YieldStatement(new ReturnStatement(expr)); } else if (la.kind == 53) { lexer.NextToken(); -#line 1610 "cs.ATG" +#line 1613 "cs.ATG" statement = new YieldStatement(new BreakStatement()); - } else SynErr(197); + } else SynErr(199); Expect(11); } else if (la.kind == 101) { lexer.NextToken(); if (StartOf(6)) { Expr( -#line 1613 "cs.ATG" +#line 1616 "cs.ATG" out expr); } Expect(11); -#line 1613 "cs.ATG" +#line 1616 "cs.ATG" statement = new ReturnStatement(expr); } else if (la.kind == 112) { lexer.NextToken(); if (StartOf(6)) { Expr( -#line 1614 "cs.ATG" +#line 1617 "cs.ATG" out expr); } Expect(11); -#line 1614 "cs.ATG" +#line 1617 "cs.ATG" statement = new ThrowStatement(expr); } else if (StartOf(6)) { StatementExpr( -#line 1617 "cs.ATG" +#line 1620 "cs.ATG" out statement); - while (!(la.kind == 0 || la.kind == 11)) {SynErr(198); lexer.NextToken(); } + while (!(la.kind == 0 || la.kind == 11)) {SynErr(200); lexer.NextToken(); } Expect(11); } else if (la.kind == 114) { TryStatement( -#line 1620 "cs.ATG" +#line 1623 "cs.ATG" out statement); } else if (la.kind == 86) { lexer.NextToken(); Expect(20); Expr( -#line 1623 "cs.ATG" +#line 1626 "cs.ATG" out expr); Expect(21); EmbeddedStatement( -#line 1624 "cs.ATG" +#line 1627 "cs.ATG" out embeddedStatement); -#line 1624 "cs.ATG" +#line 1627 "cs.ATG" statement = new LockStatement(expr, embeddedStatement); } else if (la.kind == 121) { -#line 1627 "cs.ATG" +#line 1630 "cs.ATG" Statement resourceAcquisitionStmt = null; lexer.NextToken(); Expect(20); ResourceAcquisition( -#line 1629 "cs.ATG" +#line 1632 "cs.ATG" out resourceAcquisitionStmt); Expect(21); EmbeddedStatement( -#line 1630 "cs.ATG" +#line 1633 "cs.ATG" out embeddedStatement); -#line 1630 "cs.ATG" +#line 1633 "cs.ATG" statement = new UsingStatement(resourceAcquisitionStmt, embeddedStatement); } else if (la.kind == 119) { lexer.NextToken(); Block( -#line 1633 "cs.ATG" +#line 1636 "cs.ATG" out block); -#line 1633 "cs.ATG" +#line 1636 "cs.ATG" statement = new UnsafeStatement(block); } else if (la.kind == 74) { -#line 1635 "cs.ATG" +#line 1638 "cs.ATG" Statement pointerDeclarationStmt = null; lexer.NextToken(); Expect(20); ResourceAcquisition( -#line 1637 "cs.ATG" +#line 1640 "cs.ATG" out pointerDeclarationStmt); Expect(21); EmbeddedStatement( -#line 1638 "cs.ATG" +#line 1641 "cs.ATG" out embeddedStatement); -#line 1638 "cs.ATG" +#line 1641 "cs.ATG" statement = new FixedStatement(pointerDeclarationStmt, embeddedStatement); - } else SynErr(199); + } else SynErr(201); -#line 1640 "cs.ATG" +#line 1643 "cs.ATG" if (statement != null) { statement.StartLocation = startLocation; statement.EndLocation = t.EndLocation; @@ -3912,10 +3927,10 @@ out embeddedStatement); } void IfStatement( -#line 1647 "cs.ATG" +#line 1650 "cs.ATG" out Statement statement) { -#line 1649 "cs.ATG" +#line 1652 "cs.ATG" Expression expr = null; Statement embeddedStatement = null; statement = null; @@ -3923,26 +3938,26 @@ out Statement statement) { Expect(79); Expect(20); Expr( -#line 1655 "cs.ATG" +#line 1658 "cs.ATG" out expr); Expect(21); EmbeddedStatement( -#line 1656 "cs.ATG" +#line 1659 "cs.ATG" out embeddedStatement); -#line 1657 "cs.ATG" +#line 1660 "cs.ATG" Statement elseStatement = null; if (la.kind == 67) { lexer.NextToken(); EmbeddedStatement( -#line 1658 "cs.ATG" +#line 1661 "cs.ATG" out elseStatement); } -#line 1659 "cs.ATG" +#line 1662 "cs.ATG" statement = elseStatement != null ? new IfElseStatement(expr, embeddedStatement, elseStatement) : new IfElseStatement(expr, embeddedStatement); -#line 1660 "cs.ATG" +#line 1663 "cs.ATG" if (elseStatement is IfElseStatement && (elseStatement as IfElseStatement).TrueStatement.Count == 1) { /* else if-section (otherwise we would have a BlockStatment) */ (statement as IfElseStatement).ElseIfSections.Add( @@ -3955,29 +3970,29 @@ out elseStatement); } void SwitchSections( -#line 1690 "cs.ATG" +#line 1693 "cs.ATG" List switchSections) { -#line 1692 "cs.ATG" +#line 1695 "cs.ATG" SwitchSection switchSection = new SwitchSection(); CaseLabel label; SwitchLabel( -#line 1696 "cs.ATG" +#line 1699 "cs.ATG" out label); -#line 1696 "cs.ATG" +#line 1699 "cs.ATG" SafeAdd(switchSection, switchSection.SwitchLabels, label); -#line 1697 "cs.ATG" +#line 1700 "cs.ATG" BlockStart(switchSection); while (StartOf(31)) { if (la.kind == 55 || la.kind == 63) { SwitchLabel( -#line 1699 "cs.ATG" +#line 1702 "cs.ATG" out label); -#line 1700 "cs.ATG" +#line 1703 "cs.ATG" if (label != null) { if (switchSection.Children.Count > 0) { // open new section @@ -3993,145 +4008,145 @@ out label); } } -#line 1712 "cs.ATG" +#line 1715 "cs.ATG" BlockEnd(); switchSections.Add(switchSection); } void ForInitializer( -#line 1671 "cs.ATG" +#line 1674 "cs.ATG" out List initializer) { -#line 1673 "cs.ATG" +#line 1676 "cs.ATG" Statement stmt; initializer = new List(); if ( -#line 1677 "cs.ATG" +#line 1680 "cs.ATG" IsLocalVarDecl()) { LocalVariableDecl( -#line 1677 "cs.ATG" +#line 1680 "cs.ATG" out stmt); -#line 1677 "cs.ATG" +#line 1680 "cs.ATG" initializer.Add(stmt); } else if (StartOf(6)) { StatementExpr( -#line 1678 "cs.ATG" +#line 1681 "cs.ATG" out stmt); -#line 1678 "cs.ATG" +#line 1681 "cs.ATG" initializer.Add(stmt); while (la.kind == 14) { lexer.NextToken(); StatementExpr( -#line 1678 "cs.ATG" +#line 1681 "cs.ATG" out stmt); -#line 1678 "cs.ATG" +#line 1681 "cs.ATG" initializer.Add(stmt); } - } else SynErr(200); + } else SynErr(202); } void ForIterator( -#line 1681 "cs.ATG" +#line 1684 "cs.ATG" out List iterator) { -#line 1683 "cs.ATG" +#line 1686 "cs.ATG" Statement stmt; iterator = new List(); StatementExpr( -#line 1687 "cs.ATG" +#line 1690 "cs.ATG" out stmt); -#line 1687 "cs.ATG" +#line 1690 "cs.ATG" iterator.Add(stmt); while (la.kind == 14) { lexer.NextToken(); StatementExpr( -#line 1687 "cs.ATG" +#line 1690 "cs.ATG" out stmt); -#line 1687 "cs.ATG" +#line 1690 "cs.ATG" iterator.Add(stmt); } } void GotoStatement( -#line 1769 "cs.ATG" +#line 1772 "cs.ATG" out Statement stmt) { -#line 1770 "cs.ATG" +#line 1773 "cs.ATG" Expression expr; stmt = null; Expect(78); if (StartOf(18)) { Identifier(); -#line 1774 "cs.ATG" +#line 1777 "cs.ATG" stmt = new GotoStatement(t.val); Expect(11); } else if (la.kind == 55) { lexer.NextToken(); Expr( -#line 1775 "cs.ATG" +#line 1778 "cs.ATG" out expr); Expect(11); -#line 1775 "cs.ATG" +#line 1778 "cs.ATG" stmt = new GotoCaseStatement(expr); } else if (la.kind == 63) { lexer.NextToken(); Expect(11); -#line 1776 "cs.ATG" +#line 1779 "cs.ATG" stmt = new GotoCaseStatement(null); - } else SynErr(201); + } else SynErr(203); } void StatementExpr( -#line 1796 "cs.ATG" +#line 1799 "cs.ATG" out Statement stmt) { -#line 1797 "cs.ATG" +#line 1800 "cs.ATG" Expression expr; Expr( -#line 1799 "cs.ATG" +#line 1802 "cs.ATG" out expr); -#line 1802 "cs.ATG" +#line 1805 "cs.ATG" stmt = new ExpressionStatement(expr); } void TryStatement( -#line 1722 "cs.ATG" +#line 1725 "cs.ATG" out Statement tryStatement) { -#line 1724 "cs.ATG" +#line 1727 "cs.ATG" BlockStatement blockStmt = null, finallyStmt = null; CatchClause catchClause = null; List catchClauses = new List(); Expect(114); Block( -#line 1729 "cs.ATG" +#line 1732 "cs.ATG" out blockStmt); while (la.kind == 56) { CatchClause( -#line 1731 "cs.ATG" +#line 1734 "cs.ATG" out catchClause); -#line 1732 "cs.ATG" +#line 1735 "cs.ATG" if (catchClause != null) catchClauses.Add(catchClause); } if (la.kind == 73) { lexer.NextToken(); Block( -#line 1734 "cs.ATG" +#line 1737 "cs.ATG" out finallyStmt); } -#line 1736 "cs.ATG" +#line 1739 "cs.ATG" tryStatement = new TryCatchStatement(blockStmt, catchClauses, finallyStmt); if (catchClauses != null) { foreach (CatchClause cc in catchClauses) cc.Parent = tryStatement; @@ -4140,59 +4155,59 @@ out finallyStmt); } void ResourceAcquisition( -#line 1780 "cs.ATG" +#line 1783 "cs.ATG" out Statement stmt) { -#line 1782 "cs.ATG" +#line 1785 "cs.ATG" stmt = null; Expression expr; if ( -#line 1787 "cs.ATG" +#line 1790 "cs.ATG" IsLocalVarDecl()) { LocalVariableDecl( -#line 1787 "cs.ATG" +#line 1790 "cs.ATG" out stmt); } else if (StartOf(6)) { Expr( -#line 1788 "cs.ATG" +#line 1791 "cs.ATG" out expr); -#line 1792 "cs.ATG" +#line 1795 "cs.ATG" stmt = new ExpressionStatement(expr); - } else SynErr(202); + } else SynErr(204); } void SwitchLabel( -#line 1715 "cs.ATG" +#line 1718 "cs.ATG" out CaseLabel label) { -#line 1716 "cs.ATG" +#line 1719 "cs.ATG" Expression expr = null; label = null; if (la.kind == 55) { lexer.NextToken(); Expr( -#line 1718 "cs.ATG" +#line 1721 "cs.ATG" out expr); Expect(9); -#line 1718 "cs.ATG" +#line 1721 "cs.ATG" label = new CaseLabel(expr); } else if (la.kind == 63) { lexer.NextToken(); Expect(9); -#line 1719 "cs.ATG" +#line 1722 "cs.ATG" label = new CaseLabel(); - } else SynErr(203); + } else SynErr(205); } void CatchClause( -#line 1743 "cs.ATG" +#line 1746 "cs.ATG" out CatchClause catchClause) { Expect(56); -#line 1745 "cs.ATG" +#line 1748 "cs.ATG" string identifier; BlockStatement stmt; TypeReference typeRef; @@ -4201,35 +4216,35 @@ out CatchClause catchClause) { if (la.kind == 16) { Block( -#line 1753 "cs.ATG" +#line 1756 "cs.ATG" out stmt); -#line 1753 "cs.ATG" +#line 1756 "cs.ATG" catchClause = new CatchClause(stmt); } else if (la.kind == 20) { lexer.NextToken(); ClassType( -#line 1756 "cs.ATG" +#line 1759 "cs.ATG" out typeRef, false); -#line 1756 "cs.ATG" +#line 1759 "cs.ATG" identifier = null; if (StartOf(18)) { Identifier(); -#line 1757 "cs.ATG" +#line 1760 "cs.ATG" identifier = t.val; } Expect(21); Block( -#line 1758 "cs.ATG" +#line 1761 "cs.ATG" out stmt); -#line 1759 "cs.ATG" +#line 1762 "cs.ATG" catchClause = new CatchClause(typeRef, identifier, stmt); - } else SynErr(204); + } else SynErr(206); -#line 1762 "cs.ATG" +#line 1765 "cs.ATG" if (catchClause != null) { catchClause.StartLocation = startPos; catchClause.EndLocation = t.Location; @@ -4238,75 +4253,80 @@ out stmt); } void UnaryExpr( -#line 1831 "cs.ATG" +#line 1834 "cs.ATG" out Expression uExpr) { -#line 1833 "cs.ATG" +#line 1836 "cs.ATG" TypeReference type = null; Expression expr = null; ArrayList expressions = new ArrayList(); uExpr = null; while (StartOf(32) || -#line 1855 "cs.ATG" +#line 1859 "cs.ATG" IsTypeCast()) { if (la.kind == 4) { lexer.NextToken(); -#line 1842 "cs.ATG" +#line 1845 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Plus) { StartLocation = t.Location }); } else if (la.kind == 5) { lexer.NextToken(); -#line 1843 "cs.ATG" +#line 1846 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Minus) { StartLocation = t.Location }); } else if (la.kind == 24) { lexer.NextToken(); -#line 1844 "cs.ATG" +#line 1847 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Not) { StartLocation = t.Location }); } else if (la.kind == 27) { lexer.NextToken(); -#line 1845 "cs.ATG" +#line 1848 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.BitNot) { StartLocation = t.Location }); } else if (la.kind == 6) { lexer.NextToken(); -#line 1846 "cs.ATG" +#line 1849 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Dereference) { StartLocation = t.Location }); } else if (la.kind == 31) { lexer.NextToken(); -#line 1847 "cs.ATG" +#line 1850 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Increment) { StartLocation = t.Location }); } else if (la.kind == 32) { lexer.NextToken(); -#line 1848 "cs.ATG" +#line 1851 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Decrement) { StartLocation = t.Location }); } else if (la.kind == 28) { lexer.NextToken(); -#line 1849 "cs.ATG" +#line 1852 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.AddressOf) { StartLocation = t.Location }); + } else if (la.kind == 146) { + lexer.NextToken(); + +#line 1853 "cs.ATG" + expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Await) { StartLocation = t.Location }); } else { Expect(20); Type( -#line 1855 "cs.ATG" +#line 1859 "cs.ATG" out type); Expect(21); -#line 1855 "cs.ATG" +#line 1859 "cs.ATG" expressions.Add(new CastExpression(type) { StartLocation = t.Location }); } } if ( -#line 1860 "cs.ATG" +#line 1864 "cs.ATG" LastExpressionIsUnaryMinus(expressions) && IsMostNegativeIntegerWithoutTypeSuffix()) { Expect(2); -#line 1863 "cs.ATG" +#line 1867 "cs.ATG" expressions.RemoveAt(expressions.Count - 1); if (t.literalValue is uint) { expr = new PrimitiveExpression(int.MinValue, int.MinValue.ToString()); @@ -4318,11 +4338,11 @@ LastExpressionIsUnaryMinus(expressions) && IsMostNegativeIntegerWithoutTypeSuffi } else if (StartOf(33)) { PrimaryExpr( -#line 1872 "cs.ATG" +#line 1876 "cs.ATG" out expr); - } else SynErr(205); + } else SynErr(207); -#line 1874 "cs.ATG" +#line 1878 "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) { @@ -4340,325 +4360,363 @@ out expr); } void ConditionalOrExpr( -#line 2184 "cs.ATG" +#line 2204 "cs.ATG" ref Expression outExpr) { -#line 2185 "cs.ATG" +#line 2205 "cs.ATG" Expression expr; Location startLocation = la.Location; ConditionalAndExpr( -#line 2187 "cs.ATG" +#line 2207 "cs.ATG" ref outExpr); while (la.kind == 26) { lexer.NextToken(); UnaryExpr( -#line 2187 "cs.ATG" +#line 2207 "cs.ATG" out expr); ConditionalAndExpr( -#line 2187 "cs.ATG" +#line 2207 "cs.ATG" ref expr); -#line 2187 "cs.ATG" +#line 2207 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalOr, expr) { StartLocation = startLocation, EndLocation = t.EndLocation }; } } void PrimaryExpr( -#line 1891 "cs.ATG" +#line 1895 "cs.ATG" out Expression pexpr) { -#line 1893 "cs.ATG" +#line 1897 "cs.ATG" TypeReference type = null; Expression expr; pexpr = null; -#line 1898 "cs.ATG" +#line 1902 "cs.ATG" Location startLocation = la.Location; if (la.kind == 113) { lexer.NextToken(); -#line 1900 "cs.ATG" +#line 1904 "cs.ATG" pexpr = new PrimitiveExpression(true, "true"); } else if (la.kind == 72) { lexer.NextToken(); -#line 1901 "cs.ATG" +#line 1905 "cs.ATG" pexpr = new PrimitiveExpression(false, "false"); } else if (la.kind == 90) { lexer.NextToken(); -#line 1902 "cs.ATG" +#line 1906 "cs.ATG" pexpr = new PrimitiveExpression(null, "null"); } else if (la.kind == 2) { lexer.NextToken(); -#line 1903 "cs.ATG" +#line 1907 "cs.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val) { LiteralFormat = t.literalFormat }; } else if ( -#line 1904 "cs.ATG" +#line 1908 "cs.ATG" StartOfQueryExpression()) { QueryExpression( -#line 1905 "cs.ATG" +#line 1909 "cs.ATG" out pexpr); } else if ( -#line 1906 "cs.ATG" +#line 1910 "cs.ATG" IdentAndDoubleColon()) { Identifier(); -#line 1907 "cs.ATG" +#line 1911 "cs.ATG" type = new TypeReference(t.val); Expect(10); -#line 1908 "cs.ATG" +#line 1912 "cs.ATG" pexpr = new TypeReferenceExpression(type); Identifier(); -#line 1909 "cs.ATG" +#line 1913 "cs.ATG" if (type.Type == "global") { type.IsGlobal = true; type.Type = t.val ?? "?"; } else type.Type += "." + (t.val ?? "?"); + } else if (la.kind == 64) { + lexer.NextToken(); + AnonymousMethodExpr( +#line 1915 "cs.ATG" +out expr); + +#line 1915 "cs.ATG" + pexpr = expr; + } else if ( +#line 1916 "cs.ATG" +la.kind == Tokens.Async && Peek(1).kind == Tokens.Delegate) { + Expect(145); + Expect(64); + AnonymousMethodExpr( +#line 1917 "cs.ATG" +out expr); + +#line 1917 "cs.ATG" + pexpr = expr; + +#line 1918 "cs.ATG" + ((AnonymousMethodExpression)expr).IsAsync = true; + } else if ( +#line 1920 "cs.ATG" +la.kind == Tokens.Async && Peek(1).kind == Tokens.OpenParenthesis) { + Expect(145); + LambdaExpression( +#line 1922 "cs.ATG" +out pexpr); + +#line 1923 "cs.ATG" + ((LambdaExpression)pexpr).IsAsync = true; + } else if ( +#line 1925 "cs.ATG" +la.kind == Tokens.Async && IsIdentifierToken(Peek(1))) { + Expect(145); + Identifier(); + +#line 1927 "cs.ATG" + pexpr = new IdentifierExpression(t.val); + ShortedLambdaExpression( +#line 1928 "cs.ATG" +(IdentifierExpression)pexpr, out pexpr); + +#line 1929 "cs.ATG" + ((LambdaExpression)pexpr).IsAsync = true; } else if (StartOf(18)) { Identifier(); -#line 1913 "cs.ATG" +#line 1933 "cs.ATG" pexpr = new IdentifierExpression(t.val); if (la.kind == 48 || -#line 1916 "cs.ATG" +#line 1936 "cs.ATG" IsGenericInSimpleNameOrMemberAccess()) { if (la.kind == 48) { ShortedLambdaExpression( -#line 1915 "cs.ATG" +#line 1935 "cs.ATG" (IdentifierExpression)pexpr, out pexpr); } else { -#line 1917 "cs.ATG" +#line 1937 "cs.ATG" List typeList; TypeArgumentList( -#line 1918 "cs.ATG" +#line 1938 "cs.ATG" out typeList, false); -#line 1919 "cs.ATG" +#line 1939 "cs.ATG" ((IdentifierExpression)pexpr).TypeArguments = typeList; } } } else if ( -#line 1921 "cs.ATG" +#line 1942 "cs.ATG" IsLambdaExpression()) { LambdaExpression( -#line 1922 "cs.ATG" +#line 1943 "cs.ATG" out pexpr); } else if (la.kind == 20) { lexer.NextToken(); Expr( -#line 1925 "cs.ATG" +#line 1946 "cs.ATG" out expr); Expect(21); -#line 1925 "cs.ATG" +#line 1946 "cs.ATG" pexpr = new ParenthesizedExpression(expr); } else if (StartOf(34)) { -#line 1928 "cs.ATG" +#line 1949 "cs.ATG" string val = null; switch (la.kind) { case 52: { lexer.NextToken(); -#line 1929 "cs.ATG" +#line 1950 "cs.ATG" val = "System.Boolean"; break; } case 54: { lexer.NextToken(); -#line 1930 "cs.ATG" +#line 1951 "cs.ATG" val = "System.Byte"; break; } case 57: { lexer.NextToken(); -#line 1931 "cs.ATG" +#line 1952 "cs.ATG" val = "System.Char"; break; } case 62: { lexer.NextToken(); -#line 1932 "cs.ATG" +#line 1953 "cs.ATG" val = "System.Decimal"; break; } case 66: { lexer.NextToken(); -#line 1933 "cs.ATG" +#line 1954 "cs.ATG" val = "System.Double"; break; } case 75: { lexer.NextToken(); -#line 1934 "cs.ATG" +#line 1955 "cs.ATG" val = "System.Single"; break; } case 82: { lexer.NextToken(); -#line 1935 "cs.ATG" +#line 1956 "cs.ATG" val = "System.Int32"; break; } case 87: { lexer.NextToken(); -#line 1936 "cs.ATG" +#line 1957 "cs.ATG" val = "System.Int64"; break; } case 91: { lexer.NextToken(); -#line 1937 "cs.ATG" +#line 1958 "cs.ATG" val = "System.Object"; break; } case 102: { lexer.NextToken(); -#line 1938 "cs.ATG" +#line 1959 "cs.ATG" val = "System.SByte"; break; } case 104: { lexer.NextToken(); -#line 1939 "cs.ATG" +#line 1960 "cs.ATG" val = "System.Int16"; break; } case 108: { lexer.NextToken(); -#line 1940 "cs.ATG" +#line 1961 "cs.ATG" val = "System.String"; break; } case 116: { lexer.NextToken(); -#line 1941 "cs.ATG" +#line 1962 "cs.ATG" val = "System.UInt32"; break; } case 117: { lexer.NextToken(); -#line 1942 "cs.ATG" +#line 1963 "cs.ATG" val = "System.UInt64"; break; } case 120: { lexer.NextToken(); -#line 1943 "cs.ATG" +#line 1964 "cs.ATG" val = "System.UInt16"; break; } case 123: { lexer.NextToken(); -#line 1944 "cs.ATG" +#line 1965 "cs.ATG" val = "System.Void"; break; } } -#line 1946 "cs.ATG" +#line 1967 "cs.ATG" pexpr = new TypeReferenceExpression(new TypeReference(val, true)) { StartLocation = t.Location, EndLocation = t.EndLocation }; } else if (la.kind == 111) { lexer.NextToken(); -#line 1949 "cs.ATG" +#line 1970 "cs.ATG" pexpr = new ThisReferenceExpression(); pexpr.StartLocation = t.Location; pexpr.EndLocation = t.EndLocation; } else if (la.kind == 51) { lexer.NextToken(); -#line 1951 "cs.ATG" +#line 1972 "cs.ATG" pexpr = new BaseReferenceExpression(); pexpr.StartLocation = t.Location; pexpr.EndLocation = t.EndLocation; } else if (la.kind == 89) { NewExpression( -#line 1954 "cs.ATG" +#line 1975 "cs.ATG" out pexpr); } else if (la.kind == 115) { lexer.NextToken(); Expect(20); if ( -#line 1958 "cs.ATG" +#line 1979 "cs.ATG" NotVoidPointer()) { Expect(123); -#line 1958 "cs.ATG" +#line 1979 "cs.ATG" type = new TypeReference("System.Void", true); } else if (StartOf(10)) { TypeWithRestriction( -#line 1959 "cs.ATG" +#line 1980 "cs.ATG" out type, true, true); - } else SynErr(206); + } else SynErr(208); Expect(21); -#line 1961 "cs.ATG" +#line 1982 "cs.ATG" pexpr = new TypeOfExpression(type); } else if (la.kind == 63) { lexer.NextToken(); Expect(20); Type( -#line 1963 "cs.ATG" +#line 1984 "cs.ATG" out type); Expect(21); -#line 1963 "cs.ATG" +#line 1984 "cs.ATG" pexpr = new DefaultValueExpression(type); } else if (la.kind == 105) { lexer.NextToken(); Expect(20); Type( -#line 1964 "cs.ATG" +#line 1985 "cs.ATG" out type); Expect(21); -#line 1964 "cs.ATG" +#line 1985 "cs.ATG" pexpr = new SizeOfExpression(type); } else if (la.kind == 58) { lexer.NextToken(); Expect(20); Expr( -#line 1965 "cs.ATG" +#line 1986 "cs.ATG" out expr); Expect(21); -#line 1965 "cs.ATG" +#line 1986 "cs.ATG" pexpr = new CheckedExpression(expr); } else if (la.kind == 118) { lexer.NextToken(); Expect(20); Expr( -#line 1966 "cs.ATG" +#line 1987 "cs.ATG" out expr); Expect(21); -#line 1966 "cs.ATG" +#line 1987 "cs.ATG" pexpr = new UncheckedExpression(expr); - } else if (la.kind == 64) { - lexer.NextToken(); - AnonymousMethodExpr( -#line 1967 "cs.ATG" -out expr); + } else SynErr(209); -#line 1967 "cs.ATG" - pexpr = expr; - } else SynErr(207); - -#line 1969 "cs.ATG" +#line 1989 "cs.ATG" if (pexpr != null) { if (pexpr.StartLocation.IsEmpty) pexpr.StartLocation = startLocation; @@ -4668,57 +4726,57 @@ out expr); while (StartOf(35)) { -#line 1977 "cs.ATG" +#line 1997 "cs.ATG" startLocation = la.Location; switch (la.kind) { case 31: { lexer.NextToken(); -#line 1979 "cs.ATG" +#line 1999 "cs.ATG" pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostIncrement); break; } case 32: { lexer.NextToken(); -#line 1981 "cs.ATG" +#line 2001 "cs.ATG" pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostDecrement); break; } case 47: { PointerMemberAccess( -#line 1983 "cs.ATG" +#line 2003 "cs.ATG" out pexpr, pexpr); break; } case 15: { MemberAccess( -#line 1984 "cs.ATG" +#line 2004 "cs.ATG" out pexpr, pexpr); break; } case 20: { lexer.NextToken(); -#line 1988 "cs.ATG" +#line 2008 "cs.ATG" List parameters = new List(); -#line 1989 "cs.ATG" +#line 2009 "cs.ATG" pexpr = new InvocationExpression(pexpr, parameters); if (StartOf(25)) { Argument( -#line 1990 "cs.ATG" +#line 2010 "cs.ATG" out expr); -#line 1990 "cs.ATG" +#line 2010 "cs.ATG" SafeAdd(pexpr, parameters, expr); while (la.kind == 14) { lexer.NextToken(); Argument( -#line 1991 "cs.ATG" +#line 2011 "cs.ATG" out expr); -#line 1991 "cs.ATG" +#line 2011 "cs.ATG" SafeAdd(pexpr, parameters, expr); } } @@ -4727,24 +4785,24 @@ out expr); } case 18: { -#line 1997 "cs.ATG" +#line 2017 "cs.ATG" List indices = new List(); pexpr = new IndexerExpression(pexpr, indices); lexer.NextToken(); Expr( -#line 2000 "cs.ATG" +#line 2020 "cs.ATG" out expr); -#line 2000 "cs.ATG" +#line 2020 "cs.ATG" SafeAdd(pexpr, indices, expr); while (la.kind == 14) { lexer.NextToken(); Expr( -#line 2001 "cs.ATG" +#line 2021 "cs.ATG" out expr); -#line 2001 "cs.ATG" +#line 2021 "cs.ATG" SafeAdd(pexpr, indices, expr); } Expect(19); @@ -4752,7 +4810,7 @@ out expr); } } -#line 2004 "cs.ATG" +#line 2024 "cs.ATG" if (pexpr != null) { if (pexpr.StartLocation.IsEmpty) pexpr.StartLocation = startLocation; @@ -4764,129 +4822,166 @@ out expr); } void QueryExpression( -#line 2442 "cs.ATG" +#line 2462 "cs.ATG" out Expression outExpr) { -#line 2443 "cs.ATG" +#line 2463 "cs.ATG" QueryExpression q = new QueryExpression(); outExpr = q; q.StartLocation = la.Location; QueryExpressionFromClause fromClause; QueryExpressionFromClause( -#line 2447 "cs.ATG" +#line 2467 "cs.ATG" out fromClause); -#line 2447 "cs.ATG" +#line 2467 "cs.ATG" q.FromClause = fromClause; QueryExpressionBody( -#line 2448 "cs.ATG" +#line 2468 "cs.ATG" ref q); -#line 2449 "cs.ATG" +#line 2469 "cs.ATG" q.EndLocation = t.EndLocation; outExpr = q; /* set outExpr to q again if QueryExpressionBody changed it (can happen with 'into' clauses) */ } - void ShortedLambdaExpression( + void AnonymousMethodExpr( +#line 2185 "cs.ATG" +out Expression outExpr) { + +#line 2187 "cs.ATG" + AnonymousMethodExpression expr = new AnonymousMethodExpression(); + expr.StartLocation = t.Location; + BlockStatement stmt; + List p = new List(); + outExpr = expr; + + if (la.kind == 20) { + lexer.NextToken(); + if (StartOf(11)) { + FormalParameterList( +#line 2196 "cs.ATG" +p); + +#line 2196 "cs.ATG" + expr.Parameters = p; + } + Expect(21); + +#line 2198 "cs.ATG" + expr.HasParameterList = true; + } + Block( +#line 2200 "cs.ATG" +out stmt); + +#line 2200 "cs.ATG" + expr.Body = stmt; + +#line 2201 "cs.ATG" + expr.EndLocation = t.Location; + } + + void LambdaExpression( #line 2118 "cs.ATG" +out Expression outExpr) { + +#line 2120 "cs.ATG" + LambdaExpression lambda = new LambdaExpression(); + lambda.StartLocation = la.Location; + ParameterDeclarationExpression p; + outExpr = lambda; + + Expect(20); + if (StartOf(36)) { + LambdaExpressionParameter( +#line 2128 "cs.ATG" +out p); + +#line 2128 "cs.ATG" + SafeAdd(lambda, lambda.Parameters, p); + while (la.kind == 14) { + lexer.NextToken(); + LambdaExpressionParameter( +#line 2130 "cs.ATG" +out p); + +#line 2130 "cs.ATG" + SafeAdd(lambda, lambda.Parameters, p); + } + } + Expect(21); + Expect(48); + LambdaExpressionBody( +#line 2135 "cs.ATG" +lambda); + } + + void ShortedLambdaExpression( +#line 2138 "cs.ATG" IdentifierExpression ident, out Expression pexpr) { -#line 2119 "cs.ATG" +#line 2139 "cs.ATG" LambdaExpression lambda = new LambdaExpression(); pexpr = lambda; Expect(48); -#line 2124 "cs.ATG" +#line 2144 "cs.ATG" lambda.StartLocation = ident.StartLocation; SafeAdd(lambda, lambda.Parameters, new ParameterDeclarationExpression(null, ident.Identifier)); lambda.Parameters[0].StartLocation = ident.StartLocation; lambda.Parameters[0].EndLocation = ident.EndLocation; LambdaExpressionBody( -#line 2129 "cs.ATG" +#line 2149 "cs.ATG" lambda); } void TypeArgumentList( -#line 2361 "cs.ATG" +#line 2381 "cs.ATG" out List types, bool canBeUnbound) { -#line 2363 "cs.ATG" +#line 2383 "cs.ATG" types = new List(); TypeReference type = null; Expect(23); if ( -#line 2368 "cs.ATG" +#line 2388 "cs.ATG" canBeUnbound && (la.kind == Tokens.GreaterThan || la.kind == Tokens.Comma)) { -#line 2369 "cs.ATG" +#line 2389 "cs.ATG" types.Add(TypeReference.Null); while (la.kind == 14) { lexer.NextToken(); -#line 2370 "cs.ATG" +#line 2390 "cs.ATG" types.Add(TypeReference.Null); } } else if (StartOf(10)) { Type( -#line 2371 "cs.ATG" +#line 2391 "cs.ATG" out type); -#line 2371 "cs.ATG" +#line 2391 "cs.ATG" if (type != null) { types.Add(type); } while (la.kind == 14) { lexer.NextToken(); Type( -#line 2372 "cs.ATG" +#line 2392 "cs.ATG" out type); -#line 2372 "cs.ATG" +#line 2392 "cs.ATG" if (type != null) { types.Add(type); } } - } else SynErr(208); + } else SynErr(210); Expect(22); } - void LambdaExpression( -#line 2098 "cs.ATG" -out Expression outExpr) { - -#line 2100 "cs.ATG" - LambdaExpression lambda = new LambdaExpression(); - lambda.StartLocation = la.Location; - ParameterDeclarationExpression p; - outExpr = lambda; - - Expect(20); - if (StartOf(36)) { - LambdaExpressionParameter( -#line 2108 "cs.ATG" -out p); - -#line 2108 "cs.ATG" - SafeAdd(lambda, lambda.Parameters, p); - while (la.kind == 14) { - lexer.NextToken(); - LambdaExpressionParameter( -#line 2110 "cs.ATG" -out p); - -#line 2110 "cs.ATG" - SafeAdd(lambda, lambda.Parameters, p); - } - } - Expect(21); - Expect(48); - LambdaExpressionBody( -#line 2115 "cs.ATG" -lambda); - } - void NewExpression( -#line 2045 "cs.ATG" +#line 2065 "cs.ATG" out Expression pexpr) { -#line 2046 "cs.ATG" +#line 2066 "cs.ATG" pexpr = null; List parameters = new List(); TypeReference type = null; @@ -4895,65 +4990,65 @@ out Expression pexpr) { Expect(89); if (StartOf(10)) { NonArrayType( -#line 2053 "cs.ATG" +#line 2073 "cs.ATG" out type); } if (la.kind == 16 || la.kind == 20) { if (la.kind == 20) { -#line 2059 "cs.ATG" +#line 2079 "cs.ATG" ObjectCreateExpression oce = new ObjectCreateExpression(type, parameters); lexer.NextToken(); -#line 2060 "cs.ATG" +#line 2080 "cs.ATG" if (type == null) Error("Cannot use an anonymous type with arguments for the constructor"); if (StartOf(25)) { Argument( -#line 2061 "cs.ATG" +#line 2081 "cs.ATG" out expr); -#line 2061 "cs.ATG" +#line 2081 "cs.ATG" SafeAdd(oce, parameters, expr); while (la.kind == 14) { lexer.NextToken(); Argument( -#line 2062 "cs.ATG" +#line 2082 "cs.ATG" out expr); -#line 2062 "cs.ATG" +#line 2082 "cs.ATG" SafeAdd(oce, parameters, expr); } } Expect(21); -#line 2064 "cs.ATG" +#line 2084 "cs.ATG" pexpr = oce; if (la.kind == 16) { CollectionOrObjectInitializer( -#line 2065 "cs.ATG" +#line 2085 "cs.ATG" out expr); -#line 2065 "cs.ATG" +#line 2085 "cs.ATG" oce.ObjectInitializer = (CollectionInitializerExpression)expr; } } else { -#line 2066 "cs.ATG" +#line 2086 "cs.ATG" ObjectCreateExpression oce = new ObjectCreateExpression(type, parameters); CollectionOrObjectInitializer( -#line 2067 "cs.ATG" +#line 2087 "cs.ATG" out expr); -#line 2067 "cs.ATG" +#line 2087 "cs.ATG" oce.ObjectInitializer = (CollectionInitializerExpression)expr; -#line 2068 "cs.ATG" +#line 2088 "cs.ATG" pexpr = oce; } } else if (la.kind == 18) { lexer.NextToken(); -#line 2073 "cs.ATG" +#line 2093 "cs.ATG" ArrayCreateExpression ace = new ArrayCreateExpression(type); /* we must not change RankSpecifier on the null type reference*/ if (ace.CreateType.IsNull) { ace.CreateType = new TypeReference(""); } @@ -4964,154 +5059,117 @@ out expr); while (la.kind == 14) { lexer.NextToken(); -#line 2080 "cs.ATG" +#line 2100 "cs.ATG" dims += 1; } Expect(19); -#line 2081 "cs.ATG" +#line 2101 "cs.ATG" ranks.Add(dims); dims = 0; while (la.kind == 18) { lexer.NextToken(); while (la.kind == 14) { lexer.NextToken(); -#line 2082 "cs.ATG" +#line 2102 "cs.ATG" ++dims; } Expect(19); -#line 2082 "cs.ATG" +#line 2102 "cs.ATG" ranks.Add(dims); dims = 0; } -#line 2083 "cs.ATG" +#line 2103 "cs.ATG" ace.CreateType.RankSpecifier = ranks.ToArray(); CollectionInitializer( -#line 2084 "cs.ATG" +#line 2104 "cs.ATG" out expr); -#line 2084 "cs.ATG" +#line 2104 "cs.ATG" ace.ArrayInitializer = (CollectionInitializerExpression)expr; } else if (StartOf(6)) { Expr( -#line 2085 "cs.ATG" +#line 2105 "cs.ATG" out expr); -#line 2085 "cs.ATG" +#line 2105 "cs.ATG" if (expr != null) parameters.Add(expr); while (la.kind == 14) { lexer.NextToken(); -#line 2086 "cs.ATG" +#line 2106 "cs.ATG" dims += 1; Expr( -#line 2087 "cs.ATG" +#line 2107 "cs.ATG" out expr); -#line 2087 "cs.ATG" +#line 2107 "cs.ATG" if (expr != null) parameters.Add(expr); } Expect(19); -#line 2089 "cs.ATG" +#line 2109 "cs.ATG" ranks.Add(dims); ace.Arguments = parameters; dims = 0; while (la.kind == 18) { lexer.NextToken(); while (la.kind == 14) { lexer.NextToken(); -#line 2090 "cs.ATG" +#line 2110 "cs.ATG" ++dims; } Expect(19); -#line 2090 "cs.ATG" +#line 2110 "cs.ATG" ranks.Add(dims); dims = 0; } -#line 2091 "cs.ATG" +#line 2111 "cs.ATG" ace.CreateType.RankSpecifier = ranks.ToArray(); if (la.kind == 16) { CollectionInitializer( -#line 2092 "cs.ATG" +#line 2112 "cs.ATG" out expr); -#line 2092 "cs.ATG" +#line 2112 "cs.ATG" ace.ArrayInitializer = (CollectionInitializerExpression)expr; } - } else SynErr(209); - } else SynErr(210); - } - - void AnonymousMethodExpr( -#line 2165 "cs.ATG" -out Expression outExpr) { - -#line 2167 "cs.ATG" - AnonymousMethodExpression expr = new AnonymousMethodExpression(); - expr.StartLocation = t.Location; - BlockStatement stmt; - List p = new List(); - outExpr = expr; - - if (la.kind == 20) { - lexer.NextToken(); - if (StartOf(11)) { - FormalParameterList( -#line 2176 "cs.ATG" -p); - -#line 2176 "cs.ATG" - expr.Parameters = p; - } - Expect(21); - -#line 2178 "cs.ATG" - expr.HasParameterList = true; - } - Block( -#line 2180 "cs.ATG" -out stmt); - -#line 2180 "cs.ATG" - expr.Body = stmt; - -#line 2181 "cs.ATG" - expr.EndLocation = t.Location; + } else SynErr(211); + } else SynErr(212); } void PointerMemberAccess( -#line 2033 "cs.ATG" +#line 2053 "cs.ATG" out Expression expr, Expression target) { -#line 2034 "cs.ATG" +#line 2054 "cs.ATG" List typeList; Expect(47); Identifier(); -#line 2038 "cs.ATG" +#line 2058 "cs.ATG" expr = new PointerReferenceExpression(target, t.val); expr.StartLocation = t.Location; expr.EndLocation = t.EndLocation; if ( -#line 2039 "cs.ATG" +#line 2059 "cs.ATG" IsGenericInSimpleNameOrMemberAccess()) { TypeArgumentList( -#line 2040 "cs.ATG" +#line 2060 "cs.ATG" out typeList, false); -#line 2041 "cs.ATG" +#line 2061 "cs.ATG" ((MemberReferenceExpression)expr).TypeArguments = typeList; } } void MemberAccess( -#line 2014 "cs.ATG" +#line 2034 "cs.ATG" out Expression expr, Expression target) { -#line 2015 "cs.ATG" +#line 2035 "cs.ATG" List typeList; -#line 2017 "cs.ATG" +#line 2037 "cs.ATG" if (ShouldConvertTargetExpressionToTypeReference(target)) { TypeReference type = GetTypeReferenceFromExpression(target); if (type != null) { @@ -5121,39 +5179,39 @@ out Expression expr, Expression target) { Expect(15); -#line 2024 "cs.ATG" +#line 2044 "cs.ATG" Location startLocation = t.Location; Identifier(); -#line 2026 "cs.ATG" +#line 2046 "cs.ATG" expr = new MemberReferenceExpression(target, t.val); expr.StartLocation = startLocation; expr.EndLocation = t.EndLocation; if ( -#line 2027 "cs.ATG" +#line 2047 "cs.ATG" IsGenericInSimpleNameOrMemberAccess()) { TypeArgumentList( -#line 2028 "cs.ATG" +#line 2048 "cs.ATG" out typeList, false); -#line 2029 "cs.ATG" +#line 2049 "cs.ATG" ((MemberReferenceExpression)expr).TypeArguments = typeList; } } void LambdaExpressionParameter( -#line 2132 "cs.ATG" +#line 2152 "cs.ATG" out ParameterDeclarationExpression p) { -#line 2133 "cs.ATG" +#line 2153 "cs.ATG" Location start = la.Location; p = null; TypeReference type; ParameterModifiers mod = ParameterModifiers.In; if ( -#line 2138 "cs.ATG" +#line 2158 "cs.ATG" Peek(1).kind == Tokens.Comma || Peek(1).kind == Tokens.CloseParenthesis) { Identifier(); -#line 2140 "cs.ATG" +#line 2160 "cs.ATG" p = new ParameterDeclarationExpression(null, t.val); p.StartLocation = start; p.EndLocation = t.EndLocation; @@ -5162,345 +5220,345 @@ Peek(1).kind == Tokens.Comma || Peek(1).kind == Tokens.CloseParenthesis) { if (la.kind == 100) { lexer.NextToken(); -#line 2143 "cs.ATG" +#line 2163 "cs.ATG" mod = ParameterModifiers.Ref; } else { lexer.NextToken(); -#line 2144 "cs.ATG" +#line 2164 "cs.ATG" mod = ParameterModifiers.Out; } } Type( -#line 2146 "cs.ATG" +#line 2166 "cs.ATG" out type); Identifier(); -#line 2148 "cs.ATG" +#line 2168 "cs.ATG" p = new ParameterDeclarationExpression(type, t.val, mod); p.StartLocation = start; p.EndLocation = t.EndLocation; - } else SynErr(211); + } else SynErr(213); } void LambdaExpressionBody( -#line 2154 "cs.ATG" +#line 2174 "cs.ATG" LambdaExpression lambda) { -#line 2155 "cs.ATG" +#line 2175 "cs.ATG" Expression expr; BlockStatement stmt; if (la.kind == 16) { Block( -#line 2158 "cs.ATG" +#line 2178 "cs.ATG" out stmt); -#line 2158 "cs.ATG" +#line 2178 "cs.ATG" lambda.StatementBody = stmt; } else if (StartOf(6)) { Expr( -#line 2159 "cs.ATG" +#line 2179 "cs.ATG" out expr); -#line 2159 "cs.ATG" +#line 2179 "cs.ATG" lambda.ExpressionBody = expr; - } else SynErr(212); + } else SynErr(214); -#line 2161 "cs.ATG" +#line 2181 "cs.ATG" lambda.EndLocation = t.EndLocation; -#line 2162 "cs.ATG" +#line 2182 "cs.ATG" lambda.ExtendedEndLocation = la.Location; } void ConditionalAndExpr( -#line 2190 "cs.ATG" +#line 2210 "cs.ATG" ref Expression outExpr) { -#line 2191 "cs.ATG" +#line 2211 "cs.ATG" Expression expr; Location startLocation = la.Location; InclusiveOrExpr( -#line 2193 "cs.ATG" +#line 2213 "cs.ATG" ref outExpr); while (la.kind == 25) { lexer.NextToken(); UnaryExpr( -#line 2193 "cs.ATG" +#line 2213 "cs.ATG" out expr); InclusiveOrExpr( -#line 2193 "cs.ATG" +#line 2213 "cs.ATG" ref expr); -#line 2193 "cs.ATG" +#line 2213 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalAnd, expr) { StartLocation = startLocation, EndLocation = t.EndLocation }; } } void InclusiveOrExpr( -#line 2196 "cs.ATG" +#line 2216 "cs.ATG" ref Expression outExpr) { -#line 2197 "cs.ATG" +#line 2217 "cs.ATG" Expression expr; Location startLocation = la.Location; ExclusiveOrExpr( -#line 2199 "cs.ATG" +#line 2219 "cs.ATG" ref outExpr); while (la.kind == 29) { lexer.NextToken(); UnaryExpr( -#line 2199 "cs.ATG" +#line 2219 "cs.ATG" out expr); ExclusiveOrExpr( -#line 2199 "cs.ATG" +#line 2219 "cs.ATG" ref expr); -#line 2199 "cs.ATG" +#line 2219 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseOr, expr) { StartLocation = startLocation, EndLocation = t.EndLocation }; } } void ExclusiveOrExpr( -#line 2202 "cs.ATG" +#line 2222 "cs.ATG" ref Expression outExpr) { -#line 2203 "cs.ATG" +#line 2223 "cs.ATG" Expression expr; Location startLocation = la.Location; AndExpr( -#line 2205 "cs.ATG" +#line 2225 "cs.ATG" ref outExpr); while (la.kind == 30) { lexer.NextToken(); UnaryExpr( -#line 2205 "cs.ATG" +#line 2225 "cs.ATG" out expr); AndExpr( -#line 2205 "cs.ATG" +#line 2225 "cs.ATG" ref expr); -#line 2205 "cs.ATG" +#line 2225 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.ExclusiveOr, expr) { StartLocation = startLocation, EndLocation = t.EndLocation }; } } void AndExpr( -#line 2208 "cs.ATG" +#line 2228 "cs.ATG" ref Expression outExpr) { -#line 2209 "cs.ATG" +#line 2229 "cs.ATG" Expression expr; Location startLocation = la.Location; EqualityExpr( -#line 2211 "cs.ATG" +#line 2231 "cs.ATG" ref outExpr); while (la.kind == 28) { lexer.NextToken(); UnaryExpr( -#line 2211 "cs.ATG" +#line 2231 "cs.ATG" out expr); EqualityExpr( -#line 2211 "cs.ATG" +#line 2231 "cs.ATG" ref expr); -#line 2211 "cs.ATG" +#line 2231 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseAnd, expr) { StartLocation = startLocation, EndLocation = t.EndLocation }; } } void EqualityExpr( -#line 2214 "cs.ATG" +#line 2234 "cs.ATG" ref Expression outExpr) { -#line 2216 "cs.ATG" +#line 2236 "cs.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; Location startLocation = la.Location; RelationalExpr( -#line 2221 "cs.ATG" +#line 2241 "cs.ATG" ref outExpr); while (la.kind == 33 || la.kind == 34) { if (la.kind == 34) { lexer.NextToken(); -#line 2224 "cs.ATG" +#line 2244 "cs.ATG" op = BinaryOperatorType.InEquality; } else { lexer.NextToken(); -#line 2225 "cs.ATG" +#line 2245 "cs.ATG" op = BinaryOperatorType.Equality; } UnaryExpr( -#line 2227 "cs.ATG" +#line 2247 "cs.ATG" out expr); RelationalExpr( -#line 2227 "cs.ATG" +#line 2247 "cs.ATG" ref expr); -#line 2227 "cs.ATG" +#line 2247 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr) { StartLocation = startLocation, EndLocation = t.EndLocation }; } } void RelationalExpr( -#line 2231 "cs.ATG" +#line 2251 "cs.ATG" ref Expression outExpr) { -#line 2233 "cs.ATG" +#line 2253 "cs.ATG" TypeReference type; Expression expr; BinaryOperatorType op = BinaryOperatorType.None; Location startLocation = la.Location; ShiftExpr( -#line 2239 "cs.ATG" +#line 2259 "cs.ATG" ref outExpr); while (StartOf(37)) { if (StartOf(38)) { if (la.kind == 23) { lexer.NextToken(); -#line 2241 "cs.ATG" +#line 2261 "cs.ATG" op = BinaryOperatorType.LessThan; } else if (la.kind == 22) { lexer.NextToken(); -#line 2242 "cs.ATG" +#line 2262 "cs.ATG" op = BinaryOperatorType.GreaterThan; } else if (la.kind == 36) { lexer.NextToken(); -#line 2243 "cs.ATG" +#line 2263 "cs.ATG" op = BinaryOperatorType.LessThanOrEqual; } else if (la.kind == 35) { lexer.NextToken(); -#line 2244 "cs.ATG" +#line 2264 "cs.ATG" op = BinaryOperatorType.GreaterThanOrEqual; - } else SynErr(213); + } else SynErr(215); UnaryExpr( -#line 2246 "cs.ATG" +#line 2266 "cs.ATG" out expr); ShiftExpr( -#line 2247 "cs.ATG" +#line 2267 "cs.ATG" ref expr); -#line 2248 "cs.ATG" +#line 2268 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr) { StartLocation = startLocation, EndLocation = t.EndLocation }; } else { if (la.kind == 85) { lexer.NextToken(); TypeWithRestriction( -#line 2251 "cs.ATG" +#line 2271 "cs.ATG" out type, false, false); if ( -#line 2252 "cs.ATG" +#line 2272 "cs.ATG" la.kind == Tokens.Question && !IsPossibleExpressionStart(Peek(1).kind)) { NullableQuestionMark( -#line 2253 "cs.ATG" +#line 2273 "cs.ATG" ref type); } -#line 2254 "cs.ATG" +#line 2274 "cs.ATG" outExpr = new TypeOfIsExpression(outExpr, type) { StartLocation = startLocation, EndLocation = t.EndLocation }; } else if (la.kind == 50) { lexer.NextToken(); TypeWithRestriction( -#line 2256 "cs.ATG" +#line 2276 "cs.ATG" out type, false, false); if ( -#line 2257 "cs.ATG" +#line 2277 "cs.ATG" la.kind == Tokens.Question && !IsPossibleExpressionStart(Peek(1).kind)) { NullableQuestionMark( -#line 2258 "cs.ATG" +#line 2278 "cs.ATG" ref type); } -#line 2259 "cs.ATG" +#line 2279 "cs.ATG" outExpr = new CastExpression(type, outExpr, CastType.TryCast) { StartLocation = startLocation, EndLocation = t.EndLocation }; - } else SynErr(214); + } else SynErr(216); } } } void ShiftExpr( -#line 2264 "cs.ATG" +#line 2284 "cs.ATG" ref Expression outExpr) { -#line 2266 "cs.ATG" +#line 2286 "cs.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; Location startLocation = la.Location; AdditiveExpr( -#line 2271 "cs.ATG" +#line 2291 "cs.ATG" ref outExpr); while (la.kind == 37 || -#line 2274 "cs.ATG" +#line 2294 "cs.ATG" IsShiftRight()) { if (la.kind == 37) { lexer.NextToken(); -#line 2273 "cs.ATG" +#line 2293 "cs.ATG" op = BinaryOperatorType.ShiftLeft; } else { Expect(22); Expect(22); -#line 2275 "cs.ATG" +#line 2295 "cs.ATG" op = BinaryOperatorType.ShiftRight; } UnaryExpr( -#line 2278 "cs.ATG" +#line 2298 "cs.ATG" out expr); AdditiveExpr( -#line 2278 "cs.ATG" +#line 2298 "cs.ATG" ref expr); -#line 2278 "cs.ATG" +#line 2298 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr) { StartLocation = startLocation, EndLocation = t.EndLocation }; } } void AdditiveExpr( -#line 2282 "cs.ATG" +#line 2302 "cs.ATG" ref Expression outExpr) { -#line 2284 "cs.ATG" +#line 2304 "cs.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; Location startLocation = la.Location; MultiplicativeExpr( -#line 2289 "cs.ATG" +#line 2309 "cs.ATG" ref outExpr); while (la.kind == 4 || la.kind == 5) { if (la.kind == 4) { lexer.NextToken(); -#line 2292 "cs.ATG" +#line 2312 "cs.ATG" op = BinaryOperatorType.Add; } else { lexer.NextToken(); -#line 2293 "cs.ATG" +#line 2313 "cs.ATG" op = BinaryOperatorType.Subtract; } UnaryExpr( -#line 2295 "cs.ATG" +#line 2315 "cs.ATG" out expr); MultiplicativeExpr( -#line 2295 "cs.ATG" +#line 2315 "cs.ATG" ref expr); -#line 2295 "cs.ATG" +#line 2315 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr) { StartLocation = startLocation, EndLocation = t.EndLocation }; } } void MultiplicativeExpr( -#line 2299 "cs.ATG" +#line 2319 "cs.ATG" ref Expression outExpr) { -#line 2301 "cs.ATG" +#line 2321 "cs.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; Location startLocation = la.Location; @@ -5509,124 +5567,124 @@ ref Expression outExpr) { if (la.kind == 6) { lexer.NextToken(); -#line 2308 "cs.ATG" +#line 2328 "cs.ATG" op = BinaryOperatorType.Multiply; } else if (la.kind == 7) { lexer.NextToken(); -#line 2309 "cs.ATG" +#line 2329 "cs.ATG" op = BinaryOperatorType.Divide; } else { lexer.NextToken(); -#line 2310 "cs.ATG" +#line 2330 "cs.ATG" op = BinaryOperatorType.Modulus; } UnaryExpr( -#line 2312 "cs.ATG" +#line 2332 "cs.ATG" out expr); -#line 2312 "cs.ATG" +#line 2332 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr) { StartLocation = startLocation, EndLocation = t.EndLocation }; } } void VariantTypeParameter( -#line 2390 "cs.ATG" +#line 2410 "cs.ATG" out TemplateDefinition typeParameter) { -#line 2392 "cs.ATG" +#line 2412 "cs.ATG" typeParameter = new TemplateDefinition(); AttributeSection section; while (la.kind == 18) { AttributeSection( -#line 2396 "cs.ATG" +#line 2416 "cs.ATG" out section); -#line 2396 "cs.ATG" +#line 2416 "cs.ATG" typeParameter.Attributes.Add(section); } if (la.kind == 81 || la.kind == 93) { if (la.kind == 81) { lexer.NextToken(); -#line 2398 "cs.ATG" +#line 2418 "cs.ATG" typeParameter.VarianceModifier = VarianceModifier.Contravariant; } else { lexer.NextToken(); -#line 2399 "cs.ATG" +#line 2419 "cs.ATG" typeParameter.VarianceModifier = VarianceModifier.Covariant; } } Identifier(); -#line 2401 "cs.ATG" +#line 2421 "cs.ATG" typeParameter.Name = t.val; typeParameter.StartLocation = t.Location; -#line 2402 "cs.ATG" +#line 2422 "cs.ATG" typeParameter.EndLocation = t.EndLocation; } void TypeParameterConstraintsClauseBase( -#line 2433 "cs.ATG" +#line 2453 "cs.ATG" out TypeReference type) { -#line 2434 "cs.ATG" +#line 2454 "cs.ATG" TypeReference t; type = null; if (la.kind == 109) { lexer.NextToken(); -#line 2436 "cs.ATG" +#line 2456 "cs.ATG" type = TypeReference.StructConstraint; } else if (la.kind == 59) { lexer.NextToken(); -#line 2437 "cs.ATG" +#line 2457 "cs.ATG" type = TypeReference.ClassConstraint; } else if (la.kind == 89) { lexer.NextToken(); Expect(20); Expect(21); -#line 2438 "cs.ATG" +#line 2458 "cs.ATG" type = TypeReference.NewConstraint; } else if (StartOf(10)) { Type( -#line 2439 "cs.ATG" +#line 2459 "cs.ATG" out t); -#line 2439 "cs.ATG" +#line 2459 "cs.ATG" type = t; - } else SynErr(215); + } else SynErr(217); } void QueryExpressionFromClause( -#line 2454 "cs.ATG" +#line 2474 "cs.ATG" out QueryExpressionFromClause fc) { -#line 2455 "cs.ATG" +#line 2475 "cs.ATG" fc = new QueryExpressionFromClause(); fc.StartLocation = la.Location; CollectionRangeVariable variable; Expect(137); QueryExpressionFromOrJoinClause( -#line 2461 "cs.ATG" +#line 2481 "cs.ATG" out variable); -#line 2462 "cs.ATG" +#line 2482 "cs.ATG" fc.EndLocation = t.EndLocation; fc.Sources.Add(variable); } void QueryExpressionBody( -#line 2498 "cs.ATG" +#line 2518 "cs.ATG" ref QueryExpression q) { -#line 2499 "cs.ATG" +#line 2519 "cs.ATG" QueryExpressionFromClause fromClause; QueryExpressionWhereClause whereClause; QueryExpressionLetClause letClause; QueryExpressionJoinClause joinClause; QueryExpressionOrderClause orderClause; @@ -5635,252 +5693,252 @@ ref QueryExpression q) { while (StartOf(39)) { if (la.kind == 137) { QueryExpressionFromClause( -#line 2505 "cs.ATG" +#line 2525 "cs.ATG" out fromClause); -#line 2505 "cs.ATG" +#line 2525 "cs.ATG" SafeAdd(q, q.MiddleClauses, fromClause); } else if (la.kind == 127) { QueryExpressionWhereClause( -#line 2506 "cs.ATG" +#line 2526 "cs.ATG" out whereClause); -#line 2506 "cs.ATG" +#line 2526 "cs.ATG" SafeAdd(q, q.MiddleClauses, whereClause); } else if (la.kind == 141) { QueryExpressionLetClause( -#line 2507 "cs.ATG" +#line 2527 "cs.ATG" out letClause); -#line 2507 "cs.ATG" +#line 2527 "cs.ATG" SafeAdd(q, q.MiddleClauses, letClause); } else if (la.kind == 142) { QueryExpressionJoinClause( -#line 2508 "cs.ATG" +#line 2528 "cs.ATG" out joinClause); -#line 2508 "cs.ATG" +#line 2528 "cs.ATG" SafeAdd(q, q.MiddleClauses, joinClause); } else { QueryExpressionOrderByClause( -#line 2509 "cs.ATG" +#line 2529 "cs.ATG" out orderClause); -#line 2509 "cs.ATG" +#line 2529 "cs.ATG" SafeAdd(q, q.MiddleClauses, orderClause); } } if (la.kind == 133) { QueryExpressionSelectClause( -#line 2511 "cs.ATG" +#line 2531 "cs.ATG" out selectClause); -#line 2511 "cs.ATG" +#line 2531 "cs.ATG" q.SelectOrGroupClause = selectClause; } else if (la.kind == 134) { QueryExpressionGroupClause( -#line 2512 "cs.ATG" +#line 2532 "cs.ATG" out groupClause); -#line 2512 "cs.ATG" +#line 2532 "cs.ATG" q.SelectOrGroupClause = groupClause; - } else SynErr(216); + } else SynErr(218); if (la.kind == 136) { QueryExpressionIntoClause( -#line 2514 "cs.ATG" +#line 2534 "cs.ATG" ref q); } } void QueryExpressionFromOrJoinClause( -#line 2488 "cs.ATG" +#line 2508 "cs.ATG" out CollectionRangeVariable variable) { -#line 2489 "cs.ATG" +#line 2509 "cs.ATG" TypeReference type; Expression expr; variable = new CollectionRangeVariable(); -#line 2491 "cs.ATG" +#line 2511 "cs.ATG" variable.Type = null; if ( -#line 2492 "cs.ATG" +#line 2512 "cs.ATG" IsLocalVarDecl()) { Type( -#line 2492 "cs.ATG" +#line 2512 "cs.ATG" out type); -#line 2492 "cs.ATG" +#line 2512 "cs.ATG" variable.Type = type; } Identifier(); -#line 2493 "cs.ATG" +#line 2513 "cs.ATG" variable.Identifier = t.val; Expect(81); Expr( -#line 2495 "cs.ATG" +#line 2515 "cs.ATG" out expr); -#line 2495 "cs.ATG" +#line 2515 "cs.ATG" variable.Expression = expr; } void QueryExpressionJoinClause( -#line 2467 "cs.ATG" +#line 2487 "cs.ATG" out QueryExpressionJoinClause jc) { -#line 2468 "cs.ATG" +#line 2488 "cs.ATG" jc = new QueryExpressionJoinClause(); jc.StartLocation = la.Location; Expression expr; CollectionRangeVariable variable; Expect(142); QueryExpressionFromOrJoinClause( -#line 2474 "cs.ATG" +#line 2494 "cs.ATG" out variable); Expect(143); Expr( -#line 2476 "cs.ATG" +#line 2496 "cs.ATG" out expr); -#line 2476 "cs.ATG" +#line 2496 "cs.ATG" jc.OnExpression = expr; Expect(144); Expr( -#line 2478 "cs.ATG" +#line 2498 "cs.ATG" out expr); -#line 2478 "cs.ATG" +#line 2498 "cs.ATG" jc.EqualsExpression = expr; if (la.kind == 136) { lexer.NextToken(); Identifier(); -#line 2480 "cs.ATG" +#line 2500 "cs.ATG" jc.IntoIdentifier = t.val; } -#line 2483 "cs.ATG" +#line 2503 "cs.ATG" jc.EndLocation = t.EndLocation; jc.Source = variable; } void QueryExpressionWhereClause( -#line 2517 "cs.ATG" +#line 2537 "cs.ATG" out QueryExpressionWhereClause wc) { -#line 2518 "cs.ATG" +#line 2538 "cs.ATG" Expression expr; wc = new QueryExpressionWhereClause(); wc.StartLocation = la.Location; Expect(127); Expr( -#line 2521 "cs.ATG" +#line 2541 "cs.ATG" out expr); -#line 2521 "cs.ATG" +#line 2541 "cs.ATG" wc.Condition = expr; -#line 2522 "cs.ATG" +#line 2542 "cs.ATG" wc.EndLocation = t.EndLocation; } void QueryExpressionLetClause( -#line 2525 "cs.ATG" +#line 2545 "cs.ATG" out QueryExpressionLetClause wc) { -#line 2526 "cs.ATG" +#line 2546 "cs.ATG" Expression expr; wc = new QueryExpressionLetClause(); wc.StartLocation = la.Location; Expect(141); Identifier(); -#line 2529 "cs.ATG" +#line 2549 "cs.ATG" wc.Identifier = t.val; Expect(3); Expr( -#line 2531 "cs.ATG" +#line 2551 "cs.ATG" out expr); -#line 2531 "cs.ATG" +#line 2551 "cs.ATG" wc.Expression = expr; -#line 2532 "cs.ATG" +#line 2552 "cs.ATG" wc.EndLocation = t.EndLocation; } void QueryExpressionOrderByClause( -#line 2535 "cs.ATG" +#line 2555 "cs.ATG" out QueryExpressionOrderClause oc) { -#line 2536 "cs.ATG" +#line 2556 "cs.ATG" QueryExpressionOrdering ordering; oc = new QueryExpressionOrderClause(); oc.StartLocation = la.Location; Expect(140); QueryExpressionOrdering( -#line 2539 "cs.ATG" +#line 2559 "cs.ATG" out ordering); -#line 2539 "cs.ATG" +#line 2559 "cs.ATG" SafeAdd(oc, oc.Orderings, ordering); while (la.kind == 14) { lexer.NextToken(); QueryExpressionOrdering( -#line 2541 "cs.ATG" +#line 2561 "cs.ATG" out ordering); -#line 2541 "cs.ATG" +#line 2561 "cs.ATG" SafeAdd(oc, oc.Orderings, ordering); } -#line 2543 "cs.ATG" +#line 2563 "cs.ATG" oc.EndLocation = t.EndLocation; } void QueryExpressionSelectClause( -#line 2556 "cs.ATG" +#line 2576 "cs.ATG" out QueryExpressionSelectClause sc) { -#line 2557 "cs.ATG" +#line 2577 "cs.ATG" Expression expr; sc = new QueryExpressionSelectClause(); sc.StartLocation = la.Location; Expect(133); Expr( -#line 2560 "cs.ATG" +#line 2580 "cs.ATG" out expr); -#line 2560 "cs.ATG" +#line 2580 "cs.ATG" sc.Projection = expr; -#line 2561 "cs.ATG" +#line 2581 "cs.ATG" sc.EndLocation = t.EndLocation; } void QueryExpressionGroupClause( -#line 2564 "cs.ATG" +#line 2584 "cs.ATG" out QueryExpressionGroupClause gc) { -#line 2565 "cs.ATG" +#line 2585 "cs.ATG" Expression expr; gc = new QueryExpressionGroupClause(); gc.StartLocation = la.Location; Expect(134); Expr( -#line 2568 "cs.ATG" +#line 2588 "cs.ATG" out expr); -#line 2568 "cs.ATG" +#line 2588 "cs.ATG" gc.Projection = expr; Expect(135); Expr( -#line 2570 "cs.ATG" +#line 2590 "cs.ATG" out expr); -#line 2570 "cs.ATG" +#line 2590 "cs.ATG" gc.GroupBy = expr; -#line 2571 "cs.ATG" +#line 2591 "cs.ATG" gc.EndLocation = t.EndLocation; } void QueryExpressionIntoClause( -#line 2574 "cs.ATG" +#line 2594 "cs.ATG" ref QueryExpression q) { -#line 2575 "cs.ATG" +#line 2595 "cs.ATG" QueryExpression firstQuery = q; QueryExpression continuedQuery = new QueryExpression(); continuedQuery.StartLocation = q.StartLocation; @@ -5897,43 +5955,43 @@ ref QueryExpression q) { Expect(136); Identifier(); -#line 2590 "cs.ATG" +#line 2610 "cs.ATG" fromVariable.Identifier = t.val; -#line 2591 "cs.ATG" +#line 2611 "cs.ATG" continuedQuery.FromClause.EndLocation = t.EndLocation; QueryExpressionBody( -#line 2592 "cs.ATG" +#line 2612 "cs.ATG" ref q); } void QueryExpressionOrdering( -#line 2546 "cs.ATG" +#line 2566 "cs.ATG" out QueryExpressionOrdering ordering) { -#line 2547 "cs.ATG" +#line 2567 "cs.ATG" Expression expr; ordering = new QueryExpressionOrdering(); ordering.StartLocation = la.Location; Expr( -#line 2549 "cs.ATG" +#line 2569 "cs.ATG" out expr); -#line 2549 "cs.ATG" +#line 2569 "cs.ATG" ordering.Criteria = expr; if (la.kind == 138 || la.kind == 139) { if (la.kind == 138) { lexer.NextToken(); -#line 2550 "cs.ATG" +#line 2570 "cs.ATG" ordering.Direction = QueryExpressionOrderingDirection.Ascending; } else { lexer.NextToken(); -#line 2551 "cs.ATG" +#line 2571 "cs.ATG" ordering.Direction = QueryExpressionOrderingDirection.Descending; } } -#line 2553 "cs.ATG" +#line 2573 "cs.ATG" ordering.EndLocation = t.EndLocation; } @@ -6094,23 +6152,23 @@ out expr); case 142: s = "\"join\" expected"; break; case 143: s = "\"on\" expected"; break; case 144: s = "\"equals\" expected"; break; - case 145: s = "??? expected"; break; - case 146: s = "invalid NamespaceMemberDecl"; break; - case 147: s = "invalid Identifier"; break; - case 148: s = "invalid NonArrayType"; break; - case 149: s = "invalid AttributeArgument"; break; - case 150: s = "invalid Expr"; break; - case 151: s = "invalid TypeModifier"; break; - case 152: s = "invalid TypeDecl"; break; - case 153: s = "invalid TypeDecl"; break; - case 154: s = "this symbol not expected in ClassBody"; break; - case 155: s = "this symbol not expected in InterfaceBody"; break; - case 156: s = "invalid IntegralType"; break; - case 157: s = "invalid ClassType"; break; - case 158: s = "invalid ClassMemberDecl"; break; - case 159: s = "invalid ClassMemberDecl"; break; - case 160: s = "invalid StructMemberDecl"; break; - case 161: s = "invalid StructMemberDecl"; break; + case 145: s = "\"async\" expected"; break; + case 146: s = "\"await\" expected"; break; + case 147: s = "??? expected"; break; + case 148: s = "invalid NamespaceMemberDecl"; break; + case 149: s = "invalid Identifier"; break; + case 150: s = "invalid NonArrayType"; break; + case 151: s = "invalid AttributeArgument"; break; + case 152: s = "invalid Expr"; break; + case 153: s = "invalid TypeModifier"; break; + case 154: s = "invalid TypeDecl"; break; + case 155: s = "invalid TypeDecl"; break; + case 156: s = "this symbol not expected in ClassBody"; break; + case 157: s = "this symbol not expected in InterfaceBody"; break; + case 158: s = "invalid IntegralType"; break; + case 159: s = "invalid ClassType"; break; + case 160: s = "invalid ClassMemberDecl"; break; + case 161: s = "invalid ClassMemberDecl"; break; case 162: s = "invalid StructMemberDecl"; break; case 163: s = "invalid StructMemberDecl"; break; case 164: s = "invalid StructMemberDecl"; break; @@ -6122,50 +6180,52 @@ out expr); case 170: s = "invalid StructMemberDecl"; break; case 171: s = "invalid StructMemberDecl"; break; case 172: s = "invalid StructMemberDecl"; break; - case 173: s = "invalid InterfaceMemberDecl"; break; - case 174: s = "invalid InterfaceMemberDecl"; break; + case 173: s = "invalid StructMemberDecl"; break; + case 174: s = "invalid StructMemberDecl"; break; case 175: s = "invalid InterfaceMemberDecl"; break; - case 176: s = "invalid TypeWithRestriction"; break; - case 177: s = "invalid TypeWithRestriction"; break; - case 178: s = "invalid SimpleType"; break; - case 179: s = "invalid AccessorModifiers"; break; - case 180: s = "this symbol not expected in Block"; break; - case 181: s = "invalid EventAccessorDecls"; break; - case 182: s = "invalid ConstructorInitializer"; break; - case 183: s = "invalid OverloadableOperator"; break; - case 184: s = "invalid AccessorDecls"; break; - case 185: s = "invalid InterfaceAccessors"; break; - case 186: s = "invalid InterfaceAccessors"; break; - case 187: s = "invalid GetAccessorDecl"; break; - case 188: s = "invalid SetAccessorDecl"; break; - case 189: s = "invalid VariableInitializer"; break; - case 190: s = "this symbol not expected in Statement"; break; - case 191: s = "invalid Statement"; break; - case 192: s = "invalid Argument"; break; - case 193: s = "invalid AssignmentOperator"; break; - case 194: s = "invalid ObjectPropertyInitializerOrVariableInitializer"; break; - case 195: s = "invalid ObjectPropertyInitializerOrVariableInitializer"; break; - case 196: s = "invalid EmbeddedStatement"; break; - case 197: s = "invalid EmbeddedStatement"; break; - case 198: s = "this symbol not expected in EmbeddedStatement"; break; + case 176: s = "invalid InterfaceMemberDecl"; break; + case 177: s = "invalid InterfaceMemberDecl"; break; + case 178: s = "invalid TypeWithRestriction"; break; + case 179: s = "invalid TypeWithRestriction"; break; + case 180: s = "invalid SimpleType"; break; + case 181: s = "invalid AccessorModifiers"; break; + case 182: s = "this symbol not expected in Block"; break; + case 183: s = "invalid EventAccessorDecls"; break; + case 184: s = "invalid ConstructorInitializer"; break; + case 185: s = "invalid OverloadableOperator"; break; + case 186: s = "invalid AccessorDecls"; break; + case 187: s = "invalid InterfaceAccessors"; break; + case 188: s = "invalid InterfaceAccessors"; break; + case 189: s = "invalid GetAccessorDecl"; break; + case 190: s = "invalid SetAccessorDecl"; break; + case 191: s = "invalid VariableInitializer"; break; + case 192: s = "this symbol not expected in Statement"; break; + case 193: s = "invalid Statement"; break; + case 194: s = "invalid Argument"; break; + case 195: s = "invalid AssignmentOperator"; break; + case 196: s = "invalid ObjectPropertyInitializerOrVariableInitializer"; break; + case 197: s = "invalid ObjectPropertyInitializerOrVariableInitializer"; break; + case 198: s = "invalid EmbeddedStatement"; break; case 199: s = "invalid EmbeddedStatement"; break; - case 200: s = "invalid ForInitializer"; break; - case 201: s = "invalid GotoStatement"; break; - case 202: s = "invalid ResourceAcquisition"; break; - case 203: s = "invalid SwitchLabel"; break; - case 204: s = "invalid CatchClause"; break; - case 205: s = "invalid UnaryExpr"; break; - case 206: s = "invalid PrimaryExpr"; break; - case 207: s = "invalid PrimaryExpr"; break; - case 208: s = "invalid TypeArgumentList"; break; - case 209: s = "invalid NewExpression"; break; - case 210: s = "invalid NewExpression"; break; - case 211: s = "invalid LambdaExpressionParameter"; break; - case 212: s = "invalid LambdaExpressionBody"; break; - case 213: s = "invalid RelationalExpr"; break; - case 214: s = "invalid RelationalExpr"; break; - case 215: s = "invalid TypeParameterConstraintsClauseBase"; break; - case 216: s = "invalid QueryExpressionBody"; break; + case 200: s = "this symbol not expected in EmbeddedStatement"; break; + case 201: s = "invalid EmbeddedStatement"; break; + case 202: s = "invalid ForInitializer"; break; + case 203: s = "invalid GotoStatement"; break; + case 204: s = "invalid ResourceAcquisition"; break; + case 205: s = "invalid SwitchLabel"; break; + case 206: s = "invalid CatchClause"; break; + case 207: s = "invalid UnaryExpr"; break; + case 208: s = "invalid PrimaryExpr"; break; + case 209: s = "invalid PrimaryExpr"; break; + case 210: s = "invalid TypeArgumentList"; break; + case 211: s = "invalid NewExpression"; break; + case 212: s = "invalid NewExpression"; break; + case 213: s = "invalid LambdaExpressionParameter"; break; + case 214: s = "invalid LambdaExpressionBody"; break; + case 215: s = "invalid RelationalExpr"; break; + case 216: s = "invalid RelationalExpr"; break; + case 217: s = "invalid TypeParameterConstraintsClauseBase"; break; + case 218: s = "invalid QueryExpressionBody"; break; default: s = "error " + errorNumber; break; } @@ -6178,46 +6238,46 @@ out expr); } static bool[,] set = { - {T,T,T,x, T,T,T,x, x,x,x,T, x,x,x,x, T,T,T,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,T, T,T,T,x, x,T,T,T, T,T,T,T, T,T,T,x, T,T,T,T, T,x,T,T, T,T,T,T, T,x,T,T, T,x,T,T, x,T,T,T, x,x,T,x, T,T,T,T, x,T,T,T, T,T,x,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,x, T,T,x,x, x,x,x,x, T,T,T,x, x,x,x,T, x,x,x,T, x,T,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,x, x,T,x,x, x,x,x,x, T,T,T,x, x,x,x,T, x,x,x,T, x,T,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,T,x,x, x,x,x,x, T,T,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, - {x,T,T,x, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,T,x, x,T,T,x, x,x,T,T, T,x,T,x, x,x,x,x, T,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,T,T, x,x,x,x, x,x,x,x, x,x,T,x, T,T,x,x, T,x,x,T, x,T,x,T, T,T,T,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,T,T,T, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, - {x,T,x,T, T,T,T,T, T,T,x,T, T,T,T,T, T,T,T,T, T,T,T,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, x,T,T,x, T,x,T,x, x,T,x,T, T,x,T,x, T,x,T,x, T,T,T,T, x,x,T,T, x,x,x,x, T,x,T,T, T,T,x,T, x,T,x,T, x,x,T,x, T,T,T,T, x,x,T,T, T,x,x,T, T,T,x,x, x,x,x,x, T,T,x,T, T,x,T,T, T,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,T,x,T, x,x,x,x, T,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, T,x,T,x, x,T,x,T, T,x,T,x, T,x,T,x, T,T,T,T, x,x,T,T, x,x,x,x, T,x,T,T, T,x,x,T, x,T,x,T, x,x,T,x, T,T,T,T, x,x,T,T, T,x,x,T, T,T,x,x, x,x,x,x, T,T,x,T, T,x,T,T, T,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, T,x,T,x, x,T,x,T, T,x,T,x, T,x,T,x, T,T,T,T, x,x,T,T, x,x,x,x, T,x,T,T, T,x,x,T, x,T,x,T, x,x,T,x, T,T,T,T, x,x,T,T, T,x,x,T, T,T,x,x, x,x,x,x, T,T,x,T, T,x,T,T, T,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, T,x,T,x, x,T,x,T, T,x,T,x, T,x,T,x, T,T,T,T, x,x,T,T, x,x,x,x, T,x,T,T, T,x,x,T, x,T,x,T, x,x,T,x, T,T,T,T, x,x,T,T, T,x,x,T, T,T,x,x, x,x,x,x, T,T,x,T, T,x,T,T, T,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,T,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,T,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,T,x, x,x,x,x, x,x,x,x, T,x,x,x, x,T,x,x, x,x,T,x, T,T,T,T, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,T, x,x,T,x, T,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,T, T,x,T,x, T,x,T,x, T,T,T,x, x,x,x,T, x,x,x,x, T,x,T,T, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,T,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, - {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,T,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, - {x,T,T,x, T,T,T,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,T,T,x, x,T,T,x, T,T,T,T, T,T,T,x, x,x,x,x, T,x,T,T, T,T,T,T, x,x,T,x, x,x,T,T, x,T,T,T, x,x,x,x, x,x,x,x, x,T,T,x, T,T,x,x, T,x,T,T, T,T,T,T, T,T,T,T, T,T,x,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,T,T,x, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,T,x, x,T,T,x, x,x,T,T, T,x,T,x, x,x,x,x, T,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,T,T, x,T,x,x, x,x,x,x, T,x,T,x, T,T,x,x, T,x,x,T, x,T,x,T, T,T,T,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, - {T,T,T,x, T,T,T,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,T,T,x, x,T,T,x, T,T,T,T, T,T,T,x, x,x,x,x, T,x,T,T, T,T,T,T, x,x,T,x, x,x,T,T, x,T,T,T, x,x,x,x, x,x,x,x, x,T,T,x, T,T,x,x, T,x,T,T, T,T,T,T, T,T,T,T, T,T,x,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,T,T,x, T,T,T,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,T,T,x, x,T,T,x, x,T,T,T, T,T,T,x, x,x,x,x, T,x,T,T, T,T,T,T, x,x,T,x, x,x,T,T, x,T,T,T, x,x,x,x, x,x,x,x, x,T,T,x, T,T,x,x, T,x,T,T, T,T,T,T, T,T,T,T, T,T,x,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,T,T,x, T,T,T,x, x,x,x,x, x,x,x,x, T,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,T,x, x,T,T,x, x,x,T,T, T,x,T,x, x,x,x,x, T,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,T,T, x,x,x,x, x,x,x,x, x,x,T,x, T,T,T,x, T,x,x,T, x,T,x,T, T,T,T,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,T,T,x, T,T,T,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,T,T,T, x,T,T,x, T,T,T,T, T,T,T,x, x,x,x,x, T,x,T,T, T,T,T,T, x,x,T,x, x,x,T,T, x,T,T,T, x,x,x,x, x,x,x,x, x,T,T,x, T,T,x,x, T,x,T,T, T,T,T,T, T,T,T,T, T,T,x,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {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,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,T,x, x,T,T,x, x,x,T,T, T,x,T,x, x,x,x,x, T,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,T,T, x,x,x,x, x,x,x,x, x,x,T,x, T,T,x,x, T,x,x,T, x,T,x,T, T,T,T,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, - {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,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,T,x,x, x,x,x,x, T,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x}, - {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,T,x,x, T,T,T,x, x,x,x} + {T,T,T,x, T,T,T,x, x,x,x,T, x,x,x,x, T,T,T,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,T, T,T,T,x, x,T,T,T, T,T,T,T, T,T,T,x, T,T,T,T, T,x,T,T, T,T,T,T, T,x,T,T, T,x,T,T, x,T,T,T, x,x,T,x, T,T,T,T, x,T,T,T, T,T,x,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,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,T,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,x, T,T,x,x, x,x,x,x, T,T,T,x, x,x,x,T, x,x,x,T, x,T,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,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,T,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,x, x,T,x,x, x,x,x,x, T,T,T,x, x,x,x,T, x,x,x,T, x,T,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x}, + {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,T,x,x, x,x,x,x, T,T,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,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,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,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, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,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,x,T, T,x,T,x, x,T,T,x, x,x,T,T, T,x,T,x, x,x,x,x, T,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,T,T, x,x,x,x, x,x,x,x, x,x,T,x, T,T,x,x, T,x,x,T, x,T,x,T, T,T,T,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,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,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,T,x,T, T,T,T,T, T,T,x,T, T,T,T,T, T,T,T,T, T,T,T,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, x,T,T,x, T,x,T,x, x,T,x,T, T,x,T,x, T,x,T,x, T,T,T,T, x,x,T,T, x,x,x,x, T,x,T,T, T,T,x,T, x,T,x,T, x,x,T,x, T,T,T,T, x,x,T,T, T,x,x,T, T,T,x,x, x,x,x,x, T,T,x,T, T,x,T,T, T,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,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, T,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,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, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,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,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,T,x,T, x,x,x,x, T,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,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, x,T,x,x, T,x,T,x, x,T,x,T, T,x,T,x, T,x,T,x, T,T,T,T, x,x,T,T, x,x,x,x, T,x,T,T, T,x,x,T, x,T,x,T, x,x,T,x, T,T,T,T, x,x,T,T, T,x,x,T, T,T,x,x, x,x,x,x, T,T,x,T, T,x,T,T, T,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,x, x}, + {T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, T,x,T,x, x,T,x,T, T,x,T,x, T,x,T,x, T,T,T,T, x,x,T,T, x,x,x,x, T,x,T,T, T,x,x,T, x,T,x,T, x,x,T,x, T,T,T,T, x,x,T,T, T,x,x,T, T,T,x,x, x,x,x,x, T,T,x,T, T,x,T,T, T,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,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,T,x,x, T,x,T,x, x,T,x,T, T,x,T,x, T,x,T,x, T,T,T,T, x,x,T,T, x,x,x,x, T,x,T,T, T,x,x,T, x,T,x,T, x,x,T,x, T,T,T,T, x,x,T,T, T,x,x,T, T,T,x,x, x,x,x,x, T,T,x,T, T,x,T,T, T,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,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,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,T,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,x, x}, + {T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,T,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,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,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,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,T,T, T,T,T,T, T,T,T,T, T,T,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,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,T,x, x,x,x,x, x,x,x,x, T,x,x,x, x,T,x,x, x,x,T,x, T,T,T,T, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,T, x,x,T,x, T,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,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, T,x,T,x, x,T,x,T, T,x,T,x, T,x,T,x, T,T,T,x, x,x,x,T, x,x,x,x, T,x,T,T, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,T,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,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,T, x,x,x,x, T,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,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, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,T,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,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,T,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,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,x,T, T,T,T,x, x,T,T,x, T,T,T,T, T,T,T,x, x,x,x,x, T,x,T,T, T,T,T,T, x,x,T,x, x,x,T,T, x,T,T,T, x,x,x,x, x,x,x,x, x,T,T,x, T,T,x,x, T,x,T,T, T,T,T,T, T,T,T,T, T,T,x,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,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,x,T, T,x,T,x, x,T,T,x, x,x,T,T, T,x,T,x, x,x,x,x, T,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,T,T, x,T,x,x, x,x,x,x, T,x,T,x, T,T,x,x, T,x,x,T, x,T,x,T, T,T,T,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,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, T,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,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, T,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x}, + {T,T,T,x, T,T,T,x, x,x,x,T, x,x,x,x, T,x,x,x, T,x,x,x, T,x,x,T, T,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,T,T,x, x,T,T,x, T,T,T,T, T,T,T,x, x,x,x,x, T,x,T,T, T,T,T,T, x,x,T,x, x,x,T,T, x,T,T,T, x,x,x,x, x,x,x,x, x,T,T,x, T,T,x,x, T,x,T,T, T,T,T,T, T,T,T,T, T,T,x,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,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,x,T, T,T,T,x, x,T,T,x, x,T,T,T, T,T,T,x, x,x,x,x, T,x,T,T, T,T,T,T, x,x,T,x, x,x,T,T, x,T,T,T, x,x,x,x, x,x,x,x, x,T,T,x, T,T,x,x, T,x,T,T, T,T,T,T, T,T,T,T, T,T,x,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,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,x,T, T,x,T,x, x,T,T,x, x,x,T,T, T,x,T,x, x,x,x,x, T,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,T,T, x,x,x,x, x,x,x,x, x,x,T,x, T,T,T,x, T,x,x,T, x,T,x,T, T,T,T,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,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,x,T, T,T,T,T, x,T,T,x, T,T,T,T, T,T,T,x, x,x,x,x, T,x,T,T, T,T,T,T, x,x,T,x, x,x,T,T, x,T,T,T, x,x,x,x, x,x,x,x, x,T,T,x, T,T,x,x, T,x,T,T, T,T,T,T, T,T,T,T, T,T,x,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,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,T,x, x}, + {x,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,T,x, x,T,T,x, x,x,T,T, T,x,T,x, x,x,x,x, T,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,T,T,T, x,x,x,x, x,x,x,x, x,x,T,x, T,T,x,x, T,x,x,T, x,T,x,T, T,T,T,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,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, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,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}, + {x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, x,T,x,x, x,x,T,x, x,x,T,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,x, x,x,x,T, x,x,x,T, x,T,x,x, x,x,x,x, T,x,T,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, T,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,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,T,T, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,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,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x}, + {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,T,x,x, T,T,T,x, x,x,x,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 f95c0f01af..ee6c75a6a6 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG +++ b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG @@ -166,6 +166,8 @@ TOKENS "join" "on" "equals" + "async" + "await" /* END AUTOGENERATED TOKENS SECTION */ /*------------------------------------------------------------------------* @@ -744,6 +746,7 @@ MemberModifiers | "virtual" (. m.Add(Modifiers.Virtual, t.Location); .) | "volatile" (. m.Add(Modifiers.Volatile, t.Location); .) | "partial" (. m.Add(Modifiers.Partial, t.Location); .) + | "async" (. m.Add(Modifiers.Async, t.Location); .) } . @@ -1847,6 +1850,7 @@ UnaryExpr | "++" (. expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Increment) { StartLocation = t.Location }); .) | "--" (. expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Decrement) { StartLocation = t.Location }); .) | "&" (. expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.AddressOf) { StartLocation = t.Location }); .) + | "await" (. expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Await) { StartLocation = t.Location }); .) /*--- cast expression: */ /* Problem: "(" Type ")" from here and * @@ -1908,6 +1912,22 @@ PrimaryExpr "::" (. pexpr = new TypeReferenceExpression(type); .) Identifier (. if (type.Type == "global") { type.IsGlobal = true; type.Type = t.val ?? "?"; } else type.Type += "." + (t.val ?? "?"); .) + | "delegate" AnonymousMethodExpr (. pexpr = expr; .) + | IF (la.kind == Tokens.Async && Peek(1).kind == Tokens.Delegate) + "async" "delegate" AnonymousMethodExpr (. pexpr = expr; .) + (. ((AnonymousMethodExpression)expr).IsAsync = true; .) + + | IF (la.kind == Tokens.Async && Peek(1).kind == Tokens.OpenParenthesis) + "async" + LambdaExpression + (. ((LambdaExpression)pexpr).IsAsync = true; .) + + | IF (la.kind == Tokens.Async && IsIdentifierToken(Peek(1))) + "async" + Identifier (. pexpr = new IdentifierExpression(t.val); .) + ShortedLambdaExpression<(IdentifierExpression)pexpr, out pexpr> + (. ((LambdaExpression)pexpr).IsAsync = true; .) + /*--- simple name (IdentifierExpression): */ | Identifier (. pexpr = new IdentifierExpression(t.val); .) @@ -1918,9 +1938,10 @@ PrimaryExpr TypeArgumentList (. ((IdentifierExpression)pexpr).TypeArguments = typeList; .) ] + | IF (IsLambdaExpression()) /* Lambda expression */ LambdaExpression - + /*--- parenthesized expression: */ | "(" Expr ")" (. pexpr = new ParenthesizedExpression(expr); .) @@ -1964,7 +1985,6 @@ PrimaryExpr | "sizeof" "(" Type ")" (. pexpr = new SizeOfExpression(type); .) | "checked" "(" Expr ")" (. pexpr = new CheckedExpression(expr); .) | "unchecked" "(" Expr ")" (. pexpr = new UncheckedExpression(expr); .) - | "delegate" AnonymousMethodExpr (. pexpr = expr; .) ) (. if (pexpr != null) { if (pexpr.StartLocation.IsEmpty) @@ -2616,6 +2636,8 @@ Identifier | "join" | "on" | "equals" +| "async" +| "await" . diff --git a/src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs b/src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs index ac9c05394a..80cfbbdd33 100644 --- a/src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs +++ b/src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs @@ -2458,6 +2458,10 @@ namespace ICSharpCode.NRefactory.PrettyPrinter case UnaryOperatorType.AddressOf: outputFormatter.PrintToken(Tokens.BitwiseAnd); break; + case UnaryOperatorType.Await: + outputFormatter.PrintToken(Tokens.Await); + outputFormatter.Space(); + break; default: Error(unaryOperatorExpression, String.Format("Unknown unary operator {0}", unaryOperatorExpression.Op)); return null; diff --git a/src/Libraries/NRefactory/Project/Src/PrettyPrinter/VBNet/VBNetOutputVisitor.cs b/src/Libraries/NRefactory/Project/Src/PrettyPrinter/VBNet/VBNetOutputVisitor.cs index 2466544bb3..bf3eb972e1 100644 --- a/src/Libraries/NRefactory/Project/Src/PrettyPrinter/VBNet/VBNetOutputVisitor.cs +++ b/src/Libraries/NRefactory/Project/Src/PrettyPrinter/VBNet/VBNetOutputVisitor.cs @@ -2370,6 +2370,10 @@ namespace ICSharpCode.NRefactory.PrettyPrinter outputFormatter.PrintToken(Tokens.AddressOf); TrackedVisit(unaryOperatorExpression.Expression, data); return null; + case UnaryOperatorType.Await: + outputFormatter.PrintText("Await "); + TrackedVisit(unaryOperatorExpression.Expression, data); + return null; default: Error("unknown unary operator: " + unaryOperatorExpression.Op.ToString(), unaryOperatorExpression.StartLocation); outputFormatter.PrintText(unaryOperatorExpression.Op.ToString()); diff --git a/src/Libraries/NRefactory/Project/Src/Visitors/AbstractASTVisitor.cs b/src/Libraries/NRefactory/Project/Src/Visitors/AbstractASTVisitor.cs index c1f876d666..941d22104a 100644 --- a/src/Libraries/NRefactory/Project/Src/Visitors/AbstractASTVisitor.cs +++ b/src/Libraries/NRefactory/Project/Src/Visitors/AbstractASTVisitor.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.1 +// Runtime Version:4.0.30319.235 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/src/Libraries/NRefactory/Project/Src/Visitors/AbstractAstTransformer.cs b/src/Libraries/NRefactory/Project/Src/Visitors/AbstractAstTransformer.cs index ee4f8208de..36a2011c5b 100644 --- a/src/Libraries/NRefactory/Project/Src/Visitors/AbstractAstTransformer.cs +++ b/src/Libraries/NRefactory/Project/Src/Visitors/AbstractAstTransformer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.1 +// Runtime Version:4.0.30319.235 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/src/Libraries/NRefactory/Project/Src/Visitors/NodeTrackingAstVisitor.cs b/src/Libraries/NRefactory/Project/Src/Visitors/NodeTrackingAstVisitor.cs index 84b3621bda..e61e030bfa 100644 --- a/src/Libraries/NRefactory/Project/Src/Visitors/NodeTrackingAstVisitor.cs +++ b/src/Libraries/NRefactory/Project/Src/Visitors/NodeTrackingAstVisitor.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.1 +// Runtime Version:4.0.30319.235 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/src/Libraries/NRefactory/Project/Src/Visitors/NotImplementedAstVisitor.cs b/src/Libraries/NRefactory/Project/Src/Visitors/NotImplementedAstVisitor.cs index 71dd07cdce..d0bed9f61a 100644 --- a/src/Libraries/NRefactory/Project/Src/Visitors/NotImplementedAstVisitor.cs +++ b/src/Libraries/NRefactory/Project/Src/Visitors/NotImplementedAstVisitor.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.1 +// Runtime Version:4.0.30319.235 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/src/Libraries/NRefactory/Test/Lexer/CSharp/LexerTests.cs b/src/Libraries/NRefactory/Test/Lexer/CSharp/LexerTests.cs index 13af5c0e62..355dc3a00e 100644 --- a/src/Libraries/NRefactory/Test/Lexer/CSharp/LexerTests.cs +++ b/src/Libraries/NRefactory/Test/Lexer/CSharp/LexerTests.cs @@ -1,6 +1,3 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) - // this file was autogenerated by a tool. using System; using System.IO; @@ -1012,5 +1009,19 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.CSharp ILexer lexer = GenerateLexer(new StringReader("equals")); Assert.AreEqual(Tokens.Equals, lexer.NextToken().Kind); } + + [Test] + public void TestAsync() + { + ILexer lexer = GenerateLexer(new StringReader("async")); + Assert.AreEqual(Tokens.Async, lexer.NextToken().Kind); + } + + [Test] + public void TestAwait() + { + ILexer lexer = GenerateLexer(new StringReader("await")); + Assert.AreEqual(Tokens.Await, lexer.NextToken().Kind); + } } } diff --git a/src/Libraries/NRefactory/Test/Lexer/VBNet/LexerTests.cs b/src/Libraries/NRefactory/Test/Lexer/VBNet/LexerTests.cs index 112d2b44fc..a5fdaa5df5 100644 --- a/src/Libraries/NRefactory/Test/Lexer/VBNet/LexerTests.cs +++ b/src/Libraries/NRefactory/Test/Lexer/VBNet/LexerTests.cs @@ -1,6 +1,3 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) - // this file was autogenerated by a tool. using System; using System.IO; diff --git a/src/Libraries/NRefactory/Test/Parser/Expressions/AnonymousMethodTests.cs b/src/Libraries/NRefactory/Test/Parser/Expressions/AnonymousMethodTests.cs index 147d19a6f7..9f79859ace 100644 --- a/src/Libraries/NRefactory/Test/Parser/Expressions/AnonymousMethodTests.cs +++ b/src/Libraries/NRefactory/Test/Parser/Expressions/AnonymousMethodTests.cs @@ -55,5 +55,12 @@ namespace ICSharpCode.NRefactory.Tests.Ast //Assert.AreEqual(1, ame.Body.Children.Count); //Assert.IsTrue(ame.Body.Children[0] is ReturnStatement); } + + [Test] + public void AsyncSimpleAnonymousMethod() + { + AnonymousMethodExpression ame = Parse("async delegate { }"); + Assert.IsTrue(ame.IsAsync); + } } } diff --git a/src/Libraries/NRefactory/Test/Parser/Expressions/IdentifierExpressionTests.cs b/src/Libraries/NRefactory/Test/Parser/Expressions/IdentifierExpressionTests.cs index 0685701e38..8378d92201 100644 --- a/src/Libraries/NRefactory/Test/Parser/Expressions/IdentifierExpressionTests.cs +++ b/src/Libraries/NRefactory/Test/Parser/Expressions/IdentifierExpressionTests.cs @@ -42,6 +42,13 @@ namespace ICSharpCode.NRefactory.Tests.Ast Assert.AreEqual("TargetMethod", ident.Identifier); Assert.AreEqual(1, ident.TypeArguments.Count); } + + [Test] + public void AsyncIsIdentifier() + { + IdentifierExpression ident = ParseUtilCSharp.ParseExpression("async"); + Assert.AreEqual("async", ident.Identifier); + } #endregion #region VB.NET diff --git a/src/Libraries/NRefactory/Test/Parser/Expressions/LambdaExpressionTests.cs b/src/Libraries/NRefactory/Test/Parser/Expressions/LambdaExpressionTests.cs index b793c36488..3ec3cb466d 100644 --- a/src/Libraries/NRefactory/Test/Parser/Expressions/LambdaExpressionTests.cs +++ b/src/Libraries/NRefactory/Test/Parser/Expressions/LambdaExpressionTests.cs @@ -88,6 +88,27 @@ namespace ICSharpCode.NRefactory.Tests.Ast Assert.IsTrue(e.ReturnType.IsNull); } + [Test] + public void AsyncLambdaWithParentheses() + { + LambdaExpression e = ParseCSharp("async (x) => x + 1"); + Assert.IsTrue(e.IsAsync); + Assert.AreEqual("x", e.Parameters[0].ParameterName); + Assert.IsTrue(e.Parameters[0].TypeReference.IsNull); + Assert.IsTrue(e.ExpressionBody is BinaryOperatorExpression); + Assert.IsTrue(e.ReturnType.IsNull); + } + + [Test] + public void AsyncLambdaWithoutParentheses() + { + LambdaExpression e = ParseCSharp("async x => x + 1"); + Assert.IsTrue(e.IsAsync); + Assert.AreEqual("x", e.Parameters[0].ParameterName); + Assert.IsTrue(e.Parameters[0].TypeReference.IsNull); + Assert.IsTrue(e.ExpressionBody is BinaryOperatorExpression); + Assert.IsTrue(e.ReturnType.IsNull); + } #endregion #region VB.NET diff --git a/src/Libraries/NRefactory/Test/Parser/Expressions/UnaryOperatorExpressionTests.cs b/src/Libraries/NRefactory/Test/Parser/Expressions/UnaryOperatorExpressionTests.cs index 08937e053c..3662e8fcf0 100644 --- a/src/Libraries/NRefactory/Test/Parser/Expressions/UnaryOperatorExpressionTests.cs +++ b/src/Libraries/NRefactory/Test/Parser/Expressions/UnaryOperatorExpressionTests.cs @@ -27,6 +27,12 @@ namespace ICSharpCode.NRefactory.Tests.Ast CSharpTestUnaryOperatorExpressionTest("!a", UnaryOperatorType.Not); } + [Test] + public void CSharpAwaitTest() + { + CSharpTestUnaryOperatorExpressionTest("await a", UnaryOperatorType.Await); + } + [Test] public void CSharpBitNotTest() { @@ -93,6 +99,16 @@ namespace ICSharpCode.NRefactory.Tests.Ast UnaryOperatorExpression adrOf = (UnaryOperatorExpression)ce.Expression; Assert.AreEqual(UnaryOperatorType.AddressOf, adrOf.Op); } + + [Test] + public void NestedAwait() + { + var uoe = ParseUtilCSharp.ParseExpression("await await a"); + Assert.AreEqual(UnaryOperatorType.Await, uoe.Op); + var nested = (UnaryOperatorExpression)uoe.Expression; + Assert.AreEqual(UnaryOperatorType.Await, nested.Op); + Assert.IsTrue(nested.Expression is IdentifierExpression); + } #endregion #region VB.NET diff --git a/src/Libraries/NRefactory/Test/Parser/TypeLevel/MethodDeclarationTests.cs b/src/Libraries/NRefactory/Test/Parser/TypeLevel/MethodDeclarationTests.cs index da4fc7a6b3..5cff963748 100644 --- a/src/Libraries/NRefactory/Test/Parser/TypeLevel/MethodDeclarationTests.cs +++ b/src/Libraries/NRefactory/Test/Parser/TypeLevel/MethodDeclarationTests.cs @@ -20,6 +20,47 @@ namespace ICSharpCode.NRefactory.Tests.Ast Assert.IsFalse(md.IsExtensionMethod); } + [Test] + public void CSharpAsyncMethodDeclarationTest() + { + MethodDeclaration md = ParseUtilCSharp.ParseTypeMember("async void MyMethod() {} "); + Assert.AreEqual("System.Void", md.TypeReference.Type); + Assert.AreEqual(0, md.Parameters.Count); + Assert.AreEqual(Modifiers.Async, md.Modifier); + } + + [Test, Ignore("doesn't work")] + public void AsyncAsyncAsync() + { + MethodDeclaration md = ParseUtilCSharp.ParseTypeMember("async async async(async async) { }"); + Assert.AreEqual("async", md.TypeReference.Type); + Assert.AreEqual(Modifiers.Async, md.Modifier); + Assert.AreEqual("async", md.Name); + Assert.AreEqual("async", md.Parameters[0].TypeReference.Type); + Assert.AreEqual("async", md.Parameters[0].ParameterName); + } + + [Test] + public void AsyncVoidAsync() + { + MethodDeclaration md = ParseUtilCSharp.ParseTypeMember("async void async(async async) { }"); + Assert.AreEqual("System.Void", md.TypeReference.Type); + Assert.AreEqual(Modifiers.Async, md.Modifier); + Assert.AreEqual("async", md.Name); + Assert.AreEqual("async", md.Parameters[0].TypeReference.Type); + Assert.AreEqual("async", md.Parameters[0].ParameterName); + } + + [Test] + public void BoolAsyncParameter() + { + MethodDeclaration md = ParseUtilCSharp.ParseTypeMember("void Work(bool async) { }"); + Assert.AreEqual(Modifiers.None, md.Modifier); + Assert.AreEqual("Work", md.Name); + Assert.AreEqual("System.Boolean", md.Parameters[0].TypeReference.Type); + Assert.AreEqual("async", md.Parameters[0].ParameterName); + } + [Test] public void CSharpAbstractMethodDeclarationTest() { diff --git a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/ResolveVisitor.cs b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/ResolveVisitor.cs index 11b1187a87..9e86f55ff6 100644 --- a/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/ResolveVisitor.cs +++ b/src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/NRefactoryResolver/ResolveVisitor.cs @@ -691,6 +691,13 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver } else { return null; } + case UnaryOperatorType.Await: + var crt = type.CastToConstructedReturnType(); + if (crt != null && crt.Name == "Task" && crt.TypeArguments.Count == 1) { + return CreateResolveResult(crt.TypeArguments[0]); + } else { + return null; + } default: return CreateResolveResult(type); }