diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/DocumentLine.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/DocumentLine.cs index e4e06b56ca..d877721acf 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/DocumentLine.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/DocumentLine.cs @@ -222,6 +222,14 @@ namespace ICSharpCode.AvalonEdit.Document } } } + + IDocumentLine IDocumentLine.NextLine { + get { return this.NextLine; } + } + + IDocumentLine IDocumentLine.PreviousLine { + get { return this.PreviousLine; } + } #endregion #region ToString diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs index 148cf2a7a2..36e63d8188 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Analysis/ControlFlow.cs @@ -673,7 +673,7 @@ namespace ICSharpCode.NRefactory.CSharp.Analysis return CreateConnectedEndNode(usingStatement, bodyEnd); } - public override ControlFlowNode VisitYieldStatement(YieldStatement yieldStatement, ControlFlowNode data) + public override ControlFlowNode VisitYieldReturnStatement(YieldReturnStatement yieldStatement, ControlFlowNode data) { return CreateConnectedEndNode(yieldStatement, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs index 7f8c62e5b6..a09dc9f1c9 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstNode.cs @@ -52,7 +52,7 @@ namespace ICSharpCode.NRefactory.CSharp } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return default (S); } @@ -83,7 +83,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return NodeType.Pattern; } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitPatternPlaceholder (this, child, data); } @@ -441,7 +441,7 @@ namespace ICSharpCode.NRefactory.CSharp return copy; } - public abstract S AcceptVisitor (IAstVisitor visitor, T data); + public abstract S AcceptVisitor (IAstVisitor visitor, T data = default(T)); #region Pattern Matching protected static bool MatchString (string name1, string name2) @@ -613,7 +613,7 @@ namespace ICSharpCode.NRefactory.CSharp if (IsNull) return "Null"; StringWriter w = new StringWriter(); - AcceptVisitor(new OutputVisitor(w, new CSharpFormattingOptions()), null); + AcceptVisitor(new CSharpOutputVisitor(w, new CSharpFormattingOptions()), null); string text = w.ToString().TrimEnd().Replace("\t", "").Replace(w.NewLine, " "); if (text.Length > 100) return text.Substring(0, 97) + "..."; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstType.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstType.cs index 517a4783f4..fbc3eccf21 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstType.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/AstType.cs @@ -37,7 +37,7 @@ namespace ICSharpCode.NRefactory.CSharp } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return default (S); } @@ -68,7 +68,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return NodeType.Pattern; } } - public override S AcceptVisitor(IAstVisitor visitor, T data) + public override S AcceptVisitor(IAstVisitor visitor, T data = default(T)) { return visitor.VisitPatternPlaceholder(this, child, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CSharpTokenNode.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CSharpTokenNode.cs index f174adecca..00bf53dfd2 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CSharpTokenNode.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CSharpTokenNode.cs @@ -42,7 +42,7 @@ namespace ICSharpCode.NRefactory.CSharp { } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return default (S); } @@ -87,7 +87,7 @@ namespace ICSharpCode.NRefactory.CSharp } #endregion - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitCSharpTokenNode (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CompilationUnit.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CompilationUnit.cs index 889e8d048b..f90f7cf011 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CompilationUnit.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/CompilationUnit.cs @@ -83,7 +83,7 @@ namespace ICSharpCode.NRefactory.CSharp return o != null && GetChildrenByRole(MemberRole).DoMatch(o.GetChildrenByRole(MemberRole), match); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitCompilationUnit (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ComposedType.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ComposedType.cs index dceeae35f0..d70a478207 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ComposedType.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ComposedType.cs @@ -73,7 +73,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildrenByRole (ArraySpecifierRole); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitComposedType (this, data); } @@ -159,7 +159,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.RBracket); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitArraySpecifier(this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/DepthFirstAstVisitor.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/DepthFirstAstVisitor.cs index 89e73063dd..d001b7490c 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/DepthFirstAstVisitor.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/DepthFirstAstVisitor.cs @@ -360,9 +360,9 @@ namespace ICSharpCode.NRefactory.CSharp return VisitChildren (yieldBreakStatement, data); } - public virtual S VisitYieldStatement (YieldStatement yieldStatement, T data) + public virtual S VisitYieldReturnStatement (YieldReturnStatement yieldReturnStatement, T data) { - return VisitChildren (yieldStatement, data); + return VisitChildren (yieldReturnStatement, data); } public virtual S VisitAnonymousMethodExpression (AnonymousMethodExpression anonymousMethodExpression, T data) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ErrorNode.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ErrorNode.cs index c8569c55a8..53dfd7126f 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ErrorNode.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ErrorNode.cs @@ -58,7 +58,7 @@ namespace ICSharpCode.NRefactory.CSharp { } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { // nothing return default (S); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AnonymousMethodExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AnonymousMethodExpression.cs index f8c8cefac9..91fc0c4177 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AnonymousMethodExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AnonymousMethodExpression.cs @@ -30,11 +30,15 @@ using System.Linq; namespace ICSharpCode.NRefactory.CSharp { /// - /// delegate(Parameters) {Body} + /// [async] delegate(Parameters) {Body} /// public class AnonymousMethodExpression : Expression { - // used to make a difference between delegate {} and delegate () {} + public readonly static Role AsyncModifierRole = LambdaExpression.AsyncModifierRole; + + public bool IsAsync { get; set; } + + // used to tell the difference between delegate {} and delegate () {} public bool HasParameterList { get; set; } @@ -78,7 +82,7 @@ namespace ICSharpCode.NRefactory.CSharp { } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitAnonymousMethodExpression (this, data); } @@ -86,7 +90,8 @@ namespace ICSharpCode.NRefactory.CSharp protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) { AnonymousMethodExpression o = other as AnonymousMethodExpression; - return o != null && this.HasParameterList == o.HasParameterList && this.Parameters.DoMatch(o.Parameters, match) && this.Body.DoMatch(o.Body, match); + return o != null && this.IsAsync == o.IsAsync && this.HasParameterList == o.HasParameterList + && this.Parameters.DoMatch(o.Parameters, match) && this.Body.DoMatch(o.Body, match); } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AnonymousTypeCreateExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AnonymousTypeCreateExpression.cs index 3a433fbc3a..496a2cfdb5 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AnonymousTypeCreateExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AnonymousTypeCreateExpression.cs @@ -64,7 +64,7 @@ namespace ICSharpCode.NRefactory.CSharp { } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitAnonymousTypeCreateExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ArrayCreateExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ArrayCreateExpression.cs index d3f6c26893..f9bee2a68b 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ArrayCreateExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ArrayCreateExpression.cs @@ -51,7 +51,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (InitializerRole, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitArrayCreateExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ArrayInitializerExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ArrayInitializerExpression.cs index 92afafe856..d4858d8b23 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ArrayInitializerExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ArrayInitializerExpression.cs @@ -58,7 +58,7 @@ namespace ICSharpCode.NRefactory.CSharp } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return default (S); } @@ -82,7 +82,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.RBrace); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitArrayInitializerExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AsExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AsExpression.cs index b1a1b80653..59f4652da9 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AsExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AsExpression.cs @@ -55,7 +55,7 @@ namespace ICSharpCode.NRefactory.CSharp AddChild (type, Roles.Type); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitAsExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AssignmentExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AssignmentExpression.cs index 998ab78fb4..c0e9ef3f7d 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AssignmentExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/AssignmentExpression.cs @@ -74,7 +74,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole(RightRole, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitAssignmentExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/BaseReferenceExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/BaseReferenceExpression.cs index de964170b6..2214e3eaac 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/BaseReferenceExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/BaseReferenceExpression.cs @@ -47,7 +47,7 @@ namespace ICSharpCode.NRefactory.CSharp } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitBaseReferenceExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/BinaryOperatorExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/BinaryOperatorExpression.cs index cef22fecd2..68259dedf1 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/BinaryOperatorExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/BinaryOperatorExpression.cs @@ -67,7 +67,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole(RightRole, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitBinaryOperatorExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/CastExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/CastExpression.cs index 88c7dcfe36..6a3f1ceb93 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/CastExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/CastExpression.cs @@ -59,7 +59,7 @@ namespace ICSharpCode.NRefactory.CSharp AddChild (expression, Roles.Expression); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitCastExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/CheckedExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/CheckedExpression.cs index 349976c68a..f9fd9ab9db 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/CheckedExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/CheckedExpression.cs @@ -57,7 +57,7 @@ namespace ICSharpCode.NRefactory.CSharp AddChild (expression, Roles.Expression); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitCheckedExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ConditionalExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ConditionalExpression.cs index 5e80994328..3a98ed7ed7 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ConditionalExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ConditionalExpression.cs @@ -71,7 +71,7 @@ namespace ICSharpCode.NRefactory.CSharp AddChild (falseExpression, FalseRole); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitConditionalExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/DefaultValueExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/DefaultValueExpression.cs index 1a91d6d086..28fb4adc45 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/DefaultValueExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/DefaultValueExpression.cs @@ -57,7 +57,7 @@ namespace ICSharpCode.NRefactory.CSharp AddChild (type, Roles.Type); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitDefaultValueExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/DirectionExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/DirectionExpression.cs index 0c19b2ca7d..d99182d335 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/DirectionExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/DirectionExpression.cs @@ -62,7 +62,7 @@ namespace ICSharpCode.NRefactory.CSharp AddChild (expression, Roles.Expression); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitDirectionExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/EmptyExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/EmptyExpression.cs index 9ea3c99079..e333090eb2 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/EmptyExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/EmptyExpression.cs @@ -62,7 +62,7 @@ namespace ICSharpCode.NRefactory.CSharp } #endregion - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitEmptyExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/Expression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/Expression.cs index 23f3342585..f61e67f0b7 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/Expression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/Expression.cs @@ -41,7 +41,7 @@ namespace ICSharpCode.NRefactory.CSharp } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return default (S); } @@ -72,7 +72,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return NodeType.Pattern; } } - public override S AcceptVisitor(IAstVisitor visitor, T data) + public override S AcceptVisitor(IAstVisitor visitor, T data = default(T)) { return visitor.VisitPatternPlaceholder(this, child, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/IdentifierExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/IdentifierExpression.cs index cce153e97b..892807fd3b 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/IdentifierExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/IdentifierExpression.cs @@ -60,7 +60,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildrenByRole (Roles.TypeArgument); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitIdentifierExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/IndexerExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/IndexerExpression.cs index 045d8d0388..1d7d9a4642 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/IndexerExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/IndexerExpression.cs @@ -68,7 +68,7 @@ namespace ICSharpCode.NRefactory.CSharp { } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitIndexerExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/InvocationExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/InvocationExpression.cs index 84d0830fee..b609ae8864 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/InvocationExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/InvocationExpression.cs @@ -50,7 +50,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.RPar); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitInvocationExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/IsExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/IsExpression.cs index a8c7b0e002..d01fe48b1b 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/IsExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/IsExpression.cs @@ -45,7 +45,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole(Roles.Type, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitIsExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/LambdaExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/LambdaExpression.cs index 774bd6c4a3..2b6a39d6b9 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/LambdaExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/LambdaExpression.cs @@ -1,6 +1,6 @@ // // LambdaExpression.cs -// +// // Author: // Mike Krüger // @@ -29,14 +29,17 @@ using System.Linq; namespace ICSharpCode.NRefactory.CSharp { /// - /// Parameters => Body + /// [async] Parameters => Body /// public class LambdaExpression : Expression { + public readonly static Role AsyncModifierRole = new Role("AsyncModifier", CSharpTokenNode.Null); public readonly static Role ArrowRole = new Role("Arrow", CSharpTokenNode.Null); public static readonly Role BodyRole = new Role("Body", AstNode.Null); - public AstNodeCollection Parameters { + public bool IsAsync { get; set; } + + public AstNodeCollection Parameters { get { return GetChildrenByRole (Roles.Parameter); } } @@ -49,7 +52,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (BodyRole, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitLambdaExpression (this, data); } @@ -57,7 +60,7 @@ namespace ICSharpCode.NRefactory.CSharp protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) { LambdaExpression o = other as LambdaExpression; - return o != null && this.Parameters.DoMatch(o.Parameters, match) && this.Body.DoMatch(o.Body, match); + return o != null && this.IsAsync == o.IsAsync && this.Parameters.DoMatch(o.Parameters, match) && this.Body.DoMatch(o.Body, match); } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/MemberReferenceExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/MemberReferenceExpression.cs index fdea7dc635..cf0c1808fa 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/MemberReferenceExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/MemberReferenceExpression.cs @@ -87,7 +87,7 @@ namespace ICSharpCode.NRefactory.CSharp { } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitMemberReferenceExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/NamedArgumentExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/NamedArgumentExpression.cs index c4cf8e8a58..6b63038632 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/NamedArgumentExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/NamedArgumentExpression.cs @@ -22,6 +22,7 @@ namespace ICSharpCode.NRefactory.CSharp { /// /// Represents a named argument passed to a method or attribute. + /// name: expression /// public class NamedArgumentExpression : Expression { @@ -53,8 +54,8 @@ namespace ICSharpCode.NRefactory.CSharp } } - public CSharpTokenNode AssignToken { - get { return GetChildByRole (Roles.Assign); } + public CSharpTokenNode ColonToken { + get { return GetChildByRole (Roles.Colon); } } public Expression Expression { @@ -62,7 +63,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (Roles.Expression, value); } } - public override S AcceptVisitor(IAstVisitor visitor, T data) + public override S AcceptVisitor(IAstVisitor visitor, T data = default(T)) { return visitor.VisitNamedArgumentExpression(this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/NamedExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/NamedExpression.cs index 5c4892f131..fb5ce405a1 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/NamedExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/NamedExpression.cs @@ -72,7 +72,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (Roles.Expression, value); } } - public override S AcceptVisitor(IAstVisitor visitor, T data) + public override S AcceptVisitor(IAstVisitor visitor, T data = default(T)) { return visitor.VisitNamedExpression(this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/NullReferenceExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/NullReferenceExpression.cs index 3fe5a0e49a..3a92c97f30 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/NullReferenceExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/NullReferenceExpression.cs @@ -53,7 +53,7 @@ namespace ICSharpCode.NRefactory.CSharp this.location = location; } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitNullReferenceExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ObjectCreateExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ObjectCreateExpression.cs index 7bb5dc821f..0e72c04b11 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ObjectCreateExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ObjectCreateExpression.cs @@ -79,7 +79,7 @@ namespace ICSharpCode.NRefactory.CSharp { } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitObjectCreateExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ParenthesizedExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ParenthesizedExpression.cs index 8cdb5cfd17..8c32a42ddf 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ParenthesizedExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ParenthesizedExpression.cs @@ -53,7 +53,7 @@ namespace ICSharpCode.NRefactory.CSharp Expression = expr; } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitParenthesizedExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/PointerReferenceExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/PointerReferenceExpression.cs index b9f3a95299..a1b7f051f1 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/PointerReferenceExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/PointerReferenceExpression.cs @@ -53,7 +53,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildrenByRole (Roles.TypeArgument); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitPointerReferenceExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/PrimitiveExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/PrimitiveExpression.cs index 4ba03a1508..6e39fc2779 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/PrimitiveExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/PrimitiveExpression.cs @@ -83,7 +83,7 @@ namespace ICSharpCode.NRefactory.CSharp } #endregion - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitPrimitiveExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/QueryExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/QueryExpression.cs index 6280b676d8..5e7ffaa67d 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/QueryExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/QueryExpression.cs @@ -36,7 +36,7 @@ namespace ICSharpCode.NRefactory.CSharp } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return default (S); } @@ -52,7 +52,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildrenByRole(ClauseRole); } } - public override S AcceptVisitor(IAstVisitor visitor, T data) + public override S AcceptVisitor(IAstVisitor visitor, T data = default(T)) { return visitor.VisitQueryExpression (this, data); } @@ -112,7 +112,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.Identifier); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitQueryContinuationClause (this, data); } @@ -152,7 +152,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (Roles.Expression, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitQueryFromClause (this, data); } @@ -193,7 +193,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole(Roles.Expression, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitQueryLetClause (this, data); } @@ -217,7 +217,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (Roles.Condition, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitQueryWhereClause (this, data); } @@ -316,7 +316,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole(IntoIdentifierRole); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitQueryJoinClause (this, data); } @@ -344,7 +344,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildrenByRole (OrderingRole); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitQueryOrderClause (this, data); } @@ -376,7 +376,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.Keyword); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitQueryOrdering (this, data); } @@ -406,7 +406,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (Roles.Expression, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitQuerySelectClause (this, data); } @@ -443,7 +443,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (KeyRole, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitQueryGroupClause (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/SizeOfExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/SizeOfExpression.cs index 6e7a740d61..eba12d3e02 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/SizeOfExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/SizeOfExpression.cs @@ -57,7 +57,7 @@ namespace ICSharpCode.NRefactory.CSharp AddChild (type, Roles.Type); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitSizeOfExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/StackAllocExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/StackAllocExpression.cs index ad7fc1a7ef..f69d92286d 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/StackAllocExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/StackAllocExpression.cs @@ -53,7 +53,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.RBracket); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitStackAllocExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ThisReferenceExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ThisReferenceExpression.cs index b874758b35..7d2bd33ebf 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ThisReferenceExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/ThisReferenceExpression.cs @@ -47,7 +47,7 @@ namespace ICSharpCode.NRefactory.CSharp } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitThisReferenceExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/TypeOfExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/TypeOfExpression.cs index 09e8931ff4..31e0b7bf3b 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/TypeOfExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/TypeOfExpression.cs @@ -58,7 +58,7 @@ namespace ICSharpCode.NRefactory.CSharp AddChild (type, Roles.Type); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitTypeOfExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/TypeReferenceExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/TypeReferenceExpression.cs index 92037dea11..c568f824a9 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/TypeReferenceExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/TypeReferenceExpression.cs @@ -31,7 +31,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole(Roles.Type, value); } } - public override S AcceptVisitor(IAstVisitor visitor, T data) + public override S AcceptVisitor(IAstVisitor visitor, T data = default(T)) { return visitor.VisitTypeReferenceExpression(this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/UnaryOperatorExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/UnaryOperatorExpression.cs index c99d4ea941..262bd51dd6 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/UnaryOperatorExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/UnaryOperatorExpression.cs @@ -59,7 +59,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (Roles.Expression, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitUnaryOperatorExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/UncheckedExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/UncheckedExpression.cs index 6e9e61923a..6bd835775b 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/UncheckedExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/UncheckedExpression.cs @@ -57,7 +57,7 @@ namespace ICSharpCode.NRefactory.CSharp AddChild (expression, Roles.Expression); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitUncheckedExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/UndocumentedExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/UndocumentedExpression.cs index 8bbd81a5f0..3a6d628553 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/UndocumentedExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/UndocumentedExpression.cs @@ -62,7 +62,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.RPar); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitUndocumentedExpression (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Attribute.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Attribute.cs index 95235527f3..4335103388 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Attribute.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Attribute.cs @@ -54,7 +54,7 @@ namespace ICSharpCode.NRefactory.CSharp set; } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitAttribute (this, data); } @@ -70,7 +70,7 @@ namespace ICSharpCode.NRefactory.CSharp if (IsNull) return "Null"; var w = new System.IO.StringWriter (); - AcceptVisitor (new OutputVisitor (w, new CSharpFormattingOptions ()), null); + AcceptVisitor (new CSharpOutputVisitor (w, new CSharpFormattingOptions ()), null); return w.ToString (); } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/AttributeSection.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/AttributeSection.cs index bce347c92a..cf142593cb 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/AttributeSection.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/AttributeSection.cs @@ -54,7 +54,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return NodeType.Pattern; } } - public override S AcceptVisitor(IAstVisitor visitor, T data) + public override S AcceptVisitor(IAstVisitor visitor, T data = default(T)) { return visitor.VisitPatternPlaceholder(this, child, data); } @@ -85,8 +85,21 @@ namespace ICSharpCode.NRefactory.CSharp } public string AttributeTarget { - get; - set; + get { + return GetChildByRole (Roles.Identifier).Name; + } + set { + SetChildByRole (Roles.Identifier, CSharp.Identifier.Create (value, TextLocation.Empty)); + } + } + + public Identifier AttributeTargetToken { + get { + return GetChildByRole (Roles.Identifier); + } + set { + SetChildByRole (Roles.Identifier, value); + } } public AstNodeCollection Attributes { @@ -97,7 +110,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.RBracket); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitAttributeSection (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Comment.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Comment.cs index 7d3cbdaa0c..f6cd0d2afd 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Comment.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Comment.cs @@ -91,7 +91,7 @@ namespace ICSharpCode.NRefactory.CSharp } #endregion - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitComment (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Constraint.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Constraint.cs index cac7230997..6d6dc45d0b 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Constraint.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/Constraint.cs @@ -58,7 +58,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildrenByRole (BaseTypeRole); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitConstraint (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/DelegateDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/DelegateDeclaration.cs index c6aebc4a4a..c226d8ffd8 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/DelegateDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/DelegateDeclaration.cs @@ -83,7 +83,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildrenByRole (Roles.Constraint); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitDelegateDeclaration (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/ExternAliasDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/ExternAliasDeclaration.cs index 2e4857498e..f238f1aa2b 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/ExternAliasDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/ExternAliasDeclaration.cs @@ -69,7 +69,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.Semicolon); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitExternAliasDeclaration (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/NamespaceDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/NamespaceDeclaration.cs index 5382033e46..d8736adc43 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/NamespaceDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/NamespaceDeclaration.cs @@ -109,7 +109,7 @@ namespace ICSharpCode.NRefactory.CSharp AddChild (child, MemberRole); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitNamespaceDeclaration (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeDeclaration.cs index e828c7a76e..018e0491e1 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeDeclaration.cs @@ -100,7 +100,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.RBrace); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitTypeDeclaration (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeParameterDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeParameterDeclaration.cs index 99184b7643..afa3122a57 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeParameterDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeParameterDeclaration.cs @@ -63,7 +63,7 @@ namespace ICSharpCode.NRefactory.CSharp } } - public override S AcceptVisitor(IAstVisitor visitor, T data) + public override S AcceptVisitor(IAstVisitor visitor, T data = default(T)) { return visitor.VisitTypeParameterDeclaration(this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/UsingAliasDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/UsingAliasDeclaration.cs index 5fc25031d1..8a69357c6e 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/UsingAliasDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/UsingAliasDeclaration.cs @@ -82,7 +82,7 @@ namespace ICSharpCode.NRefactory.CSharp AddChild (import, ImportRole); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitUsingAliasDeclaration (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/UsingDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/UsingDeclaration.cs index 77c2697f85..31ae7ddfc8 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/UsingDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/UsingDeclaration.cs @@ -74,7 +74,7 @@ namespace ICSharpCode.NRefactory.CSharp AddChild (import, ImportRole); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitUsingDeclaration (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/IAstVisitor.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/IAstVisitor.cs index d18f464a2a..6079ca0466 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/IAstVisitor.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/IAstVisitor.cs @@ -110,7 +110,7 @@ namespace ICSharpCode.NRefactory.CSharp S VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement, T data); S VisitWhileStatement(WhileStatement whileStatement, T data); S VisitYieldBreakStatement(YieldBreakStatement yieldBreakStatement, T data); - S VisitYieldStatement(YieldStatement yieldStatement, T data); + S VisitYieldReturnStatement(YieldReturnStatement yieldReturnStatement, T data); S VisitAccessor(Accessor accessor, T data); S VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration, T data); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Identifier.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Identifier.cs index e95e36a90a..3c692706d1 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Identifier.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Identifier.cs @@ -39,7 +39,7 @@ namespace ICSharpCode.NRefactory.CSharp } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return default (S); } @@ -113,24 +113,25 @@ namespace ICSharpCode.NRefactory.CSharp public static Identifier Create (string name, TextLocation location) { - if (name == null) - throw new ArgumentNullException("name"); - if (name.Length > 0 && name[0] == '@') + if (string.IsNullOrEmpty(name)) + return Identifier.Null; + if (name[0] == '@') return new VerbatimIdentifier(name.Substring (1), location); - return new Identifier (name, location); + else + return new Identifier (name, location); } public static Identifier Create (string name, TextLocation location, bool isVerbatim) { - if (name == null) - throw new ArgumentNullException("name"); + if (string.IsNullOrEmpty(name)) + return Identifier.Null; if (isVerbatim) return new VerbatimIdentifier(name, location); return new Identifier (name, location); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitIdentifier (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/MemberType.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/MemberType.cs index dc16f98cc4..b551e77eee 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/MemberType.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/MemberType.cs @@ -87,7 +87,7 @@ namespace ICSharpCode.NRefactory.CSharp { } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitMemberType (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Modifiers.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Modifiers.cs index fd6a4bcf64..eb320495c3 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Modifiers.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Modifiers.cs @@ -30,7 +30,6 @@ using System; namespace ICSharpCode.NRefactory.CSharp { - // For compatibility with old nrefactory - same flags. [Flags] public enum Modifiers { @@ -54,17 +53,8 @@ namespace ICSharpCode.NRefactory.CSharp Extern = 0x2000, Volatile = 0x4000, Unsafe = 0x8000, + Async = 0x10000, - //Overloads = 0x10000, - //WithEvents = 0x20000, - //Default = 0x40000, - //Fixed = 0x80000, - - //ProtectedOrInternal = Internal | Protected, - //ProtectedAndInternal = 0x100000, (not supported in C#) - //SpecialName = 0x200000, - //Final = 0x400000, - //Literal = 0x800000, VisibilityMask = Private | Internal | Protected | Public, /// diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ObservableAstVisitor.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ObservableAstVisitor.cs index ac8743de6a..9088ca0e39 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ObservableAstVisitor.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/ObservableAstVisitor.cs @@ -1,4 +1,4 @@ -// +// // ObservableAstVisitor.cs // // Author: @@ -671,11 +671,11 @@ namespace ICSharpCode.NRefactory.CSharp return VisitChildren (yieldBreakStatement, data); } - public event Action YieldStatementVisited; + public event Action YieldReturnStatementVisited; - S IAstVisitor.VisitYieldStatement (YieldStatement yieldStatement, T data) + S IAstVisitor.VisitYieldReturnStatement (YieldReturnStatement yieldStatement, T data) { - var handler = YieldStatementVisited; + var handler = YieldReturnStatementVisited; if (handler != null) handler (yieldStatement, data); return VisitChildren (yieldStatement, data); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/PrimitiveType.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/PrimitiveType.cs index 85e2e723ae..92705e96a4 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/PrimitiveType.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/PrimitiveType.cs @@ -68,7 +68,7 @@ namespace ICSharpCode.NRefactory.CSharp } #endregion - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitPrimitiveType (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/SimpleType.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/SimpleType.cs index cf451339c3..280511da0f 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/SimpleType.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/SimpleType.cs @@ -81,7 +81,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildrenByRole (Roles.TypeArgument); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitSimpleType (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/BlockStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/BlockStatement.cs index 50cf3e6cd4..e42f13b6cc 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/BlockStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/BlockStatement.cs @@ -45,7 +45,7 @@ namespace ICSharpCode.NRefactory.CSharp } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return default (S); } @@ -76,7 +76,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return NodeType.Pattern; } } - public override S AcceptVisitor(IAstVisitor visitor, T data) + public override S AcceptVisitor(IAstVisitor visitor, T data = default(T)) { return visitor.VisitPatternPlaceholder(this, child, data); } @@ -105,7 +105,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.RBrace); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitBlockStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/BreakStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/BreakStatement.cs index 6599b5eafc..5c993f8968 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/BreakStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/BreakStatement.cs @@ -35,7 +35,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.Semicolon); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitBreakStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/CheckedStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/CheckedStatement.cs index 731649f4af..c81724b919 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/CheckedStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/CheckedStatement.cs @@ -49,7 +49,7 @@ namespace ICSharpCode.NRefactory.CSharp AddChild (body, Roles.Body); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitCheckedStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ContinueStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ContinueStatement.cs index 1de6b5d505..cb8cf30e6e 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ContinueStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ContinueStatement.cs @@ -35,7 +35,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.Semicolon); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitContinueStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/DoWhileStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/DoWhileStatement.cs index 378fd43ab0..9e0cc4a43e 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/DoWhileStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/DoWhileStatement.cs @@ -64,7 +64,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.Semicolon); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitDoWhileStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/EmptyStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/EmptyStatement.cs index e8c460913e..e0c8999835 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/EmptyStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/EmptyStatement.cs @@ -44,7 +44,7 @@ namespace ICSharpCode.NRefactory.CSharp public override TextLocation EndLocation { get { - return new TextLocation (Location.Line, Location.Column); + return new TextLocation (Location.Line, Location.Column + 1); } } @@ -55,7 +55,7 @@ namespace ICSharpCode.NRefactory.CSharp } #endregion - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitEmptyStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ExpressionStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ExpressionStatement.cs index 4e76bd5bbe..3954d5e427 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ExpressionStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ExpressionStatement.cs @@ -40,7 +40,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.Semicolon); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitExpressionStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/FixedStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/FixedStatement.cs index 9a8efbc9ac..263cf8fbd5 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/FixedStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/FixedStatement.cs @@ -59,7 +59,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (Roles.EmbeddedStatement, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitFixedStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ForStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ForStatement.cs index ebbe44022b..a6c91b322f 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ForStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ForStatement.cs @@ -71,7 +71,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (Roles.EmbeddedStatement, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitForStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ForeachStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ForeachStatement.cs index c9791bd5d8..ccd3ecdeb1 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ForeachStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ForeachStatement.cs @@ -80,7 +80,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (Roles.EmbeddedStatement, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitForeachStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/GotoStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/GotoStatement.cs index c7d57644f4..c02e223d63 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/GotoStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/GotoStatement.cs @@ -60,7 +60,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.Semicolon); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitGotoStatement (this, data); } @@ -99,7 +99,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.Semicolon); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitGotoCaseStatement (this, data); } @@ -130,7 +130,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.Semicolon); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitGotoDefaultStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/IfElseStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/IfElseStatement.cs index 8fa84392d7..803d7bf8ad 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/IfElseStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/IfElseStatement.cs @@ -69,7 +69,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (FalseRole, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitIfElseStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/LabelStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/LabelStatement.cs index 81a9a186f5..6b3a08cf86 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/LabelStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/LabelStatement.cs @@ -44,7 +44,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.Colon); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitLabelStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/LockStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/LockStatement.cs index 7298e4f1da..8a5f2f76f7 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/LockStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/LockStatement.cs @@ -53,7 +53,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (Roles.EmbeddedStatement, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitLockStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ReturnStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ReturnStatement.cs index 075a22589e..8219490d7d 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ReturnStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ReturnStatement.cs @@ -53,7 +53,7 @@ namespace ICSharpCode.NRefactory.CSharp AddChild (returnExpression, Roles.Expression); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitReturnStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/Statement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/Statement.cs index 73100a64cd..665a5dfd75 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/Statement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/Statement.cs @@ -25,7 +25,7 @@ namespace ICSharpCode.NRefactory.CSharp } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return default (S); } @@ -56,7 +56,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return NodeType.Pattern; } } - public override S AcceptVisitor(IAstVisitor visitor, T data) + public override S AcceptVisitor(IAstVisitor visitor, T data = default(T)) { return visitor.VisitPatternPlaceholder(this, child, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/SwitchStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/SwitchStatement.cs index c3fd4dd3fb..bf5ca7a834 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/SwitchStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/SwitchStatement.cs @@ -65,7 +65,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.RBrace); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitSwitchStatement (this, data); } @@ -98,7 +98,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return NodeType.Pattern; } } - public override S AcceptVisitor(IAstVisitor visitor, T data) + public override S AcceptVisitor(IAstVisitor visitor, T data = default(T)) { return visitor.VisitPatternPlaceholder(this, child, data); } @@ -131,7 +131,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildrenByRole (Roles.EmbeddedStatement); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitSwitchSection (this, data); } @@ -151,6 +151,9 @@ namespace ICSharpCode.NRefactory.CSharp } } + /// + /// Gets or sets the expression. The expression can be null - if the expression is null, it's the default switch section. + /// public Expression Expression { get { return GetChildByRole (Roles.Expression); } set { SetChildByRole (Roles.Expression, value); } @@ -165,7 +168,7 @@ namespace ICSharpCode.NRefactory.CSharp this.Expression = expression; } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitCaseLabel (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ThrowStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ThrowStatement.cs index 2eafdd977f..5d42af3ccc 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ThrowStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/ThrowStatement.cs @@ -53,7 +53,7 @@ namespace ICSharpCode.NRefactory.CSharp AddChild (expression, Roles.Expression); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitThrowStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/TryCatchStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/TryCatchStatement.cs index e6cc8a48f9..711a6f491a 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/TryCatchStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/TryCatchStatement.cs @@ -62,7 +62,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (FinallyBlockRole, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitTryCatchStatement (this, data); } @@ -98,7 +98,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return NodeType.Pattern; } } - public override S AcceptVisitor(IAstVisitor visitor, T data) + public override S AcceptVisitor(IAstVisitor visitor, T data = default(T)) { return visitor.VisitPatternPlaceholder(this, child, data); } @@ -162,7 +162,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (Roles.Body, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitCatchClause (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/UncheckedStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/UncheckedStatement.cs index af40fa5a9f..086cff8548 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/UncheckedStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/UncheckedStatement.cs @@ -49,7 +49,7 @@ namespace ICSharpCode.NRefactory.CSharp AddChild (body, Roles.Body); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitUncheckedStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/UnsafeStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/UnsafeStatement.cs index c5ccb63af3..fba1ebe439 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/UnsafeStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/UnsafeStatement.cs @@ -40,7 +40,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (Roles.Body, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitUnsafeStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/UsingStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/UsingStatement.cs index 27714d61bf..030ce03687 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/UsingStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/UsingStatement.cs @@ -58,7 +58,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (Roles.EmbeddedStatement, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitUsingStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/VariableDeclarationStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/VariableDeclarationStatement.cs index 54f473684e..c9792125f0 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/VariableDeclarationStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/VariableDeclarationStatement.cs @@ -66,7 +66,7 @@ namespace ICSharpCode.NRefactory.CSharp return Variables.FirstOrDefault (vi => vi.Name == name); } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitVariableDeclarationStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/WhileStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/WhileStatement.cs index 01470b3ab2..db71887c41 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/WhileStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/WhileStatement.cs @@ -55,7 +55,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (Roles.EmbeddedStatement, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitWhileStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/YieldBreakStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/YieldBreakStatement.cs index 4c572615ad..253253feff 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/YieldBreakStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/YieldBreakStatement.cs @@ -46,7 +46,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.Semicolon); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitYieldBreakStatement (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/YieldStatement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/YieldReturnStatement.cs similarity index 92% rename from src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/YieldStatement.cs rename to src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/YieldReturnStatement.cs index 001815f3a8..a3b65ac2ab 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/YieldStatement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/YieldReturnStatement.cs @@ -29,7 +29,7 @@ namespace ICSharpCode.NRefactory.CSharp /// /// yield return Expression; /// - public class YieldStatement : Statement + public class YieldReturnStatement : Statement { public static readonly Role YieldKeywordRole = new Role("YieldKeyword", CSharpTokenNode.Null); public static readonly Role ReturnKeywordRole = new Role("ReturnKeyword", CSharpTokenNode.Null); @@ -51,14 +51,14 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.Semicolon); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { - return visitor.VisitYieldStatement (this, data); + return visitor.VisitYieldReturnStatement (this, data); } protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) { - YieldStatement o = other as YieldStatement; + YieldReturnStatement o = other as YieldReturnStatement; return o != null && this.Expression.DoMatch(o.Expression, match); } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/Accessor.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/Accessor.cs index 748948f6a7..0755e04369 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/Accessor.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/Accessor.cs @@ -42,7 +42,7 @@ namespace ICSharpCode.NRefactory.CSharp } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return default (S); } @@ -57,7 +57,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (Roles.Body, value); } } - public override S AcceptVisitor(IAstVisitor visitor, T data) + public override S AcceptVisitor(IAstVisitor visitor, T data = default(T)) { return visitor.VisitAccessor (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/ConstructorDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/ConstructorDeclaration.cs index afcc2d47d6..f356e93ab6 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/ConstructorDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/ConstructorDeclaration.cs @@ -71,7 +71,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return NodeType.Member; } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitConstructorDeclaration (this, data); } @@ -106,7 +106,7 @@ namespace ICSharpCode.NRefactory.CSharp } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return default (S); } @@ -140,7 +140,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.RPar); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitConstructorInitializer (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/DestructorDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/DestructorDeclaration.cs index 829682e73f..0e129e4330 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/DestructorDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/DestructorDeclaration.cs @@ -62,7 +62,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return NodeType.Member; } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitDestructorDeclaration (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EnumMemberDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EnumMemberDeclaration.cs index 286800cbe3..f646a93853 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EnumMemberDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EnumMemberDeclaration.cs @@ -58,7 +58,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return NodeType.Member; } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitEnumMemberDeclaration (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EventDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EventDeclaration.cs index 49d28ede35..752463a2e2 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EventDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EventDeclaration.cs @@ -43,7 +43,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildrenByRole (Roles.Variable); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitEventDeclaration (this, data); } @@ -79,7 +79,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.RBrace); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitCustomEventDeclaration (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FieldDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FieldDeclaration.cs index 1003aa9b75..2b30b2be30 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FieldDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FieldDeclaration.cs @@ -44,7 +44,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildrenByRole (Roles.Variable); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitFieldDeclaration (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FixedFieldDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FixedFieldDeclaration.cs index 2fde822604..ea20b3585a 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FixedFieldDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FixedFieldDeclaration.cs @@ -48,7 +48,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildrenByRole (VariableRole); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitFixedFieldDeclaration (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FixedVariableInitializer.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FixedVariableInitializer.cs index d6dbaf91a2..11bbc138ae 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FixedVariableInitializer.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FixedVariableInitializer.cs @@ -80,7 +80,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.RBracket); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitFixedVariableInitializer (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/IndexerDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/IndexerDeclaration.cs index 4d19c97d73..221a6dde8c 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/IndexerDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/IndexerDeclaration.cs @@ -64,7 +64,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.RBrace); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitIndexerDeclaration (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/MethodDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/MethodDeclaration.cs index 556c0a3a4c..129c87e26e 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/MethodDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/MethodDeclaration.cs @@ -63,7 +63,7 @@ namespace ICSharpCode.NRefactory.CSharp } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitMethodDeclaration (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/OperatorDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/OperatorDeclaration.cs index 85ff7a7bd2..35865d24c0 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/OperatorDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/OperatorDeclaration.cs @@ -129,7 +129,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return NodeType.Member; } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitOperatorDeclaration (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/ParameterDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/ParameterDeclaration.cs index 8641a72277..3329730046 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/ParameterDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/ParameterDeclaration.cs @@ -86,7 +86,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (Roles.Expression, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitParameterDeclaration (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/PropertyDeclaration.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/PropertyDeclaration.cs index 2d1376a0ed..5362667504 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/PropertyDeclaration.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/PropertyDeclaration.cs @@ -49,7 +49,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return GetChildByRole (Roles.RBrace); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitPropertyDeclaration (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/VariableInitializer.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/VariableInitializer.cs index 8ebfc938d6..314fca0c9e 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/VariableInitializer.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/VariableInitializer.cs @@ -47,7 +47,7 @@ namespace ICSharpCode.NRefactory.CSharp get { return NodeType.Pattern; } } - public override S AcceptVisitor(IAstVisitor visitor, T data) + public override S AcceptVisitor(IAstVisitor visitor, T data = default(T)) { return visitor.VisitPatternPlaceholder(this, child, data); } @@ -107,7 +107,7 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (Roles.Expression, value); } } - public override S AcceptVisitor (IAstVisitor visitor, T data) + public override S AcceptVisitor (IAstVisitor visitor, T data = default(T)) { return visitor.VisitVariableInitializer (this, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs new file mode 100644 index 0000000000..45a2ec2dd0 --- /dev/null +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs @@ -0,0 +1,51 @@ +// +// CSharpCompletionEngine.cs +// +// Author: +// Mike Krüger +// +// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using System.Collections.Generic; +using ICSharpCode.NRefactory.Completion; +using ICSharpCode.NRefactory.Editor; + +namespace ICSharpCode.NRefactory.CSharp.Completion +{ + public class CSharpCompletionEngine + { + IDocument document; + ICompletionDataFactory factory; + + public CSharpCompletionEngine (IDocument document, ICompletionDataFactory factory) + { + this.document = document; + this.factory = factory; + } + + public IEnumerable GetCompletionData (int offset) + { + // BIG TODO !!!! + yield break; + } + } +} + diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/AstFormattingVisitor.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/AstFormattingVisitor.cs index 99b8f67a3e..7b1779a37c 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/AstFormattingVisitor.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/AstFormattingVisitor.cs @@ -27,6 +27,7 @@ using System; using System.Text; using System.Collections.Generic; using System.Linq; +using ICSharpCode.NRefactory.Editor; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.NRefactory.CSharp.Refactoring; @@ -35,7 +36,7 @@ namespace ICSharpCode.NRefactory.CSharp public class AstFormattingVisitor : DepthFirstAstVisitor { CSharpFormattingOptions policy; - ITextEditorAdapter data; + IDocument document; IActionFactory factory; List changes = new List (); Indent curIndent = new Indent (); @@ -67,16 +68,20 @@ namespace ICSharpCode.NRefactory.CSharp get; set; } + + public string EolMarker { get; set; } - public AstFormattingVisitor (CSharpFormattingOptions policy, ITextEditorAdapter data, IActionFactory factory) + public AstFormattingVisitor (CSharpFormattingOptions policy, IDocument document, IActionFactory factory, + bool tabsToSpaces = false, int indentationSize = 4) { if (factory == null) throw new ArgumentNullException ("factory"); this.policy = policy; - this.data = data; - this.curIndent.TabsToSpaces = this.data.TabsToSpaces; - this.curIndent.TabSize = this.data.TabSize; + this.document = document; + this.curIndent.TabsToSpaces = tabsToSpaces; + this.curIndent.TabSize = indentationSize; this.factory = factory; + this.EolMarker = Environment.NewLine; CorrectBlankLines = true; } @@ -94,21 +99,23 @@ namespace ICSharpCode.NRefactory.CSharp int line = loc.Line; do { line++; - } while (line < data.LineCount && data.GetEditableLength (line) == data.GetIndentation (line).Length); - var start = data.LocationToOffset (node.EndLocation.Line, node.EndLocation.Column); + } while (line < document.LineCount && IsSpacing(document.GetLineByNumber(line))); + var start = document.GetOffset (node.EndLocation); int foundBlankLines = line - loc.Line - 1; StringBuilder sb = new StringBuilder (); for (int i = 0; i < blankLines - foundBlankLines; i++) - sb.Append (data.EolMarker); + sb.Append (this.EolMarker); int ws = start; - while (ws < data.Length && IsSpacing (data.GetCharAt (ws))) + while (ws < document.TextLength && IsSpacing (document.GetCharAt (ws))) ws++; int removedChars = ws - start; - if (foundBlankLines > blankLines) - removedChars += data.GetLineEndOffset (loc.Line + foundBlankLines - blankLines) - data.GetLineEndOffset (loc.Line); + if (foundBlankLines > blankLines) { + removedChars += document.GetLineByNumber (loc.Line + foundBlankLines - blankLines).EndOffset + - document.GetLineByNumber (loc.Line).EndOffset; + } AddChange (start, removedChars, sb.ToString ()); } @@ -120,12 +127,12 @@ namespace ICSharpCode.NRefactory.CSharp int line = loc.Line; do { line--; - } while (line > 0 && data.GetEditableLength (line) == data.GetIndentation (line).Length); - int end = data.GetLineOffset (loc.Line); - int start = line >= 1 ? data.GetLineEndOffset (line) : 0; + } while (line > 0 && IsSpacing(document.GetLineByNumber(line))); + int end = document.GetOffset (loc.Line, 1); + int start = document.GetOffset (line + 1, 1); StringBuilder sb = new StringBuilder (); for (int i = 0; i < blankLines; i++) - sb.Append (data.EolMarker); + sb.Append (this.EolMarker); AddChange (start, end - start, sb.ToString ()); } @@ -166,7 +173,7 @@ namespace ICSharpCode.NRefactory.CSharp public override object VisitTypeDeclaration (TypeDeclaration typeDeclaration, object data) { - FixIndentationForceNewLine (typeDeclaration.StartLocation); + FormatAttributedNode (typeDeclaration); BraceStyle braceStyle; bool indentBody = false; switch (typeDeclaration.ClassType) { @@ -216,6 +223,16 @@ namespace ICSharpCode.NRefactory.CSharp { return ch == ' ' || ch == '\t'; } + + bool IsSpacing (ISegment segment) + { + int endOffset = segment.EndOffset; + for (int i = segment.Offset; i < endOffset; i++) { + if (!IsSpacing(document.GetCharAt(i))) + return false; + } + return true; + } int SearchLastNonWsChar (int startOffset, int endOffset) { @@ -226,18 +243,18 @@ namespace ICSharpCode.NRefactory.CSharp int result = -1; bool inComment = false; - for (int i = startOffset; i < endOffset && i < data.Length; i++) { - char ch = data.GetCharAt (i); + for (int i = startOffset; i < endOffset && i < document.TextLength; i++) { + char ch = document.GetCharAt (i); if (IsSpacing (ch)) continue; - if (ch == '/' && i + 1 < data.Length && data.GetCharAt (i + 1) == '/') + if (ch == '/' && i + 1 < document.TextLength && document.GetCharAt (i + 1) == '/') return result; - if (ch == '/' && i + 1 < data.Length && data.GetCharAt (i + 1) == '*') { + if (ch == '/' && i + 1 < document.TextLength && document.GetCharAt (i + 1) == '*') { inComment = true; i++; continue; } - if (inComment && ch == '*' && i + 1 < data.Length && data.GetCharAt (i + 1) == '/') { + if (inComment && ch == '*' && i + 1 < document.TextLength && document.GetCharAt (i + 1) == '/') { inComment = false; i++; continue; @@ -271,11 +288,11 @@ namespace ICSharpCode.NRefactory.CSharp if (n == null) return; TextLocation location = n.EndLocation; - int offset = data.LocationToOffset (location.Line, location.Column); - if (location.Column > data.GetEditableLength (location.Line)) + int offset = document.GetOffset (location); + if (location.Column > document.GetLineByNumber (location.Line).Length) return; int i = offset; - while (i < data.Length && IsSpacing (data.GetCharAt (i))) { + while (i < document.TextLength && IsSpacing (document.GetCharAt (i))) { i++; } ForceSpace (offset - 1, i, forceSpaces); @@ -303,12 +320,12 @@ namespace ICSharpCode.NRefactory.CSharp return 0; TextLocation location = n.StartLocation; // respect manual line breaks. - if (location.Column <= 1 || data.GetIndentation (location.Line).Length == location.Column - 1) + if (location.Column <= 1 || GetIndentation (location.Line).Length == location.Column - 1) return 0; - int offset = data.LocationToOffset (location.Line, location.Column); + int offset = document.GetOffset (location); int i = offset - 1; - while (i >= 0 && IsSpacing (data.GetCharAt (i))) { + while (i >= 0 && IsSpacing (document.GetCharAt (i))) { i--; } ForceSpace (i, offset, forceSpaces); @@ -317,7 +334,7 @@ namespace ICSharpCode.NRefactory.CSharp public override object VisitPropertyDeclaration (PropertyDeclaration propertyDeclaration, object data) { - FixIndentationForceNewLine (propertyDeclaration.StartLocation); + FormatAttributedNode (propertyDeclaration); bool oneLine = false; switch (policy.PropertyFormatting) { case PropertyFormatting.AllowOneLine: @@ -337,14 +354,14 @@ namespace ICSharpCode.NRefactory.CSharp case PropertyFormatting.ForceOneLine: isSimple = IsSimpleAccessor (propertyDeclaration.Getter) && IsSimpleAccessor (propertyDeclaration.Setter); if (isSimple) { - int offset = this.data.LocationToOffset (propertyDeclaration.LBraceToken.StartLocation.Line, propertyDeclaration.LBraceToken.StartLocation.Column); + int offset = this.document.GetOffset (propertyDeclaration.LBraceToken.StartLocation); int start = SearchWhitespaceStart (offset); int end = SearchWhitespaceEnd (offset); AddChange (start, offset - start, " "); AddChange (offset + 1, end - offset - 2, " "); - offset = this.data.LocationToOffset (propertyDeclaration.RBraceToken.StartLocation.Line, propertyDeclaration.RBraceToken.StartLocation.Column); + offset = this.document.GetOffset (propertyDeclaration.RBraceToken.StartLocation); start = SearchWhitespaceStart (offset); AddChange (start, offset - start, " "); oneLine = true; @@ -360,15 +377,15 @@ namespace ICSharpCode.NRefactory.CSharp if (!propertyDeclaration.Getter.IsNull) { if (!oneLine) { if (!IsLineIsEmptyUpToEol (propertyDeclaration.Getter.StartLocation)) { - int offset = this.data.LocationToOffset (propertyDeclaration.Getter.StartLocation.Line, propertyDeclaration.Getter.StartLocation.Column); + int offset = this.document.GetOffset (propertyDeclaration.Getter.StartLocation); int start = SearchWhitespaceStart (offset); string indentString = this.curIndent.IndentString; - AddChange (start, offset - start, this.data.EolMarker + indentString); + AddChange (start, offset - start, this.EolMarker + indentString); } else { FixIndentation (propertyDeclaration.Getter.StartLocation); } } else { - int offset = this.data.LocationToOffset (propertyDeclaration.Getter.StartLocation.Line, propertyDeclaration.Getter.StartLocation.Column); + int offset = this.document.GetOffset (propertyDeclaration.Getter.StartLocation); int start = SearchWhitespaceStart (offset); AddChange (start, offset - start, " "); @@ -388,15 +405,15 @@ namespace ICSharpCode.NRefactory.CSharp if (!propertyDeclaration.Setter.IsNull) { if (!oneLine) { if (!IsLineIsEmptyUpToEol (propertyDeclaration.Setter.StartLocation)) { - int offset = this.data.LocationToOffset (propertyDeclaration.Setter.StartLocation.Line, propertyDeclaration.Setter.StartLocation.Column); + int offset = this.document.GetOffset (propertyDeclaration.Setter.StartLocation); int start = SearchWhitespaceStart (offset); string indentString = this.curIndent.IndentString; - AddChange (start, offset - start, this.data.EolMarker + indentString); + AddChange (start, offset - start, this.EolMarker + indentString); } else { FixIndentation (propertyDeclaration.Setter.StartLocation); } } else { - int offset = this.data.LocationToOffset (propertyDeclaration.Setter.StartLocation.Line, propertyDeclaration.Setter.StartLocation.Column); + int offset = this.document.GetOffset (propertyDeclaration.Setter.StartLocation); int start = SearchWhitespaceStart (offset); AddChange (start, offset - start, " "); @@ -429,7 +446,7 @@ namespace ICSharpCode.NRefactory.CSharp FormatCommas (indexerDeclaration, policy.SpaceBeforeIndexerDeclarationParameterComma, policy.SpaceAfterIndexerDeclarationParameterComma); - FixIndentationForceNewLine (indexerDeclaration.StartLocation); + FormatAttributedNode (indexerDeclaration); EnforceBraceStyle (policy.PropertyBraceStyle, indexerDeclaration.LBraceToken, indexerDeclaration.RBraceToken); if (policy.IndentPropertyBody) IndentLevel++; @@ -471,7 +488,7 @@ namespace ICSharpCode.NRefactory.CSharp public override object VisitCustomEventDeclaration (CustomEventDeclaration eventDeclaration, object data) { - FixIndentationForceNewLine (eventDeclaration.StartLocation); + FormatAttributedNode (eventDeclaration); EnforceBraceStyle (policy.EventBraceStyle, eventDeclaration.LBraceToken, eventDeclaration.RBraceToken); if (policy.IndentEventBody) IndentLevel++; @@ -514,7 +531,7 @@ namespace ICSharpCode.NRefactory.CSharp public override object VisitEventDeclaration (EventDeclaration eventDeclaration, object data) { - FixIndentationForceNewLine (eventDeclaration.StartLocation); + FormatAttributedNode (eventDeclaration); if (eventDeclaration.NextSibling is EventDeclaration && IsSimpleEvent (eventDeclaration) && IsSimpleEvent (eventDeclaration.NextSibling)) { EnsureBlankLinesAfter (eventDeclaration, policy.BlankLinesBetweenEventFields); } else if (IsMember (eventDeclaration.NextSibling)) { @@ -532,7 +549,7 @@ namespace ICSharpCode.NRefactory.CSharp public override object VisitFieldDeclaration (FieldDeclaration fieldDeclaration, object data) { - FixIndentationForceNewLine (fieldDeclaration.StartLocation); + FormatAttributedNode (fieldDeclaration); FormatCommas (fieldDeclaration, policy.SpaceBeforeFieldDeclarationComma, policy.SpaceAfterFieldDeclarationComma); if (fieldDeclaration.NextSibling is FieldDeclaration || fieldDeclaration.NextSibling is FixedFieldDeclaration) { EnsureBlankLinesAfter (fieldDeclaration, policy.BlankLinesBetweenFields); @@ -544,7 +561,7 @@ namespace ICSharpCode.NRefactory.CSharp public override object VisitFixedFieldDeclaration (FixedFieldDeclaration fixedFieldDeclaration, object data) { - FixIndentationForceNewLine (fixedFieldDeclaration.StartLocation); + FormatAttributedNode (fixedFieldDeclaration); FormatCommas (fixedFieldDeclaration, policy.SpaceBeforeFieldDeclarationComma, policy.SpaceAfterFieldDeclarationComma); if (fixedFieldDeclaration.NextSibling is FieldDeclaration || fixedFieldDeclaration.NextSibling is FixedFieldDeclaration) { EnsureBlankLinesAfter (fixedFieldDeclaration, policy.BlankLinesBetweenFields); @@ -556,13 +573,13 @@ namespace ICSharpCode.NRefactory.CSharp public override object VisitEnumMemberDeclaration (EnumMemberDeclaration enumMemberDeclaration, object data) { - FixIndentationForceNewLine (enumMemberDeclaration.StartLocation); + FormatAttributedNode (enumMemberDeclaration); return base.VisitEnumMemberDeclaration (enumMemberDeclaration, data); } public override object VisitDelegateDeclaration (DelegateDeclaration delegateDeclaration, object data) { - FixIndentation (delegateDeclaration.StartLocation); + FormatAttributedNode (delegateDeclaration); ForceSpacesBefore (delegateDeclaration.LParToken, policy.SpaceBeforeDelegateDeclarationParentheses); if (delegateDeclaration.Parameters.Any ()) { @@ -587,10 +604,23 @@ namespace ICSharpCode.NRefactory.CSharp { return nextSibling != null && nextSibling.NodeType == NodeType.Member; } - + + void FormatAttributedNode (AstNode node) + { + if (node == null) + return; + AstNode child = node.FirstChild; + while (child != null && child is AttributeSection) { + FixIndentationForceNewLine (child.StartLocation); + child = child.NextSibling; + } + if (child != null) + FixIndentationForceNewLine (child.StartLocation); + } + public override object VisitMethodDeclaration (MethodDeclaration methodDeclaration, object data) { - FixIndentationForceNewLine (methodDeclaration.StartLocation); + FormatAttributedNode (methodDeclaration); ForceSpacesBefore (methodDeclaration.LParToken, policy.SpaceBeforeMethodDeclarationParentheses); if (methodDeclaration.Parameters.Any ()) { @@ -618,7 +648,7 @@ namespace ICSharpCode.NRefactory.CSharp public override object VisitOperatorDeclaration (OperatorDeclaration operatorDeclaration, object data) { - FixIndentationForceNewLine (operatorDeclaration.StartLocation); + FormatAttributedNode (operatorDeclaration); ForceSpacesBefore (operatorDeclaration.LParToken, policy.SpaceBeforeMethodDeclarationParentheses); if (operatorDeclaration.Parameters.Any ()) { @@ -646,7 +676,7 @@ namespace ICSharpCode.NRefactory.CSharp public override object VisitConstructorDeclaration (ConstructorDeclaration constructorDeclaration, object data) { - FixIndentationForceNewLine (constructorDeclaration.StartLocation); + FormatAttributedNode (constructorDeclaration); ForceSpacesBefore (constructorDeclaration.LParToken, policy.SpaceBeforeConstructorDeclarationParentheses); if (constructorDeclaration.Parameters.Any ()) { @@ -674,10 +704,10 @@ namespace ICSharpCode.NRefactory.CSharp public override object VisitDestructorDeclaration (DestructorDeclaration destructorDeclaration, object data) { - FixIndentationForceNewLine (destructorDeclaration.StartLocation); + FormatAttributedNode (destructorDeclaration); CSharpTokenNode lParen = destructorDeclaration.LParToken; - int offset = this.data.LocationToOffset (lParen.StartLocation.Line, lParen.StartLocation.Column); + int offset = this.document.GetOffset (lParen.StartLocation); ForceSpaceBefore (offset, policy.SpaceBeforeConstructorDeclarationParentheses); object result = null; @@ -786,9 +816,9 @@ namespace ICSharpCode.NRefactory.CSharp case BraceForcement.AddBraces: if (!isBlock) { AstNode n = node.Parent.GetCSharpNodeBefore (node); - int start = data.LocationToOffset (n.EndLocation.Line, n.EndLocation.Column); + int start = document.GetOffset (n.EndLocation); var next = n.GetNextNode (); - int offset = data.LocationToOffset (next.StartLocation.Line, next.StartLocation.Column); + int offset = document.GetOffset (next.StartLocation); string startBrace = ""; switch (braceStyle) { case BraceStyle.EndOfLineWithoutSpace: @@ -798,15 +828,15 @@ namespace ICSharpCode.NRefactory.CSharp startBrace = " {"; break; case BraceStyle.NextLine: - startBrace = data.EolMarker + curIndent.IndentString + "{"; + startBrace = this.EolMarker + curIndent.IndentString + "{"; break; case BraceStyle.NextLineShifted2: case BraceStyle.NextLineShifted: - startBrace = data.EolMarker + curIndent.IndentString + curIndent.SingleIndent + "{"; + startBrace = this.EolMarker + curIndent.IndentString + curIndent.SingleIndent + "{"; break; } - if (IsLineIsEmptyUpToEol (data.LocationToOffset (node.StartLocation.Line, node.StartLocation.Column))) - startBrace += data.EolMarker + data.GetIndentation (node.StartLocation.Line); + if (IsLineIsEmptyUpToEol (document.GetOffset (node.StartLocation))) + startBrace += this.EolMarker + GetIndentation (node.StartLocation.Line); AddChange (start, offset - start, startBrace); } break; @@ -814,10 +844,10 @@ namespace ICSharpCode.NRefactory.CSharp if (isBlock) { BlockStatement block = node as BlockStatement; if (block.Statements.Count () == 1) { - int offset1 = data.LocationToOffset (node.StartLocation.Line, node.StartLocation.Column); + int offset1 = document.GetOffset (node.StartLocation); int start = SearchWhitespaceStart (offset1); - int offset2 = data.LocationToOffset (node.EndLocation.Line, node.EndLocation.Column); + int offset2 = document.GetOffset (node.EndLocation); int end = SearchWhitespaceStart (offset2 - 1); AddChange (start, offset1 - start + 1, null); @@ -853,8 +883,8 @@ namespace ICSharpCode.NRefactory.CSharp break; case BraceForcement.AddBraces: if (!isBlock) { - int offset = data.LocationToOffset (node.EndLocation.Line, node.EndLocation.Column); - if (!char.IsWhiteSpace (data.GetCharAt (offset))) + int offset = document.GetOffset (node.EndLocation); + if (!char.IsWhiteSpace (document.GetCharAt (offset))) offset++; string startBrace = ""; switch (braceStyle) { @@ -862,17 +892,17 @@ namespace ICSharpCode.NRefactory.CSharp startBrace = null; break; case BraceStyle.EndOfLineWithoutSpace: - startBrace = data.EolMarker + curIndent.IndentString + "}"; + startBrace = this.EolMarker + curIndent.IndentString + "}"; break; case BraceStyle.EndOfLine: - startBrace = data.EolMarker + curIndent.IndentString + "}"; + startBrace = this.EolMarker + curIndent.IndentString + "}"; break; case BraceStyle.NextLine: - startBrace = data.EolMarker + curIndent.IndentString + "}"; + startBrace = this.EolMarker + curIndent.IndentString + "}"; break; case BraceStyle.NextLineShifted2: case BraceStyle.NextLineShifted: - startBrace = data.EolMarker + curIndent.IndentString + curIndent.SingleIndent + "}"; + startBrace = this.EolMarker + curIndent.IndentString + curIndent.SingleIndent + "}"; break; } if (startBrace != null) @@ -889,10 +919,10 @@ namespace ICSharpCode.NRefactory.CSharp return; // LineSegment lbraceLineSegment = data.Document.GetLine (lbrace.StartLocation.Line); - int lbraceOffset = data.LocationToOffset (lbrace.StartLocation.Line, lbrace.StartLocation.Column); + int lbraceOffset = document.GetOffset (lbrace.StartLocation); // LineSegment rbraceLineSegment = data.Document.GetLine (rbrace.StartLocation.Line); - int rbraceOffset = data.LocationToOffset (rbrace.StartLocation.Line, rbrace.StartLocation.Column); + int rbraceOffset = document.GetOffset (rbrace.StartLocation); int whitespaceStart = SearchWhitespaceStart (lbraceOffset); int whitespaceEnd = SearchWhitespaceLineStart (rbraceOffset); string startIndent = ""; @@ -903,7 +933,7 @@ namespace ICSharpCode.NRefactory.CSharp break; case BraceStyle.EndOfLineWithoutSpace: startIndent = ""; - endIndent = IsLineIsEmptyUpToEol (rbraceOffset) ? curIndent.IndentString : data.EolMarker + curIndent.IndentString; + endIndent = IsLineIsEmptyUpToEol (rbraceOffset) ? curIndent.IndentString : this.EolMarker + curIndent.IndentString; break; case BraceStyle.EndOfLine: var prevNode = lbrace.GetPrevNode (); @@ -914,22 +944,22 @@ namespace ICSharpCode.NRefactory.CSharp while (prevNode is Comment) { prevNode = prevNode.GetPrevNode (); } - whitespaceStart = data.LocationToOffset (prevNode.EndLocation.Line, prevNode.EndLocation.Column); + whitespaceStart = document.GetOffset (prevNode.EndLocation); lbraceOffset = whitespaceStart; startIndent = " {"; } else { startIndent = " "; } - endIndent = IsLineIsEmptyUpToEol (rbraceOffset) ? curIndent.IndentString : data.EolMarker + curIndent.IndentString; + endIndent = IsLineIsEmptyUpToEol (rbraceOffset) ? curIndent.IndentString : this.EolMarker + curIndent.IndentString; break; case BraceStyle.NextLine: - startIndent = data.EolMarker + curIndent.IndentString; - endIndent = IsLineIsEmptyUpToEol (rbraceOffset) ? curIndent.IndentString : data.EolMarker + curIndent.IndentString; + startIndent = this.EolMarker + curIndent.IndentString; + endIndent = IsLineIsEmptyUpToEol (rbraceOffset) ? curIndent.IndentString : this.EolMarker + curIndent.IndentString; break; case BraceStyle.NextLineShifted2: case BraceStyle.NextLineShifted: - startIndent = data.EolMarker + curIndent.IndentString + curIndent.SingleIndent; - endIndent = IsLineIsEmptyUpToEol (rbraceOffset) ? curIndent.IndentString + curIndent.SingleIndent : data.EolMarker + curIndent.IndentString + curIndent.SingleIndent; + startIndent = this.EolMarker + curIndent.IndentString + curIndent.SingleIndent; + endIndent = IsLineIsEmptyUpToEol (rbraceOffset) ? curIndent.IndentString + curIndent.SingleIndent : this.EolMarker + curIndent.IndentString + curIndent.SingleIndent; break; } @@ -944,7 +974,7 @@ namespace ICSharpCode.NRefactory.CSharp if (changes.Any (c => c.Offset == offset && c.RemovedChars == removedChars && c.InsertedText == insertedText)) return; - string currentText = data.GetTextAt (offset, removedChars); + string currentText = document.GetText (offset, removedChars); if (currentText == insertedText) return; if (currentText.Any (c => !(char.IsWhiteSpace (c) || c == '\r' || c == '\t' || c == '{' || c == '}'))) @@ -973,13 +1003,13 @@ namespace ICSharpCode.NRefactory.CSharp public bool IsLineIsEmptyUpToEol (TextLocation startLocation) { - return IsLineIsEmptyUpToEol (data.LocationToOffset (startLocation.Line, startLocation.Column) - 1); + return IsLineIsEmptyUpToEol (document.GetOffset (startLocation) - 1); } bool IsLineIsEmptyUpToEol (int startOffset) { for (int offset = startOffset - 1; offset >= 0; offset--) { - char ch = data.GetCharAt (offset); + char ch = document.GetCharAt (offset); if (ch != ' ' && ch != '\t') return ch == '\n' || ch == '\r'; } @@ -991,7 +1021,7 @@ namespace ICSharpCode.NRefactory.CSharp if (startOffset < 0) throw new ArgumentOutOfRangeException ("startoffset", "value : " + startOffset); for (int offset = startOffset - 1; offset >= 0; offset--) { - char ch = data.GetCharAt (offset); + char ch = document.GetCharAt (offset); if (!Char.IsWhiteSpace (ch)) { return offset + 1; } @@ -1001,15 +1031,15 @@ namespace ICSharpCode.NRefactory.CSharp int SearchWhitespaceEnd (int startOffset) { - if (startOffset > data.Length) + if (startOffset > document.TextLength) throw new ArgumentOutOfRangeException ("startoffset", "value : " + startOffset); - for (int offset = startOffset + 1; offset < data.Length; offset++) { - char ch = data.GetCharAt (offset); + for (int offset = startOffset + 1; offset < document.TextLength; offset++) { + char ch = document.GetCharAt (offset); if (!Char.IsWhiteSpace (ch)) { return offset + 1; } } - return data.Length - 1; + return document.TextLength - 1; } int SearchWhitespaceLineStart (int startOffset) @@ -1017,7 +1047,7 @@ namespace ICSharpCode.NRefactory.CSharp if (startOffset < 0) throw new ArgumentOutOfRangeException ("startoffset", "value : " + startOffset); for (int offset = startOffset - 1; offset >= 0; offset--) { - char ch = data.GetCharAt (offset); + char ch = document.GetCharAt (offset); if (ch != ' ' && ch != '\t') { return offset + 1; } @@ -1248,7 +1278,7 @@ namespace ICSharpCode.NRefactory.CSharp return null; } - public override object VisitYieldStatement (YieldStatement yieldStatement, object data) + public override object VisitYieldReturnStatement (YieldReturnStatement yieldStatement, object data) { FixStatementIndentation (yieldStatement.StartLocation); return null; @@ -1466,7 +1496,7 @@ namespace ICSharpCode.NRefactory.CSharp { bool insertedSpace = false; do { - char ch = data.GetCharAt (offset); + char ch = document.GetCharAt (offset); //Console.WriteLine (ch); if (!IsSpacing (ch) && (insertedSpace || !forceSpace)) break; @@ -1524,9 +1554,9 @@ namespace ICSharpCode.NRefactory.CSharp { if (semicolon.IsNull) return; - int endOffset = data.LocationToOffset (semicolon.StartLocation.Line, semicolon.StartLocation.Column); + int endOffset = document.GetOffset (semicolon.StartLocation); int offset = endOffset; - while (offset - 1 > 0 && char.IsWhiteSpace (data.GetCharAt (offset - 1))) { + while (offset - 1 > 0 && char.IsWhiteSpace (document.GetCharAt (offset - 1))) { offset--; } if (offset < endOffset) { @@ -1538,10 +1568,10 @@ namespace ICSharpCode.NRefactory.CSharp { if (keywordNode == null) return; - int offset = data.LocationToOffset (keywordNode.StartLocation.Line, keywordNode.StartLocation.Column); + int offset = document.GetOffset (keywordNode.StartLocation); int whitespaceStart = SearchWhitespaceStart (offset); - string indentString = newLine ? data.EolMarker + this.curIndent.IndentString : " "; + string indentString = newLine ? this.EolMarker + this.curIndent.IndentString : " "; AddChange (whitespaceStart, offset - whitespaceStart, indentString); } @@ -1549,7 +1579,7 @@ namespace ICSharpCode.NRefactory.CSharp void FixStatementIndentation (TextLocation location) { - int offset = data.LocationToOffset (location.Line, location.Column); + int offset = document.GetOffset (location); if (offset <= 0) { Console.WriteLine ("possible wrong offset"); Console.WriteLine (Environment.StackTrace); @@ -1557,7 +1587,7 @@ namespace ICSharpCode.NRefactory.CSharp } bool isEmpty = IsLineIsEmptyUpToEol (offset); int lineStart = SearchWhitespaceLineStart (offset); - string indentString = nextStatementIndent == null ? (isEmpty ? "" : data.EolMarker) + this.curIndent.IndentString : nextStatementIndent; + string indentString = nextStatementIndent == null ? (isEmpty ? "" : this.EolMarker) + this.curIndent.IndentString : nextStatementIndent; nextStatementIndent = null; AddChange (lineStart, offset - lineStart, indentString); } @@ -1569,40 +1599,54 @@ namespace ICSharpCode.NRefactory.CSharp void FixIndentation (TextLocation location, int relOffset) { - if (location.Line < 1 || location.Line > data.LineCount) { + if (location.Line < 1 || location.Line > document.LineCount) { Console.WriteLine ("Invalid location " + location); Console.WriteLine (Environment.StackTrace); return; } - string lineIndent = data.GetIndentation (location.Line); + string lineIndent = GetIndentation (location.Line); string indentString = this.curIndent.IndentString; if (indentString != lineIndent && location.Column - 1 + relOffset == lineIndent.Length) { - AddChange (data.GetLineOffset (location.Line), lineIndent.Length, indentString); + AddChange (document.GetOffset (location.Line, 1), lineIndent.Length, indentString); } } void FixIndentationForceNewLine (TextLocation location) { - string lineIndent = data.GetIndentation (location.Line); + string lineIndent = GetIndentation (location.Line); string indentString = this.curIndent.IndentString; if (location.Column - 1 == lineIndent.Length) { - AddChange (data.GetLineOffset (location.Line), lineIndent.Length, indentString); + AddChange (document.GetOffset (location.Line, 1), lineIndent.Length, indentString); } else { - int offset = data.LocationToOffset (location.Line, location.Column); + int offset = document.GetOffset (location); int start = SearchWhitespaceLineStart (offset); if (start > 0) { - char ch = data.GetCharAt (start - 1); + char ch = document.GetCharAt (start - 1); if (ch == '\n') { start--; - if (start > 1 && data.GetCharAt (start - 1) == '\r') + if (start > 1 && document.GetCharAt (start - 1) == '\r') start--; } else if (ch == '\r') { start--; } - AddChange (start, offset - start, data.EolMarker + indentString); + AddChange (start, offset - start, this.EolMarker + indentString); } } } + + string GetIndentation(int lineNumber) + { + IDocumentLine line = document.GetLineByNumber(lineNumber); + StringBuilder b = new StringBuilder(); + int endOffset = line.EndOffset; + for (int i = line.Offset; i < endOffset; i++) { + char c = document.GetCharAt(i); + if (!IsSpacing(c)) + break; + b.Append(c); + } + return b.ToString(); + } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/ITextEditorAdapter.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/ITextEditorAdapter.cs deleted file mode 100644 index 4568f8736e..0000000000 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Formatter/ITextEditorAdapter.cs +++ /dev/null @@ -1,83 +0,0 @@ -// -// ITextEditorAdapter.cs -// -// Author: -// Mike Krüger -// -// Copyright (c) 2011 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -using System; -using System.Collections.Generic; - -namespace ICSharpCode.NRefactory -{ - public interface ITextEditorAdapter - { - bool TabsToSpaces { get; } - - int TabSize { get; } - - string EolMarker { get; } - - string Text { get; } - - int Length { get; } - - int LocationToOffset (int line, int col); - char GetCharAt (int offset); - string GetTextAt (int offset, int length); - - int LineCount { get; } - - int GetEditableLength (int lineNumber); - string GetIndentation (int lineNumber); - int GetLineOffset (int lineNumber); - int GetLineLength (int lineNumber); - int GetLineEndOffset (int lineNumber); - - void Replace (int offset, int count, string text); - } - - /* - public static class ITextEditorAdapterHelperMethods - { - public static void AcceptChanges (this ITextEditorAdapter adapter, List changes) - { - for (int i = 0; i < changes.Count; i++) { - changes [i].PerformChange (adapter); - var replaceChange = changes [i]; - for (int j = i + 1; j < changes.Count; j++) { - var change = changes [j]; - if (replaceChange.Offset >= 0 && change.Offset >= 0) { - if (replaceChange.Offset < change.Offset) { - change.Offset -= replaceChange.RemovedChars; - if (!string.IsNullOrEmpty (replaceChange.InsertedText)) - change.Offset += replaceChange.InsertedText.Length; - } else if (replaceChange.Offset < change.Offset + change.RemovedChars) { - change.RemovedChars -= replaceChange.RemovedChars; - change.Offset = replaceChange.Offset + (!string.IsNullOrEmpty (replaceChange.InsertedText) ? replaceChange.InsertedText.Length : 0); - } - } - } - } - } - }*/ -} - diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj index 66b2770618..2aad83fdef 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj @@ -8,12 +8,13 @@ ICSharpCode.NRefactory.CSharp ICSharpCode.NRefactory.CSharp v4.0 - Client Properties False False 4 false + 10.0.0 + 2.0 True ..\ICSharpCode.NRefactory.snk False @@ -148,7 +149,7 @@ - + @@ -168,11 +169,11 @@ - + - + @@ -302,21 +303,7 @@ - - - - - - - - - - - - - - - + diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpAmbience.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpAmbience.cs index 19960922e7..cf4dea3afc 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpAmbience.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpAmbience.cs @@ -179,9 +179,9 @@ namespace ICSharpCode.NRefactory.CSharp } } - OutputVisitor CreatePrinter(StringWriter writer) + CSharpOutputVisitor CreatePrinter(StringWriter writer) { - return new OutputVisitor(writer, new CSharpFormattingOptions()); + return new CSharpOutputVisitor(writer, new CSharpFormattingOptions()); } void PrintModifiers(Modifiers modifiers, StringWriter writer) @@ -202,7 +202,7 @@ namespace ICSharpCode.NRefactory.CSharp AstNode astNode = astBuilder.ConvertVariable(v); CSharpFormattingOptions formatting = new CSharpFormattingOptions(); StringWriter writer = new StringWriter(); - astNode.AcceptVisitor(new OutputVisitor(writer, formatting), null); + astNode.AcceptVisitor(new CSharpOutputVisitor(writer, formatting), null); return writer.ToString().TrimEnd(';', '\r', '\n'); } } @@ -213,7 +213,7 @@ namespace ICSharpCode.NRefactory.CSharp AstType astType = astBuilder.ConvertType(type); CSharpFormattingOptions formatting = new CSharpFormattingOptions(); StringWriter writer = new StringWriter(); - astType.AcceptVisitor(new OutputVisitor(writer, formatting), null); + astType.AcceptVisitor(new CSharpOutputVisitor(writer, formatting), null); return writer.ToString(); } @@ -224,7 +224,7 @@ namespace ICSharpCode.NRefactory.CSharp AstType astType = astBuilder.ConvertTypeReference(type); CSharpFormattingOptions formatting = new CSharpFormattingOptions(); StringWriter writer = new StringWriter(); - astType.AcceptVisitor(new OutputVisitor(writer, formatting), null); + astType.AcceptVisitor(new CSharpOutputVisitor(writer, formatting), null); return writer.ToString(); } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/OutputVisitor.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpOutputVisitor.cs similarity index 97% rename from src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/OutputVisitor.cs rename to src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpOutputVisitor.cs index 7a00d36f2f..a7eeedd00d 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/OutputVisitor.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CSharpOutputVisitor.cs @@ -23,7 +23,7 @@ using System.Globalization; using System.IO; using System.Linq; using System.Text; - +using System.Threading.Tasks; using ICSharpCode.NRefactory.PatternMatching; using ICSharpCode.NRefactory.TypeSystem; @@ -32,7 +32,7 @@ namespace ICSharpCode.NRefactory.CSharp /// /// Outputs the AST. /// - public class OutputVisitor : IAstVisitor + public class CSharpOutputVisitor : IAstVisitor { readonly IOutputFormatter formatter; readonly CSharpFormattingOptions policy; @@ -56,7 +56,7 @@ namespace ICSharpCode.NRefactory.CSharp Division } - public OutputVisitor (TextWriter textWriter, CSharpFormattingOptions formattingPolicy) + public CSharpOutputVisitor (TextWriter textWriter, CSharpFormattingOptions formattingPolicy) { if (textWriter == null) throw new ArgumentNullException ("textWriter"); @@ -66,7 +66,7 @@ namespace ICSharpCode.NRefactory.CSharp this.policy = formattingPolicy; } - public OutputVisitor (IOutputFormatter formatter, CSharpFormattingOptions formattingPolicy) + public CSharpOutputVisitor (IOutputFormatter formatter, CSharpFormattingOptions formattingPolicy) { if (formatter == null) throw new ArgumentNullException ("formatter"); @@ -420,13 +420,21 @@ namespace ICSharpCode.NRefactory.CSharp { if (unconditionalKeywords.Contains (identifier)) return true; - if (context.Ancestors.Any (a => a is QueryExpression)) { - if (queryKeywords.Contains (identifier)) + foreach (AstNode ancestor in context.Ancestors) { + if (ancestor is QueryExpression && queryKeywords.Contains (identifier)) return true; + if (identifier == "await") { + // with lambdas/anonymous methods, + if (ancestor is LambdaExpression) + return ((LambdaExpression)ancestor).IsAsync; + if (ancestor is AnonymousMethodExpression) + return ((AnonymousMethodExpression)ancestor).IsAsync; + if (ancestor is AttributedNode) + return (((AttributedNode)ancestor).Modifiers & Modifiers.Async) == Modifiers.Async; + } } return false; } - #endregion #region Write constructs @@ -518,6 +526,10 @@ namespace ICSharpCode.NRefactory.CSharp public object VisitAnonymousMethodExpression (AnonymousMethodExpression anonymousMethodExpression, object data) { StartNode (anonymousMethodExpression); + if (anonymousMethodExpression.IsAsync) { + WriteKeyword ("async", AnonymousMethodExpression.AsyncModifierRole); + Space (); + } WriteKeyword ("delegate"); if (anonymousMethodExpression.HasParameterList) { Space (policy.SpaceBeforeMethodDeclarationParentheses); @@ -792,6 +804,10 @@ namespace ICSharpCode.NRefactory.CSharp public object VisitLambdaExpression (LambdaExpression lambdaExpression, object data) { StartNode (lambdaExpression); + if (lambdaExpression.IsAsync) { + WriteKeyword ("async", LambdaExpression.AsyncModifierRole); + Space (); + } if (LambdaNeedsParenthesis (lambdaExpression)) { WriteCommaSeparatedListInParenthesis (lambdaExpression.Parameters, policy.SpaceWithinMethodDeclarationParentheses); } else { @@ -1118,8 +1134,11 @@ namespace ICSharpCode.NRefactory.CSharp StartNode (unaryOperatorExpression); UnaryOperatorType opType = unaryOperatorExpression.Operator; string opSymbol = UnaryOperatorExpression.GetOperatorSymbol (opType); - if (!(opType == UnaryOperatorType.PostIncrement || opType == UnaryOperatorType.PostDecrement)) + if (opType == UnaryOperatorType.Await) { + WriteKeyword (opSymbol, UnaryOperatorExpression.OperatorRole); + } else if (!(opType == UnaryOperatorType.PostIncrement || opType == UnaryOperatorType.PostDecrement)) { WriteToken (opSymbol, UnaryOperatorExpression.OperatorRole); + } unaryOperatorExpression.Expression.AcceptVisitor (this, data); if (opType == UnaryOperatorType.PostIncrement || opType == UnaryOperatorType.PostDecrement) WriteToken (opSymbol, UnaryOperatorExpression.OperatorRole); @@ -1862,15 +1881,15 @@ namespace ICSharpCode.NRefactory.CSharp return EndNode (yieldBreakStatement); } - public object VisitYieldStatement (YieldStatement yieldStatement, object data) + public object VisitYieldReturnStatement (YieldReturnStatement yieldReturnStatement, object data) { - StartNode (yieldStatement); - WriteKeyword ("yield", YieldStatement.YieldKeywordRole); - WriteKeyword ("return", YieldStatement.ReturnKeywordRole); + StartNode (yieldReturnStatement); + WriteKeyword ("yield", YieldReturnStatement.YieldKeywordRole); + WriteKeyword ("return", YieldReturnStatement.ReturnKeywordRole); Space (); - yieldStatement.Expression.AcceptVisitor (this, data); + yieldReturnStatement.Expression.AcceptVisitor (this, data); Semicolon (); - return EndNode (yieldStatement); + return EndNode (yieldReturnStatement); } #endregion diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CodeDomConvertVisitor.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CodeDomConvertVisitor.cs new file mode 100644 index 0000000000..eb82b1981c --- /dev/null +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/CodeDomConvertVisitor.cs @@ -0,0 +1,1304 @@ +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +using System; +using System.CodeDom; +using System.Collections.Generic; +using System.IO; +using System.Linq; + +using ICSharpCode.NRefactory.CSharp.Resolver; +using ICSharpCode.NRefactory.PatternMatching; +using ICSharpCode.NRefactory.Semantics; +using ICSharpCode.NRefactory.TypeSystem; +using ICSharpCode.NRefactory.TypeSystem.Implementation; + +namespace ICSharpCode.NRefactory.CSharp +{ + /// + /// Converts from C# AST to CodeDom. + /// + /// + /// The conversion is intended for use in the SharpDevelop forms designer. + /// + public class CodeDomConvertVisitor : IAstVisitor + { + ITypeResolveContext context = MinimalResolveContext.Instance; + ResolveVisitor resolveVisitor; + bool useFullyQualifiedTypeNames; + + /// + /// Gets/Sets whether the visitor should use fully-qualified type references. + /// + public bool UseFullyQualifiedTypeNames { + get { return useFullyQualifiedTypeNames; } + set { useFullyQualifiedTypeNames = value; } + } + + /// + /// Converts a compilation unit to CodeDom. + /// + /// The input compilation unit. + /// Type resolve context, used for resolving type references. + /// CSharpParsedFile, used for resolving. + /// Converted CodeCompileUnit + /// + /// This conversion process requires a resolver because it needs to distinguish field/property/event references etc. + /// + public CodeCompileUnit Convert(CompilationUnit compilationUnit, ITypeResolveContext context, CSharpParsedFile parsedFile) + { + if (compilationUnit == null) + throw new ArgumentNullException("compilationUnit"); + if (context == null) + throw new ArgumentNullException("context"); + if (parsedFile == null) + throw new ArgumentNullException("parsedFile"); + using (var ctx = context.Synchronize()) { + ResolveVisitor resolveVisitor = new ResolveVisitor(new CSharpResolver(ctx), parsedFile); + resolveVisitor.Scan(compilationUnit); + return (CodeCompileUnit)Convert(compilationUnit, resolveVisitor); + } + } + + /// + /// Converts a C# AST node to CodeDom. + /// + /// The input node. + /// The resolve visitor. + /// The visitor must be already initialized for the file containing the given node (Scan must be called). + /// The node converted into CodeDom + /// + /// This conversion process requires a resolver because it needs to distinguish field/property/event references etc. + /// + public CodeObject Convert(AstNode node, ResolveVisitor resolveVisitor) + { + if (node == null) + throw new ArgumentNullException("node"); + if (resolveVisitor == null) + throw new ArgumentNullException("resolveVisitor"); + try { + this.resolveVisitor = resolveVisitor; + this.context = resolveVisitor.TypeResolveContext; + return node.AcceptVisitor(this); + } finally { + this.resolveVisitor = null; + this.context = MinimalResolveContext.Instance; + } + } + + ResolveResult Resolve(AstNode node) + { + if (resolveVisitor == null) + return ErrorResolveResult.UnknownError; + else + return resolveVisitor.GetResolveResult(node); + } + + CodeExpression Convert(Expression expr) + { + return (CodeExpression)expr.AcceptVisitor(this); + } + + CodeExpression[] Convert(IEnumerable expressions) + { + List result = new List(); + foreach (Expression expr in expressions) { + CodeExpression e = Convert(expr); + if (e != null) + result.Add(e); + } + return result.ToArray(); + } + + CodeTypeReference Convert(AstType type) + { + return (CodeTypeReference)type.AcceptVisitor(this); + } + + CodeTypeReference[] Convert(IEnumerable types) + { + List result = new List(); + foreach (AstType type in types) { + CodeTypeReference e = Convert(type); + if (e != null) + result.Add(e); + } + return result.ToArray(); + } + + CodeTypeReference Convert(IType type) + { + return new CodeTypeReference(type.ReflectionName); + } + + CodeStatement Convert(Statement stmt) + { + return (CodeStatement)stmt.AcceptVisitor(this); + } + + CodeStatement[] ConvertBlock(BlockStatement block) + { + List result = new List(); + foreach (Statement stmt in block.Statements) { + CodeStatement s = Convert(stmt); + if (s != null) + result.Add(s); + } + return result.ToArray(); + } + + CodeStatement[] ConvertEmbeddedStatement(Statement embeddedStatement) + { + BlockStatement block = embeddedStatement as BlockStatement; + if (block != null) { + return ConvertBlock(block); + } + CodeStatement s = Convert(embeddedStatement); + if (s != null) + return new CodeStatement[] { s }; + else + return new CodeStatement[0]; + } + + string MakeSnippet(AstNode node) + { + StringWriter w = new StringWriter(); + CSharpOutputVisitor v = new CSharpOutputVisitor(w, new CSharpFormattingOptions()); + node.AcceptVisitor(v); + return w.ToString(); + } + + /// + /// Converts an expression by storing it as C# snippet. + /// This is used for expressions that cannot be represented in CodeDom. + /// + CodeSnippetExpression MakeSnippetExpression(Expression expr) + { + return new CodeSnippetExpression(MakeSnippet(expr)); + } + + CodeSnippetStatement MakeSnippetStatement(Statement stmt) + { + return new CodeSnippetStatement(MakeSnippet(stmt)); + } + + CodeObject IAstVisitor.VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression, object data) + { + return MakeSnippetExpression(anonymousMethodExpression); + } + + CodeObject IAstVisitor.VisitUndocumentedExpression(UndocumentedExpression undocumentedExpression, object data) + { + return MakeSnippetExpression(undocumentedExpression); + } + + CodeObject IAstVisitor.VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, object data) + { + CodeArrayCreateExpression ace = new CodeArrayCreateExpression(); + int dimensions = arrayCreateExpression.Arguments.Count; + int nestingDepth = arrayCreateExpression.AdditionalArraySpecifiers.Count; + if (dimensions > 0) + nestingDepth++; + if (nestingDepth > 1 || dimensions > 1) { + // CodeDom does not support jagged or multi-dimensional arrays + return MakeSnippetExpression(arrayCreateExpression); + } + if (arrayCreateExpression.Type.IsNull) { + ace.CreateType = Convert(Resolve(arrayCreateExpression).Type); + } else { + ace.CreateType = Convert(arrayCreateExpression.Type); + } + if (arrayCreateExpression.Arguments.Count == 1) { + ace.SizeExpression = Convert(arrayCreateExpression.Arguments.Single()); + } + ace.Initializers.AddRange(Convert(arrayCreateExpression.Initializer.Elements)); + return ace; + } + + CodeObject IAstVisitor.VisitArrayInitializerExpression(ArrayInitializerExpression arrayInitializerExpression, object data) + { + // Array initializers should be handled by the parent node + return MakeSnippetExpression(arrayInitializerExpression); + } + + CodeObject IAstVisitor.VisitAsExpression(AsExpression asExpression, object data) + { + return MakeSnippetExpression(asExpression); + } + + CodeObject IAstVisitor.VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data) + { + // assignments are only supported as statements, not as expressions + return MakeSnippetExpression(assignmentExpression); + } + + CodeObject IAstVisitor.VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression, object data) + { + return new CodeBaseReferenceExpression(); + } + + CodeObject IAstVisitor.VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression, object data) + { + CodeBinaryOperatorType op; + switch (binaryOperatorExpression.Operator) { + case BinaryOperatorType.BitwiseAnd: + op = CodeBinaryOperatorType.BitwiseAnd; + break; + case BinaryOperatorType.BitwiseOr: + op = CodeBinaryOperatorType.BitwiseOr; + break; + case BinaryOperatorType.ConditionalAnd: + op = CodeBinaryOperatorType.BooleanAnd; + break; + case BinaryOperatorType.ConditionalOr: + op = CodeBinaryOperatorType.BooleanOr; + break; + case BinaryOperatorType.GreaterThan: + op = CodeBinaryOperatorType.GreaterThan; + break; + case BinaryOperatorType.GreaterThanOrEqual: + op = CodeBinaryOperatorType.GreaterThanOrEqual; + break; + case BinaryOperatorType.LessThan: + op = CodeBinaryOperatorType.LessThan; + break; + case BinaryOperatorType.LessThanOrEqual: + op = CodeBinaryOperatorType.LessThanOrEqual; + break; + case BinaryOperatorType.Add: + op = CodeBinaryOperatorType.Add; + break; + case BinaryOperatorType.Subtract: + op = CodeBinaryOperatorType.Subtract; + break; + case BinaryOperatorType.Multiply: + op = CodeBinaryOperatorType.Multiply; + break; + case BinaryOperatorType.Divide: + op = CodeBinaryOperatorType.Divide; + break; + case BinaryOperatorType.Modulus: + op = CodeBinaryOperatorType.Modulus; + break; + case BinaryOperatorType.Equality: + case BinaryOperatorType.InEquality: + BinaryOperatorResolveResult rr = Resolve(binaryOperatorExpression) as BinaryOperatorResolveResult; + if (rr != null && rr.Left.Type.IsReferenceType(context) == true) { + if (binaryOperatorExpression.Operator == BinaryOperatorType.Equality) + op = CodeBinaryOperatorType.IdentityEquality; + else + op = CodeBinaryOperatorType.IdentityInequality; + } else { + if (binaryOperatorExpression.Operator == BinaryOperatorType.Equality) { + op = CodeBinaryOperatorType.ValueEquality; + } else { + // CodeDom is retarded and does not support ValueInequality, so we'll simulate it using + // ValueEquality and Not... but CodeDom doesn't have Not either, so we use + // '(a == b) == false' + return new CodeBinaryOperatorExpression( + new CodeBinaryOperatorExpression( + Convert(binaryOperatorExpression.Left), + CodeBinaryOperatorType.ValueEquality, + Convert(binaryOperatorExpression.Right) + ), + CodeBinaryOperatorType.ValueEquality, + new CodePrimitiveExpression(false) + ); + } + } + break; + default: + // not supported: xor, shift, null coalescing + return MakeSnippetExpression(binaryOperatorExpression); + } + return new CodeBinaryOperatorExpression(Convert(binaryOperatorExpression.Left), op, Convert(binaryOperatorExpression.Right)); + } + + CodeObject IAstVisitor.VisitCastExpression(CastExpression castExpression, object data) + { + return new CodeCastExpression(Convert(castExpression.Type), Convert(castExpression.Expression)); + } + + CodeObject IAstVisitor.VisitCheckedExpression(CheckedExpression checkedExpression, object data) + { + return MakeSnippetExpression(checkedExpression); + } + + CodeObject IAstVisitor.VisitConditionalExpression(ConditionalExpression conditionalExpression, object data) + { + return MakeSnippetExpression(conditionalExpression); + } + + CodeObject IAstVisitor.VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression, object data) + { + return new CodeDefaultValueExpression(Convert(defaultValueExpression.Type)); + } + + CodeObject IAstVisitor.VisitDirectionExpression(DirectionExpression directionExpression, object data) + { + System.CodeDom.FieldDirection direction; + if (directionExpression.FieldDirection == FieldDirection.Out) { + direction = System.CodeDom.FieldDirection.Out; + } else { + direction = System.CodeDom.FieldDirection.Ref; + } + return new CodeDirectionExpression(direction, Convert(directionExpression.Expression)); + } + + CodeObject IAstVisitor.VisitIdentifierExpression(IdentifierExpression identifierExpression, object data) + { + ResolveResult rr = Resolve(identifierExpression); + LocalResolveResult lrr = rr as LocalResolveResult; + if (lrr != null && lrr.IsParameter) { + if (lrr.Variable.Name == "value" && identifierExpression.Ancestors.Any(a => a is Accessor)) { + return new CodePropertySetValueReferenceExpression(); + } else { + return new CodeArgumentReferenceExpression(lrr.Variable.Name); + } + } + MemberResolveResult mrr = rr as MemberResolveResult; + if (mrr != null) { + return HandleMemberReference(null, identifierExpression.Identifier, identifierExpression.TypeArguments, mrr); + } + TypeResolveResult trr = rr as TypeResolveResult; + if (trr != null) { + CodeTypeReference typeRef; + if (useFullyQualifiedTypeNames) { + typeRef = Convert(trr.Type); + } else { + typeRef = new CodeTypeReference(identifierExpression.Identifier); + typeRef.TypeArguments.AddRange(Convert(identifierExpression.TypeArguments)); + } + return new CodeTypeReferenceExpression(typeRef); + } + MethodGroupResolveResult mgrr = rr as MethodGroupResolveResult; + if (mgrr != null) { + return new CodeMethodReferenceExpression(new CodeThisReferenceExpression(), identifierExpression.Identifier, Convert(identifierExpression.TypeArguments)); + } + return new CodeVariableReferenceExpression(identifierExpression.Identifier); + } + + CodeObject IAstVisitor.VisitIndexerExpression(IndexerExpression indexerExpression, object data) + { + if (Resolve(indexerExpression) is ArrayAccessResolveResult) + return new CodeArrayIndexerExpression(Convert(indexerExpression.Target), Convert(indexerExpression.Arguments)); + else + return new CodeIndexerExpression(Convert(indexerExpression.Target), Convert(indexerExpression.Arguments)); + } + + CodeObject IAstVisitor.VisitInvocationExpression(InvocationExpression invocationExpression, object data) + { + MemberResolveResult rr = Resolve(invocationExpression) as MemberResolveResult; + CSharpInvocationResolveResult csRR = rr as CSharpInvocationResolveResult; + if (csRR != null && csRR.IsDelegateInvocation) { + return new CodeDelegateInvokeExpression(Convert(invocationExpression.Target), Convert(invocationExpression.Arguments)); + } + + Expression methodExpr = invocationExpression.Target; + while (methodExpr is ParenthesizedExpression) + methodExpr = ((ParenthesizedExpression)methodExpr).Expression; + CodeMethodReferenceExpression mr = null; + MemberReferenceExpression mre = methodExpr as MemberReferenceExpression; + if (mre != null) { + mr = new CodeMethodReferenceExpression(Convert(mre.Target), mre.MemberName, Convert(mre.TypeArguments)); + } + IdentifierExpression id = methodExpr as IdentifierExpression; + if (id != null) { + CodeExpression target; + if (rr != null && rr.Member.IsStatic) + target = new CodeTypeReferenceExpression(Convert(rr.Member.DeclaringType)); + else + target = new CodeThisReferenceExpression(); + + mr = new CodeMethodReferenceExpression(target, id.Identifier, Convert(id.TypeArguments)); + } + if (mr != null) + return new CodeMethodInvokeExpression(mr, Convert(invocationExpression.Arguments)); + else + return MakeSnippetExpression(invocationExpression); + } + + CodeObject IAstVisitor.VisitIsExpression(IsExpression isExpression, object data) + { + return MakeSnippetExpression(isExpression); + } + + CodeObject IAstVisitor.VisitLambdaExpression(LambdaExpression lambdaExpression, object data) + { + return MakeSnippetExpression(lambdaExpression); + } + + CodeObject IAstVisitor.VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression, object data) + { + CodeExpression target = Convert(memberReferenceExpression.Target); + ResolveResult rr = Resolve(memberReferenceExpression); + MemberResolveResult mrr = rr as MemberResolveResult; + if (mrr != null) { + return HandleMemberReference(target, memberReferenceExpression.MemberName, memberReferenceExpression.TypeArguments, mrr); + } else { + if (memberReferenceExpression.TypeArguments.Any() || rr is MethodGroupResolveResult) { + return new CodeMethodReferenceExpression(target, memberReferenceExpression.MemberName, Convert(memberReferenceExpression.TypeArguments)); + } else { + return new CodePropertyReferenceExpression(target, memberReferenceExpression.MemberName); + } + } + } + + CodeExpression HandleMemberReference(CodeExpression target, string identifier, AstNodeCollection typeArguments, MemberResolveResult mrr) + { + if (target == null) { + if (mrr.Member.IsStatic) + target = new CodeTypeReferenceExpression(Convert(mrr.Member.DeclaringType)); + else + target = new CodeThisReferenceExpression(); + } + if (mrr.Member is IField) { + return new CodeFieldReferenceExpression(target, identifier); + } else if (mrr.Member is IMethod) { + return new CodeMethodReferenceExpression(target, identifier, Convert(typeArguments)); + } else if (mrr.Member is IEvent) { + return new CodeEventReferenceExpression(target, identifier); + } else { + return new CodePropertyReferenceExpression(target, identifier); + } + } + + CodeObject IAstVisitor.VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data) + { + return MakeSnippetExpression(namedArgumentExpression); + } + + CodeObject IAstVisitor.VisitNamedExpression(NamedExpression namedExpression, object data) + { + return MakeSnippetExpression(namedExpression); + } + + CodeObject IAstVisitor.VisitNullReferenceExpression(NullReferenceExpression nullReferenceExpression, object data) + { + return new CodePrimitiveExpression(null); + } + + CodeObject IAstVisitor.VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression, object data) + { + if (!objectCreateExpression.Initializer.IsNull) + return MakeSnippetExpression(objectCreateExpression); + return new CodeObjectCreateExpression(Convert(objectCreateExpression.Type), Convert(objectCreateExpression.Arguments)); + } + + CodeObject IAstVisitor.VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression, object data) + { + return MakeSnippetExpression(anonymousTypeCreateExpression); + } + + CodeObject IAstVisitor.VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression, object data) + { + // CodeDom generators will insert parentheses where necessary + return Convert(parenthesizedExpression.Expression); + } + + CodeObject IAstVisitor.VisitPointerReferenceExpression(PointerReferenceExpression pointerReferenceExpression, object data) + { + return MakeSnippetExpression(pointerReferenceExpression); + } + + CodeObject IAstVisitor.VisitPrimitiveExpression(PrimitiveExpression primitiveExpression, object data) + { + return new CodePrimitiveExpression(primitiveExpression.Value); + } + + CodeObject IAstVisitor.VisitSizeOfExpression(SizeOfExpression sizeOfExpression, object data) + { + return MakeSnippetExpression(sizeOfExpression); + } + + CodeObject IAstVisitor.VisitStackAllocExpression(StackAllocExpression stackAllocExpression, object data) + { + return MakeSnippetExpression(stackAllocExpression); + } + + CodeObject IAstVisitor.VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, object data) + { + return new CodeThisReferenceExpression(); + } + + CodeObject IAstVisitor.VisitTypeOfExpression(TypeOfExpression typeOfExpression, object data) + { + return new CodeTypeOfExpression(Convert(typeOfExpression.Type)); + } + + CodeObject IAstVisitor.VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression, object data) + { + return new CodeTypeReferenceExpression(Convert(typeReferenceExpression.Type)); + } + + CodeObject IAstVisitor.VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression, object data) + { + switch (unaryOperatorExpression.Operator) { + case UnaryOperatorType.Not: + return new CodeBinaryOperatorExpression( + Convert(unaryOperatorExpression.Expression), + CodeBinaryOperatorType.ValueEquality, + new CodePrimitiveExpression(false)); + case UnaryOperatorType.Minus: + return new CodeBinaryOperatorExpression( + new CodePrimitiveExpression(0), + CodeBinaryOperatorType.Subtract, + Convert(unaryOperatorExpression.Expression)); + case UnaryOperatorType.Plus: + return Convert(unaryOperatorExpression.Expression); + default: + return MakeSnippetExpression(unaryOperatorExpression); + } + } + + CodeObject IAstVisitor.VisitUncheckedExpression(UncheckedExpression uncheckedExpression, object data) + { + return MakeSnippetExpression(uncheckedExpression); + } + + CodeObject IAstVisitor.VisitEmptyExpression(EmptyExpression emptyExpression, object data) + { + return null; + } + + CodeObject IAstVisitor.VisitQueryExpression(QueryExpression queryExpression, object data) + { + return MakeSnippetExpression(queryExpression); + } + + CodeObject IAstVisitor.VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause, object data) + { + throw new NotSupportedException(); + } + + CodeObject IAstVisitor.VisitQueryFromClause(QueryFromClause queryFromClause, object data) + { + throw new NotSupportedException(); + } + + CodeObject IAstVisitor.VisitQueryLetClause(QueryLetClause queryLetClause, object data) + { + throw new NotSupportedException(); + } + + CodeObject IAstVisitor.VisitQueryWhereClause(QueryWhereClause queryWhereClause, object data) + { + throw new NotSupportedException(); + } + + CodeObject IAstVisitor.VisitQueryJoinClause(QueryJoinClause queryJoinClause, object data) + { + throw new NotSupportedException(); + } + + CodeObject IAstVisitor.VisitQueryOrderClause(QueryOrderClause queryOrderClause, object data) + { + throw new NotSupportedException(); + } + + CodeObject IAstVisitor.VisitQueryOrdering(QueryOrdering queryOrdering, object data) + { + throw new NotSupportedException(); + } + + CodeObject IAstVisitor.VisitQuerySelectClause(QuerySelectClause querySelectClause, object data) + { + throw new NotSupportedException(); + } + + CodeObject IAstVisitor.VisitQueryGroupClause(QueryGroupClause queryGroupClause, object data) + { + throw new NotSupportedException(); + } + + CodeObject IAstVisitor.VisitAttribute(Attribute attribute, object data) + { + throw new NotSupportedException(); + } + + CodeObject IAstVisitor.VisitAttributeSection(AttributeSection attributeSection, object data) + { + throw new NotSupportedException(); + } + + CodeAttributeDeclaration Convert(Attribute attribute) + { + var attr = new CodeAttributeDeclaration(Convert(attribute.Type)); + foreach (Expression expr in attribute.Arguments) { + NamedExpression ne = expr as NamedExpression; + if (ne != null) + attr.Arguments.Add(new CodeAttributeArgument(ne.Identifier, Convert(ne.Expression))); + else + attr.Arguments.Add(new CodeAttributeArgument(Convert(expr))); + } + return attr; + } + + CodeAttributeDeclaration[] Convert(IEnumerable attributeSections) + { + List result = new List(); + foreach (AttributeSection section in attributeSections) { + foreach (Attribute attr in section.Attributes) { + CodeAttributeDeclaration attrDecl = Convert(attr); + if (attrDecl != null) + result.Add(attrDecl); + } + } + return result.ToArray(); + } + + CodeObject IAstVisitor.VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration, object data) + { + CodeTypeDelegate d = new CodeTypeDelegate(delegateDeclaration.Name); + d.Attributes = ConvertMemberAttributes(delegateDeclaration.Modifiers); + d.CustomAttributes.AddRange(Convert(delegateDeclaration.Attributes)); + d.ReturnType = Convert(delegateDeclaration.ReturnType); + d.Parameters.AddRange(Convert(delegateDeclaration.Parameters)); + d.TypeParameters.AddRange(ConvertTypeParameters(delegateDeclaration.TypeParameters, delegateDeclaration.Constraints)); + return d; + } + + static MemberAttributes ConvertMemberAttributes(Modifiers modifiers) + { + MemberAttributes a = 0; + if ((modifiers & Modifiers.Abstract) != 0) + a |= MemberAttributes.Abstract; + if ((modifiers & Modifiers.Sealed) != 0) + a |= MemberAttributes.Final; + if ((modifiers & Modifiers.Static) != 0) + a |= MemberAttributes.Static; + if ((modifiers & Modifiers.Override) != 0) + a |= MemberAttributes.Override; + if ((modifiers & Modifiers.Const) != 0) + a |= MemberAttributes.Const; + if ((modifiers & Modifiers.New) != 0) + a |= MemberAttributes.New; + + if ((modifiers & Modifiers.Public) != 0) + a |= MemberAttributes.Public; + else if ((modifiers & (Modifiers.Protected | Modifiers.Internal)) == (Modifiers.Protected | Modifiers.Internal)) + a |= MemberAttributes.FamilyOrAssembly; + else if ((modifiers & Modifiers.Protected) != 0) + a |= MemberAttributes.Family; + else if ((modifiers & Modifiers.Internal) != 0) + a |= MemberAttributes.Assembly; + else if ((modifiers & Modifiers.Private) != 0) + a |= MemberAttributes.Private; + + return a; + } + + CodeObject IAstVisitor.VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data) + { + CodeNamespace ns = new CodeNamespace(namespaceDeclaration.Name); + foreach (AstNode node in namespaceDeclaration.Members) { + CodeObject r = node.AcceptVisitor(this); + + CodeNamespaceImport import = r as CodeNamespaceImport; + if (import != null) + ns.Imports.Add(import); + + CodeTypeDeclaration typeDecl = r as CodeTypeDeclaration; + if (typeDecl != null) + ns.Types.Add(typeDecl); + } + return ns; + } + + Stack typeStack = new Stack(); + + CodeObject IAstVisitor.VisitTypeDeclaration(TypeDeclaration typeDeclaration, object data) + { + bool isNestedType = typeStack.Count > 0; + CodeTypeDeclaration typeDecl = new CodeTypeDeclaration(typeDeclaration.Name); + typeDecl.Attributes = ConvertMemberAttributes(typeDeclaration.Modifiers); + typeDecl.CustomAttributes.AddRange(Convert(typeDeclaration.Attributes)); + + switch (typeDeclaration.ClassType) { + case ClassType.Struct: + typeDecl.IsStruct = true; + break; + case ClassType.Interface: + typeDecl.IsInterface = true; + break; + case ClassType.Enum: + typeDecl.IsEnum = true; + break; + default: + typeDecl.IsClass = true; + break; + } + typeDecl.IsPartial = (typeDeclaration.Modifiers & Modifiers.Partial) == Modifiers.Partial; + + typeDecl.BaseTypes.AddRange(Convert(typeDeclaration.BaseTypes)); + typeDecl.TypeParameters.AddRange(ConvertTypeParameters(typeDeclaration.TypeParameters, typeDeclaration.Constraints)); + + typeStack.Push(typeDecl); + foreach (var member in typeDeclaration.Members) { + CodeTypeMember m = member.AcceptVisitor(this) as CodeTypeMember; + if (m != null) + typeDecl.Members.Add(m); + } + typeStack.Pop(); + return typeDecl; + } + + void AddTypeMember(CodeTypeMember member) + { + if (typeStack.Count != 0) + typeStack.Peek().Members.Add(member); + } + + CodeObject IAstVisitor.VisitUsingAliasDeclaration(UsingAliasDeclaration usingAliasDeclaration, object data) + { + return new CodeSnippetTypeMember(MakeSnippet(usingAliasDeclaration)); + } + + CodeObject IAstVisitor.VisitUsingDeclaration(UsingDeclaration usingDeclaration, object data) + { + return new CodeNamespaceImport(usingDeclaration.Namespace); + } + + CodeObject IAstVisitor.VisitExternAliasDeclaration(ExternAliasDeclaration externAliasDeclaration, object data) + { + return new CodeSnippetTypeMember(MakeSnippet(externAliasDeclaration)); + } + + CodeObject IAstVisitor.VisitBlockStatement(BlockStatement blockStatement, object data) + { + return new CodeConditionStatement(new CodePrimitiveExpression(true), ConvertBlock(blockStatement)); + } + + CodeObject IAstVisitor.VisitBreakStatement(BreakStatement breakStatement, object data) + { + return MakeSnippetStatement(breakStatement); + } + + CodeObject IAstVisitor.VisitCheckedStatement(CheckedStatement checkedStatement, object data) + { + return MakeSnippetStatement(checkedStatement); + } + + CodeObject IAstVisitor.VisitContinueStatement(ContinueStatement continueStatement, object data) + { + return MakeSnippetStatement(continueStatement); + } + + CodeObject IAstVisitor.VisitDoWhileStatement(DoWhileStatement doWhileStatement, object data) + { + // do { } while (expr); + // + // emulate with: + // for (bool _do = true; _do; _do = expr) {} + string varName = "_do" + doWhileStatement.Ancestors.OfType().Count(); + return new CodeIterationStatement( + new CodeVariableDeclarationStatement(typeof(bool), varName, new CodePrimitiveExpression(true)), + new CodeVariableReferenceExpression(varName), + new CodeAssignStatement(new CodeVariableReferenceExpression(varName), Convert(doWhileStatement.Condition)), + ConvertEmbeddedStatement(doWhileStatement.EmbeddedStatement) + ); + } + + CodeObject IAstVisitor.VisitEmptyStatement(EmptyStatement emptyStatement, object data) + { + return null; + } + + CodeObject IAstVisitor.VisitExpressionStatement(ExpressionStatement expressionStatement, object data) + { + AssignmentExpression assignment = expressionStatement.Expression as AssignmentExpression; + if (assignment != null && assignment.Operator == AssignmentOperatorType.Assign) { + return new CodeAssignStatement(Convert(assignment.Left), Convert(assignment.Right)); + } + return new CodeExpressionStatement(Convert(expressionStatement.Expression)); + } + + CodeObject IAstVisitor.VisitFixedStatement(FixedStatement fixedStatement, object data) + { + return MakeSnippetStatement(fixedStatement); + } + + CodeObject IAstVisitor.VisitForeachStatement(ForeachStatement foreachStatement, object data) + { + return MakeSnippetStatement(foreachStatement); + } + + CodeObject IAstVisitor.VisitForStatement(ForStatement forStatement, object data) + { + if (forStatement.Initializers.Count != 1 || forStatement.Iterators.Count != 1) + return MakeSnippetStatement(forStatement); + return new CodeIterationStatement( + Convert(forStatement.Initializers.Single()), + Convert(forStatement.Condition), + Convert(forStatement.Iterators.Single()), + ConvertEmbeddedStatement(forStatement.EmbeddedStatement) + ); + } + + CodeObject IAstVisitor.VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data) + { + return MakeSnippetStatement(gotoCaseStatement); + } + + CodeObject IAstVisitor.VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement, object data) + { + return MakeSnippetStatement(gotoDefaultStatement); + } + + CodeObject IAstVisitor.VisitGotoStatement(GotoStatement gotoStatement, object data) + { + return new CodeGotoStatement(gotoStatement.Label); + } + + CodeObject IAstVisitor.VisitIfElseStatement(IfElseStatement ifElseStatement, object data) + { + return new CodeConditionStatement( + Convert(ifElseStatement.Condition), + ConvertEmbeddedStatement(ifElseStatement.TrueStatement), + ConvertEmbeddedStatement(ifElseStatement.FalseStatement)); + } + + CodeObject IAstVisitor.VisitLabelStatement(LabelStatement labelStatement, object data) + { + return new CodeLabeledStatement(labelStatement.Label); + } + + CodeObject IAstVisitor.VisitLockStatement(LockStatement lockStatement, object data) + { + return MakeSnippetStatement(lockStatement); + } + + CodeObject IAstVisitor.VisitReturnStatement(ReturnStatement returnStatement, object data) + { + return new CodeMethodReturnStatement(Convert(returnStatement.Expression)); + } + + CodeObject IAstVisitor.VisitSwitchStatement(SwitchStatement switchStatement, object data) + { + return MakeSnippetStatement(switchStatement); + } + + CodeObject IAstVisitor.VisitSwitchSection(SwitchSection switchSection, object data) + { + throw new NotSupportedException(); + } + + CodeObject IAstVisitor.VisitCaseLabel(CaseLabel caseLabel, object data) + { + throw new NotSupportedException(); + } + + CodeObject IAstVisitor.VisitThrowStatement(ThrowStatement throwStatement, object data) + { + return new CodeThrowExceptionStatement(Convert(throwStatement.Expression)); + } + + CodeObject IAstVisitor.VisitTryCatchStatement(TryCatchStatement tryCatchStatement, object data) + { + List catchClauses = new List(); + foreach (var catchClause in tryCatchStatement.CatchClauses) { + catchClauses.Add(new CodeCatchClause(catchClause.VariableName, Convert(catchClause.Type), ConvertBlock(catchClause.Body))); + } + return new CodeTryCatchFinallyStatement( + ConvertBlock(tryCatchStatement.TryBlock), + catchClauses.ToArray(), + ConvertBlock(tryCatchStatement.FinallyBlock)); + } + + CodeObject IAstVisitor.VisitCatchClause(CatchClause catchClause, object data) + { + throw new NotSupportedException(); + } + + CodeObject IAstVisitor.VisitUncheckedStatement(UncheckedStatement uncheckedStatement, object data) + { + return MakeSnippetStatement(uncheckedStatement); + } + + CodeObject IAstVisitor.VisitUnsafeStatement(UnsafeStatement unsafeStatement, object data) + { + return MakeSnippetStatement(unsafeStatement); + } + + CodeObject IAstVisitor.VisitUsingStatement(UsingStatement usingStatement, object data) + { + return MakeSnippetStatement(usingStatement); + } + + CodeObject IAstVisitor.VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement, object data) + { + if (variableDeclarationStatement.Variables.Count != 1) + return MakeSnippetStatement(variableDeclarationStatement); + VariableInitializer vi = variableDeclarationStatement.Variables.Single(); + return new CodeVariableDeclarationStatement( + Convert(variableDeclarationStatement.Type), + vi.Name, + ConvertVariableInitializer(vi.Initializer, variableDeclarationStatement.Type)); + } + + CodeExpression ConvertVariableInitializer(Expression expr, AstType type) + { + ArrayInitializerExpression aie = expr as ArrayInitializerExpression; + if (aie != null) { + return new CodeArrayCreateExpression(Convert(type), Convert(aie.Elements)); + } else { + return Convert(expr); + } + } + + CodeObject IAstVisitor.VisitWhileStatement(WhileStatement whileStatement, object data) + { + return new CodeIterationStatement(null, Convert(whileStatement.Condition), null, ConvertEmbeddedStatement(whileStatement.EmbeddedStatement)); + } + + CodeObject IAstVisitor.VisitYieldBreakStatement(YieldBreakStatement yieldBreakStatement, object data) + { + return MakeSnippetStatement(yieldBreakStatement); + } + + CodeObject IAstVisitor.VisitYieldReturnStatement(YieldReturnStatement yieldStatement, object data) + { + return MakeSnippetStatement(yieldStatement); + } + + CodeObject IAstVisitor.VisitAccessor(Accessor accessor, object data) + { + throw new NotSupportedException(); + } + + CodeObject IAstVisitor.VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration, object data) + { + CodeConstructor ctor = new CodeConstructor(); + ctor.Attributes = ConvertMemberAttributes(constructorDeclaration.Modifiers); + ctor.CustomAttributes.AddRange(Convert(constructorDeclaration.Attributes)); + if (constructorDeclaration.Initializer.ConstructorInitializerType == ConstructorInitializerType.This) { + ctor.ChainedConstructorArgs.AddRange(Convert(constructorDeclaration.Initializer.Arguments)); + } else { + ctor.BaseConstructorArgs.AddRange(Convert(constructorDeclaration.Initializer.Arguments)); + } + ctor.Parameters.AddRange(Convert(constructorDeclaration.Parameters)); + + ctor.Statements.AddRange(ConvertBlock(constructorDeclaration.Body)); + return ctor; + } + + CodeObject IAstVisitor.VisitConstructorInitializer(ConstructorInitializer constructorInitializer, object data) + { + throw new NotSupportedException(); + } + + CodeObject IAstVisitor.VisitDestructorDeclaration(DestructorDeclaration destructorDeclaration, object data) + { + return new CodeSnippetTypeMember(MakeSnippet(destructorDeclaration)); + } + + CodeObject IAstVisitor.VisitEnumMemberDeclaration(EnumMemberDeclaration enumMemberDeclaration, object data) + { + TypeDeclaration td = enumMemberDeclaration.Parent as TypeDeclaration; + CodeMemberField f = new CodeMemberField(td != null ? td.Name : "Enum", enumMemberDeclaration.Name); + f.Attributes = MemberAttributes.Public | MemberAttributes.Static; + f.CustomAttributes.AddRange(Convert(enumMemberDeclaration.Attributes)); + f.InitExpression = Convert(enumMemberDeclaration.Initializer); + return f; + } + + CodeObject IAstVisitor.VisitEventDeclaration(EventDeclaration eventDeclaration, object data) + { + foreach (VariableInitializer vi in eventDeclaration.Variables) { + if (!vi.Initializer.IsNull) { + AddTypeMember(new CodeSnippetTypeMember(MakeSnippet(eventDeclaration))); + continue; + } + + CodeMemberEvent e = new CodeMemberEvent(); + e.Attributes = ConvertMemberAttributes(eventDeclaration.Modifiers); + e.CustomAttributes.AddRange(Convert(eventDeclaration.Attributes)); + e.Name = vi.Name; + e.Type = Convert(eventDeclaration.ReturnType); + AddTypeMember(e); + } + return null; + } + + CodeObject IAstVisitor.VisitCustomEventDeclaration(CustomEventDeclaration customEventDeclaration, object data) + { + return new CodeSnippetTypeMember(MakeSnippet(customEventDeclaration)); + } + + CodeObject IAstVisitor.VisitFieldDeclaration(FieldDeclaration fieldDeclaration, object data) + { + foreach (VariableInitializer vi in fieldDeclaration.Variables) { + CodeMemberField f = new CodeMemberField(Convert(fieldDeclaration.ReturnType), vi.Name); + f.Attributes = ConvertMemberAttributes(fieldDeclaration.Modifiers); + f.CustomAttributes.AddRange(Convert(fieldDeclaration.Attributes)); + f.InitExpression = ConvertVariableInitializer(vi.Initializer, fieldDeclaration.ReturnType); + AddTypeMember(f); + } + return null; + } + + CodeObject IAstVisitor.VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration, object data) + { + CodeMemberProperty p = new CodeMemberProperty(); + p.Attributes = ConvertMemberAttributes(indexerDeclaration.Modifiers); + p.CustomAttributes.AddRange(Convert(indexerDeclaration.Attributes)); + p.Name = "Items"; + p.PrivateImplementationType = Convert(indexerDeclaration.PrivateImplementationType); + p.Parameters.AddRange(Convert(indexerDeclaration.Parameters)); + p.Type = Convert(indexerDeclaration.ReturnType); + + if (!indexerDeclaration.Getter.IsNull) { + p.HasGet = true; + p.GetStatements.AddRange(ConvertBlock(indexerDeclaration.Getter.Body)); + } + if (!indexerDeclaration.Setter.IsNull) { + p.HasSet = true; + p.SetStatements.AddRange(ConvertBlock(indexerDeclaration.Setter.Body)); + } + return p; + } + + CodeObject IAstVisitor.VisitMethodDeclaration(MethodDeclaration methodDeclaration, object data) + { + CodeMemberMethod m = new CodeMemberMethod(); + m.Attributes = ConvertMemberAttributes(methodDeclaration.Modifiers); + + m.CustomAttributes.AddRange(Convert(methodDeclaration.Attributes.Where(a => a.AttributeTarget != "return"))); + m.ReturnTypeCustomAttributes.AddRange(Convert(methodDeclaration.Attributes.Where(a => a.AttributeTarget == "return"))); + + m.ReturnType = Convert(methodDeclaration.ReturnType); + m.PrivateImplementationType = Convert(methodDeclaration.PrivateImplementationType); + m.Name = methodDeclaration.Name; + m.TypeParameters.AddRange(ConvertTypeParameters(methodDeclaration.TypeParameters, methodDeclaration.Constraints)); + m.Parameters.AddRange(Convert(methodDeclaration.Parameters)); + + m.Statements.AddRange(ConvertBlock(methodDeclaration.Body)); + return m; + } + + CodeObject IAstVisitor.VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration, object data) + { + CodeMemberMethod m = new CodeMemberMethod(); + m.Attributes = ConvertMemberAttributes(operatorDeclaration.Modifiers); + + m.CustomAttributes.AddRange(Convert(operatorDeclaration.Attributes.Where(a => a.AttributeTarget != "return"))); + m.ReturnTypeCustomAttributes.AddRange(Convert(operatorDeclaration.Attributes.Where(a => a.AttributeTarget == "return"))); + + m.ReturnType = Convert(operatorDeclaration.ReturnType); + m.Name = operatorDeclaration.Name; + m.Parameters.AddRange(Convert(operatorDeclaration.Parameters)); + + m.Statements.AddRange(ConvertBlock(operatorDeclaration.Body)); + return m; + } + + CodeObject IAstVisitor.VisitParameterDeclaration(ParameterDeclaration parameterDeclaration, object data) + { + var p = new CodeParameterDeclarationExpression(Convert(parameterDeclaration.Type), parameterDeclaration.Name); + p.CustomAttributes.AddRange(Convert(parameterDeclaration.Attributes)); + switch (parameterDeclaration.ParameterModifier) { + case ParameterModifier.Ref: + p.Direction = System.CodeDom.FieldDirection.Ref; + break; + case ParameterModifier.Out: + p.Direction = System.CodeDom.FieldDirection.Out; + break; + } + return p; + } + + CodeParameterDeclarationExpression[] Convert(IEnumerable parameters) + { + List result = new List(); + foreach (ParameterDeclaration pd in parameters) { + CodeParameterDeclarationExpression pde = pd.AcceptVisitor(this) as CodeParameterDeclarationExpression; + if (pde != null) + result.Add(pde); + } + return result.ToArray(); + } + + CodeObject IAstVisitor.VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration, object data) + { + CodeMemberProperty p = new CodeMemberProperty(); + p.Attributes = ConvertMemberAttributes(propertyDeclaration.Modifiers); + p.CustomAttributes.AddRange(Convert(propertyDeclaration.Attributes)); + p.Name = propertyDeclaration.Name; + p.PrivateImplementationType = Convert(propertyDeclaration.PrivateImplementationType); + p.Type = Convert(propertyDeclaration.ReturnType); + + if (!propertyDeclaration.Getter.IsNull) { + p.HasGet = true; + p.GetStatements.AddRange(ConvertBlock(propertyDeclaration.Getter.Body)); + } + if (!propertyDeclaration.Setter.IsNull) { + p.HasSet = true; + p.SetStatements.AddRange(ConvertBlock(propertyDeclaration.Setter.Body)); + } + return p; + } + + CodeObject IAstVisitor.VisitVariableInitializer(VariableInitializer variableInitializer, object data) + { + throw new NotSupportedException(); // should be handled by the parent node + } + + CodeObject IAstVisitor.VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration, object data) + { + return new CodeSnippetTypeMember(MakeSnippet(fixedFieldDeclaration)); + } + + CodeObject IAstVisitor.VisitFixedVariableInitializer(FixedVariableInitializer fixedVariableInitializer, object data) + { + throw new NotSupportedException(); // should be handled by the parent node + } + + CodeObject IAstVisitor.VisitCompilationUnit(CompilationUnit compilationUnit, object data) + { + CodeCompileUnit cu = new CodeCompileUnit(); + foreach (AstNode node in compilationUnit.Children) { + CodeObject o = node.AcceptVisitor(this); + + CodeNamespace ns = o as CodeNamespace; + if (ns != null) { + cu.Namespaces.Add(ns); + } + CodeTypeDeclaration td = o as CodeTypeDeclaration; + if (td != null) { + cu.Namespaces.Add(new CodeNamespace() { Types = { td } }); + } + } + return cu; + } + + CodeObject IAstVisitor.VisitSimpleType(SimpleType simpleType, object data) + { + if (useFullyQualifiedTypeNames) { + IType type = Resolve(simpleType).Type; + if (type.Kind != TypeKind.Unknown) + return Convert(type); + } + var tr = new CodeTypeReference(simpleType.Identifier); + tr.TypeArguments.AddRange(Convert(simpleType.TypeArguments)); + return tr; + } + + CodeObject IAstVisitor.VisitMemberType(MemberType memberType, object data) + { + if (memberType.IsDoubleColon && new SimpleType("global").IsMatch(memberType.Target)) { + var tr = new CodeTypeReference(memberType.MemberName, CodeTypeReferenceOptions.GlobalReference); + tr.TypeArguments.AddRange(Convert(memberType.TypeArguments)); + return tr; + } + if (useFullyQualifiedTypeNames || memberType.IsDoubleColon) { + IType type = Resolve(memberType).Type; + if (type.Kind != TypeKind.Unknown) + return Convert(type); + } + CodeTypeReference target = Convert(memberType.Target); + if (target == null) + return null; + target.BaseType = target.BaseType + "." + memberType.MemberName; + target.TypeArguments.AddRange(Convert(memberType.TypeArguments)); + return target; + } + + CodeObject IAstVisitor.VisitComposedType(ComposedType composedType, object data) + { + CodeTypeReference typeRef = Convert(composedType.BaseType); + if (typeRef == null) + return null; + if (composedType.HasNullableSpecifier) { + typeRef = new CodeTypeReference("System.Nullable") { TypeArguments = { typeRef } }; + } + foreach (ArraySpecifier s in composedType.ArraySpecifiers.Reverse()) { + typeRef = new CodeTypeReference(typeRef, s.Dimensions); + } + return typeRef; + } + + CodeObject IAstVisitor.VisitArraySpecifier(ArraySpecifier arraySpecifier, object data) + { + throw new NotSupportedException(); // handled by parent node + } + + CodeObject IAstVisitor.VisitPrimitiveType(PrimitiveType primitiveType, object data) + { + string keyword = primitiveType.Keyword; + for (TypeCode c = TypeCode.Empty; c <= TypeCode.String; c++) { + if (ReflectionHelper.GetCSharpNameByTypeCode(c) == keyword) + return new CodeTypeReference("System." + ReflectionHelper.GetShortNameByTypeCode(c)); + } + return new CodeTypeReference(primitiveType.Keyword); + } + + CodeObject IAstVisitor.VisitComment(Comment comment, object data) + { + return new CodeComment(comment.Content, comment.CommentType == CommentType.Documentation); + } + + CodeObject IAstVisitor.VisitTypeParameterDeclaration(TypeParameterDeclaration typeParameterDeclaration, object data) + { + throw new NotSupportedException(); // type parameters and constraints are handled together + } + + CodeObject IAstVisitor.VisitConstraint(Constraint constraint, object data) + { + throw new NotSupportedException(); + } + + CodeTypeParameter[] ConvertTypeParameters(IEnumerable typeParameters, IEnumerable constraints) + { + List result = new List(); + foreach (TypeParameterDeclaration tpDecl in typeParameters) { + CodeTypeParameter tp = new CodeTypeParameter(tpDecl.Name); + tp.CustomAttributes.AddRange(Convert(tpDecl.Attributes)); + foreach (Constraint constraint in constraints) { + if (constraint.TypeParameter == tp.Name) { + foreach (AstType baseType in constraint.BaseTypes) { + if (baseType is PrimitiveType && ((PrimitiveType)baseType).Keyword == "new") { + tp.HasConstructorConstraint = true; + } else { + CodeTypeReference tr = Convert(baseType); + if (tr != null) + tp.Constraints.Add(tr); + } + } + } + } + result.Add(tp); + } + return result.ToArray(); + } + + CodeObject IAstVisitor.VisitCSharpTokenNode(CSharpTokenNode cSharpTokenNode, object data) + { + return null; + } + + CodeObject IAstVisitor.VisitIdentifier(Identifier identifier, object data) + { + return null; + } + + CodeObject IAstVisitor.VisitPatternPlaceholder(AstNode placeholder, ICSharpCode.NRefactory.PatternMatching.Pattern pattern, object data) + { + return null; + } + } +} diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/InsertParenthesesVisitor.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/InsertParenthesesVisitor.cs index c3face7a88..340955c159 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/InsertParenthesesVisitor.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/InsertParenthesesVisitor.cs @@ -147,6 +147,11 @@ namespace ICSharpCode.NRefactory.CSharp public override object VisitIndexerExpression(IndexerExpression indexerExpression, object data) { ParenthesizeIfRequired(indexerExpression.Target, Primary); + ArrayCreateExpression ace = indexerExpression.Target as ArrayCreateExpression; + if (ace != null && (InsertParenthesesForReadability || ace.Initializer.IsNull)) { + // require parentheses for "(new int[1])[0]" + Parenthesize(indexerExpression.Target); + } return base.VisitIndexerExpression(indexerExpression, data); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs index 22bf05f09b..e6eb0ed99d 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs @@ -91,15 +91,27 @@ namespace ICSharpCode.NRefactory.CSharp { AstType result; if (memberName.Left != null) { - result = new MemberType () { MemberName = memberName.Name }; + result = new MemberType (); result.AddChild (ConvertToType (memberName.Left), MemberType.TargetRole); + var loc = LocationsBag.GetLocations (memberName.Left); + if (loc != null) + result.AddChild (new CSharpTokenNode (Convert (loc [0]), 1), MemberType.Roles.Dot); + result.AddChild (Identifier.Create (memberName.Name, Convert (memberName.Location)), MemberType.Roles.Identifier); } else { - result = new SimpleType () { Identifier = memberName.Name }; + result = new SimpleType () { IdentifierToken = Identifier.Create (memberName.Name, Convert (memberName.Location)) }; } if (memberName.TypeArguments != null && !memberName.TypeArguments.IsEmpty) { + var chevronLocs = LocationsBag.GetLocations (memberName.TypeArguments); + if (chevronLocs != null) + result.AddChild (new CSharpTokenNode (Convert (chevronLocs[chevronLocs.Count - 2]), 1), InvocationExpression.Roles.LChevron); + int i = 0; foreach (var arg in memberName.TypeArguments.Args) { result.AddChild (ConvertToType (arg), AstType.Roles.TypeArgument); + if (chevronLocs != null && i < chevronLocs.Count - 2) + result.AddChild (new CSharpTokenNode (Convert (chevronLocs [i++]), 1), InvocationExpression.Roles.Comma); } + if (chevronLocs != null) + result.AddChild (new CSharpTokenNode (Convert (chevronLocs[chevronLocs.Count - 1]), 1), InvocationExpression.Roles.RChevron); } return result; } @@ -128,6 +140,8 @@ namespace ICSharpCode.NRefactory.CSharp var memberType = new MemberType (); memberType.AddChild (ConvertToType (ma.LeftExpression), MemberType.TargetRole); + memberType.AddChild (new CSharpTokenNode (Convert (ma.DotLocation), 1), MemberType.Roles.Dot); + memberType.MemberNameToken = Identifier.Create (ma.Name, Convert (ma.Location)); AddTypeArguments (ma, memberType); @@ -148,9 +162,9 @@ namespace ICSharpCode.NRefactory.CSharp var ccSpec = cc.Spec; while (ccSpec != null) { if (ccSpec.IsNullable) { - result.HasNullableSpecifier = true; + result.AddChild (new CSharpTokenNode (Convert (ccSpec.Location), 1), ComposedType.NullableRole); } else if (ccSpec.IsPointer) { - result.PointerRank++; + result.AddChild (new CSharpTokenNode (Convert (ccSpec.Location), 1), ComposedType.PointerRole); } else { var location = LocationsBag.GetLocations (ccSpec); var spec = new ArraySpecifier () { Dimensions = ccSpec.Dimension }; @@ -190,8 +204,9 @@ namespace ICSharpCode.NRefactory.CSharp result.Type = ConvertToType (attr.TypeNameExpression); var loc = LocationsBag.GetLocations (attr); result.HasArgumentList = loc != null; + int pos = 0; if (loc != null) - result.AddChild (new CSharpTokenNode (Convert (loc [0]), 1), AttributeSection.Roles.LPar); + result.AddChild (new CSharpTokenNode (Convert (loc [pos++]), 1), AttributeSection.Roles.LPar); if (attr.PosArguments != null) { foreach (var arg in attr.PosArguments) { @@ -202,15 +217,16 @@ namespace ICSharpCode.NRefactory.CSharp var argLoc = LocationsBag.GetLocations (na); if (argLoc != null) - newArg.AddChild (new CSharpTokenNode (Convert (argLoc[0]), 1), NamedArgumentExpression.Roles.Assign); + newArg.AddChild (new CSharpTokenNode (Convert (argLoc [0]), 1), NamedArgumentExpression.Roles.Colon); newArg.AddChild ((Expression)na.Expr.Accept (this), NamedExpression.Roles.Expression); result.AddChild (newArg, Attribute.Roles.Argument); - continue; + } else { + result.AddChild ((Expression)arg.Expr.Accept (this), Attribute.Roles.Argument); } - result.AddChild ((Expression)arg.Expr.Accept (this), Attribute.Roles.Argument); + if (loc != null && pos + 1 < loc.Count) + result.AddChild (new CSharpTokenNode (Convert (loc [pos++]), 1), AttributeSection.Roles.Comma); } } - Console.WriteLine ("---"); if (attr.NamedArguments != null) { foreach (NamedArgument na in attr.NamedArguments) { var newArg = new NamedExpression (); @@ -221,10 +237,12 @@ namespace ICSharpCode.NRefactory.CSharp newArg.AddChild (new CSharpTokenNode (Convert (argLoc[0]), 1), NamedExpression.Roles.Assign); newArg.AddChild ((Expression)na.Expr.Accept (this), NamedExpression.Roles.Expression); result.AddChild (newArg, Attribute.Roles.Argument); + if (loc != null && pos + 1 < loc.Count) + result.AddChild (new CSharpTokenNode (Convert (loc [pos++]), 1), AttributeSection.Roles.Comma); } } - if (loc != null) - result.AddChild (new CSharpTokenNode (Convert (loc [1]), 1), AttributeSection.Roles.RPar); + if (loc != null && pos < loc.Count) + result.AddChild (new CSharpTokenNode (Convert (loc [pos++]), 1), AttributeSection.Roles.RPar); yield return result; } @@ -234,19 +252,32 @@ namespace ICSharpCode.NRefactory.CSharp { if (optAttributes == null) return null; - AttributeSection result = new AttributeSection (); var loc = LocationsBag.GetLocations (optAttributes); + int pos = 0; if (loc != null) - result.AddChild (new CSharpTokenNode (Convert (loc [0]), 1), AttributeSection.Roles.LBracket); + result.AddChild (new CSharpTokenNode (Convert (loc [pos++]), 1), AttributeSection.Roles.LBracket); + + string target = optAttributes.First ().ExplicitTarget; + + if (!string.IsNullOrEmpty (target)) { + if (loc != null && pos < loc.Count - 1) { + result.AddChild (Identifier.Create (target, Convert (loc [pos++])), AttributeSection.Roles.Identifier); + } else { + result.AddChild (Identifier.Create (target), AttributeSection.Roles.Identifier); + } + if (loc != null && pos < loc.Count) + result.AddChild (new CSharpTokenNode (Convert (loc [pos++]), 1), AttributeSection.Roles.Colon); + } - result.AttributeTarget = optAttributes.First ().ExplicitTarget; foreach (var attr in GetAttributes (optAttributes)) { result.AddChild (attr, AttributeSection.AttributeRole); } - - if (loc != null) - result.AddChild (new CSharpTokenNode (Convert (loc [1]), 1), AttributeSection.Roles.RBracket); + // optional comma + if (loc != null && pos < loc.Count - 1 && !loc [pos].Equals (loc [pos + 1])) + result.AddChild (new CSharpTokenNode (Convert (loc [pos++]), 1), AttributeSection.Roles.Comma); + if (loc != null && pos < loc.Count) + result.AddChild (new CSharpTokenNode (Convert (loc [pos++]), 1), AttributeSection.Roles.RBracket); return result; } @@ -260,8 +291,8 @@ namespace ICSharpCode.NRefactory.CSharp nDecl.AddChild (new CSharpTokenNode (Convert (nspace.OpenBrace), 1), NamespaceDeclaration.Roles.LBrace); AddToNamespace (nDecl); namespaceStack.Push (nDecl); - } + VisitNamespaceUsings (nspace); VisitNamespaceBody (nspace); @@ -281,6 +312,13 @@ namespace ICSharpCode.NRefactory.CSharp Identifier newIdent = Identifier.Create (memberName.Name, Convert (memberName.Location)); namespaceDecl.InsertChildBefore (insertPos, newIdent, NamespaceDeclaration.Roles.Identifier); insertPos = newIdent; + + if (!memberName.DotLocation.IsNull) { + var dotToken = new CSharpTokenNode (Convert (memberName.DotLocation), 1); + namespaceDecl.InsertChildBefore (insertPos, dotToken, NamespaceDeclaration.Roles.Dot); + insertPos = dotToken; + } + memberName = memberName.Left; } } @@ -322,13 +360,17 @@ namespace ICSharpCode.NRefactory.CSharp var t = new MemberType(); t.IsDoubleColon = memberName.IsDoubleColon; t.AddChild (ConvertImport (memberName.Left), MemberType.TargetRole); + + if (!memberName.DotLocation.IsNull) + t.AddChild (new CSharpTokenNode (Convert (memberName.DotLocation), 1), MemberType.Roles.Dot); + t.AddChild (Identifier.Create (memberName.Name, Convert(memberName.Location)), MemberType.Roles.Identifier); - AddTypeArguments (t, (List)null, memberName.TypeArguments); + AddTypeArguments (t, memberName.TypeArguments); return t; } else { SimpleType t = new SimpleType(); t.AddChild (Identifier.Create (memberName.Name, Convert(memberName.Location)), SimpleType.Roles.Identifier); - AddTypeArguments (t, (List)null, memberName.TypeArguments); + AddTypeArguments (t, memberName.TypeArguments); return t; } } @@ -349,29 +391,41 @@ namespace ICSharpCode.NRefactory.CSharp var location = LocationsBag.GetMemberLocation (c); AddModifiers (newType, location); + int curLoc = 0; if (location != null) - newType.AddChild (new CSharpTokenNode (Convert (location[0]), "class".Length), TypeDeclaration.Roles.Keyword); + newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), "class".Length), TypeDeclaration.Roles.Keyword); + newType.AddChild (Identifier.Create (c.MemberName.Name, Convert (c.MemberName.Location)), AstNode.Roles.Identifier); if (c.MemberName.TypeArguments != null) { - var typeArgLocation = LocationsBag.GetLocations (c.MemberName); - if (typeArgLocation != null) - newType.AddChild (new CSharpTokenNode (Convert (typeArgLocation[0]), 1), TypeDeclaration.Roles.LChevron); - AddTypeParameters (newType, typeArgLocation, c.MemberName.TypeArguments); - if (typeArgLocation != null) - newType.AddChild (new CSharpTokenNode (Convert (typeArgLocation[1]), 1), TypeDeclaration.Roles.RChevron); - AddConstraints (newType, c); + AddTypeParameters (newType, c.MemberName.TypeArguments); } + if (c.TypeBaseExpressions != null) { + if (location != null && curLoc < location.Count) + newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), 1), AstNode.Roles.Colon); + + var commaLocations = LocationsBag.GetLocations (c.TypeBaseExpressions); + int i = 0; foreach (var baseTypes in c.TypeBaseExpressions) { newType.AddChild (ConvertToType (baseTypes), TypeDeclaration.BaseTypeRole); + if (commaLocations != null && i < commaLocations.Count) { + newType.AddChild (new CSharpTokenNode (Convert (commaLocations [i]), 1), TypeDeclaration.Roles.Comma); + i++; + } } } - if (location != null && location.Count > 1) - newType.AddChild (new CSharpTokenNode (Convert (location[1]), 1), AstNode.Roles.LBrace); + + AddConstraints (newType, c); + if (location != null && curLoc < location.Count) + newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), 1), AstNode.Roles.LBrace); typeStack.Push (newType); base.Visit (c); - if (location != null && location.Count > 2) { - newType.AddChild (new CSharpTokenNode (Convert (location[2]), 1), AstNode.Roles.RBrace); + if (location != null && curLoc < location.Count) { + newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), 1), AstNode.Roles.RBrace); + + if (c.HasOptionalSemicolon) + newType.AddChild (new CSharpTokenNode (Convert (c.OptionalSemicolon), 1), AstNode.Roles.Semicolon); + } else { // parser error, set end node to max value. newType.AddChild (new ErrorNode (), AstNode.Roles.Error); @@ -387,31 +441,38 @@ namespace ICSharpCode.NRefactory.CSharp AddAttributeSection (newType, s); var location = LocationsBag.GetMemberLocation (s); AddModifiers (newType, location); + int curLoc = 0; if (location != null) - newType.AddChild (new CSharpTokenNode (Convert (location[0]), "struct".Length), TypeDeclaration.Roles.Keyword); + newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), "struct".Length), TypeDeclaration.Roles.Keyword); newType.AddChild (Identifier.Create (s.MemberName.Name, Convert (s.MemberName.Location)), AstNode.Roles.Identifier); if (s.MemberName.TypeArguments != null) { - var typeArgLocation = LocationsBag.GetLocations (s.MemberName); - if (typeArgLocation != null) - newType.AddChild (new CSharpTokenNode (Convert (typeArgLocation[0]), 1), TypeDeclaration.Roles.LChevron); - AddTypeParameters (newType, typeArgLocation, s.MemberName.TypeArguments); - if (typeArgLocation != null) - newType.AddChild (new CSharpTokenNode (Convert (typeArgLocation[1]), 1), TypeDeclaration.Roles.RChevron); - AddConstraints (newType, s); + AddTypeParameters (newType, s.MemberName.TypeArguments); } if (s.TypeBaseExpressions != null) { + if (location != null && curLoc < location.Count) + newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), 1), AstNode.Roles.Colon); + var commaLocations = LocationsBag.GetLocations (s.TypeBaseExpressions); + int i = 0; foreach (var baseTypes in s.TypeBaseExpressions) { newType.AddChild (ConvertToType (baseTypes), TypeDeclaration.BaseTypeRole); + if (commaLocations != null && i < commaLocations.Count) { + newType.AddChild (new CSharpTokenNode (Convert (commaLocations [i]), 1), TypeDeclaration.Roles.Comma); + i++; + } } } - if (location != null && location.Count > 1) - newType.AddChild (new CSharpTokenNode (Convert (location[1]), 1), AstNode.Roles.LBrace); + AddConstraints (newType, s); + if (location != null && curLoc < location.Count) + newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), 1), AstNode.Roles.LBrace); typeStack.Push (newType); base.Visit (s); if (location != null && location.Count > 2) { - newType.AddChild (new CSharpTokenNode (Convert (location[2]), 1), AstNode.Roles.RBrace); + if (location != null && curLoc < location.Count) + newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), 1), AstNode.Roles.RBrace); + if (s.HasOptionalSemicolon) + newType.AddChild (new CSharpTokenNode (Convert (s.OptionalSemicolon), 1), AstNode.Roles.Semicolon); } else { // parser error, set end node to max value. newType.AddChild (new ErrorNode (), AstNode.Roles.Error); @@ -427,29 +488,38 @@ namespace ICSharpCode.NRefactory.CSharp AddAttributeSection (newType, i); var location = LocationsBag.GetMemberLocation (i); AddModifiers (newType, location); + int curLoc = 0; if (location != null) - newType.AddChild (new CSharpTokenNode (Convert (location[0]), "interface".Length), TypeDeclaration.Roles.Keyword); + newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), "interface".Length), TypeDeclaration.Roles.Keyword); newType.AddChild (Identifier.Create (i.MemberName.Name, Convert (i.MemberName.Location)), AstNode.Roles.Identifier); if (i.MemberName.TypeArguments != null) { - var typeArgLocation = LocationsBag.GetLocations (i.MemberName); - if (typeArgLocation != null) - newType.AddChild (new CSharpTokenNode (Convert (typeArgLocation[0]), 1), MemberReferenceExpression.Roles.LChevron); - AddTypeParameters (newType, typeArgLocation, i.MemberName.TypeArguments); - if (typeArgLocation != null) - newType.AddChild (new CSharpTokenNode (Convert (typeArgLocation[1]), 1), MemberReferenceExpression.Roles.RChevron); - AddConstraints (newType, i); + AddTypeParameters (newType, i.MemberName.TypeArguments); } + if (i.TypeBaseExpressions != null) { + if (location != null && curLoc < location.Count) + newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), 1), AstNode.Roles.Colon); + var commaLocations = LocationsBag.GetLocations (i.TypeBaseExpressions); + int j = 0; foreach (var baseTypes in i.TypeBaseExpressions) { newType.AddChild (ConvertToType (baseTypes), TypeDeclaration.BaseTypeRole); + if (commaLocations != null && j < commaLocations.Count) { + newType.AddChild (new CSharpTokenNode (Convert (commaLocations [j]), 1), TypeDeclaration.Roles.Comma); + j++; + } } } - if (location != null && location.Count > 1) - newType.AddChild (new CSharpTokenNode (Convert (location[1]), 1), AstNode.Roles.LBrace); + + AddConstraints (newType, i); + if (location != null && curLoc < location.Count) + newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), 1), AstNode.Roles.LBrace); typeStack.Push (newType); base.Visit (i); if (location != null && location.Count > 2) { - newType.AddChild (new CSharpTokenNode (Convert (location[2]), 1), AstNode.Roles.RBrace); + if (location != null && curLoc < location.Count) + newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), 1), AstNode.Roles.RBrace); + if (i.HasOptionalSemicolon) + newType.AddChild (new CSharpTokenNode (Convert (i.OptionalSemicolon), 1), AstNode.Roles.Semicolon); } else { // parser error, set end node to max value. newType.AddChild (new ErrorNode (), AstNode.Roles.Error); @@ -469,13 +539,7 @@ namespace ICSharpCode.NRefactory.CSharp newDelegate.AddChild (ConvertToType (d.ReturnType), AstNode.Roles.Type); newDelegate.AddChild (Identifier.Create (d.MemberName.Name, Convert (d.MemberName.Location)), AstNode.Roles.Identifier); if (d.MemberName.TypeArguments != null) { - var typeArgLocation = LocationsBag.GetLocations (d.MemberName); - if (typeArgLocation != null) - newDelegate.AddChild (new CSharpTokenNode (Convert (typeArgLocation[0]), 1), TypeDeclaration.Roles.LChevron); - AddTypeParameters (newDelegate, typeArgLocation, d.MemberName.TypeArguments); - if (typeArgLocation != null) - newDelegate.AddChild (new CSharpTokenNode (Convert (typeArgLocation[1]), 1), TypeDeclaration.Roles.RChevron); - AddConstraints (newDelegate, d); + AddTypeParameters (newDelegate, d.MemberName.TypeArguments); } if (location != null) newDelegate.AddChild (new CSharpTokenNode (Convert (location[1]), 1), DelegateDeclaration.Roles.LPar); @@ -483,6 +547,9 @@ namespace ICSharpCode.NRefactory.CSharp if (location != null) { newDelegate.AddChild (new CSharpTokenNode (Convert (location[2]), 1), DelegateDeclaration.Roles.RPar); + } + AddConstraints (newDelegate, d); + if (location != null) { newDelegate.AddChild (new CSharpTokenNode (Convert (location[3]), 1), DelegateDeclaration.Roles.Semicolon); } AddType (newDelegate); @@ -514,19 +581,33 @@ namespace ICSharpCode.NRefactory.CSharp var location = LocationsBag.GetMemberLocation (e); AddModifiers (newType, location); + int curLoc = 0; if (location != null) - newType.AddChild (new CSharpTokenNode (Convert (location [0]), "enum".Length), TypeDeclaration.Roles.Keyword); + newType.AddChild (new CSharpTokenNode (Convert (location [curLoc++]), "enum".Length), TypeDeclaration.Roles.Keyword); newType.AddChild (Identifier.Create (e.MemberName.Name, Convert (e.MemberName.Location)), AstNode.Roles.Identifier); - if (e.BaseTypeExpression != null) + if (e.BaseTypeExpression != null) { + if (location != null && curLoc < location.Count) + newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), 1), AstNode.Roles.Colon); newType.AddChild (ConvertToType (e.BaseTypeExpression), TypeDeclaration.BaseTypeRole); + } - if (location != null && location.Count > 1) - newType.AddChild (new CSharpTokenNode (Convert (location[1]), 1), AstNode.Roles.LBrace); + if (location != null && curLoc < location.Count) + newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), 1), AstNode.Roles.LBrace); typeStack.Push (newType); - base.Visit (e); + + foreach (EnumMember member in e.OrderedAllMembers) { + Visit (member); + if (location != null && curLoc < location.Count - 1) //last one is closing brace + newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), 1), AstNode.Roles.Comma); + } + if (location != null && location.Count > 2) { - newType.AddChild (new CSharpTokenNode (Convert (location[2]), 1), AstNode.Roles.RBrace); + if (location != null && curLoc < location.Count) + newType.AddChild (new CSharpTokenNode (Convert (location[curLoc++]), 1), AstNode.Roles.RBrace); + + if (e.HasOptionalSemicolon) + newType.AddChild (new CSharpTokenNode (Convert (e.OptionalSemicolon), 1), AstNode.Roles.Semicolon); } else { // parser error, set end node to max value. newType.AddChild (new ErrorNode (), AstNode.Roles.Error); @@ -542,6 +623,7 @@ namespace ICSharpCode.NRefactory.CSharp newField.AddChild (Identifier.Create (em.Name, Convert (em.Location)), AstNode.Roles.Identifier); if (em.Initializer != null) { + newField.AddChild (new CSharpTokenNode (Convert (em.Initializer.Location), 1), EnumMemberDeclaration.Roles.Assign); newField.AddChild ((Expression)em.Initializer.Accept (this), EnumMemberDeclaration.InitializerRole); } @@ -623,12 +705,13 @@ namespace ICSharpCode.NRefactory.CSharp foreach (var decl in f.Declarators) { var declLoc = LocationsBag.GetLocations (decl); if (declLoc != null) - newField.AddChild (new CSharpTokenNode (Convert (declLoc[0]), 1), FieldDeclaration.Roles.Comma); + newField.AddChild (new CSharpTokenNode (Convert (declLoc [0]), 1), FieldDeclaration.Roles.Comma); variable = new VariableInitializer (); variable.AddChild (Identifier.Create (decl.Name.Value, Convert (decl.Name.Location)), VariableInitializer.Roles.Identifier); if (decl.Initializer != null) { - variable.AddChild (new CSharpTokenNode (Convert (decl.Initializer.Location), 1), FieldDeclaration.Roles.Assign); + if (declLoc != null) + variable.AddChild (new CSharpTokenNode (Convert (declLoc [1]), 1), FieldDeclaration.Roles.Assign); variable.AddChild ((Expression)decl.Initializer.Accept (this), VariableInitializer.Roles.Expression); } newField.AddChild (variable, FieldDeclaration.Roles.Variable); @@ -691,19 +774,22 @@ namespace ICSharpCode.NRefactory.CSharp AddAttributeSection (newOperator, o); AddModifiers (newOperator, location); - newOperator.AddChild (ConvertToType (o.TypeName), AstNode.Roles.Type); if (o.OperatorType == Operator.OpType.Implicit) { if (location != null) { newOperator.AddChild (new CSharpTokenNode (Convert (location[0]), "implicit".Length), OperatorDeclaration.OperatorTypeRole); newOperator.AddChild (new CSharpTokenNode (Convert (location[1]), "operator".Length), OperatorDeclaration.OperatorKeywordRole); } + newOperator.AddChild (ConvertToType (o.TypeName), AstNode.Roles.Type); } else if (o.OperatorType == Operator.OpType.Explicit) { if (location != null) { newOperator.AddChild (new CSharpTokenNode (Convert (location[0]), "explicit".Length), OperatorDeclaration.OperatorTypeRole); newOperator.AddChild (new CSharpTokenNode (Convert (location[1]), "operator".Length), OperatorDeclaration.OperatorKeywordRole); } + newOperator.AddChild (ConvertToType (o.TypeName), AstNode.Roles.Type); } else { + newOperator.AddChild (ConvertToType (o.TypeName), AstNode.Roles.Type); + if (location != null) newOperator.AddChild (new CSharpTokenNode (Convert (location[0]), "operator".Length), OperatorDeclaration.OperatorKeywordRole); @@ -717,9 +803,12 @@ namespace ICSharpCode.NRefactory.CSharp if (location != null) newOperator.AddChild (new CSharpTokenNode (Convert (location[3]), 1), OperatorDeclaration.Roles.RPar); - if (o.Block != null) + if (o.Block != null) { newOperator.AddChild ((BlockStatement)o.Block.Accept (this), OperatorDeclaration.Roles.Body); - + } else { + if (location != null && location.Count >= 5) + newOperator.AddChild (new CSharpTokenNode (Convert (location[4]), 1), MethodDeclaration.Roles.Semicolon); + } typeStack.Peek ().AddChild (newOperator, TypeDeclaration.MemberRole); } @@ -745,13 +834,18 @@ namespace ICSharpCode.NRefactory.CSharp AddAttributeSection (newIndexer, indexer); var location = LocationsBag.GetMemberLocation (indexer); AddModifiers (newIndexer, location); - - if (indexer.MemberName.Left != null) - newIndexer.AddChild (ConvertToType (indexer.MemberName.Left), IndexerDeclaration.PrivateImplementationTypeRole); newIndexer.AddChild (ConvertToType (indexer.TypeName), IndexerDeclaration.Roles.Type); + var name = indexer.MemberName; + if (name.Left != null) { + newIndexer.AddChild (ConvertToType (name.Left), IndexerDeclaration.PrivateImplementationTypeRole); + var privateImplTypeLoc = LocationsBag.GetLocations (name.Left); + if (privateImplTypeLoc != null) + newIndexer.AddChild (new CSharpTokenNode (Convert (privateImplTypeLoc[0]), 1), MethodDeclaration.Roles.Dot); + } + newIndexer.AddChild (Identifier.Create ("this", Convert (name.Location)), IndexerDeclaration.Roles.Identifier); if (location != null) - newIndexer.AddChild (new CSharpTokenNode (Convert (location[0]), 1), IndexerDeclaration.Roles.LBracket); + newIndexer.AddChild (new CSharpTokenNode (Convert (location [0]), 1), IndexerDeclaration.Roles.LBracket); AddParameter (newIndexer, indexer.ParameterInfo); if (location != null) newIndexer.AddChild (new CSharpTokenNode (Convert (location[1]), 1), IndexerDeclaration.Roles.RBracket); @@ -808,19 +902,16 @@ namespace ICSharpCode.NRefactory.CSharp AddModifiers (newMethod, location); newMethod.AddChild (ConvertToType (m.TypeName), AstNode.Roles.Type); - if (m.MethodName.Left != null) + if (m.MethodName.Left != null) { newMethod.AddChild (ConvertToType (m.MethodName.Left), MethodDeclaration.PrivateImplementationTypeRole); - + var privateImplTypeLoc = LocationsBag.GetLocations (m.MethodName.Left); + if (privateImplTypeLoc != null) + newMethod.AddChild (new CSharpTokenNode (Convert (privateImplTypeLoc[0]), 1), MethodDeclaration.Roles.Dot); + } newMethod.AddChild (Identifier.Create (m.MethodName.Name, Convert (m.Location)), AstNode.Roles.Identifier); if (m.MemberName.TypeArguments != null) { - var typeArgLocation = LocationsBag.GetLocations (m.MemberName); - if (typeArgLocation != null) - newMethod.AddChild (new CSharpTokenNode (Convert (typeArgLocation[0]), 1), MemberReferenceExpression.Roles.LChevron); - AddTypeParameters (newMethod, typeArgLocation, m.MemberName.TypeArguments); - if (typeArgLocation != null) - newMethod.AddChild (new CSharpTokenNode (Convert (typeArgLocation[1]), 1), MemberReferenceExpression.Roles.RChevron); - AddConstraints (newMethod, m.GenericMethod); + AddTypeParameters (newMethod, m.MemberName.TypeArguments); } if (location != null) @@ -829,6 +920,9 @@ namespace ICSharpCode.NRefactory.CSharp if (location != null) newMethod.AddChild (new CSharpTokenNode (Convert (location[1]), 1), MethodDeclaration.Roles.RPar); + + AddConstraints (newMethod, m.GenericMethod); + if (m.Block != null) { var bodyBlock = (BlockStatement)m.Block.Accept (this); // if (m.Block is ToplevelBlock) { @@ -836,9 +930,13 @@ namespace ICSharpCode.NRefactory.CSharp // } else { newMethod.AddChild (bodyBlock, MethodDeclaration.Roles.Body); // } - } else if (location != null && location.Count < 3) { - // parser error, set end node to max value. - newMethod.AddChild (new ErrorNode (), AstNode.Roles.Error); + } else if (location != null) { + if (location.Count < 3) { + // parser error, set end node to max value. + newMethod.AddChild (new ErrorNode (), AstNode.Roles.Error); + } else { + newMethod.AddChild (new CSharpTokenNode (Convert (location[2]), 1), MethodDeclaration.Roles.Semicolon); + } } typeStack.Peek ().AddChild (newMethod, TypeDeclaration.MemberRole); } @@ -901,16 +999,21 @@ namespace ICSharpCode.NRefactory.CSharp var location = LocationsBag.GetMemberLocation (p); AddModifiers (newProperty, location); newProperty.AddChild (ConvertToType (p.TypeName), AstNode.Roles.Type); - if (p.MemberName.Left != null) + if (p.MemberName.Left != null) { newProperty.AddChild (ConvertToType (p.MemberName.Left), PropertyDeclaration.PrivateImplementationTypeRole); + var privateImplTypeLoc = LocationsBag.GetLocations (p.MemberName.Left); + if (privateImplTypeLoc != null) + newProperty.AddChild (new CSharpTokenNode (Convert (privateImplTypeLoc[0]), 1), MethodDeclaration.Roles.Dot); + } newProperty.AddChild (Identifier.Create (p.MemberName.Name, Convert (p.Location)), PropertyDeclaration.Roles.Identifier); if (location != null) newProperty.AddChild (new CSharpTokenNode (Convert (location[0]), 1), MethodDeclaration.Roles.LBrace); + Accessor getAccessor = null; if (p.Get != null) { - Accessor getAccessor = new Accessor (); + getAccessor = new Accessor (); AddAttributeSection (getAccessor, p.Get); var getLocation = LocationsBag.GetMemberLocation (p.Get); AddModifiers (getAccessor, getLocation); @@ -920,13 +1023,13 @@ namespace ICSharpCode.NRefactory.CSharp getAccessor.AddChild ((BlockStatement)p.Get.Block.Accept (this), MethodDeclaration.Roles.Body); } else { if (getLocation != null && getLocation.Count > 0) - newProperty.AddChild (new CSharpTokenNode (Convert (getLocation[0]), 1), MethodDeclaration.Roles.Semicolon); + getAccessor.AddChild (new CSharpTokenNode (Convert (getLocation[0]), 1), MethodDeclaration.Roles.Semicolon); } - newProperty.AddChild (getAccessor, PropertyDeclaration.GetterRole); } + Accessor setAccessor = null; if (p.Set != null) { - Accessor setAccessor = new Accessor (); + setAccessor = new Accessor (); AddAttributeSection (setAccessor, p.Set); var setLocation = LocationsBag.GetMemberLocation (p.Set); AddModifiers (setAccessor, setLocation); @@ -936,10 +1039,24 @@ namespace ICSharpCode.NRefactory.CSharp setAccessor.AddChild ((BlockStatement)p.Set.Block.Accept (this), MethodDeclaration.Roles.Body); } else { if (setLocation != null && setLocation.Count > 0) - newProperty.AddChild (new CSharpTokenNode (Convert (setLocation[0]), 1), MethodDeclaration.Roles.Semicolon); + setAccessor.AddChild (new CSharpTokenNode (Convert (setLocation[0]), 1), MethodDeclaration.Roles.Semicolon); + } + } + if (getAccessor != null && setAccessor != null) { + if (getAccessor.StartLocation < setAccessor.StartLocation) { + newProperty.AddChild (getAccessor, PropertyDeclaration.GetterRole); + newProperty.AddChild (setAccessor, PropertyDeclaration.SetterRole); + } else { + newProperty.AddChild (setAccessor, PropertyDeclaration.SetterRole); + newProperty.AddChild (getAccessor, PropertyDeclaration.GetterRole); } - newProperty.AddChild (setAccessor, PropertyDeclaration.SetterRole); + } else { + if (getAccessor != null) + newProperty.AddChild (getAccessor, PropertyDeclaration.GetterRole); + if (setAccessor != null) + newProperty.AddChild (setAccessor, PropertyDeclaration.SetterRole); } + if (location != null && location.Count > 1) { newProperty.AddChild (new CSharpTokenNode (Convert (location[1]), 1), MethodDeclaration.Roles.RBrace); } else { @@ -970,12 +1087,14 @@ namespace ICSharpCode.NRefactory.CSharp var initializerLocation = LocationsBag.GetLocations (c.Initializer); if (initializerLocation != null) - newConstructor.AddChild (new CSharpTokenNode (Convert (location[0]), 1), ConstructorDeclaration.Roles.Colon); + newConstructor.AddChild (new CSharpTokenNode (Convert (initializerLocation[0]), 1), ConstructorDeclaration.Roles.Colon); + // this and base has the same length + initializer.AddChild (new CSharpTokenNode (Convert (c.Initializer.Location), "this".Length), ConstructorDeclaration.Roles.Keyword); if (initializerLocation != null) - initializer.AddChild (new CSharpTokenNode (Convert (location[0]), 1), ConstructorDeclaration.Roles.LPar); + initializer.AddChild (new CSharpTokenNode (Convert (initializerLocation[1]), 1), ConstructorDeclaration.Roles.LPar); AddArguments (initializer, LocationsBag.GetLocations (c.Initializer.Arguments), c.Initializer.Arguments); if (initializerLocation != null) - initializer.AddChild (new CSharpTokenNode (Convert (location[0]), 1), ConstructorDeclaration.Roles.RPar); + initializer.AddChild (new CSharpTokenNode (Convert (initializerLocation[2]), 1), ConstructorDeclaration.Roles.RPar); newConstructor.AddChild (initializer, ConstructorDeclaration.InitializerRole); } @@ -1030,13 +1149,14 @@ namespace ICSharpCode.NRefactory.CSharp foreach (var decl in e.Declarators) { var declLoc = LocationsBag.GetLocations (decl); if (declLoc != null) - newEvent.AddChild (new CSharpTokenNode (Convert (declLoc[0]), 1), FieldDeclaration.Roles.Comma); + newEvent.AddChild (new CSharpTokenNode (Convert (declLoc [0]), 1), FieldDeclaration.Roles.Comma); variable = new VariableInitializer (); variable.AddChild (Identifier.Create (decl.Name.Value, Convert (decl.Name.Location)), VariableInitializer.Roles.Identifier); if (decl.Initializer != null) { - variable.AddChild (new CSharpTokenNode (Convert (decl.Initializer.Location), 1), FieldDeclaration.Roles.Assign); + if (declLoc != null) + variable.AddChild (new CSharpTokenNode (Convert (declLoc [1]), 1), FieldDeclaration.Roles.Assign); variable.AddChild ((Expression)decl.Initializer.Accept (this), VariableInitializer.Roles.Expression); } newEvent.AddChild (variable, FieldDeclaration.Roles.Variable); @@ -1059,8 +1179,12 @@ namespace ICSharpCode.NRefactory.CSharp if (location != null) newEvent.AddChild (new CSharpTokenNode (Convert (location[0]), "event".Length), CustomEventDeclaration.Roles.Keyword); newEvent.AddChild (ConvertToType (ep.TypeName), CustomEventDeclaration.Roles.Type); - if (ep.MemberName.Left != null) + if (ep.MemberName.Left != null) { newEvent.AddChild (ConvertToType (ep.MemberName.Left), CustomEventDeclaration.PrivateImplementationTypeRole); + var privateImplTypeLoc = LocationsBag.GetLocations (ep.MemberName.Left); + if (privateImplTypeLoc != null) + newEvent.AddChild (new CSharpTokenNode (Convert (privateImplTypeLoc[0]), 1), MethodDeclaration.Roles.Dot); + } newEvent.AddChild (Identifier.Create (ep.MemberName.Name, Convert (ep.Location)), CustomEventDeclaration.Roles.Identifier); @@ -1133,7 +1257,7 @@ namespace ICSharpCode.NRefactory.CSharp init.AddChild (Identifier.Create (decl.Variable.Name, Convert (decl.Variable.Location)), VariableInitializer.Roles.Identifier); if (decl.Initializer != null) { if (loc != null && loc.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (loc [1]), 1), VariableInitializer.Roles.Assign); + init.AddChild (new CSharpTokenNode (Convert (loc [1]), 1), VariableInitializer.Roles.Assign); init.AddChild ((Expression)decl.Initializer.Accept (this), VariableInitializer.Roles.Expression); } else { } @@ -1347,9 +1471,10 @@ namespace ICSharpCode.NRefactory.CSharp var result = new GotoStatement (); var location = LocationsBag.GetLocations (gotoStatement); result.AddChild (new CSharpTokenNode (Convert (gotoStatement.loc), "goto".Length), GotoStatement.Roles.Keyword); - result.AddChild (Identifier.Create (gotoStatement.Target, Convert (gotoStatement.loc)), GotoStatement.Roles.Identifier); + var loc = location != null ? Convert (location [0]) : TextLocation.Empty; + result.AddChild (Identifier.Create (gotoStatement.Target, loc), GotoStatement.Roles.Identifier); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), GotoStatement.Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location [1]), 1), GotoStatement.Roles.Semicolon); return result; } @@ -1358,6 +1483,9 @@ namespace ICSharpCode.NRefactory.CSharp { var result = new LabelStatement (); result.AddChild (Identifier.Create (labeledStatement.Name, Convert (labeledStatement.loc)), LabelStatement.Roles.Identifier); + var location = LocationsBag.GetLocations (labeledStatement); + if (location != null) + result.AddChild (new CSharpTokenNode (Convert (location [0]), 1), LabelStatement.Roles.Colon); return result; } @@ -1442,7 +1570,7 @@ namespace ICSharpCode.NRefactory.CSharp var loc = LocationsBag.GetLocations (u.Variables); if (loc != null) - initializer.AddChild (new CSharpTokenNode (Convert (loc[1]), 1), VariableInitializer.Roles.Assign); + initializer.AddChild (new CSharpTokenNode (Convert (loc[0]), 1), VariableInitializer.Roles.Assign); if (u.Variables.Initializer != null) initializer.Initializer = u.Variables.Initializer.Accept (this) as Expression; @@ -1513,10 +1641,16 @@ namespace ICSharpCode.NRefactory.CSharp var newSection = new SwitchSection (); foreach (var caseLabel in section.Labels) { var newLabel = new CaseLabel (); - newLabel.AddChild (new CSharpTokenNode (Convert (caseLabel.Location), "case".Length), SwitchStatement.Roles.Keyword); - if (caseLabel.Label != null) + if (caseLabel.Label != null) { + newLabel.AddChild (new CSharpTokenNode (Convert (caseLabel.Location), "case".Length), SwitchStatement.Roles.Keyword); newLabel.AddChild ((Expression)caseLabel.Label.Accept (this), SwitchStatement.Roles.Expression); - + var colonLocation = LocationsBag.GetLocations (caseLabel); + if (colonLocation != null) + newLabel.AddChild (new CSharpTokenNode (Convert (colonLocation [0]), 1), SwitchStatement.Roles.Colon); + } else { + newLabel.AddChild (new CSharpTokenNode (Convert (caseLabel.Location), "default".Length), SwitchStatement.Roles.Keyword); + newLabel.AddChild (new CSharpTokenNode (new TextLocation (caseLabel.Location.Row, caseLabel.Location.Column + "default".Length), 1), SwitchStatement.Roles.Colon); + } newSection.AddChild (newLabel, SwitchSection.CaseLabelRole); } @@ -1739,16 +1873,16 @@ namespace ICSharpCode.NRefactory.CSharp public override object Visit (Yield yieldStatement) { - var result = new YieldStatement (); + var result = new YieldReturnStatement (); var location = LocationsBag.GetLocations (yieldStatement); - result.AddChild (new CSharpTokenNode (Convert (yieldStatement.loc), "yield".Length), YieldStatement.YieldKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (yieldStatement.loc), "yield".Length), YieldReturnStatement.YieldKeywordRole); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0]), "return".Length), YieldStatement.ReturnKeywordRole); + result.AddChild (new CSharpTokenNode (Convert (location[0]), "return".Length), YieldReturnStatement.ReturnKeywordRole); if (yieldStatement.Expr != null) - result.AddChild ((Expression)yieldStatement.Expr.Accept (this), YieldStatement.Roles.Expression); + result.AddChild ((Expression)yieldStatement.Expr.Accept (this), YieldReturnStatement.Roles.Expression); if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[1]), ";".Length), YieldStatement.Roles.Semicolon); + result.AddChild (new CSharpTokenNode (Convert (location[1]), ";".Length), YieldReturnStatement.Roles.Semicolon); return result; } @@ -1803,17 +1937,15 @@ namespace ICSharpCode.NRefactory.CSharp var leftExpr = memberAccess.LeftExpression.Accept (this); result.AddChild ((Expression)leftExpr, MemberReferenceExpression.Roles.TargetExpression); } + if (!memberAccess.DotLocation.IsNull) { + result.AddChild (new CSharpTokenNode (Convert (memberAccess.DotLocation), 1), MemberReferenceExpression.Roles.Dot); + } } - + result.AddChild (Identifier.Create (memberAccess.Name, Convert (memberAccess.Location)), MemberReferenceExpression.Roles.Identifier); if (memberAccess.TypeArguments != null) { - var location = LocationsBag.GetLocations (memberAccess); - if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), MemberReferenceExpression.Roles.LChevron); - AddTypeArguments (result, location, memberAccess.TypeArguments); - if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), MemberReferenceExpression.Roles.RChevron); + AddTypeArguments (result, memberAccess.TypeArguments); } return result; } @@ -1838,7 +1970,10 @@ namespace ICSharpCode.NRefactory.CSharp } else { literalValue = constant.GetValueAsLiteral (); } - var result = new PrimitiveExpression (constant.GetValue (), Convert (constant.Location), literalValue); + object val = constant.GetValue (); + if (val is bool) + literalValue = (bool)val ? "true" : "false"; + var result = new PrimitiveExpression (val, Convert (constant.Location), literalValue); return result; } @@ -1847,12 +1982,7 @@ namespace ICSharpCode.NRefactory.CSharp var result = new IdentifierExpression (); result.AddChild (Identifier.Create (simpleName.Name, Convert (simpleName.Location)), IdentifierExpression.Roles.Identifier); if (simpleName.TypeArguments != null) { - var location = LocationsBag.GetLocations (simpleName); - if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), IdentifierExpression.Roles.LChevron); - AddTypeArguments (result, location, simpleName.TypeArguments); - if (location != null && location.Count > 1) - result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), IdentifierExpression.Roles.RChevron); + AddTypeArguments (result, simpleName.TypeArguments); } return result; } @@ -2121,11 +2251,8 @@ namespace ICSharpCode.NRefactory.CSharp var paramLocation = LocationsBag.GetLocations (parameters); for (int i = 0; i < parameters.Count; i++) { - if (paramLocation != null && i > 0 && i - 1 < paramLocation.Count) - parent.AddChild (new CSharpTokenNode (Convert (paramLocation [i - 1]), 1), ParameterDeclaration.Roles.Comma); var p = (Parameter)parameters.FixedParameters [i]; var location = LocationsBag.GetLocations (p); - ParameterDeclaration parameterDeclarationExpression = new ParameterDeclaration (); AddAttributeSection (parameterDeclarationExpression, p); switch (p.ModFlags) { @@ -2147,8 +2274,9 @@ namespace ICSharpCode.NRefactory.CSharp default: if (p.HasExtensionMethodModifier) { parameterDeclarationExpression.ParameterModifier = ParameterModifier.This; - if (location != null) + if (location != null) { parameterDeclarationExpression.AddChild (new CSharpTokenNode (Convert (location [0]), "this".Length), ParameterDeclaration.Roles.Keyword); + } } break; } @@ -2162,21 +2290,47 @@ namespace ICSharpCode.NRefactory.CSharp parameterDeclarationExpression.AddChild ((Expression)p.DefaultValue.Accept (this), ParameterDeclaration.Roles.Expression); } parent.AddChild (parameterDeclarationExpression, InvocationExpression.Roles.Parameter); + if (paramLocation != null && i < paramLocation.Count) { + parent.AddChild (new CSharpTokenNode (Convert (paramLocation [i]), 1), ParameterDeclaration.Roles.Comma); + } } } - void AddTypeParameters (AstNode parent, List location, Mono.CSharp.TypeArguments typeArguments) + void AddTypeParameters (AstNode parent, Mono.CSharp.TypeArguments typeArguments) { if (typeArguments == null || typeArguments.IsEmpty) return; + var chevronLocs = LocationsBag.GetLocations (typeArguments); + if (chevronLocs != null) + parent.AddChild (new CSharpTokenNode (Convert (chevronLocs[chevronLocs.Count - 2]), 1), InvocationExpression.Roles.LChevron); for (int i = 0; i < typeArguments.Count; i++) { - if (location != null && i > 0 && i - 1 < location.Count) - parent.AddChild (new CSharpTokenNode (Convert (location[i - 1]), 1), InvocationExpression.Roles.Comma); + if (chevronLocs != null && i > 0 && i - 1 < chevronLocs.Count) + parent.AddChild (new CSharpTokenNode (Convert (chevronLocs[i - 1]), 1), InvocationExpression.Roles.Comma); var arg = (TypeParameterName)typeArguments.Args[i]; if (arg == null) continue; TypeParameterDeclaration tp = new TypeParameterDeclaration(); + List varianceLocation; + switch (arg.Variance) { + case Variance.Contravariant: + tp.Variance = VarianceModifier.Contravariant; + varianceLocation = LocationsBag.GetLocations (arg); + if (varianceLocation != null) + tp.AddChild (new CSharpTokenNode (Convert (varianceLocation[0]), "out".Length), TypeParameterDeclaration.VarianceRole); + break; + case Variance.Covariant: + tp.Variance = VarianceModifier.Covariant; + varianceLocation = LocationsBag.GetLocations (arg); + if (varianceLocation != null) + tp.AddChild (new CSharpTokenNode (Convert (varianceLocation[0]), "out".Length), TypeParameterDeclaration.VarianceRole); + break; + default: + tp.Variance = VarianceModifier.Invariant; + break; + + } + AddAttributeSection (tp, arg.OptAttributes); switch (arg.Variance) { @@ -2190,34 +2344,29 @@ namespace ICSharpCode.NRefactory.CSharp tp.AddChild (Identifier.Create (arg.Name, Convert (arg.Location)), InvocationExpression.Roles.Identifier); parent.AddChild (tp, InvocationExpression.Roles.TypeParameter); } + if (chevronLocs != null) + parent.AddChild (new CSharpTokenNode (Convert (chevronLocs[chevronLocs.Count - 1]), 1), InvocationExpression.Roles.RChevron); } - void AddTypeArguments (AstNode parent, LocationsBag.MemberLocations location, Mono.CSharp.TypeArguments typeArguments) - { - if (typeArguments == null || typeArguments.IsEmpty) - return; - for (int i = 0; i < typeArguments.Count; i++) { - if (location != null && i > 0 && i - 1 < location.Count) - parent.AddChild (new CSharpTokenNode (Convert (location[i - 1]), 1), InvocationExpression.Roles.Comma); - var arg = typeArguments.Args[i]; - if (arg == null) - continue; - parent.AddChild (ConvertToType (arg), InvocationExpression.Roles.TypeArgument); - } - } - - void AddTypeArguments (AstNode parent, List location, Mono.CSharp.TypeArguments typeArguments) + void AddTypeArguments (AstNode parent, Mono.CSharp.TypeArguments typeArguments) { if (typeArguments == null || typeArguments.IsEmpty) return; + var chevronLocs = LocationsBag.GetLocations (typeArguments); + if (chevronLocs != null) + parent.AddChild (new CSharpTokenNode (Convert (chevronLocs[chevronLocs.Count - 2]), 1), InvocationExpression.Roles.LChevron); + for (int i = 0; i < typeArguments.Count; i++) { - if (location != null && i > 0 && i - 1 < location.Count) - parent.AddChild (new CSharpTokenNode (Convert (location[i - 1]), 1), InvocationExpression.Roles.Comma); var arg = typeArguments.Args[i]; if (arg == null) continue; parent.AddChild (ConvertToType (arg), InvocationExpression.Roles.TypeArgument); + if (chevronLocs != null && i < chevronLocs.Count - 2) + parent.AddChild (new CSharpTokenNode (Convert (chevronLocs[i]), 1), InvocationExpression.Roles.Comma); } + + if (chevronLocs != null) + parent.AddChild (new CSharpTokenNode (Convert (chevronLocs[chevronLocs.Count - 1]), 1), InvocationExpression.Roles.RChevron); } void AddConstraints (AstNode parent, DeclSpace d) @@ -2228,13 +2377,17 @@ namespace ICSharpCode.NRefactory.CSharp Constraints c = d.PlainConstraints [i]; var location = LocationsBag.GetLocations (c); var constraint = new Constraint (); - if (location != null) - constraint.AddChild (new CSharpTokenNode (Convert (location [0]), "where".Length), InvocationExpression.Roles.Keyword); + constraint.AddChild (new CSharpTokenNode (Convert (c.Location), "where".Length), InvocationExpression.Roles.Keyword); constraint.AddChild (Identifier.Create (c.TypeParameter.Value, Convert (c.TypeParameter.Location)), InvocationExpression.Roles.Identifier); - if (location != null && location.Count > 1) - constraint.AddChild (new CSharpTokenNode (Convert (location [1]), 1), Constraint.ColonRole); - foreach (var expr in c.ConstraintExpressions) + if (location != null) + constraint.AddChild (new CSharpTokenNode (Convert (location [0]), 1), Constraint.ColonRole); + var commaLocs = LocationsBag.GetLocations (c.ConstraintExpressions); + int curComma = 0; + foreach (var expr in c.ConstraintExpressions) { constraint.AddChild (ConvertToType (expr), Constraint.BaseTypeRole); + if (commaLocs != null && curComma < commaLocs.Count) + constraint.AddChild (new CSharpTokenNode (Convert (commaLocs[curComma++]), 1), InvocationExpression.Roles.Comma); + } parent.AddChild (constraint, AstNode.Roles.Constraint); } } @@ -2248,7 +2401,7 @@ namespace ICSharpCode.NRefactory.CSharp var loc = LocationsBag.GetLocations (na); if (loc != null) - newArg.AddChild (new CSharpTokenNode (Convert (loc[0]), 1), NamedArgumentExpression.Roles.Assign); + newArg.AddChild (new CSharpTokenNode (Convert (loc[0]), 1), NamedArgumentExpression.Roles.Colon); if (arg.ArgType == Argument.AType.Out || arg.ArgType == Argument.AType.Ref) { DirectionExpression direction = new DirectionExpression (); @@ -2285,14 +2438,12 @@ namespace ICSharpCode.NRefactory.CSharp var commaLocations = LocationsBag.GetLocations (args); for (int i = 0; i < args.Count; i++) { parent.AddChild (ConvertArgument (args[i]), InvocationExpression.Roles.Argument); - if (commaLocations != null && i > 0) { - int idx = commaLocations.Count - i; - if (idx >= 0) - parent.AddChild (new CSharpTokenNode (Convert (commaLocations[idx]), 1), InvocationExpression.Roles.Comma); + if (commaLocations != null && i < commaLocations.Count) { + parent.AddChild (new CSharpTokenNode (Convert (commaLocations[i]), 1), InvocationExpression.Roles.Comma); } } if (commaLocations != null && commaLocations.Count > args.Count) - parent.AddChild (new CSharpTokenNode (Convert (commaLocations[0]), 1), InvocationExpression.Roles.Comma); + parent.AddChild (new CSharpTokenNode (Convert (commaLocations[args.Count]), 1), InvocationExpression.Roles.Comma); } public override object Visit (Invocation invocationExpression) @@ -2337,12 +2488,14 @@ namespace ICSharpCode.NRefactory.CSharp var location = LocationsBag.GetLocations (par); if (location == null) { - result.AddChild ((Expression)par.Expr.Accept (this), AnonymousTypeCreateExpression.Roles.Expression); + if (par.Expr != null) + result.AddChild ((Expression)par.Expr.Accept (this), AnonymousTypeCreateExpression.Roles.Expression); } else { var namedExpression = new NamedExpression (); namedExpression.AddChild (Identifier.Create (par.Name, Convert (par.Location)), AnonymousTypeCreateExpression.Roles.Identifier); namedExpression.AddChild (new CSharpTokenNode (Convert (location[0]), 1), AnonymousTypeCreateExpression.Roles.Assign); - namedExpression.AddChild ((Expression)par.Expr.Accept (this), AnonymousTypeCreateExpression.Roles.Expression); + if (par.Expr != null) + namedExpression.AddChild ((Expression)par.Expr.Accept (this), AnonymousTypeCreateExpression.Roles.Expression); result.AddChild (namedExpression, AnonymousTypeCreateExpression.Roles.Expression); } } @@ -2354,12 +2507,7 @@ namespace ICSharpCode.NRefactory.CSharp if (minit == null) return null; var init = new ArrayInitializerExpression (); - var braceLocs = LocationsBag.GetLocations (minit); - if (braceLocs != null) - init.AddChild (new CSharpTokenNode (Convert (braceLocs[0]), 1), ArrayInitializerExpression.Roles.LBrace); AddConvertCollectionOrObjectInitializers (init, minit); - if (braceLocs != null) - init.AddChild (new CSharpTokenNode (Convert (braceLocs[1]), 1), ArrayInitializerExpression.Roles.RBrace); return init; } @@ -2367,7 +2515,9 @@ namespace ICSharpCode.NRefactory.CSharp { var initLoc = LocationsBag.GetLocations (minit); var commaLoc = LocationsBag.GetLocations (minit.Initializers); - int curComma = commaLoc != null ? commaLoc.Count - 1 : -1; + int curComma = 0; + if (initLoc != null) + init.AddChild (new CSharpTokenNode (Convert (initLoc [0]), 1), ArrayInitializerExpression.Roles.LBrace); foreach (var expr in minit.Initializers) { var collectionInit = expr as CollectionElementInitializer; if (collectionInit != null) { @@ -2375,49 +2525,48 @@ namespace ICSharpCode.NRefactory.CSharp var braceLocs = LocationsBag.GetLocations (expr); if (braceLocs != null) - parent.AddChild (new CSharpTokenNode (Convert (braceLocs[0]), 1), ArrayInitializerExpression.Roles.LBrace); + parent.AddChild (new CSharpTokenNode (Convert (braceLocs [0]), 1), ArrayInitializerExpression.Roles.LBrace); for (int i = 0; i < collectionInit.Arguments.Count; i++) { - var arg = collectionInit.Arguments[i] as CollectionElementInitializer.ElementInitializerArgument; + var arg = collectionInit.Arguments [i] as CollectionElementInitializer.ElementInitializerArgument; if (arg == null) continue; parent.AddChild ((ICSharpCode.NRefactory.CSharp.Expression)arg.Expr.Accept (this), ArrayInitializerExpression.Roles.Expression); - if (curComma >= 0) - parent.AddChild (new CSharpTokenNode (Convert (commaLoc[curComma--]), 1), ArrayInitializerExpression.Roles.Comma); } if (braceLocs != null) - parent.AddChild (new CSharpTokenNode (Convert (braceLocs[1]), 1), ArrayInitializerExpression.Roles.RBrace); + parent.AddChild (new CSharpTokenNode (Convert (braceLocs [1]), 1), ArrayInitializerExpression.Roles.RBrace); init.AddChild (parent, ArrayInitializerExpression.Roles.Expression); - continue; - } - - var eleInit = expr as ElementInitializer; - if (eleInit != null) { - var nexpr = new NamedExpression (); - nexpr.AddChild (Identifier.Create (eleInit.Name, Convert(eleInit.Location)), NamedArgumentExpression.Roles.Identifier); - var assignLoc = LocationsBag.GetLocations (eleInit); - if (assignLoc != null) - nexpr.AddChild (new CSharpTokenNode (Convert (assignLoc[0]), 1), NamedArgumentExpression.Roles.Assign); - if (eleInit.Source != null) { - if (eleInit.Source is CollectionOrObjectInitializers) { - var arrInit = new ArrayInitializerExpression (); - AddConvertCollectionOrObjectInitializers (arrInit, eleInit.Source as CollectionOrObjectInitializers); - nexpr.AddChild (arrInit, NamedArgumentExpression.Roles.Expression); - } else { - nexpr.AddChild ((Expression)eleInit.Source.Accept (this), NamedArgumentExpression.Roles.Expression); + } else { + var eleInit = expr as ElementInitializer; + if (eleInit != null) { + var nexpr = new NamedExpression (); + nexpr.AddChild (Identifier.Create (eleInit.Name, Convert (eleInit.Location)), NamedArgumentExpression.Roles.Identifier); + var assignLoc = LocationsBag.GetLocations (eleInit); + if (assignLoc != null) + nexpr.AddChild (new CSharpTokenNode (Convert (assignLoc [0]), 1), NamedArgumentExpression.Roles.Assign); + if (eleInit.Source != null) { + if (eleInit.Source is CollectionOrObjectInitializers) { + var arrInit = new ArrayInitializerExpression (); + AddConvertCollectionOrObjectInitializers (arrInit, eleInit.Source as CollectionOrObjectInitializers); + nexpr.AddChild (arrInit, NamedArgumentExpression.Roles.Expression); + } else { + nexpr.AddChild ((Expression)eleInit.Source.Accept (this), NamedArgumentExpression.Roles.Expression); + } } + + init.AddChild (nexpr, ArrayInitializerExpression.Roles.Expression); } - - init.AddChild (nexpr, ArrayInitializerExpression.Roles.Expression); } + if (commaLoc != null && curComma < commaLoc.Count) + init.AddChild (new CSharpTokenNode (Convert (commaLoc [curComma++]), 1), ArrayInitializerExpression.Roles.Comma); } if (initLoc != null) { if (initLoc.Count == 3) // optional comma - init.AddChild (new CSharpTokenNode (Convert (initLoc[1]), 1), ArrayInitializerExpression.Roles.Comma); - init.AddChild (new CSharpTokenNode (Convert (initLoc[initLoc.Count - 1]), 1), ArrayInitializerExpression.Roles.RBrace); + init.AddChild (new CSharpTokenNode (Convert (initLoc [1]), 1), ArrayInitializerExpression.Roles.Comma); + init.AddChild (new CSharpTokenNode (Convert (initLoc [initLoc.Count - 1]), 1), ArrayInitializerExpression.Roles.RBrace); } } @@ -2450,36 +2599,39 @@ namespace ICSharpCode.NRefactory.CSharp var result = new ArrayCreateExpression (); var location = LocationsBag.GetLocations (arrayCreationExpression); + result.AddChild (new CSharpTokenNode (Convert (arrayCreationExpression.Location), "new".Length), ArrayCreateExpression.Roles.Keyword); if (arrayCreationExpression.NewType != null) result.AddChild (ConvertToType (arrayCreationExpression.NewType), ArrayCreateExpression.Roles.Type); - if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), ArrayCreateExpression.Roles.LBracket); - + var next = arrayCreationExpression.Rank; if (arrayCreationExpression.Arguments != null) { // skip first array rank. next = next.Next; + + if (location != null) + result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), ArrayCreateExpression.Roles.LBracket); + var commaLocations = LocationsBag.GetLocations (arrayCreationExpression.Arguments); for (int i = 0 ;i < arrayCreationExpression.Arguments.Count; i++) { result.AddChild ((Expression)arrayCreationExpression.Arguments[i].Accept (this), ArrayCreateExpression.Roles.Argument); - if (commaLocations != null && i > 0) - result.AddChild (new CSharpTokenNode (Convert (commaLocations [commaLocations.Count - i]), 1), ArrayCreateExpression.Roles.Comma); + if (commaLocations != null && i < commaLocations.Count) + result.AddChild (new CSharpTokenNode (Convert (commaLocations [i]), 1), ArrayCreateExpression.Roles.Comma); } + if (location != null) + result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), ArrayCreateExpression.Roles.RBracket); + } while (next != null) { ArraySpecifier spec = new ArraySpecifier (next.Dimension); var loc = LocationsBag.GetLocations (next); spec.AddChild (new CSharpTokenNode (Convert (next.Location), 1), ArraySpecifier.Roles.LBracket); + result.AddChild (spec, ArrayCreateExpression.AdditionalArraySpecifierRole); if (loc != null) result.AddChild (new CSharpTokenNode (Convert (loc[0]), 1), ArraySpecifier.Roles.RBracket); - result.AddChild (spec, ArrayCreateExpression.AdditionalArraySpecifierRole); next = next.Next; } - if (location != null) - result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), ArrayCreateExpression.Roles.RBracket); - if (arrayCreationExpression.Initializers != null && arrayCreationExpression.Initializers.Count != 0) { var initLocation = LocationsBag.GetLocations (arrayCreationExpression.Initializers); ArrayInitializerExpression initializer = new ArrayInitializerExpression(); @@ -2488,8 +2640,8 @@ namespace ICSharpCode.NRefactory.CSharp var commaLocations = LocationsBag.GetLocations (arrayCreationExpression.Initializers.Elements); for (int i = 0; i < arrayCreationExpression.Initializers.Count; i++) { initializer.AddChild ((Expression)arrayCreationExpression.Initializers[i].Accept (this), ArrayInitializerExpression.Roles.Expression); - if (commaLocations != null && i > 0) { - initializer.AddChild (new CSharpTokenNode (Convert (commaLocations [commaLocations.Count - i]), 1), IndexerExpression.Roles.Comma); + if (commaLocations != null && i < commaLocations.Count) { + initializer.AddChild (new CSharpTokenNode (Convert (commaLocations [i]), 1), IndexerExpression.Roles.Comma); } } @@ -3067,36 +3219,85 @@ namespace ICSharpCode.NRefactory.CSharp static void InsertComments (CompilerCompilationUnit top, ConversionVisitor conversionVisitor) { - var leaf = GetOuterLeft(conversionVisitor.Unit); + var leaf = GetOuterLeft (conversionVisitor.Unit); - foreach (var special in top.SpecialsBag.Specials) { + for (int i = 0; i < top.SpecialsBag.Specials.Count; i++) { + var special = top.SpecialsBag.Specials [i]; + Comment newLeaf = null; + var comment = special as SpecialsBag.Comment; - if (comment == null) - continue; - if (conversionVisitor.convertTypeSystemMode && (comment.CommentType != SpecialsBag.CommentType.Documentation)) + if (comment != null) { + if (conversionVisitor.convertTypeSystemMode && (comment.CommentType != SpecialsBag.CommentType.Documentation)) + continue; + var type = (CommentType)comment.CommentType; + var start = new TextLocation (comment.Line, comment.Col); + var end = new TextLocation (comment.EndLine, comment.EndCol); + newLeaf = new Comment (type, start, end) { + StartsLine = comment.StartsLine, + Content = comment.Content + }; + } else { + // TODO: Proper handling of pre processor directives (atm got treated as comments Ast wise) + var directive = special as SpecialsBag.PreProcessorDirective; + if (directive != null) { + newLeaf = new Comment (CommentType.SingleLine, new TextLocation (directive.Line, directive.Col), new TextLocation (directive.EndLine, directive.EndCol + 1)); + + if (!directive.Take) { + SpecialsBag.PreProcessorDirective endif = null; + int endifLevel = 0; + for (int j = i + 1; j < top.SpecialsBag.Specials.Count; j++) { + var s = top.SpecialsBag.Specials [j] as SpecialsBag.PreProcessorDirective; + if (s == null) + continue; + if (s.Cmd == Tokenizer.PreprocessorDirective.If) { + endifLevel++; + continue; + } + if (s.Cmd == Tokenizer.PreprocessorDirective.Endif || endifLevel == 0 && s.Cmd == Tokenizer.PreprocessorDirective.Else) { + if (endifLevel == 0) { + endif = s; + i = j; + break; + } + endifLevel--; + } + } + if (endif != null) + newLeaf = new Comment (CommentType.SingleLine, new TextLocation (directive.Line, directive.Col), new TextLocation (endif.EndLine, endif.EndCol)); + } + } + } + + if (newLeaf == null) continue; - var type = (CommentType)comment.CommentType; - var start = new TextLocation (comment.Line, comment.Col); - var end = new TextLocation (comment.EndLine, comment.EndCol); - var domComment = new Comment (type, start, end); - domComment.StartsLine = comment.StartsLine; - domComment.Content = comment.Content; while (true) { - var nextLeaf = NextLeaf(leaf); - // instert comment at the end + var nextLeaf = NextLeaf (leaf); + // insert comment at begin + if (newLeaf.StartLocation < leaf.StartLocation) { + var node = leaf.Parent ?? conversionVisitor.Unit; + while (node.Parent != null && node.FirstChild == leaf) { + leaf = node; + node = node.Parent; + } + node.InsertChildBefore (leaf, newLeaf, AstNode.Roles.Comment); + leaf = newLeaf; + break; + } + + // insert comment at the end if (nextLeaf == null) { var node = leaf.Parent ?? conversionVisitor.Unit; - node.AddChild(domComment, AstNode.Roles.Comment); - leaf = domComment; + node.AddChild (newLeaf, AstNode.Roles.Comment); + leaf = newLeaf; break; } // comment is between 2 nodes - if (leaf.EndLocation <= domComment.StartLocation && domComment.StartLocation <= nextLeaf.StartLocation) { + if (leaf.EndLocation <= newLeaf.StartLocation && newLeaf.StartLocation <= nextLeaf.StartLocation) { var node = leaf.Parent ?? conversionVisitor.Unit; - node.InsertChildAfter(leaf, domComment, AstNode.Roles.Comment); - leaf = domComment; + node.InsertChildAfter (leaf, newLeaf, AstNode.Roles.Comment); + leaf = newLeaf; break; } leaf = nextLeaf; @@ -3109,8 +3310,8 @@ namespace ICSharpCode.NRefactory.CSharp if (top == null) return null; CSharpParser.ConversionVisitor conversionVisitor = new ConversionVisitor (convertTypeSystemMode, top.LocationsBag); - conversionVisitor.AddAttributeSection (conversionVisitor.Unit, top.ModuleCompiled); top.UsingsBag.Global.Accept (conversionVisitor); + conversionVisitor.AddAttributeSection (conversionVisitor.Unit, top.ModuleCompiled); InsertComments (top, conversionVisitor); return conversionVisitor.Unit; } @@ -3182,8 +3383,8 @@ namespace ICSharpCode.NRefactory.CSharp if (top == null) return null; CSharpParser.ConversionVisitor conversionVisitor = new ConversionVisitor (GenerateTypeSystemMode, top.LocationsBag); - conversionVisitor.AddAttributeSection (conversionVisitor.Unit, top.ModuleCompiled); top.UsingsBag.Global.Accept (conversionVisitor); + conversionVisitor.AddAttributeSection (conversionVisitor.Unit, top.ModuleCompiled); InsertComments (top, conversionVisitor); if (CompilationUnitCallback != null) CompilationUnitCallback (top); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/anonymous.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/anonymous.cs index 5576bcc5f6..d52dc82d3e 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/anonymous.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/anonymous.cs @@ -193,7 +193,7 @@ namespace Mono.CSharp { protected HoistedThis hoisted_this; // Local variable which holds this storey instance - public LocalTemporary Instance; + public Expression Instance; public AnonymousMethodStorey (Block block, TypeContainer parent, MemberBase host, TypeParameter[] tparams, string name) : base (parent, MakeMemberName (host, name, unique_id, tparams, block.StartLocation), @@ -236,7 +236,12 @@ namespace Mono.CSharp { protected Field AddCompilerGeneratedField (string name, FullNamedExpression type) { - const Modifiers mod = Modifiers.INTERNAL | Modifiers.COMPILER_GENERATED; + return AddCompilerGeneratedField (name, type, false); + } + + protected Field AddCompilerGeneratedField (string name, FullNamedExpression type, bool privateAccess) + { + Modifiers mod = Modifiers.COMPILER_GENERATED | (privateAccess ? Modifiers.PRIVATE : Modifiers.INTERNAL); Field f = new Field (this, type, mod, new MemberName (name, Location), null); AddField (f); return f; @@ -391,21 +396,47 @@ namespace Mono.CSharp { SymbolWriter.OpenCompilerGeneratedBlock (ec); // - // Create an instance of a storey + // Create an instance of this storey // - var storey_type_expr = CreateStoreyTypeExpression (ec); - ResolveContext rc = new ResolveContext (ec.MemberContext); rc.CurrentBlock = block; - Expression e = new New (storey_type_expr, null, Location).Resolve (rc); - e.Emit (ec); - Instance = new LocalTemporary (storey_type_expr.Type); - Instance.Store (ec); + var storey_type_expr = CreateStoreyTypeExpression (ec); + var source = new New (storey_type_expr, null, Location).Resolve (rc); + + // + // When the current context is async (or iterator) lift local storey + // instantiation to the currect storey + // + if (ec.CurrentAnonymousMethod is StateMachineInitializer) { + // + // Unfortunately, normal capture mechanism could not be used because we are + // too late in the pipeline and standart assign cannot be used either due to + // recursive nature of GetStoreyInstanceExpression + // + var field = ec.CurrentAnonymousMethod.Storey.AddCompilerGeneratedField ( + LocalVariable.GetCompilerGeneratedName (block), storey_type_expr, true); + + field.Define (); + field.Emit (); + + var fexpr = new FieldExpr (field, Location); + fexpr.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, Location); + fexpr.EmitAssign (ec, source, false, false); + + Instance = fexpr; + } else { + var local = TemporaryVariableReference.Create (source.Type, block, Location); + local.EmitAssign (ec, source); + + Instance = local; + } EmitHoistedFieldsInitialization (rc, ec); - SymbolWriter.DefineScopeVariable (ID, Instance.Builder); + // TODO: Implement properly + //SymbolWriter.DefineScopeVariable (ID, Instance.Builder); + SymbolWriter.CloseCompilerGeneratedBlock (ec); } @@ -526,10 +557,11 @@ namespace Mono.CSharp { if (f == null) { if (am.Storey == this) { // - // Access inside of same storey (S -> S) + // Access from inside of same storey (S -> S) // return new CompilerGeneratedThis (CurrentType, Location); } + // // External field access // @@ -583,6 +615,11 @@ namespace Mono.CSharp { this.hv = hv; } + public override bool ContainsEmitWithAwait () + { + return false; + } + public override Expression CreateExpressionTree (ResolveContext ec) { return hv.CreateExpressionTree (); @@ -637,6 +674,11 @@ namespace Mono.CSharp { GetFieldExpression (ec).Emit (ec); } + public Expression EmitToField (EmitContext ec) + { + return GetFieldExpression (ec); + } + // // Creates field access expression for hoisted variable // @@ -692,7 +734,7 @@ namespace Mono.CSharp { GetFieldExpression (ec).Emit (ec, leave_copy); } - public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load) + public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound) { GetFieldExpression (ec).EmitAssign (ec, source, leave_copy, false); } @@ -760,12 +802,20 @@ namespace Mono.CSharp { { readonly string name; - public HoistedLocalVariable (AnonymousMethodStorey scope, LocalVariable local, string name) - : base (scope, name, local.Type) + public HoistedLocalVariable (AnonymousMethodStorey storey, LocalVariable local, string name) + : base (storey, name, local.Type) { this.name = local.Name; } + // + // For compiler generated local variables + // + public HoistedLocalVariable (AnonymousMethodStorey storey, Field field) + : base (storey, field) + { + } + public override void EmitSymbolInfo () { SymbolWriter.DefineCapturedLocal (storey.ID, name, field.Name); @@ -1021,7 +1071,7 @@ namespace Mono.CSharp { var body = CompatibleMethodBody (ec, tic, InternalType.Arglist, delegate_type); if (body != null) { if (is_async) { - AsyncInitializer.Create (body.Block, body.Parameters, ec.CurrentMemberDefinition.Parent, null, loc); + AsyncInitializer.Create (ec, body.Block, body.Parameters, ec.CurrentMemberDefinition.Parent, null, loc); } am = body.Compatible (ec, body, is_async); @@ -1037,6 +1087,11 @@ namespace Mono.CSharp { return am.ReturnType; } + public override bool ContainsEmitWithAwait () + { + return false; + } + // // Returns AnonymousMethod container if this anonymous method // expression can be implicitly converted to the delegate type `delegate_type' @@ -1102,7 +1157,7 @@ namespace Mono.CSharp { } } else { if (is_async) { - AsyncInitializer.Create (body.Block, body.Parameters, ec.CurrentMemberDefinition.Parent, body.ReturnType, loc); + AsyncInitializer.Create (ec, body.Block, body.Parameters, ec.CurrentMemberDefinition.Parent, body.ReturnType, loc); } am = body.Compatible (ec); @@ -1190,12 +1245,13 @@ namespace Mono.CSharp { if (!DoResolveParameters (ec)) return null; +#if !STATIC // FIXME: The emitted code isn't very careful about reachability // so, ensure we have a 'ret' at the end BlockContext bc = ec as BlockContext; if (bc != null && bc.CurrentBranching != null && bc.CurrentBranching.CurrentUsageVector.IsUnreachable) bc.NeedReturnLabel (); - +#endif return this; } @@ -1280,11 +1336,6 @@ namespace Mono.CSharp { { EmitContext ec = new EmitContext (this, ig, ReturnType); ec.CurrentAnonymousMethod = AnonymousMethod; - if (AnonymousMethod.return_label != null) { - ec.HasReturnLabel = true; - ec.ReturnLabel = (Label) AnonymousMethod.return_label; - } - return ec; } @@ -1330,8 +1381,6 @@ namespace Mono.CSharp { public TypeSpec ReturnType; - object return_label; - protected AnonymousExpression (ParametersBlock block, TypeSpec return_type, Location loc) { this.ReturnType = return_type; @@ -1380,9 +1429,6 @@ namespace Mono.CSharp { bool res = Block.Resolve (ec.CurrentBranching, aec, null); - if (aec.HasReturnLabel) - return_label = aec.ReturnLabel; - if (am != null && am.ReturnTypeInference != null) { am.ReturnTypeInference.FixAllTypes (ec); ReturnType = am.ReturnTypeInference.InferredTypeArguments [0]; @@ -1403,6 +1449,11 @@ namespace Mono.CSharp { return res ? this : null; } + public override bool ContainsEmitWithAwait () + { + return false; + } + public void SetHasThisAccess () { ExplicitBlock b = block; @@ -1629,13 +1680,13 @@ namespace Mono.CSharp { // if (is_static) { - ec.Emit (OpCodes.Ldnull); + ec.EmitNull (); } else if (storey != null) { Expression e = storey.GetStoreyInstanceExpression (ec).Resolve (new ResolveContext (ec.MemberContext)); if (e != null) e.Emit (ec); } else { - ec.Emit (OpCodes.Ldarg_0); + ec.EmitThis (); } var delegate_method = method.Spec; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/argument.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/argument.cs index a246066896..2192b9c9e6 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/argument.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/argument.cs @@ -103,6 +103,28 @@ namespace Mono.CSharp return Expr.CreateExpressionTree (ec); } + + public virtual void Emit (EmitContext ec) + { + if (!IsByRef) { + Expr.Emit (ec); + return; + } + + AddressOp mode = AddressOp.Store; + if (ArgType == AType.Ref) + mode |= AddressOp.Load; + + IMemoryLocation ml = (IMemoryLocation) Expr; + ml.AddressOf (ec, mode); + } + + public Argument EmitToField (EmitContext ec) + { + var res = Expr.EmitToField (ec); + return res == Expr ? this : new Argument (res, ArgType); + } + public string GetSignatureForError () { if (Expr.eclass == ExprClass.MethodGroup) @@ -141,21 +163,6 @@ namespace Mono.CSharp Expr = ErrorExpression.Instance; // } } - - public virtual void Emit (EmitContext ec) - { - if (!IsByRef) { - Expr.Emit (ec); - return; - } - - AddressOp mode = AddressOp.Store; - if (ArgType == AType.Ref) - mode |= AddressOp.Load; - - IMemoryLocation ml = (IMemoryLocation) Expr; - ml.AddressOf (ec, mode); - } } public class MovableArgument : Argument @@ -182,12 +189,12 @@ namespace Mono.CSharp variable.Release (ec); } - public void EmitAssign (EmitContext ec) + public void EmitToVariable (EmitContext ec) { var type = Expr.Type; if (IsByRef) { var ml = (IMemoryLocation) Expr; - ml.AddressOf (ec, AddressOp.Load); + ml.AddressOf (ec, AddressOp.LoadStore); type = ReferenceContainer.MakeType (ec.Module, type); } else { Expr.Emit (ec); @@ -246,13 +253,16 @@ namespace Mono.CSharp ordered.Add (arg); } - public override Expression[] Emit (EmitContext ec, bool dup_args) + public override Arguments Emit (EmitContext ec, bool dup_args, bool prepareAwait) { foreach (var a in ordered) { - a.EmitAssign (ec); + if (prepareAwait) + a.EmitToField (ec); + else + a.EmitToVariable (ec); } - return base.Emit (ec, dup_args); + return base.Emit (ec, dup_args, prepareAwait); } } @@ -264,6 +274,11 @@ namespace Mono.CSharp args = new List (capacity); } + private Arguments (List args) + { + this.args = args; + } + public void Add (Argument arg) { args.Add (arg); @@ -274,6 +289,16 @@ namespace Mono.CSharp this.args.AddRange (args.args); } + public bool ContainsEmitWithAwait () + { + foreach (var arg in args) { + if (arg.Expr.ContainsEmitWithAwait ()) + return true; + } + + return false; + } + public ArrayInitializer CreateDynamicBinderArguments (ResolveContext rc) { Location loc = Location.Null; @@ -395,46 +420,58 @@ namespace Mono.CSharp // public void Emit (EmitContext ec) { - Emit (ec, false); + Emit (ec, false, false); } // - // if `dup_args' is true, a copy of the arguments will be left - // on the stack and return value will contain an array of access - // expressions - // NOTE: It's caller responsibility is to release temporary variables + // if `dup_args' is true or any of arguments contains await. + // A copy of all arguments will be returned to the caller // - public virtual Expression[] Emit (EmitContext ec, bool dup_args) + public virtual Arguments Emit (EmitContext ec, bool dup_args, bool prepareAwait) { - Expression[] temps; + List dups; - if (dup_args && Count != 0) - temps = new Expression [Count]; + if ((dup_args && Count != 0) || prepareAwait) + dups = new List (Count); else - temps = null; + dups = null; - int i = 0; LocalTemporary lt; foreach (Argument a in args) { + if (prepareAwait) { + dups.Add (a.EmitToField (ec)); + continue; + } + a.Emit (ec); - if (!dup_args) + + if (!dup_args) { continue; + } - if (a.Expr is Constant || a.Expr is This) { + if (a.Expr.IsSideEffectFree) { // - // No need to create a temporary variable for constants + // No need to create a temporary variable for side effect free expressions. I assume + // all side-effect free expressions are cheap, this has to be tweaked when we become + // more aggressive on detection // - temps[i] = a.Expr; + dups.Add (a); } else { ec.Emit (OpCodes.Dup); - temps[i] = lt = new LocalTemporary (a.Type); + + // TODO: Release local temporary on next Emit + // Need to add a flag to argument to indicate this + lt = new LocalTemporary (a.Type); lt.Store (ec); - } - ++i; + dups.Add (new Argument (lt, a.ArgType)); + } } - return temps; + if (dups != null) + return new Arguments (dups); + + return null; } public List.Enumerator GetEnumerator () @@ -497,9 +534,9 @@ namespace Mono.CSharp public Arguments MarkOrderedArgument (NamedArgument a) { // - // Constant expression have no effect on left-to-right execution + // An expression has no effect on left-to-right execution // - if (a.Expr is Constant) + if (a.Expr.IsSideEffectFree) return this; ArgumentsOrdered ra = this as ArgumentsOrdered; @@ -511,6 +548,12 @@ namespace Mono.CSharp if (la == a) break; + // + // When the argument is filled later by default expression + // + if (la == null) + continue; + var ma = la as MovableArgument; if (ma == null) { ma = new MovableArgument (la); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/assign.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/assign.cs index 6fd2a7a03a..2a82f240be 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/assign.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/assign.cs @@ -51,7 +51,7 @@ namespace Mono.CSharp { // be data on the stack that it can use to compuatate its value. This is // for expressions like a [f ()] ++, where you can't call `f ()' twice. // - void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load); + void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound); /* For simple assignments, this interface is very simple, EmitAssign is called with source @@ -201,6 +201,11 @@ namespace Mono.CSharp { builder = null; } + public override bool ContainsEmitWithAwait () + { + return false; + } + public override Expression CreateExpressionTree (ResolveContext ec) { Arguments args = new Arguments (1); @@ -236,9 +241,9 @@ namespace Mono.CSharp { Emit (ec); } - public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load) + public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound) { - if (prepare_for_load) + if (isCompound) throw new NotImplementedException (); source.Emit (ec); @@ -294,12 +299,6 @@ namespace Mono.CSharp { this.loc = loc; } - public override Expression CreateExpressionTree (ResolveContext ec) - { - ec.Report.Error (832, loc, "An expression tree cannot contain an assignment operator"); - return null; - } - public Expression Target { get { return target; } } @@ -310,6 +309,17 @@ namespace Mono.CSharp { } } + public override bool ContainsEmitWithAwait () + { + return target.ContainsEmitWithAwait () || source.ContainsEmitWithAwait (); + } + + public override Expression CreateExpressionTree (ResolveContext ec) + { + ec.Report.Error (832, loc, "An expression tree cannot contain an assignment operator"); + return null; + } + protected override Expression DoResolve (ResolveContext ec) { bool ok = true; @@ -546,10 +556,6 @@ namespace Mono.CSharp { base.EmitStatement (ec); } - public bool IsComplexInitializer { - get { return !(source is Constant); } - } - public bool IsDefaultInitializer { get { Constant c = source as Constant; @@ -560,6 +566,12 @@ namespace Mono.CSharp { return c.IsDefaultInitializer (fe.Type); } } + + public override bool IsSideEffectFree { + get { + return source.IsSideEffectFree; + } + } } // @@ -570,13 +582,19 @@ namespace Mono.CSharp { // This is just a hack implemented for arrays only public sealed class TargetExpression : Expression { - Expression child; + readonly Expression child; + public TargetExpression (Expression child) { this.child = child; this.loc = child.Location; } + public override bool ContainsEmitWithAwait () + { + return child.ContainsEmitWithAwait (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { throw new NotSupportedException ("ET"); @@ -593,6 +611,11 @@ namespace Mono.CSharp { { child.Emit (ec); } + + public override Expression EmitToField (EmitContext ec) + { + return child.EmitToField (ec); + } } // Used for underlying binary operator diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/async.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/async.cs index 1a1345013f..24c138ece1 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/async.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/async.cs @@ -1,4 +1,4 @@ -// +// // async.cs: Asynchronous functions // // Author: @@ -7,11 +7,14 @@ // Dual licensed under the terms of the MIT X11 or GNU GPL // // Copyright 2011 Novell, Inc. +// Copyright 2011 Xamarin Inc. // using System; using System.Collections.Generic; using System.Linq; +using System.Collections; + #if STATIC using IKVM.Reflection.Emit; #else @@ -43,18 +46,13 @@ namespace Mono.CSharp throw new NotImplementedException ("ET"); } - protected override Expression DoResolve (ResolveContext rc) + public override bool ContainsEmitWithAwait () { - if (rc.HasSet (ResolveContext.Options.FinallyScope)) { - rc.Report.Error (1984, loc, - "The `await' operator cannot be used in the body of a finally clause"); - } - - if (rc.HasSet (ResolveContext.Options.CatchScope)) { - rc.Report.Error (1985, loc, - "The `await' operator cannot be used in the body of a catch clause"); - } + return true; + } + protected override Expression DoResolve (ResolveContext rc) + { if (rc.HasSet (ResolveContext.Options.LockScope)) { rc.Report.Error (1996, loc, "The `await' operator cannot be used in the body of a lock statement"); @@ -92,7 +90,13 @@ namespace Mono.CSharp stmt.EmitPrologue (ec); stmt.Emit (ec); } - + + public override Expression EmitToField (EmitContext ec) + { + stmt.EmitPrologue (ec); + return stmt.GetResultExpression (ec); + } + public void EmitAssign (EmitContext ec, FieldExpr field) { stmt.EmitPrologue (ec); @@ -126,11 +130,27 @@ namespace Mono.CSharp } } + sealed class GetResultInvocation : Invocation + { + public GetResultInvocation (MethodGroupExpr mge, Arguments arguments) + : base (null, arguments) + { + mg = mge; + type = mg.BestCandidateReturnType; + } + + public override Expression EmitToField (EmitContext ec) + { + return this; + } + } + Field awaiter; - PropertyExpr is_completed; + PropertySpec is_completed; MethodSpec on_completed; MethodSpec get_result; TypeSpec type; + TypeSpec result_type; public AwaitStatement (Expression expr, Location loc) : base (expr, loc) @@ -139,6 +159,12 @@ namespace Mono.CSharp #region Properties + bool IsDynamic { + get { + return is_completed == null; + } + } + public TypeSpec Type { get { return type; @@ -147,13 +173,18 @@ namespace Mono.CSharp public TypeSpec ResultType { get { - return get_result.ReturnType; + return result_type; } } #endregion protected override void DoEmit (EmitContext ec) + { + GetResultExpression (ec).Emit (ec); + } + + public Expression GetResultExpression (EmitContext ec) { var fe_awaiter = new FieldExpr (awaiter, loc); fe_awaiter.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, loc); @@ -161,10 +192,15 @@ namespace Mono.CSharp // // result = awaiter.GetResult (); // - var mg_result = MethodGroupExpr.CreatePredefined (get_result, fe_awaiter.Type, loc); - mg_result.InstanceExpression = fe_awaiter; + if (IsDynamic) { + var rc = new ResolveContext (ec.MemberContext); + return new Invocation (new MemberAccess (fe_awaiter, "GetResult"), new Arguments (0)).Resolve (rc); + } else { + var mg_result = MethodGroupExpr.CreatePredefined (get_result, fe_awaiter.Type, loc); + mg_result.InstanceExpression = fe_awaiter; - mg_result.EmitCall (ec, new Arguments (0)); + return new GetResultInvocation (mg_result, new Arguments (0)); + } } public void EmitPrologue (EmitContext ec) @@ -177,11 +213,35 @@ namespace Mono.CSharp // fe_awaiter.EmitAssign (ec, expr, false, false); - is_completed.InstanceExpression = fe_awaiter; - is_completed.EmitBranchable (ec, resume_point, true); + Label skip_continuation = ec.DefineLabel (); - var mg_completed = MethodGroupExpr.CreatePredefined (on_completed, fe_awaiter.Type, loc); - mg_completed.InstanceExpression = fe_awaiter; + Expression completed_expr; + if (IsDynamic) { + var rc = new ResolveContext (ec.MemberContext); + + Arguments dargs = new Arguments (1); + dargs.Add (new Argument (fe_awaiter)); + completed_expr = new DynamicMemberBinder ("IsCompleted", dargs, loc).Resolve (rc); + } else { + var pe = PropertyExpr.CreatePredefined (is_completed, loc); + pe.InstanceExpression = fe_awaiter; + completed_expr = pe; + } + + completed_expr.EmitBranchable (ec, skip_continuation, true); + + base.DoEmit (ec); + + // + // The stack has to be empty before calling await continuation. We handle this + // by lifting values which would be left on stack into class fields. The process + // is quite complicated and quite hard to test because any expression can possibly + // leave a value on the stack. + // + // Following assert fails when some of expression called before is missing EmitToField + // or parent expression fails to find await in children expressions + // + ec.AssertEmptyStack (); var args = new Arguments (1); var storey = (AsyncTaskStorey) machine_initializer.Storey; @@ -190,12 +250,27 @@ namespace Mono.CSharp args.Add (new Argument (fe_cont)); - // - // awaiter.OnCompleted (continuation); - // - mg_completed.EmitCall (ec, args); + if (IsDynamic) { + var rc = new ResolveContext (ec.MemberContext); + var mg_expr = new Invocation (new MemberAccess (fe_awaiter, "OnCompleted"), args).Resolve (rc); - base.DoEmit (ec); + ExpressionStatement es = (ExpressionStatement) mg_expr; + es.EmitStatement (ec); + } else { + var mg_completed = MethodGroupExpr.CreatePredefined (on_completed, fe_awaiter.Type, loc); + mg_completed.InstanceExpression = fe_awaiter; + + // + // awaiter.OnCompleted (continuation); + // + mg_completed.EmitCall (ec, args); + } + + // Return ok + machine_initializer.EmitLeave (ec, unwind_protect); + + ec.MarkLabel (resume_point); + ec.MarkLabel (skip_continuation); } public void EmitStatement (EmitContext ec) @@ -231,13 +306,21 @@ namespace Mono.CSharp if (!base.Resolve (bc)) return false; + Arguments args = new Arguments (0); + type = expr.Type; // - // The task result is of dynamic type + // The await expression is of dynamic type // - if (expr.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) - throw new NotImplementedException ("dynamic await"); + if (type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) { + result_type = type; + + awaiter = ((AsyncTaskStorey) machine_initializer.Storey).AddAwaiter (type, loc); + + expr = new Invocation (new MemberAccess (expr, "GetAwaiter"), args).Resolve (bc); + return true; + } // // Check whether the expression is awaitable @@ -246,40 +329,28 @@ namespace Mono.CSharp if (ama == null) return false; - Arguments args = new Arguments (0); - var errors_printer = new SessionReportPrinter (); var old = bc.Report.SetPrinter (errors_printer); ama = new Invocation (ama, args).Resolve (bc); + bc.Report.SetPrinter (old); if (errors_printer.ErrorsCount > 0 || !MemberAccess.IsValidDotExpression (ama.Type)) { - bc.Report.SetPrinter (old); - Error_WrongGetAwaiter (bc, loc, expr.Type); + Error_WrongGetAwaiter (bc, expr.Location, expr.Type); return false; } var awaiter_type = ama.Type; awaiter = ((AsyncTaskStorey) machine_initializer.Storey).AddAwaiter (awaiter_type, loc); + expr = ama; // // Predefined: bool IsCompleted { get; } // - var is_completed_ma = new MemberAccess (expr, "IsCompleted").Resolve (bc); - if (is_completed_ma != null) { - is_completed = is_completed_ma as PropertyExpr; - if (is_completed != null && is_completed.Type.BuiltinType == BuiltinTypeSpec.Type.Bool && is_completed.IsInstance && is_completed.Getter != null) { - // valid - } else { - bc.Report.SetPrinter (old); - Error_WrongAwaiterPattern (bc, awaiter_type); - return false; - } - } - - bc.Report.SetPrinter (old); + is_completed = MemberCache.FindMember (awaiter_type, MemberFilter.Property ("IsCompleted", bc.Module.Compiler.BuiltinTypes.Bool), + BindingRestriction.InstanceOnly) as PropertySpec; - if (errors_printer.ErrorsCount > 0) { + if (is_completed == null || !is_completed.HasGet) { Error_WrongAwaiterPattern (bc, awaiter_type); return false; } @@ -312,6 +383,8 @@ namespace Mono.CSharp return false; } + result_type = get_result.ReturnType; + return true; } } @@ -353,7 +426,7 @@ namespace Mono.CSharp #endregion - public static void Create (ParametersBlock block, ParametersCompiled parameters, TypeContainer host, TypeSpec returnType, Location loc) + public static void Create (IMemberContext context, ParametersBlock block, ParametersCompiled parameters, TypeContainer host, TypeSpec returnType, Location loc) { if (returnType != null && returnType.Kind != MemberKind.Void && returnType != host.Module.PredefinedTypes.Task.TypeSpec && @@ -385,11 +458,12 @@ namespace Mono.CSharp } } - // TODO: Warning - //if (!block.HasAwait) { - //} + if (!block.IsAsync) { + host.Compiler.Report.Warning (1998, 1, loc, + "Async block lacks `await' operator and will run synchronously"); + } - block.WrapIntoAsyncTask (host, returnType); + block.WrapIntoAsyncTask (context, host, returnType); } protected override BlockContext CreateBlockContext (ResolveContext rc) @@ -399,6 +473,7 @@ namespace Mono.CSharp if (lambda != null) return_inference = lambda.ReturnTypeInference; + ctx.StartFlowBranching (this, rc.CurrentBranching); return ctx; } @@ -422,17 +497,31 @@ namespace Mono.CSharp { var storey = (AsyncTaskStorey) Storey; storey.Instance.Emit (ec); - ec.Emit (OpCodes.Call, storey.StateMachineMethod.Spec); + var move_next_entry = storey.StateMachineMethod.Spec; + if (storey.MemberName.Arity > 0) { + move_next_entry = MemberCache.GetMember (storey.Instance.Type, move_next_entry); + } + + ec.Emit (OpCodes.Call, move_next_entry); + + // + // Emits return .$builder.Task; + // if (storey.Task != null) { - // - // async.$builder.Task; - // + var builder_field = storey.Builder.Spec; + var task_get = storey.Task.Get; + + if (storey.MemberName.Arity > 0) { + builder_field = MemberCache.GetMember (storey.Instance.Type, builder_field); + task_get = MemberCache.GetMember (builder_field.MemberType, task_get); + } + var pe_task = new PropertyExpr (storey.Task, loc) { - InstanceExpression = new FieldExpr (storey.Builder, loc) { + InstanceExpression = new FieldExpr (builder_field, loc) { InstanceExpression = storey.Instance }, - Getter = storey.Task.Get + Getter = task_get }; pe_task.Emit (ec); @@ -440,33 +529,60 @@ namespace Mono.CSharp ec.Emit (OpCodes.Ret); } - - public override void InjectYield (EmitContext ec, Expression expr, int resume_pc, bool unwind_protect, Label resume_point) - { - base.InjectYield (ec, expr, resume_pc, unwind_protect, resume_point); - } } class AsyncTaskStorey : StateMachine { + sealed class ParametersLoadStatement : Statement + { + readonly FieldSpec[] fields; + readonly TypeSpec[] parametersTypes; + readonly int thisParameterIndex; + + public ParametersLoadStatement (FieldSpec[] fields, TypeSpec[] parametersTypes, int thisParameterIndex) + { + this.fields = fields; + this.parametersTypes = parametersTypes; + this.thisParameterIndex = thisParameterIndex; + } + + protected override void CloneTo (CloneContext clonectx, Statement target) + { + throw new NotImplementedException (); + } + + protected override void DoEmit (EmitContext ec) + { + for (int i = 0; i < fields.Length; ++i) { + var field = fields[i]; + if (field == null) + continue; + + ec.EmitArgumentLoad (thisParameterIndex); + ec.EmitArgumentLoad (i); + if (parametersTypes[i] is ReferenceContainer) + ec.EmitLoadFromPtr (field.MemberType); + + ec.Emit (OpCodes.Stfld, field); + } + } + } + int awaiters; Field builder, continuation; readonly TypeSpec return_type; MethodSpec set_result; + MethodSpec set_exception; PropertySpec task; LocalVariable hoisted_return; + int locals_captured; - public AsyncTaskStorey (AsyncInitializer initializer, TypeSpec type) - : base (initializer.OriginalBlock, initializer.Host, null, null, "async") + public AsyncTaskStorey (IMemberContext context, AsyncInitializer initializer, TypeSpec type) + : base (initializer.OriginalBlock, initializer.Host,context.CurrentMemberDefinition as MemberBase, context.CurrentTypeParameters, "async") { return_type = type; } - public Field AddAwaiter (TypeSpec type, Location loc) - { - return AddCompilerGeneratedField ("$awaiter" + awaiters++.ToString ("X"), new TypeExpression (type, loc)); - } - #region Properties public Field Builder { @@ -501,17 +617,34 @@ namespace Mono.CSharp #endregion + public Field AddAwaiter (TypeSpec type, Location loc) + { + return AddCompilerGeneratedField ("$awaiter" + awaiters++.ToString ("X"), new TypeExpression (type, loc), true); + } + + public Field AddCapturedLocalVariable (TypeSpec type) + { + if (mutator != null) + type = mutator.Mutate (type); + + var field = AddCompilerGeneratedField ("$" + locals_captured++.ToString ("X"), new TypeExpression (type, Location), true); + field.Define (); + + return field; + } + protected override bool DoDefineMembers () { var action = Module.PredefinedTypes.Action.Resolve (); if (action != null) { - continuation = AddCompilerGeneratedField ("$continuation", new TypeExpression (action, Location)); + continuation = AddCompilerGeneratedField ("$continuation", new TypeExpression (action, Location), true); continuation.ModFlags |= Modifiers.READONLY; } PredefinedType builder_type; PredefinedMember bf; PredefinedMember sr; + PredefinedMember se; bool has_task_return_type = false; var pred_members = Module.PredefinedMembers; @@ -519,32 +652,41 @@ namespace Mono.CSharp builder_type = Module.PredefinedTypes.AsyncVoidMethodBuilder; bf = pred_members.AsyncVoidMethodBuilderCreate; sr = pred_members.AsyncVoidMethodBuilderSetResult; + se = pred_members.AsyncVoidMethodBuilderSetException; } else if (return_type == Module.PredefinedTypes.Task.TypeSpec) { builder_type = Module.PredefinedTypes.AsyncTaskMethodBuilder; bf = pred_members.AsyncTaskMethodBuilderCreate; sr = pred_members.AsyncTaskMethodBuilderSetResult; + se = pred_members.AsyncTaskMethodBuilderSetException; task = pred_members.AsyncTaskMethodBuilderTask.Resolve (Location); } else { builder_type = Module.PredefinedTypes.AsyncTaskMethodBuilderGeneric; bf = pred_members.AsyncTaskMethodBuilderGenericCreate; sr = pred_members.AsyncTaskMethodBuilderGenericSetResult; + se = pred_members.AsyncTaskMethodBuilderGenericSetException; task = pred_members.AsyncTaskMethodBuilderGenericTask.Resolve (Location); has_task_return_type = true; } set_result = sr.Resolve (Location); + set_exception = se.Resolve (Location); var builder_factory = bf.Resolve (Location); var bt = builder_type.Resolve (); - if (bt == null || set_result == null || builder_factory == null) + if (bt == null || set_result == null || builder_factory == null || set_exception == null) return false; // // Inflate generic Task types // if (has_task_return_type) { - bt = bt.MakeGenericType (Module, return_type.TypeArguments); + var task_return_type = return_type.TypeArguments; + if (mutator != null) + task_return_type = mutator.Mutate (task_return_type); + + bt = bt.MakeGenericType (Module, task_return_type); builder_factory = MemberCache.GetMember (bt, builder_factory); set_result = MemberCache.GetMember (bt, set_result); + set_exception = MemberCache.GetMember (bt, set_exception); if (task != null) task = MemberCache.GetMember (bt, task); @@ -589,6 +731,22 @@ namespace Mono.CSharp return true; } + public void EmitSetException (EmitContext ec, LocalVariableReference exceptionVariable) + { + // + // $builder.SetException (Exception) + // + var mg = MethodGroupExpr.CreatePredefined (set_exception, set_exception.DeclaringType, Location); + mg.InstanceExpression = new FieldExpr (Builder, Location) { + InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, Location) + }; + + Arguments args = new Arguments (1); + args.Add (new Argument (exceptionVariable)); + + mg.EmitCall (ec, args); + } + public void EmitSetResult (EmitContext ec) { // diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/attribute.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/attribute.cs index b58a81351f..71c3b06631 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/attribute.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/attribute.cs @@ -82,7 +82,7 @@ namespace Mono.CSharp { public abstract string[] ValidAttributeTargets { get; } }; - public class Attribute : Expression + public class Attribute { public readonly string ExplicitTarget; public AttributeTargets Target; @@ -94,6 +94,8 @@ namespace Mono.CSharp { bool resolve_error; bool arg_resolved; readonly bool nameEscaped; + readonly Location loc; + public TypeSpec Type; // // An attribute can be attached to multiple targets (e.g. multiple fields) @@ -123,6 +125,12 @@ namespace Mono.CSharp { this.nameEscaped = nameEscaped; } + public Location Location { + get { + return loc; + } + } + void AddModuleCharSet (ResolveContext rc) { const string dll_import_char_set = "CharSet"; @@ -326,7 +334,7 @@ namespace Mono.CSharp { return Type; } - public override string GetSignatureForError () + public string GetSignatureForError () { if (Type != null) return TypeManager.CSharpName (Type); @@ -337,7 +345,7 @@ namespace Mono.CSharp { public bool HasSecurityAttribute { get { PredefinedAttribute pa = context.Module.PredefinedAttributes.Security; - return pa.IsDefined && TypeSpec.IsBaseClass (type, pa.TypeSpec, false); + return pa.IsDefined && TypeSpec.IsBaseClass (Type, pa.TypeSpec, false); } } @@ -468,7 +476,7 @@ namespace Mono.CSharp { } } - return ConstructorLookup (ec, Type, ref PosArguments, loc); + return Expression.ConstructorLookup (ec, Type, ref PosArguments, loc); } bool ResolveNamedArguments (ResolveContext ec) @@ -489,10 +497,10 @@ namespace Mono.CSharp { a.Resolve (ec); - Expression member = Expression.MemberLookup (ec, false, Type, name, 0, MemberLookupRestrictions.ExactArity, loc); + Expression member = Expression.MemberLookup (ec, false, Type, name, 0, Expression.MemberLookupRestrictions.ExactArity, loc); if (member == null) { - member = Expression.MemberLookup (ec, true, Type, name, 0, MemberLookupRestrictions.ExactArity, loc); + member = Expression.MemberLookup (ec, true, Type, name, 0, Expression.MemberLookupRestrictions.ExactArity, loc); if (member != null) { // TODO: ec.Report.SymbolRelatedToPreviousError (member); @@ -680,7 +688,7 @@ namespace Mono.CSharp { { if (!arg_resolved) { // corlib only case when obsolete is used before is resolved - var c = type.MemberDefinition as Class; + var c = Type.MemberDefinition as Class; if (c != null && !c.HasMembersDefined) c.Define (); @@ -919,7 +927,7 @@ namespace Mono.CSharp { public override int GetHashCode () { - return type.GetHashCode () ^ Target.GetHashCode (); + return Type.GetHashCode () ^ Target.GetHashCode (); } /// @@ -1087,21 +1095,6 @@ namespace Mono.CSharp { return null; return e.TypeArgument; } - - public override Expression CreateExpressionTree (ResolveContext ec) - { - throw new NotSupportedException ("ET"); - } - - protected override Expression DoResolve (ResolveContext ec) - { - throw new NotImplementedException (); - } - - public override void Emit (EmitContext ec) - { - throw new NotImplementedException (); - } } public class Attributes diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/class.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/class.cs index 83fbea0b38..3959f351bb 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/class.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/class.cs @@ -99,7 +99,7 @@ namespace Mono.CSharp return tc.GetSignatureForError (); } - public IList LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceContainer scope) + public ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity) { return null; } @@ -319,6 +319,12 @@ namespace Mono.CSharp } } + public TypeSpec[] Interfaces { + get { + return iface_exprs; + } + } + #endregion public override void Accept (StructuralVisitor visitor) @@ -756,7 +762,7 @@ namespace Mono.CSharp ExpressionStatement s = fi.ResolveStatement (ec); if (s == null) { s = EmptyExpressionStatement.Instance; - } else if (fi.IsComplexInitializer) { + } else if (!fi.IsSideEffectFree) { has_complex_initializer |= true; } @@ -2455,18 +2461,19 @@ namespace Mono.CSharp } } - public override IList LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceContainer scope) + public override ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity) { DeclSpace top_level = Parent; if (top_level != null) { - var candidates = NamespaceEntry.NS.LookupExtensionMethod (this, extensionType, name, arity); - if (candidates != null) { - scope = NamespaceEntry; - return candidates; + var methods = NamespaceEntry.NS.LookupExtensionMethod (this, extensionType, name, arity); + if (methods != null) { + return new ExtensionMethodCandidates (methods, NamespaceEntry, NamespaceEntry.NS) { + HasUninspectedMembers = true + }; } } - return NamespaceEntry.LookupExtensionMethod (extensionType, name, arity, ref scope); + return NamespaceEntry.LookupExtensionMethod (extensionType, name, arity); } protected override TypeAttributes TypeAttr { @@ -2805,7 +2812,10 @@ namespace Mono.CSharp } } - if ((field.IsStatic && (!ftype.IsGeneric || ftype == CurrentType))) + // + // Static fields of exactly same type are allowed + // + if (field.IsStatic && ftype == s.CurrentType) continue; if (!CheckFieldTypeCycle (ftype)) { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/codegen.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/codegen.cs index abd114d2f9..8764c79fe9 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/codegen.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/codegen.cs @@ -51,16 +51,6 @@ namespace Mono.CSharp /// public LocalBuilder return_value; - /// - /// The location where return has to jump to return the - /// value - /// - public Label ReturnLabel; - - /// - /// If we already defined the ReturnLabel - /// - public bool HasReturnLabel; /// /// Current loop begin and end labels. @@ -87,13 +77,17 @@ namespace Mono.CSharp DynamicSiteClass dynamic_site_container; + Label? return_label; + public EmitContext (IMemberContext rc, ILGenerator ig, TypeSpec return_type) { this.member_context = rc; this.ig = ig; - this.return_type = return_type; + if (rc.Module.Compiler.Settings.Checked) + flags |= Options.CheckedScope; + #if STATIC ig.__CleverExceptionBlockAssistance (); #endif @@ -101,6 +95,12 @@ namespace Mono.CSharp #region Properties + internal AsyncTaskStorey AsyncTaskStorey { + get { + return CurrentAnonymousMethod.Storey as AsyncTaskStorey; + } + } + public BuiltinTypes BuiltinTypes { get { return MemberContext.Module.Compiler.BuiltinTypes; @@ -119,6 +119,12 @@ namespace Mono.CSharp get { return member_context.CurrentMemberDefinition; } } + public bool HasReturnLabel { + get { + return return_label.HasValue; + } + } + public bool IsStatic { get { return member_context.IsStatic; } } @@ -156,8 +162,27 @@ namespace Mono.CSharp return return_type; } } + + // + // The label where we have to jump before leaving the context + // + public Label ReturnLabel { + get { + return return_label.Value; + } + } + #endregion + public void AssertEmptyStack () + { +#if STATIC + if (ig.__StackHeight != 0) + throw new InternalErrorException ("Await yields with non-empty stack in `{0}", + member_context.GetSignatureForError ()); +#endif + } + /// /// This is called immediately before emitting an IL opcode to tell the symbol /// writer to which source line this opcode belongs. @@ -228,6 +253,14 @@ namespace Mono.CSharp return dynamic_site_container; } + public Label CreateReturnLabel () + { + if (!return_label.HasValue) + return_label = DefineLabel (); + + return return_label.Value; + } + public LocalBuilder DeclareLocal (TypeSpec type, bool pinned) { if (IsAnonymousStoreyMutateRequired) @@ -241,6 +274,17 @@ namespace Mono.CSharp return ig.DefineLabel (); } + // + // Creates temporary field in current async storey + // + public FieldExpr GetTemporaryField (TypeSpec type) + { + var f = AsyncTaskStorey.AddCapturedLocalVariable (type); + var fexpr = new FieldExpr (f, Location.Null); + fexpr.InstanceExpression = new CompilerGeneratedThis (CurrentType, Location.Null); + return fexpr; + } + public void MarkLabel (Label label) { ig.MarkLabel (label); @@ -271,16 +315,6 @@ namespace Mono.CSharp ig.Emit (opcode, arg); } - public void Emit (OpCode opcode, int arg) - { - ig.Emit (opcode, arg); - } - - public void Emit (OpCode opcode, byte arg) - { - ig.Emit (opcode, arg); - } - public void Emit (OpCode opcode, Label label) { ig.Emit (opcode, label); @@ -333,7 +367,11 @@ namespace Mono.CSharp public void EmitArrayNew (ArrayContainer ac) { if (ac.Rank == 1) { - Emit (OpCodes.Newarr, ac.Element); + var type = IsAnonymousStoreyMutateRequired ? + CurrentAnonymousMethod.Storey.Mutator.Mutate (ac.Element) : + ac.Element; + + ig.Emit (OpCodes.Newarr, type.GetMetaInfo ()); } else { if (IsAnonymousStoreyMutateRequired) ac = (ArrayContainer) ac.Mutate (CurrentAnonymousMethod.Storey.Mutator); @@ -350,7 +388,11 @@ namespace Mono.CSharp ig.Emit (OpCodes.Call, ac.GetAddressMethod ()); } else { - Emit (OpCodes.Ldelema, ac.Element); + var type = IsAnonymousStoreyMutateRequired ? + CurrentAnonymousMethod.Storey.Mutator.Mutate (ac.Element) : + ac.Element; + + ig.Emit (OpCodes.Ldelema, type.GetMetaInfo ()); } } @@ -367,6 +409,7 @@ namespace Mono.CSharp return; } + var type = ac.Element; if (type.Kind == MemberKind.Enum) type = EnumSpec.GetUnderlyingType (type); @@ -374,52 +417,59 @@ namespace Mono.CSharp switch (type.BuiltinType) { case BuiltinTypeSpec.Type.Byte: case BuiltinTypeSpec.Type.Bool: - Emit (OpCodes.Ldelem_U1); - return; + ig.Emit (OpCodes.Ldelem_U1); + break; case BuiltinTypeSpec.Type.SByte: - Emit (OpCodes.Ldelem_I1); - return; + ig.Emit (OpCodes.Ldelem_I1); + break; case BuiltinTypeSpec.Type.Short: - Emit (OpCodes.Ldelem_I2); - return; + ig.Emit (OpCodes.Ldelem_I2); + break; case BuiltinTypeSpec.Type.UShort: case BuiltinTypeSpec.Type.Char: - Emit (OpCodes.Ldelem_U2); - return; + ig.Emit (OpCodes.Ldelem_U2); + break; case BuiltinTypeSpec.Type.Int: - Emit (OpCodes.Ldelem_I4); - return; + ig.Emit (OpCodes.Ldelem_I4); + break; case BuiltinTypeSpec.Type.UInt: - Emit (OpCodes.Ldelem_U4); - return; + ig.Emit (OpCodes.Ldelem_U4); + break; case BuiltinTypeSpec.Type.ULong: case BuiltinTypeSpec.Type.Long: - Emit (OpCodes.Ldelem_I8); - return; + ig.Emit (OpCodes.Ldelem_I8); + break; case BuiltinTypeSpec.Type.Float: - Emit (OpCodes.Ldelem_R4); - return; - case BuiltinTypeSpec.Type.Double: - Emit (OpCodes.Ldelem_R8); - return; - case BuiltinTypeSpec.Type.IntPtr: - Emit (OpCodes.Ldelem_I); - return; - } - - switch (type.Kind) { - case MemberKind.Struct: - Emit (OpCodes.Ldelema, type); - Emit (OpCodes.Ldobj, type); + ig.Emit (OpCodes.Ldelem_R4); break; - case MemberKind.TypeParameter: - Emit (OpCodes.Ldelem, type); + case BuiltinTypeSpec.Type.Double: + ig.Emit (OpCodes.Ldelem_R8); break; - case MemberKind.PointerType: - Emit (OpCodes.Ldelem_I); + case BuiltinTypeSpec.Type.IntPtr: + ig.Emit (OpCodes.Ldelem_I); break; default: - Emit (OpCodes.Ldelem_Ref); + switch (type.Kind) { + case MemberKind.Struct: + if (IsAnonymousStoreyMutateRequired) + type = CurrentAnonymousMethod.Storey.Mutator.Mutate (type); + + ig.Emit (OpCodes.Ldelema, type.GetMetaInfo ()); + ig.Emit (OpCodes.Ldobj, type.GetMetaInfo ()); + break; + case MemberKind.TypeParameter: + if (IsAnonymousStoreyMutateRequired) + type = CurrentAnonymousMethod.Storey.Mutator.Mutate (type); + + ig.Emit (OpCodes.Ldelem, type.GetMetaInfo ()); + break; + case MemberKind.PointerType: + ig.Emit (OpCodes.Ldelem_I); + break; + default: + ig.Emit (OpCodes.Ldelem_Ref); + break; + } break; } } @@ -486,6 +536,11 @@ namespace Mono.CSharp } public void EmitInt (int i) + { + EmitIntConstant (i); + } + + void EmitIntConstant (int i) { switch (i) { case -1: @@ -540,18 +595,14 @@ namespace Mono.CSharp public void EmitLong (long l) { if (l >= int.MinValue && l <= int.MaxValue) { - EmitInt (unchecked ((int) l)); + EmitIntConstant (unchecked ((int) l)); ig.Emit (OpCodes.Conv_I8); - return; - } - - if (l >= 0 && l <= uint.MaxValue) { - EmitInt (unchecked ((int) l)); + } else if (l >= 0 && l <= uint.MaxValue) { + EmitIntConstant (unchecked ((int) l)); ig.Emit (OpCodes.Conv_U8); - return; + } else { + ig.Emit (OpCodes.Ldc_I8, l); } - - ig.Emit (OpCodes.Ldc_I8, l); } // @@ -565,53 +616,103 @@ namespace Mono.CSharp switch (type.BuiltinType) { case BuiltinTypeSpec.Type.Int: ig.Emit (OpCodes.Ldind_I4); - return; + break; case BuiltinTypeSpec.Type.UInt: ig.Emit (OpCodes.Ldind_U4); - return; + break; case BuiltinTypeSpec.Type.Short: ig.Emit (OpCodes.Ldind_I2); - return; + break; case BuiltinTypeSpec.Type.UShort: case BuiltinTypeSpec.Type.Char: ig.Emit (OpCodes.Ldind_U2); - return; + break; case BuiltinTypeSpec.Type.Byte: ig.Emit (OpCodes.Ldind_U1); - return; + break; case BuiltinTypeSpec.Type.SByte: case BuiltinTypeSpec.Type.Bool: ig.Emit (OpCodes.Ldind_I1); - return; + break; case BuiltinTypeSpec.Type.ULong: case BuiltinTypeSpec.Type.Long: ig.Emit (OpCodes.Ldind_I8); - return; + break; case BuiltinTypeSpec.Type.Float: ig.Emit (OpCodes.Ldind_R4); - return; + break; case BuiltinTypeSpec.Type.Double: ig.Emit (OpCodes.Ldind_R8); - return; + break; case BuiltinTypeSpec.Type.IntPtr: ig.Emit (OpCodes.Ldind_I); - return; - } - - switch (type.Kind) { - case MemberKind.Struct: - case MemberKind.TypeParameter: - Emit (OpCodes.Ldobj, type); break; - case MemberKind.PointerType: - ig.Emit (OpCodes.Ldind_I); + default: + switch (type.Kind) { + case MemberKind.Struct: + case MemberKind.TypeParameter: + if (IsAnonymousStoreyMutateRequired) + type = CurrentAnonymousMethod.Storey.Mutator.Mutate (type); + + ig.Emit (OpCodes.Ldobj, type.GetMetaInfo ()); + break; + case MemberKind.PointerType: + ig.Emit (OpCodes.Ldind_I); + break; + default: + ig.Emit (OpCodes.Ldind_Ref); + break; + } break; + } + } + + public void EmitNull () + { + ig.Emit (OpCodes.Ldnull); + } + + public void EmitArgumentAddress (int pos) + { + if (!IsStatic) + ++pos; + + if (pos > byte.MaxValue) + ig.Emit (OpCodes.Ldarga, pos); + else + ig.Emit (OpCodes.Ldarga_S, (byte) pos); + } + + public void EmitArgumentLoad (int pos) + { + if (!IsStatic) + ++pos; + + switch (pos) { + case 0: ig.Emit (OpCodes.Ldarg_0); break; + case 1: ig.Emit (OpCodes.Ldarg_1); break; + case 2: ig.Emit (OpCodes.Ldarg_2); break; + case 3: ig.Emit (OpCodes.Ldarg_3); break; default: - ig.Emit (OpCodes.Ldind_Ref); + if (pos > byte.MaxValue) + ig.Emit (OpCodes.Ldarg, pos); + else + ig.Emit (OpCodes.Ldarg_S, (byte) pos); break; } } + public void EmitArgumentStore (int pos) + { + if (!IsStatic) + ++pos; + + if (pos > byte.MaxValue) + ig.Emit (OpCodes.Starg, pos); + else + ig.Emit (OpCodes.Starg_S, (byte) pos); + } + // // The stack contains the pointer and the value of type `type' // @@ -650,10 +751,23 @@ namespace Mono.CSharp return; } - if (type.IsStruct || TypeManager.IsGenericParameter (type)) - Emit (OpCodes.Stobj, type); - else + switch (type.Kind) { + case MemberKind.Struct: + case MemberKind.TypeParameter: + if (IsAnonymousStoreyMutateRequired) + type = CurrentAnonymousMethod.Storey.Mutator.Mutate (type); + + ig.Emit (OpCodes.Stobj, type.GetMetaInfo ()); + break; + default: ig.Emit (OpCodes.Stind_Ref); + break; + } + } + + public void EmitThis () + { + ig.Emit (OpCodes.Ldarg_0); } /// @@ -716,13 +830,203 @@ namespace Mono.CSharp { if (return_value == null){ return_value = DeclareLocal (return_type, false); - if (!HasReturnLabel){ - ReturnLabel = DefineLabel (); - HasReturnLabel = true; - } } return return_value; } } + + struct CallEmitter + { + public Expression InstanceExpression; + + // + // When set leaves an extra copy of all arguments on the stack + // + public bool DuplicateArguments; + + // + // Does not emit InstanceExpression load when InstanceExpressionOnStack + // is set. Used by compound assignments. + // + public bool InstanceExpressionOnStack; + + // + // Any of arguments contains await expression + // + public bool HasAwaitArguments; + + // + // When dealing with await arguments the original arguments are converted + // into a new set with hoisted stack results + // + public Arguments EmittedArguments; + + public void Emit (EmitContext ec, MethodSpec method, Arguments Arguments, Location loc) + { + // Speed up the check by not doing it on not allowed targets + if (method.ReturnType.Kind == MemberKind.Void && method.IsConditionallyExcluded (ec.Module.Compiler, loc)) + return; + + EmitPredefined (ec, method, Arguments); + } + + public void EmitPredefined (EmitContext ec, MethodSpec method, Arguments Arguments) + { + Expression instance_copy = null; + + if (!HasAwaitArguments && ec.HasSet (BuilderContext.Options.AsyncBody)) { + HasAwaitArguments = Arguments != null && Arguments.ContainsEmitWithAwait (); + if (HasAwaitArguments && InstanceExpressionOnStack) { + throw new NotSupportedException (); + } + } + + OpCode call_op; + LocalTemporary lt = null; + + if (method.IsStatic) { + call_op = OpCodes.Call; + } else { + if (IsVirtualCallRequired (InstanceExpression, method)) { + call_op = OpCodes.Callvirt; + } else { + call_op = OpCodes.Call; + } + + if (HasAwaitArguments) { + instance_copy = InstanceExpression.EmitToField (ec); + if (Arguments == null) + EmitCallInstance (ec, instance_copy, method.DeclaringType, call_op); + } else if (!InstanceExpressionOnStack) { + var instance_on_stack_type = EmitCallInstance (ec, InstanceExpression, method.DeclaringType, call_op); + + if (DuplicateArguments) { + ec.Emit (OpCodes.Dup); + if (Arguments != null && Arguments.Count != 0) { + lt = new LocalTemporary (instance_on_stack_type); + lt.Store (ec); + instance_copy = lt; + } + } + } + } + + if (Arguments != null && !InstanceExpressionOnStack) { + EmittedArguments = Arguments.Emit (ec, DuplicateArguments, HasAwaitArguments); + if (EmittedArguments != null) { + if (instance_copy != null) { + EmitCallInstance (ec, instance_copy, method.DeclaringType, call_op); + + if (lt != null) + lt.Release (ec); + } + + EmittedArguments.Emit (ec); + } + } + + if (call_op == OpCodes.Callvirt && (InstanceExpression.Type.IsGenericParameter || InstanceExpression.Type.IsStruct)) { + ec.Emit (OpCodes.Constrained, InstanceExpression.Type); + } + + // + // Set instance expression to actual result expression. When it contains await it can be + // picked up by caller + // + InstanceExpression = instance_copy; + + if (method.Parameters.HasArglist) { + var varargs_types = GetVarargsTypes (method, Arguments); + ec.Emit (call_op, method, varargs_types); + return; + } + + // + // If you have: + // this.DoFoo (); + // and DoFoo is not virtual, you can omit the callvirt, + // because you don't need the null checking behavior. + // + ec.Emit (call_op, method); + } + + static TypeSpec EmitCallInstance (EmitContext ec, Expression instance, TypeSpec declaringType, OpCode callOpcode) + { + var instance_type = instance.Type; + + // + // Push the instance expression + // + if ((instance_type.IsStruct && (callOpcode == OpCodes.Callvirt || (callOpcode == OpCodes.Call && declaringType == instance_type))) || + instance_type.IsGenericParameter || declaringType.IsNullableType) { + // + // If the expression implements IMemoryLocation, then + // we can optimize and use AddressOf on the + // return. + // + // If not we have to use some temporary storage for + // it. + var iml = instance as IMemoryLocation; + if (iml != null) { + iml.AddressOf (ec, AddressOp.Load); + } else { + LocalTemporary temp = new LocalTemporary (instance_type); + instance.Emit (ec); + temp.Store (ec); + temp.AddressOf (ec, AddressOp.Load); + temp.Release (ec); + } + + return ReferenceContainer.MakeType (ec.Module, instance_type); + } + + if (instance_type.IsEnum || instance_type.IsStruct) { + instance.Emit (ec); + ec.Emit (OpCodes.Box, instance_type); + return ec.BuiltinTypes.Object; + } + + instance.Emit (ec); + return instance_type; + } + + static MetaType[] GetVarargsTypes (MethodSpec method, Arguments arguments) + { + AParametersCollection pd = method.Parameters; + + Argument a = arguments[pd.Count - 1]; + Arglist list = (Arglist) a.Expr; + + return list.ArgumentTypes; + } + + // + // Used to decide whether call or callvirt is needed + // + static bool IsVirtualCallRequired (Expression instance, MethodSpec method) + { + // + // There are 2 scenarious where we emit callvirt + // + // Case 1: A method is virtual and it's not used to call base + // Case 2: A method instance expression can be null. In this casen callvirt ensures + // correct NRE exception when the method is called + // + var decl_type = method.DeclaringType; + if (decl_type.IsStruct || decl_type.IsEnum) + return false; + + if (instance is BaseThis) + return false; + + // + // It's non-virtual and will never be null + // + if (!method.IsVirtual && (instance is This || instance is New || instance is ArrayCreation || instance is DelegateCreation)) + return false; + + return true; + } + } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/complete.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/complete.cs index 965416e79b..a8641784e1 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/complete.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/complete.cs @@ -43,19 +43,24 @@ namespace Mono.CSharp { } } - public override void EmitStatement (EmitContext ec) + public override bool ContainsEmitWithAwait () { - // Do nothing + return false; } - public override void Emit (EmitContext ec) + public override Expression CreateExpressionTree (ResolveContext ec) + { + return null; + } + + public override void EmitStatement (EmitContext ec) { // Do nothing } - public override Expression CreateExpressionTree (ResolveContext ec) + public override void Emit (EmitContext ec) { - return null; + // Do nothing } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/constant.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/constant.cs index 2848e46a7e..b00fee56cd 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/constant.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/constant.cs @@ -78,6 +78,11 @@ namespace Mono.CSharp { return c; } + public override bool ContainsEmitWithAwait () + { + return false; + } + public virtual Constant ConvertImplicitly (TypeSpec type) { if (this.type == type) @@ -309,7 +314,13 @@ namespace Mono.CSharp { public virtual bool IsOneInteger { get { return false; } - } + } + + public override bool IsSideEffectFree { + get { + return true; + } + } // // Returns true iff 1) the stack type of this is one of Object, @@ -427,9 +438,9 @@ namespace Mono.CSharp { public override void Emit (EmitContext ec) { if (Value) - ec.Emit (OpCodes.Ldc_I4_1); + ec.EmitInt (1); else - ec.Emit (OpCodes.Ldc_I4_0); + ec.EmitInt (0); } public override bool IsDefaultValue { @@ -1945,7 +1956,7 @@ namespace Mono.CSharp { public override void Emit (EmitContext ec) { if (Value == null) { - ec.Emit (OpCodes.Ldnull); + ec.EmitNull (); return; } @@ -2050,7 +2061,7 @@ namespace Mono.CSharp { public override void Emit (EmitContext ec) { - ec.Emit (OpCodes.Ldnull); + ec.EmitNull (); // Only to make verifier happy if (type.IsGenericParameter) @@ -2152,7 +2163,7 @@ namespace Mono.CSharp { // // Emits null pointer // - ec.Emit (OpCodes.Ldc_I4_0); + ec.EmitInt (0); ec.Emit (OpCodes.Conv_U); } } @@ -2162,7 +2173,8 @@ namespace Mono.CSharp { /// used by BitwiseAnd to ensure that the second expression is invoked /// regardless of the value of the left side. /// - public class SideEffectConstant : Constant { + public class SideEffectConstant : Constant + { public readonly Constant value; Expression side_effect; @@ -2178,6 +2190,12 @@ namespace Mono.CSharp { this.side_effect = side_effect; } + public override bool IsSideEffectFree { + get { + return false; + } + } + public override object GetValue () { return value.GetValue (); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/context.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/context.cs index 316968454e..06c64500de 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/context.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/context.cs @@ -7,18 +7,13 @@ // // Copyright 2001, 2002, 2003 Ximian, Inc. // Copyright 2004-2009 Novell, Inc. +// Copyright 2011 Xamarin Inc. // using System; using System.Collections.Generic; using System.IO; -#if STATIC -using IKVM.Reflection.Emit; -#else -using System.Reflection.Emit; -#endif - namespace Mono.CSharp { public enum LookupMode @@ -58,7 +53,7 @@ namespace Mono.CSharp string GetSignatureForError (); - IList LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceContainer scope); + ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity); FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc); FullNamedExpression LookupNamespaceAlias (string name); } @@ -75,18 +70,7 @@ namespace Mono.CSharp { FlowBranching current_flow_branching; - TypeSpec return_type; - - /// - /// The location where return has to jump to return the - /// value - /// - public Label ReturnLabel; // TODO: It's emit dependant - - /// - /// If we already defined the ReturnLabel - /// - public bool HasReturnLabel; + readonly TypeSpec return_type; public int FlowOffset; @@ -116,6 +100,10 @@ namespace Mono.CSharp get { return current_flow_branching; } } + public TypeSpec ReturnType { + get { return return_type; } + } + // // Starts a new code branching. This inherits the state of all local // variables and parameters from the current branching. @@ -145,9 +133,9 @@ namespace Mono.CSharp return branching; } - public FlowBranchingException StartFlowBranching (ExceptionStatement stmt) + public FlowBranchingTryFinally StartFlowBranching (TryFinallyBlock stmt) { - FlowBranchingException branching = new FlowBranchingException (CurrentBranching, stmt); + FlowBranchingTryFinally branching = new FlowBranchingTryFinally (CurrentBranching, stmt); current_flow_branching = branching; return branching; } @@ -159,13 +147,20 @@ namespace Mono.CSharp return branching; } - public FlowBranchingIterator StartFlowBranching (StateMachineInitializer iterator, FlowBranching parent) + public FlowBranchingIterator StartFlowBranching (Iterator iterator, FlowBranching parent) { FlowBranchingIterator branching = new FlowBranchingIterator (parent, iterator); current_flow_branching = branching; return branching; } + public FlowBranchingAsync StartFlowBranching (AsyncInitializer asyncBody, FlowBranching parent) + { + var branching = new FlowBranchingAsync (parent, asyncBody); + current_flow_branching = branching; + return branching; + } + public FlowBranchingToplevel StartFlowBranching (ParametersBlock stmt, FlowBranching parent) { FlowBranchingToplevel branching = new FlowBranchingToplevel (parent, stmt); @@ -196,19 +191,11 @@ namespace Mono.CSharp current_flow_branching = current_flow_branching.Parent; } - // - // This method is used during the Resolution phase to flag the - // need to define the ReturnLabel - // +#if !STATIC public void NeedReturnLabel () { - if (!HasReturnLabel) - HasReturnLabel = true; - } - - public TypeSpec ReturnType { - get { return return_type; } } +#endif } // @@ -484,7 +471,7 @@ namespace Mono.CSharp // FIXME: IsIterator is too aggressive, we should capture only if child // block contains yield - if (CurrentAnonymousMethod.IsIterator) + if (CurrentAnonymousMethod.IsIterator || CurrentAnonymousMethod is AsyncInitializer) return true; return local.Block.ParametersBlock != CurrentBlock.ParametersBlock.Original; @@ -519,9 +506,9 @@ namespace Mono.CSharp return MemberContext.GetSignatureForError (); } - public IList LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceContainer scope) + public ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity) { - return MemberContext.LookupExtensionMethod (extensionType, name, arity, ref scope); + return MemberContext.LookupExtensionMethod (extensionType, name, arity); } public FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc) @@ -685,18 +672,11 @@ namespace Mono.CSharp /// CheckedScope = 1 << 0, - /// - /// The constant check state is always set to `true' and cant be changed - /// from the command line. The source code can change this setting with - /// the `checked' and `unchecked' statements and expressions. - /// - ConstantCheckState = 1 << 1, - - AllCheckStateFlags = CheckedScope | ConstantCheckState, - OmitDebugInfo = 1 << 2, - ConstructorScope = 1 << 3 + ConstructorScope = 1 << 3, + + AsyncBody = 1 << 4 } // utility helper for CheckExpr, UnCheckExpr, Checked and Unchecked statements @@ -725,7 +705,7 @@ namespace Mono.CSharp } } - Options flags; + protected Options flags; public bool HasSet (Options options) { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/convert.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/convert.cs index 020c842755..73361860f4 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/convert.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/convert.cs @@ -8,6 +8,7 @@ // // Copyright 2001, 2002, 2003 Ximian, Inc. // Copyright 2003-2008 Novell, Inc. +// Copyright 2011 Xamarin, Inc (http://www.xamarin.com) // using System; @@ -198,7 +199,7 @@ namespace Mono.CSharp { return ImplicitReferenceConversionExists (expr_type, target_type, true); } - static bool ImplicitReferenceConversionExists (TypeSpec expr_type, TypeSpec target_type, bool refOnlyTypeParameter) + public static bool ImplicitReferenceConversionExists (TypeSpec expr_type, TypeSpec target_type, bool refOnlyTypeParameter) { // It's here only to speed things up if (target_type.IsStruct) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.cs index f77ba27ac9..ab4fdfce2c 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.cs @@ -4,14 +4,15 @@ // // cs-parser.jay: The Parser for the C# compiler // -// Authors: Miguel de Icaza (miguel@gnu.org) +// Authors: Miguel de Icaza (miguel@gnome.org) // Ravi Pratap (ravi@ximian.com) -// Marek Safar (marek.safar@gmail.com) +// Marek Safar (marek.safar@gmail.com) // // Dual Licensed under the terms of the GNU GPL and the MIT X11 license // // (C) 2001 Ximian, Inc (http://www.ximian.com) -// (C) 2004 Novell, Inc +// (C) 2004-2011 Novell, Inc +// Copyright 2011 Xamarin Inc. // // TODO: // (1) Figure out why error productions dont work. `type-declaration' is a @@ -145,9 +146,12 @@ namespace Mono.CSharp UsingsBag ubag; List> mod_locations; Location parameterModifierLocation, savedLocation, savedOpenLocation, savedCloseLocation; - Location savedAttrParenOpenLocation, savedAttrParenCloseLocation; + Location savedAttrParenOpenLocation, savedAttrParenCloseLocation, savedOperatorLocation; Stack> locationListStack = new Stack> (); // used for type parameters List attributeCommas = new List (); + List attributeArgumentCommas = new List (); + List parameterListCommas = new List (); + List enumCommas = new List (); object lastYYVal; @@ -303,24 +307,9 @@ namespace Mono.CSharp //t "$$9 :", //t "$$10 :", //t "$$11 :", -//t "struct_declaration : opt_attributes opt_modifiers opt_partial STRUCT $$8 type_declaration_name $$9 opt_class_base opt_type_parameter_constraints_clauses $$10 struct_body $$11 opt_semicolon", -//t "struct_declaration : opt_attributes opt_modifiers opt_partial STRUCT error", //t "$$12 :", -//t "struct_body : OPEN_BRACE $$12 opt_struct_member_declarations CLOSE_BRACE", -//t "opt_struct_member_declarations :", -//t "opt_struct_member_declarations : struct_member_declarations", -//t "struct_member_declarations : struct_member_declaration", -//t "struct_member_declarations : struct_member_declarations struct_member_declaration", -//t "struct_member_declaration : constant_declaration", -//t "struct_member_declaration : field_declaration", -//t "struct_member_declaration : method_declaration", -//t "struct_member_declaration : property_declaration", -//t "struct_member_declaration : event_declaration", -//t "struct_member_declaration : indexer_declaration", -//t "struct_member_declaration : operator_declaration", -//t "struct_member_declaration : constructor_declaration", -//t "struct_member_declaration : type_declaration", -//t "struct_member_declaration : destructor_declaration", +//t "struct_declaration : opt_attributes opt_modifiers opt_partial STRUCT $$8 type_declaration_name $$9 opt_class_base opt_type_parameter_constraints_clauses $$10 OPEN_BRACE $$11 opt_class_member_declarations CLOSE_BRACE $$12 opt_semicolon", +//t "struct_declaration : opt_attributes opt_modifiers opt_partial STRUCT error", //t "$$13 :", //t "constant_declaration : opt_attributes opt_modifiers CONST type IDENTIFIER $$13 constant_initializer opt_constant_declarators SEMICOLON", //t "opt_constant_declarators :", @@ -526,7 +515,8 @@ namespace Mono.CSharp //t "$$56 :", //t "$$57 :", //t "$$58 :", -//t "enum_declaration : opt_attributes opt_modifiers ENUM type_declaration_name opt_enum_base $$56 OPEN_BRACE $$57 opt_enum_member_declarations $$58 CLOSE_BRACE opt_semicolon", +//t "$$59 :", +//t "enum_declaration : opt_attributes opt_modifiers ENUM $$56 type_declaration_name opt_enum_base $$57 OPEN_BRACE $$58 opt_enum_member_declarations $$59 CLOSE_BRACE opt_semicolon", //t "opt_enum_base :", //t "opt_enum_base : COLON type", //t "opt_enum_base : COLON error", @@ -536,12 +526,12 @@ namespace Mono.CSharp //t "enum_member_declarations : enum_member_declaration", //t "enum_member_declarations : enum_member_declarations COMMA enum_member_declaration", //t "enum_member_declaration : opt_attributes IDENTIFIER", -//t "$$59 :", -//t "enum_member_declaration : opt_attributes IDENTIFIER $$59 ASSIGN constant_expression", //t "$$60 :", +//t "enum_member_declaration : opt_attributes IDENTIFIER $$60 ASSIGN constant_expression", //t "$$61 :", //t "$$62 :", -//t "delegate_declaration : opt_attributes opt_modifiers DELEGATE member_type type_declaration_name OPEN_PARENS $$60 opt_formal_parameter_list CLOSE_PARENS $$61 opt_type_parameter_constraints_clauses $$62 SEMICOLON", +//t "$$63 :", +//t "delegate_declaration : opt_attributes opt_modifiers DELEGATE member_type type_declaration_name OPEN_PARENS $$61 opt_formal_parameter_list CLOSE_PARENS $$62 opt_type_parameter_constraints_clauses $$63 SEMICOLON", //t "opt_nullable :", //t "opt_nullable : INTERR_NULLABLE", //t "namespace_or_type_name : member_name", @@ -554,8 +544,8 @@ namespace Mono.CSharp //t "opt_type_argument_list : OP_GENERICS_LT error", //t "type_arguments : type", //t "type_arguments : type_arguments COMMA type", -//t "$$63 :", -//t "type_declaration_name : IDENTIFIER $$63 opt_type_parameter_list", +//t "$$64 :", +//t "type_declaration_name : IDENTIFIER $$64 opt_type_parameter_list", //t "member_declaration_name : method_declaration_name", //t "method_declaration_name : type_declaration_name", //t "method_declaration_name : explicit_interface IDENTIFIER opt_type_parameter_list", @@ -701,8 +691,8 @@ namespace Mono.CSharp //t "array_creation_expression : NEW rank_specifier array_initializer", //t "array_creation_expression : NEW new_expr_type OPEN_BRACKET CLOSE_BRACKET OPEN_BRACKET_EXPR error CLOSE_BRACKET", //t "array_creation_expression : NEW new_expr_type error", -//t "$$64 :", -//t "new_expr_type : $$64 simple_type", +//t "$$65 :", +//t "new_expr_type : $$65 simple_type", //t "anonymous_type_expression : NEW OPEN_BRACE anonymous_type_parameters_opt_comma CLOSE_BRACE", //t "anonymous_type_parameters_opt_comma : anonymous_type_parameters_opt", //t "anonymous_type_parameters_opt_comma : anonymous_type_parameters COMMA", @@ -728,8 +718,8 @@ namespace Mono.CSharp //t "array_initializer : OPEN_BRACE variable_initializer_list opt_comma CLOSE_BRACE", //t "variable_initializer_list : variable_initializer", //t "variable_initializer_list : variable_initializer_list COMMA variable_initializer", -//t "$$65 :", -//t "typeof_expression : TYPEOF $$65 open_parens_any typeof_type_expression CLOSE_PARENS", +//t "$$66 :", +//t "typeof_expression : TYPEOF $$66 open_parens_any typeof_type_expression CLOSE_PARENS", //t "typeof_type_expression : type_and_void", //t "typeof_type_expression : unbound_type_name", //t "typeof_type_expression : error", @@ -744,14 +734,14 @@ namespace Mono.CSharp //t "checked_expression : CHECKED open_parens_any expression CLOSE_PARENS", //t "unchecked_expression : UNCHECKED open_parens_any expression CLOSE_PARENS", //t "pointer_member_access : primary_expression OP_PTR IDENTIFIER opt_type_argument_list", -//t "$$66 :", -//t "anonymous_method_expression : DELEGATE opt_anonymous_method_signature $$66 block", //t "$$67 :", -//t "anonymous_method_expression : ASYNC DELEGATE opt_anonymous_method_signature $$67 block", +//t "anonymous_method_expression : DELEGATE opt_anonymous_method_signature $$67 block", +//t "$$68 :", +//t "anonymous_method_expression : ASYNC DELEGATE opt_anonymous_method_signature $$68 block", //t "opt_anonymous_method_signature :", //t "opt_anonymous_method_signature : anonymous_method_signature", -//t "$$68 :", -//t "anonymous_method_signature : OPEN_PARENS $$68 opt_formal_parameter_list CLOSE_PARENS", +//t "$$69 :", +//t "anonymous_method_signature : OPEN_PARENS $$69 opt_formal_parameter_list CLOSE_PARENS", //t "default_value_expression : DEFAULT open_parens_any type CLOSE_PARENS", //t "unary_expression : primary_expression", //t "unary_expression : BANG prefixed_unary_expression", @@ -822,20 +812,20 @@ namespace Mono.CSharp //t "opt_lambda_parameter_list : lambda_parameter_list", //t "lambda_expression_body : lambda_expression_body_simple", //t "lambda_expression_body : block", -//t "$$69 :", -//t "lambda_expression_body_simple : $$69 expression_or_error", +//t "$$70 :", +//t "lambda_expression_body_simple : $$70 expression_or_error", //t "expression_or_error : expression", //t "expression_or_error : error", -//t "$$70 :", -//t "lambda_expression : IDENTIFIER ARROW $$70 lambda_expression_body", //t "$$71 :", -//t "lambda_expression : ASYNC IDENTIFIER ARROW $$71 lambda_expression_body", +//t "lambda_expression : IDENTIFIER ARROW $$71 lambda_expression_body", //t "$$72 :", +//t "lambda_expression : ASYNC IDENTIFIER ARROW $$72 lambda_expression_body", //t "$$73 :", -//t "lambda_expression : OPEN_PARENS_LAMBDA $$72 opt_lambda_parameter_list CLOSE_PARENS ARROW $$73 lambda_expression_body", //t "$$74 :", +//t "lambda_expression : OPEN_PARENS_LAMBDA $$73 opt_lambda_parameter_list CLOSE_PARENS ARROW $$74 lambda_expression_body", //t "$$75 :", -//t "lambda_expression : ASYNC OPEN_PARENS_LAMBDA $$74 opt_lambda_parameter_list CLOSE_PARENS ARROW $$75 lambda_expression_body", +//t "$$76 :", +//t "lambda_expression : ASYNC OPEN_PARENS_LAMBDA $$75 opt_lambda_parameter_list CLOSE_PARENS ARROW $$76 lambda_expression_body", //t "expression : assignment_expression", //t "expression : non_assignment_expression", //t "non_assignment_expression : conditional_expression", @@ -847,11 +837,11 @@ namespace Mono.CSharp //t "undocumented_expressions : MAKEREF open_parens_any expression CLOSE_PARENS", //t "constant_expression : expression", //t "boolean_expression : expression", -//t "$$76 :", //t "$$77 :", //t "$$78 :", //t "$$79 :", -//t "class_declaration : opt_attributes opt_modifiers opt_partial CLASS $$76 type_declaration_name $$77 opt_class_base opt_type_parameter_constraints_clauses $$78 OPEN_BRACE opt_class_member_declarations CLOSE_BRACE $$79 opt_semicolon", +//t "$$80 :", +//t "class_declaration : opt_attributes opt_modifiers opt_partial CLASS $$77 type_declaration_name $$78 opt_class_base opt_type_parameter_constraints_clauses $$79 OPEN_BRACE opt_class_member_declarations CLOSE_BRACE $$80 opt_semicolon", //t "opt_partial :", //t "opt_partial : PARTIAL", //t "opt_modifiers :", @@ -891,12 +881,12 @@ namespace Mono.CSharp //t "opt_type_parameter_variance : type_parameter_variance", //t "type_parameter_variance : OUT", //t "type_parameter_variance : IN", -//t "$$80 :", -//t "block : OPEN_BRACE $$80 opt_statement_list block_end", +//t "$$81 :", +//t "block : OPEN_BRACE $$81 opt_statement_list block_end", //t "block_end : CLOSE_BRACE", //t "block_end : COMPLETE_COMPLETION", -//t "$$81 :", -//t "block_prepared : OPEN_BRACE $$81 opt_statement_list CLOSE_BRACE", +//t "$$82 :", +//t "block_prepared : OPEN_BRACE $$82 opt_statement_list CLOSE_BRACE", //t "opt_statement_list :", //t "opt_statement_list : statement_list", //t "statement_list : statement", @@ -941,8 +931,8 @@ namespace Mono.CSharp //t "embedded_statement : labeled_statement", //t "embedded_statement : error", //t "empty_statement : SEMICOLON", -//t "$$82 :", -//t "labeled_statement : IDENTIFIER COLON $$82 statement", +//t "$$83 :", +//t "labeled_statement : IDENTIFIER COLON $$83 statement", //t "variable_type : variable_type_simple", //t "variable_type : variable_type_simple rank_specifiers", //t "variable_type_simple : primary_expression_or_type opt_nullable", @@ -954,15 +944,17 @@ namespace Mono.CSharp //t "pointer_stars : pointer_star", //t "pointer_stars : pointer_star pointer_stars", //t "pointer_star : STAR", -//t "$$83 :", -//t "block_variable_declaration : variable_type IDENTIFIER $$83 opt_local_variable_initializer opt_variable_declarators SEMICOLON", //t "$$84 :", -//t "block_variable_declaration : CONST variable_type IDENTIFIER $$84 const_variable_initializer opt_const_declarators SEMICOLON", +//t "block_variable_declaration : variable_type IDENTIFIER $$84 opt_local_variable_initializer opt_variable_declarators SEMICOLON", +//t "$$85 :", +//t "block_variable_declaration : CONST variable_type IDENTIFIER $$85 const_variable_initializer opt_const_declarators SEMICOLON", //t "opt_local_variable_initializer :", //t "opt_local_variable_initializer : ASSIGN block_variable_initializer", //t "opt_local_variable_initializer : error", //t "opt_variable_declarators :", //t "opt_variable_declarators : variable_declarators", +//t "opt_using_or_fixed_variable_declarators :", +//t "opt_using_or_fixed_variable_declarators : variable_declarators", //t "variable_declarators : variable_declarator", //t "variable_declarators : variable_declarators variable_declarator", //t "variable_declarator : COMMA IDENTIFIER", @@ -988,15 +980,15 @@ namespace Mono.CSharp //t "selection_statement : switch_statement", //t "if_statement : IF open_parens_any boolean_expression CLOSE_PARENS embedded_statement", //t "if_statement : IF open_parens_any boolean_expression CLOSE_PARENS embedded_statement ELSE embedded_statement", -//t "$$85 :", -//t "switch_statement : SWITCH open_parens_any expression CLOSE_PARENS OPEN_BRACE $$85 opt_switch_sections CLOSE_BRACE", +//t "$$86 :", +//t "switch_statement : SWITCH open_parens_any expression CLOSE_PARENS OPEN_BRACE $$86 opt_switch_sections CLOSE_BRACE", //t "opt_switch_sections :", //t "opt_switch_sections : switch_sections", //t "switch_sections : switch_section", //t "switch_sections : switch_sections switch_section", //t "switch_sections : error", -//t "$$86 :", -//t "switch_section : switch_labels $$86 statement_list", +//t "$$87 :", +//t "switch_section : switch_labels $$87 statement_list", //t "switch_labels : switch_label", //t "switch_labels : switch_labels switch_label", //t "switch_label : CASE constant_expression COLON", @@ -1007,14 +999,14 @@ namespace Mono.CSharp //t "iteration_statement : foreach_statement", //t "while_statement : WHILE open_parens_any boolean_expression CLOSE_PARENS embedded_statement", //t "do_statement : DO embedded_statement WHILE open_parens_any boolean_expression CLOSE_PARENS SEMICOLON", -//t "$$87 :", -//t "for_statement : FOR open_parens_any $$87 for_statement_cont", +//t "$$88 :", +//t "for_statement : FOR open_parens_any $$88 for_statement_cont", //t "for_statement_cont : opt_for_initializer SEMICOLON opt_for_condition SEMICOLON opt_for_iterator CLOSE_PARENS embedded_statement", //t "for_statement_cont : error", //t "opt_for_initializer :", //t "opt_for_initializer : for_initializer", -//t "$$88 :", -//t "for_initializer : variable_type IDENTIFIER $$88 opt_local_variable_initializer opt_variable_declarators", +//t "$$89 :", +//t "for_initializer : variable_type IDENTIFIER $$89 opt_local_variable_initializer opt_variable_declarators", //t "for_initializer : statement_expression_list", //t "opt_for_condition :", //t "opt_for_condition : boolean_expression", @@ -1024,8 +1016,8 @@ namespace Mono.CSharp //t "statement_expression_list : statement_expression", //t "statement_expression_list : statement_expression_list COMMA statement_expression", //t "foreach_statement : FOREACH open_parens_any type IN expression CLOSE_PARENS", -//t "$$89 :", -//t "foreach_statement : FOREACH open_parens_any type IDENTIFIER IN expression CLOSE_PARENS $$89 embedded_statement", +//t "$$90 :", +//t "foreach_statement : FOREACH open_parens_any type IDENTIFIER IN expression CLOSE_PARENS $$90 embedded_statement", //t "jump_statement : break_statement", //t "jump_statement : continue_statement", //t "jump_statement : goto_statement", @@ -1052,20 +1044,20 @@ namespace Mono.CSharp //t "opt_identifier :", //t "opt_identifier : IDENTIFIER", //t "catch_clause : CATCH block", -//t "$$90 :", -//t "catch_clause : CATCH open_parens_any type opt_identifier CLOSE_PARENS $$90 block_prepared", +//t "$$91 :", +//t "catch_clause : CATCH open_parens_any type opt_identifier CLOSE_PARENS $$91 block_prepared", //t "catch_clause : CATCH open_parens_any error", //t "checked_statement : CHECKED block", //t "unchecked_statement : UNCHECKED block", -//t "$$91 :", -//t "unsafe_statement : UNSAFE $$91 block", -//t "lock_statement : LOCK open_parens_any expression CLOSE_PARENS embedded_statement", //t "$$92 :", +//t "unsafe_statement : UNSAFE $$92 block", +//t "lock_statement : LOCK open_parens_any expression CLOSE_PARENS embedded_statement", //t "$$93 :", -//t "fixed_statement : FIXED open_parens_any variable_type IDENTIFIER $$92 using_or_fixed_variable_initializer opt_variable_declarators CLOSE_PARENS $$93 embedded_statement", //t "$$94 :", +//t "fixed_statement : FIXED open_parens_any variable_type IDENTIFIER $$93 using_or_fixed_variable_initializer opt_using_or_fixed_variable_declarators CLOSE_PARENS $$94 embedded_statement", //t "$$95 :", -//t "using_statement : USING open_parens_any variable_type IDENTIFIER $$94 using_or_fixed_variable_initializer opt_variable_declarators CLOSE_PARENS $$95 embedded_statement", +//t "$$96 :", +//t "using_statement : USING open_parens_any variable_type IDENTIFIER $$95 using_or_fixed_variable_initializer opt_using_or_fixed_variable_declarators CLOSE_PARENS $$96 embedded_statement", //t "using_statement : USING open_parens_any expression CLOSE_PARENS embedded_statement", //t "using_or_fixed_variable_initializer :", //t "using_or_fixed_variable_initializer : ASSIGN variable_initializer", @@ -1077,18 +1069,18 @@ namespace Mono.CSharp //t "first_from_clause : FROM_FIRST type IDENTIFIER IN expression", //t "nested_from_clause : FROM IDENTIFIER IN expression", //t "nested_from_clause : FROM type IDENTIFIER IN expression", -//t "$$96 :", -//t "from_clause : FROM IDENTIFIER IN $$96 expression", //t "$$97 :", -//t "from_clause : FROM type IDENTIFIER IN $$97 expression", +//t "from_clause : FROM IDENTIFIER IN $$97 expression", +//t "$$98 :", +//t "from_clause : FROM type IDENTIFIER IN $$98 expression", //t "query_body : opt_query_body_clauses select_or_group_clause opt_query_continuation", //t "query_body : opt_query_body_clauses COMPLETE_COMPLETION", //t "query_body : error", -//t "$$98 :", -//t "select_or_group_clause : SELECT $$98 expression", //t "$$99 :", +//t "select_or_group_clause : SELECT $$99 expression", //t "$$100 :", -//t "select_or_group_clause : GROUP $$99 expression $$100 BY expression", +//t "$$101 :", +//t "select_or_group_clause : GROUP $$100 expression $$101 BY expression", //t "opt_query_body_clauses :", //t "opt_query_body_clauses : query_body_clauses", //t "query_body_clauses : query_body_clause", @@ -1098,28 +1090,28 @@ namespace Mono.CSharp //t "query_body_clause : where_clause", //t "query_body_clause : join_clause", //t "query_body_clause : orderby_clause", -//t "$$101 :", -//t "let_clause : LET IDENTIFIER ASSIGN $$101 expression", //t "$$102 :", -//t "where_clause : WHERE $$102 expression", +//t "let_clause : LET IDENTIFIER ASSIGN $$102 expression", //t "$$103 :", +//t "where_clause : WHERE $$103 expression", //t "$$104 :", //t "$$105 :", -//t "join_clause : JOIN IDENTIFIER IN $$103 expression ON $$104 expression EQUALS $$105 expression opt_join_into", //t "$$106 :", +//t "join_clause : JOIN IDENTIFIER IN $$104 expression ON $$105 expression EQUALS $$106 expression opt_join_into", //t "$$107 :", //t "$$108 :", -//t "join_clause : JOIN type IDENTIFIER IN $$106 expression ON $$107 expression EQUALS $$108 expression opt_join_into", +//t "$$109 :", +//t "join_clause : JOIN type IDENTIFIER IN $$107 expression ON $$108 expression EQUALS $$109 expression opt_join_into", //t "opt_join_into :", //t "opt_join_into : INTO IDENTIFIER", -//t "$$109 :", -//t "orderby_clause : ORDERBY $$109 orderings", -//t "orderings : order_by", //t "$$110 :", -//t "orderings : order_by COMMA $$110 orderings_then_by", -//t "orderings_then_by : then_by", +//t "orderby_clause : ORDERBY $$110 orderings", +//t "orderings : order_by", //t "$$111 :", -//t "orderings_then_by : orderings_then_by COMMA $$111 then_by", +//t "orderings : order_by COMMA $$111 orderings_then_by", +//t "orderings_then_by : then_by", +//t "$$112 :", +//t "orderings_then_by : orderings_then_by COMMA $$112 then_by", //t "order_by : expression", //t "order_by : expression ASCENDING", //t "order_by : expression DESCENDING", @@ -1127,12 +1119,12 @@ namespace Mono.CSharp //t "then_by : expression ASCENDING", //t "then_by : expression DESCENDING", //t "opt_query_continuation :", -//t "$$112 :", -//t "opt_query_continuation : INTO IDENTIFIER $$112 query_body", +//t "$$113 :", +//t "opt_query_continuation : INTO IDENTIFIER $$113 query_body", //t "interactive_parsing : EVAL_STATEMENT_PARSER EOF", //t "interactive_parsing : EVAL_USING_DECLARATIONS_UNIT_PARSER using_directives opt_COMPLETE_COMPLETION", -//t "$$113 :", -//t "interactive_parsing : EVAL_STATEMENT_PARSER $$113 interactive_statement_list opt_COMPLETE_COMPLETION", +//t "$$114 :", +//t "interactive_parsing : EVAL_STATEMENT_PARSER $$114 interactive_statement_list opt_COMPLETE_COMPLETION", //t "interactive_parsing : EVAL_COMPILATION_UNIT_PARSER interactive_compilation_unit", //t "interactive_compilation_unit : opt_extern_alias_directives opt_using_directives", //t "interactive_compilation_unit : opt_extern_alias_directives opt_using_directives namespace_or_type_declarations", @@ -1145,16 +1137,16 @@ namespace Mono.CSharp //t "doc_cref : builtin_types opt_doc_method_sig", //t "doc_cref : builtin_types DOT IDENTIFIER opt_doc_method_sig", //t "doc_cref : doc_type_declaration_name DOT THIS", -//t "$$114 :", -//t "doc_cref : doc_type_declaration_name DOT THIS OPEN_BRACKET $$114 opt_doc_parameters CLOSE_BRACKET", +//t "$$115 :", +//t "doc_cref : doc_type_declaration_name DOT THIS OPEN_BRACKET $$115 opt_doc_parameters CLOSE_BRACKET", //t "doc_cref : EXPLICIT OPERATOR type opt_doc_method_sig", //t "doc_cref : IMPLICIT OPERATOR type opt_doc_method_sig", //t "doc_cref : OPERATOR overloadable_operator opt_doc_method_sig", //t "doc_type_declaration_name : type_declaration_name", //t "doc_type_declaration_name : doc_type_declaration_name DOT type_declaration_name", //t "opt_doc_method_sig :", -//t "$$115 :", -//t "opt_doc_method_sig : OPEN_PARENS $$115 opt_doc_parameters CLOSE_PARENS", +//t "$$116 :", +//t "opt_doc_method_sig : OPEN_PARENS $$116 opt_doc_parameters CLOSE_PARENS", //t "opt_doc_parameters :", //t "opt_doc_parameters : doc_parameters", //t "doc_parameters : doc_parameter", @@ -1399,20 +1391,20 @@ namespace Mono.CSharp yyVal = yyV > yyTop ? null : yyVals[yyV]; // yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]); switch (yyN) { case 1: -#line 396 "cs-parser.jay" +#line 400 "cs-parser.jay" { Lexer.check_incorrect_doc_comment (); } break; case 2: -#line 397 "cs-parser.jay" +#line 401 "cs-parser.jay" { Lexer.CompleteOnEOF = false; } break; case 6: case_6(); break; case 7: -#line 414 "cs-parser.jay" +#line 418 "cs-parser.jay" { module.AddAttributes ((Attributes) yyVals[0+yyTop], current_namespace); } @@ -1424,7 +1416,7 @@ case 13: case_13(); break; case 14: -#line 452 "cs-parser.jay" +#line 456 "cs-parser.jay" { syntax_error (GetLocation (yyVals[-1+yyTop]), "`alias' expected"); /* TODO: better*/ } @@ -1469,7 +1461,7 @@ case 41: case_41(); break; case 42: -#line 641 "cs-parser.jay" +#line 645 "cs-parser.jay" { current_namespace.DeclarationFound = true; } @@ -1499,18 +1491,18 @@ case 57: case_57(); break; case 58: -#line 737 "cs-parser.jay" - { yyVal = "event"; } +#line 754 "cs-parser.jay" + { yyVal = "event"; savedCloseLocation = GetLocation (yyVals[0+yyTop]); } break; case 59: -#line 738 "cs-parser.jay" - { yyVal = "return"; } +#line 755 "cs-parser.jay" + { yyVal = "return"; savedCloseLocation = GetLocation (yyVals[0+yyTop]); } break; case 60: case_60(); break; case 61: -#line 755 "cs-parser.jay" +#line 772 "cs-parser.jay" { yyVal = new List (4) { (Attribute) yyVals[0+yyTop] }; } @@ -1519,7 +1511,7 @@ case 62: case_62(); break; case 63: -#line 770 "cs-parser.jay" +#line 787 "cs-parser.jay" { ++lexer.parsing_block; } @@ -1528,14 +1520,14 @@ case 64: case_64(); break; case 66: -#line 794 "cs-parser.jay" +#line 814 "cs-parser.jay" { yyVal = null; } break; case 67: case_67(); break; case 68: -#line 805 "cs-parser.jay" +#line 825 "cs-parser.jay" { yyVal = null; } break; case 69: @@ -1551,13 +1543,13 @@ case 72: case_72(); break; case 73: -#line 849 "cs-parser.jay" +#line 869 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; case 75: -#line 857 "cs-parser.jay" +#line 877 "cs-parser.jay" { ++lexer.parsing_block; } @@ -1569,26 +1561,38 @@ case 77: case_77(); break; case 78: -#line 882 "cs-parser.jay" +#line 903 "cs-parser.jay" { yyVal = null; } break; case 79: -#line 886 "cs-parser.jay" +#line 907 "cs-parser.jay" { yyVal = Argument.AType.Ref; } break; case 80: -#line 890 "cs-parser.jay" +#line 911 "cs-parser.jay" { yyVal = Argument.AType.Out; } break; +case 83: +#line 923 "cs-parser.jay" + { + lexer.parsing_modifiers = true; + } + break; +case 84: +#line 927 "cs-parser.jay" + { + lexer.parsing_modifiers = true; + } + break; case 95: case_95(); break; case 96: -#line 931 "cs-parser.jay" +#line 957 "cs-parser.jay" { lexer.ConstraintsParsing = true; } @@ -1606,69 +1610,114 @@ case 100: case_100(); break; case 101: -#line 963 "cs-parser.jay" + case_101(); + break; +case 102: +#line 998 "cs-parser.jay" { Error_SyntaxError (yyToken); } break; -case 102: - case_102(); - break; case 103: -#line 975 "cs-parser.jay" + case_103(); + break; +case 104: + case_104(); + break; +case 107: +#line 1039 "cs-parser.jay" { - lbag.AppendToMember (current_class, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); + current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; -case 118: - case_118(); +case 108: +#line 1043 "cs-parser.jay" + { + current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); + } break; -case 119: - case_119(); +case 109: + case_109(); break; -case 122: -#line 1044 "cs-parser.jay" +case 110: +#line 1059 "cs-parser.jay" { - current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); + ++lexer.parsing_block; } break; -case 123: -#line 1048 "cs-parser.jay" +case 111: + case_111(); + break; +case 112: + case_112(); + break; +case 115: + case_115(); + break; +case 116: + case_116(); + break; +case 117: + case_117(); + break; +case 118: + case_118(); + break; +case 119: +#line 1138 "cs-parser.jay" { - current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); + report.Error (1641, GetLocation (yyVals[-1+yyTop]), "A fixed size buffer field must have the array size specifier after the field name"); } break; -case 124: - case_124(); +case 121: + case_121(); + break; +case 122: + case_122(); break; case 125: -#line 1064 "cs-parser.jay" +#line 1168 "cs-parser.jay" { - ++lexer.parsing_block; + current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 126: - case_126(); +#line 1172 "cs-parser.jay" + { + current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); + } break; case 127: case_127(); break; -case 130: - case_130(); +case 128: +#line 1185 "cs-parser.jay" + { + ++lexer.parsing_block; + } break; -case 131: - case_131(); +case 129: + case_129(); break; case 132: - case_132(); +#line 1204 "cs-parser.jay" + { + current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); + } break; case 133: - case_133(); +#line 1208 "cs-parser.jay" + { + current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); + } break; case 134: -#line 1143 "cs-parser.jay" + case_134(); + break; +case 135: +#line 1224 "cs-parser.jay" { - report.Error (1641, GetLocation (yyVals[-1+yyTop]), "A fixed size buffer field must have the array size specifier after the field name"); + ++lexer.parsing_block; } break; case 136: @@ -1678,55 +1727,57 @@ case 137: case_137(); break; case 140: -#line 1173 "cs-parser.jay" - { - current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); - } + case_140(); break; case 141: -#line 1177 "cs-parser.jay" - { - current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); - } + case_141(); break; case 142: case_142(); break; case 143: -#line 1190 "cs-parser.jay" +#line 1295 "cs-parser.jay" { - ++lexer.parsing_block; + valid_param_mod = ParameterModifierType.All; } break; case 144: - case_144(); +#line 1299 "cs-parser.jay" + { + lexer.ConstraintsParsing = true; + } break; -case 147: -#line 1209 "cs-parser.jay" +case 145: + case_145(); + break; +case 146: +#line 1339 "cs-parser.jay" { - current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); + lexer.parsing_generic_declaration = true; } break; +case 147: + case_147(); + break; case 148: -#line 1213 "cs-parser.jay" +#line 1349 "cs-parser.jay" { - current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); + lexer.ConstraintsParsing = true; } break; case 149: case_149(); break; case 150: -#line 1229 "cs-parser.jay" - { - ++lexer.parsing_block; - } - break; -case 151: - case_151(); + case_150(); break; case 152: - case_152(); +#line 1423 "cs-parser.jay" + { savedLocation = GetLocation (yyVals[0+yyTop]); yyVal = null; } + break; +case 153: +#line 1427 "cs-parser.jay" + { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } break; case 155: case_155(); @@ -1738,33 +1789,27 @@ case 157: case_157(); break; case 158: -#line 1296 "cs-parser.jay" - { - valid_param_mod = ParameterModifierType.All; - } + case_158(); break; case 159: -#line 1300 "cs-parser.jay" - { - lexer.ConstraintsParsing = true; - } + case_159(); break; case 160: case_160(); break; case 161: -#line 1340 "cs-parser.jay" - { - lexer.parsing_generic_declaration = true; - } + case_161(); break; case 162: - case_162(); +#line 1499 "cs-parser.jay" + { + yyVal = new ParametersCompiled (new Parameter[] { (Parameter) yyVals[0+yyTop] } ); + } break; case 163: -#line 1350 "cs-parser.jay" +#line 1503 "cs-parser.jay" { - lexer.ConstraintsParsing = true; + yyVal = new ParametersCompiled (new Parameter [] { new ArglistParameter (GetLocation (yyVals[0+yyTop])) }, true); } break; case 164: @@ -1773,28 +1818,36 @@ case 164: case 165: case_165(); break; +case 166: + case_166(); + break; case 167: -#line 1424 "cs-parser.jay" - { yyVal = null; } + case_167(); break; case 168: -#line 1428 "cs-parser.jay" - { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } + case_168(); + break; +case 169: + case_169(); break; case 170: - case_170(); +#line 1578 "cs-parser.jay" + { + ++lexer.parsing_block; + } break; case 171: case_171(); break; case 172: - case_172(); - break; -case 173: - case_173(); +#line 1619 "cs-parser.jay" + { yyVal = Parameter.Modifier.NONE; } break; case 174: - case_174(); +#line 1627 "cs-parser.jay" + { + yyVal = yyVals[0+yyTop]; + } break; case 175: case_175(); @@ -1803,16 +1856,10 @@ case 176: case_176(); break; case 177: -#line 1487 "cs-parser.jay" - { - yyVal = new ParametersCompiled (new Parameter[] { (Parameter) yyVals[0+yyTop] } ); - } + case_177(); break; case 178: -#line 1491 "cs-parser.jay" - { - yyVal = new ParametersCompiled (new Parameter [] { new ArglistParameter (GetLocation (yyVals[0+yyTop])) }, true); - } + case_178(); break; case 179: case_179(); @@ -1830,56 +1877,49 @@ case 183: case_183(); break; case 184: - case_184(); - break; -case 185: -#line 1566 "cs-parser.jay" +#line 1720 "cs-parser.jay" { - ++lexer.parsing_block; + Error_DuplicateParameterModifier (GetLocation (yyVals[-1+yyTop]), Parameter.Modifier.PARAMS); } break; +case 185: + case_185(); + break; case 186: case_186(); break; case 187: -#line 1607 "cs-parser.jay" - { yyVal = Parameter.Modifier.NONE; } + case_187(); + break; +case 188: + case_188(); break; case 189: case_189(); break; case 190: - case_190(); +#line 1774 "cs-parser.jay" + { + valid_param_mod = ParameterModifierType.Params | ParameterModifierType.DefaultValue; + } break; case 191: case_191(); break; case 192: - case_192(); +#line 1803 "cs-parser.jay" + { + lexer.PropertyParsing = false; + } break; case 193: case_193(); break; -case 194: - case_194(); - break; -case 195: - case_195(); - break; -case 196: - case_196(); - break; -case 197: - case_197(); - break; case 198: case_198(); break; case 199: -#line 1705 "cs-parser.jay" - { - Error_DuplicateParameterModifier (GetLocation (yyVals[-1+yyTop]), Parameter.Modifier.PARAMS); - } + case_199(); break; case 200: case_200(); @@ -1890,232 +1930,248 @@ case 201: case 202: case_202(); break; -case 203: - case_203(); - break; case 204: case_204(); break; case 205: -#line 1759 "cs-parser.jay" - { - valid_param_mod = ParameterModifierType.Params | ParameterModifierType.DefaultValue; - } + case_205(); break; case 206: - case_206(); - break; -case 207: -#line 1788 "cs-parser.jay" +#line 1952 "cs-parser.jay" { - lexer.PropertyParsing = false; + lexer.ConstraintsParsing = true; } break; +case 207: + case_207(); + break; case 208: case_208(); break; -case 213: - case_213(); - break; -case 214: - case_214(); - break; -case 215: - case_215(); - break; -case 216: - case_216(); - break; -case 217: - case_217(); - break; -case 219: - case_219(); +case 209: + case_209(); break; -case 220: - case_220(); +case 210: + case_210(); break; -case 221: -#line 1933 "cs-parser.jay" +case 211: +#line 1989 "cs-parser.jay" { - lexer.ConstraintsParsing = true; + Error_SyntaxError (yyToken); } break; -case 222: - case_222(); - break; -case 223: - case_223(); - break; -case 224: - case_224(); - break; -case 225: - case_225(); +case 214: +#line 2001 "cs-parser.jay" + { + lexer.parsing_modifiers = true; + } break; -case 226: -#line 1966 "cs-parser.jay" +case 215: +#line 2005 "cs-parser.jay" { - Error_SyntaxError (yyToken); + lexer.parsing_modifiers = true; } break; -case 231: -#line 1983 "cs-parser.jay" +case 216: +#line 2012 "cs-parser.jay" { report.Error (525, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain fields or constants"); } break; -case 232: -#line 1987 "cs-parser.jay" +case 217: +#line 2016 "cs-parser.jay" { report.Error (525, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain fields or constants"); } break; -case 237: -#line 1995 "cs-parser.jay" +case 222: +#line 2024 "cs-parser.jay" { report.Error (567, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain operators"); } break; -case 238: -#line 1999 "cs-parser.jay" +case 223: +#line 2028 "cs-parser.jay" { report.Error (526, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain contructors"); } break; -case 239: -#line 2003 "cs-parser.jay" +case 224: +#line 2032 "cs-parser.jay" { report.Error (524, GetLocation (yyVals[0+yyTop]), "Interfaces cannot declare classes, structs, interfaces, delegates, or enumerations"); } break; -case 240: -#line 2009 "cs-parser.jay" +case 225: +#line 2038 "cs-parser.jay" { } break; -case 241: - case_241(); +case 226: + case_226(); break; -case 243: -#line 2039 "cs-parser.jay" - { yyVal = null; } +case 228: +#line 2071 "cs-parser.jay" + { savedLocation = GetLocation (yyVals[0+yyTop]); yyVal = null; } break; -case 245: - case_245(); +case 230: + case_230(); break; -case 246: -#line 2055 "cs-parser.jay" +case 231: +#line 2087 "cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } break; -case 247: - case_247(); +case 232: + case_232(); + break; +case 234: +#line 2133 "cs-parser.jay" + { yyVal = Operator.OpType.LogicalNot; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } + break; +case 235: +#line 2134 "cs-parser.jay" + { yyVal = Operator.OpType.OnesComplement; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } + break; +case 236: +#line 2135 "cs-parser.jay" + { yyVal = Operator.OpType.Increment; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } + break; +case 237: +#line 2136 "cs-parser.jay" + { yyVal = Operator.OpType.Decrement; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } + break; +case 238: +#line 2137 "cs-parser.jay" + { yyVal = Operator.OpType.True; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } + break; +case 239: +#line 2138 "cs-parser.jay" + { yyVal = Operator.OpType.False; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } + break; +case 240: +#line 2140 "cs-parser.jay" + { yyVal = Operator.OpType.Addition; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } + break; +case 241: +#line 2141 "cs-parser.jay" + { yyVal = Operator.OpType.Subtraction; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } + break; +case 242: +#line 2143 "cs-parser.jay" + { yyVal = Operator.OpType.Multiply; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } + break; +case 243: +#line 2144 "cs-parser.jay" + { yyVal = Operator.OpType.Division; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } + break; +case 244: +#line 2145 "cs-parser.jay" + { yyVal = Operator.OpType.Modulus; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } + break; +case 245: +#line 2146 "cs-parser.jay" + { yyVal = Operator.OpType.BitwiseAnd; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } + break; +case 246: +#line 2147 "cs-parser.jay" + { yyVal = Operator.OpType.BitwiseOr; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } + break; +case 247: +#line 2148 "cs-parser.jay" + { yyVal = Operator.OpType.ExclusiveOr; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } + break; +case 248: +#line 2149 "cs-parser.jay" + { yyVal = Operator.OpType.LeftShift; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 249: -#line 2101 "cs-parser.jay" - { yyVal = Operator.OpType.LogicalNot; } +#line 2150 "cs-parser.jay" + { yyVal = Operator.OpType.RightShift; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 250: -#line 2102 "cs-parser.jay" - { yyVal = Operator.OpType.OnesComplement; } +#line 2151 "cs-parser.jay" + { yyVal = Operator.OpType.Equality; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 251: -#line 2103 "cs-parser.jay" - { yyVal = Operator.OpType.Increment; } +#line 2152 "cs-parser.jay" + { yyVal = Operator.OpType.Inequality; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 252: -#line 2104 "cs-parser.jay" - { yyVal = Operator.OpType.Decrement; } +#line 2153 "cs-parser.jay" + { yyVal = Operator.OpType.GreaterThan; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 253: -#line 2105 "cs-parser.jay" - { yyVal = Operator.OpType.True; } +#line 2154 "cs-parser.jay" + { yyVal = Operator.OpType.LessThan; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 254: -#line 2106 "cs-parser.jay" - { yyVal = Operator.OpType.False; } +#line 2155 "cs-parser.jay" + { yyVal = Operator.OpType.GreaterThanOrEqual; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 255: -#line 2108 "cs-parser.jay" - { yyVal = Operator.OpType.Addition; } +#line 2156 "cs-parser.jay" + { yyVal = Operator.OpType.LessThanOrEqual; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 256: -#line 2109 "cs-parser.jay" - { yyVal = Operator.OpType.Subtraction; } +#line 2163 "cs-parser.jay" + { + valid_param_mod = ParameterModifierType.DefaultValue; + } break; case 257: -#line 2111 "cs-parser.jay" - { yyVal = Operator.OpType.Multiply; } + case_257(); break; case 258: -#line 2112 "cs-parser.jay" - { yyVal = Operator.OpType.Division; } +#line 2182 "cs-parser.jay" + { + valid_param_mod = ParameterModifierType.DefaultValue; + } break; case 259: -#line 2113 "cs-parser.jay" - { yyVal = Operator.OpType.Modulus; } + case_259(); break; case 260: -#line 2114 "cs-parser.jay" - { yyVal = Operator.OpType.BitwiseAnd; } + case_260(); break; case 261: -#line 2115 "cs-parser.jay" - { yyVal = Operator.OpType.BitwiseOr; } + case_261(); break; case 262: -#line 2116 "cs-parser.jay" - { yyVal = Operator.OpType.ExclusiveOr; } + case_262(); break; case 263: -#line 2117 "cs-parser.jay" - { yyVal = Operator.OpType.LeftShift; } + case_263(); break; case 264: -#line 2118 "cs-parser.jay" - { yyVal = Operator.OpType.RightShift; } + case_264(); break; case 265: -#line 2119 "cs-parser.jay" - { yyVal = Operator.OpType.Equality; } - break; -case 266: -#line 2120 "cs-parser.jay" - { yyVal = Operator.OpType.Inequality; } + case_265(); break; case 267: -#line 2121 "cs-parser.jay" - { yyVal = Operator.OpType.GreaterThan; } - break; -case 268: -#line 2122 "cs-parser.jay" - { yyVal = Operator.OpType.LessThan; } - break; -case 269: -#line 2123 "cs-parser.jay" - { yyVal = Operator.OpType.GreaterThanOrEqual; } +#line 2285 "cs-parser.jay" + { current_block = null; yyVal = null; } break; case 270: -#line 2124 "cs-parser.jay" - { yyVal = Operator.OpType.LessThanOrEqual; } - break; -case 271: -#line 2131 "cs-parser.jay" +#line 2297 "cs-parser.jay" { - valid_param_mod = ParameterModifierType.DefaultValue; + ++lexer.parsing_block; } break; -case 272: - case_272(); +case 271: + case_271(); break; -case 273: -#line 2150 "cs-parser.jay" +case 272: +#line 2307 "cs-parser.jay" { - valid_param_mod = ParameterModifierType.DefaultValue; + ++lexer.parsing_block; } break; +case 273: + case_273(); + break; case 274: case_274(); break; @@ -2137,33 +2193,38 @@ case 279: case 280: case_280(); break; -case 282: -#line 2253 "cs-parser.jay" - { current_block = null; yyVal = null; } +case 281: + case_281(); break; -case 285: -#line 2265 "cs-parser.jay" +case 283: +#line 2416 "cs-parser.jay" { - ++lexer.parsing_block; + ++lexer.parsing_block; } break; -case 286: - case_286(); +case 284: + case_284(); break; case 287: -#line 2275 "cs-parser.jay" +#line 2433 "cs-parser.jay" { - ++lexer.parsing_block; + current_event_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 288: - case_288(); +#line 2437 "cs-parser.jay" + { + current_event_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); + } break; case 289: case_289(); break; case 290: - case_290(); +#line 2450 "cs-parser.jay" + { + ++lexer.parsing_block; + } break; case 291: case_291(); @@ -2172,45 +2233,39 @@ case 292: case_292(); break; case 293: - case_293(); - break; -case 294: - case_294(); - break; -case 295: - case_295(); +#line 2475 "cs-parser.jay" + { + yyVal = yyVals[0+yyTop]; + } break; case 296: case_296(); break; +case 297: + case_297(); + break; case 298: -#line 2384 "cs-parser.jay" - { - ++lexer.parsing_block; - } + case_298(); break; case 299: case_299(); break; +case 300: + case_300(); + break; +case 301: + case_301(); + break; case 302: -#line 2401 "cs-parser.jay" - { - current_event_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); - } + case_302(); break; case 303: -#line 2405 "cs-parser.jay" - { - current_event_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); - } - break; -case 304: - case_304(); + case_303(); break; case 305: -#line 2418 "cs-parser.jay" +#line 2569 "cs-parser.jay" { - ++lexer.parsing_block; + enumCommas.Add (GetLocation (yyVals[0+yyTop])); } break; case 306: @@ -2220,10 +2275,10 @@ case 307: case_307(); break; case 308: -#line 2443 "cs-parser.jay" - { - yyVal = yyVals[0+yyTop]; - } + case_308(); + break; +case 309: + case_309(); break; case 311: case_311(); @@ -2231,17 +2286,11 @@ case 311: case 312: case_312(); break; -case 313: - case_313(); - break; -case 314: - case_314(); - break; case 315: - case_315(); - break; -case 316: - case_316(); +#line 2637 "cs-parser.jay" + { + enumCommas.Add (GetLocation (yyVals[0+yyTop])); + } break; case 317: case_317(); @@ -2249,36 +2298,42 @@ case 317: case 318: case_318(); break; +case 319: + case_319(); + break; case 320: case_320(); break; case 321: - case_321(); +#line 2695 "cs-parser.jay" + { + valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out | ParameterModifierType.Params | ParameterModifierType.DefaultValue; + } break; case 322: case_322(); break; case 323: - case_323(); +#line 2717 "cs-parser.jay" + { + lexer.ConstraintsParsing = false; + } break; -case 325: - case_325(); +case 324: + case_324(); break; case 326: case_326(); break; -case 329: -#line 2598 "cs-parser.jay" - { - lbag.AddLocation (yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); - } +case 328: + case_328(); + break; +case 330: + case_330(); break; case 331: case_331(); break; -case 332: - case_332(); - break; case 333: case_333(); break; @@ -2286,37 +2341,40 @@ case 334: case_334(); break; case 335: -#line 2656 "cs-parser.jay" - { - valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out | ParameterModifierType.Params | ParameterModifierType.DefaultValue; - } + case_335(); break; case 336: case_336(); break; case 337: -#line 2678 "cs-parser.jay" +#line 2822 "cs-parser.jay" { - lexer.ConstraintsParsing = false; + lexer.parsing_generic_declaration = true; } break; case 338: case_338(); break; -case 340: - case_340(); +case 339: + case_339(); + break; +case 341: + case_341(); break; case 342: case_342(); break; +case 343: + case_343(); + break; case 344: case_344(); break; case 345: case_345(); break; -case 347: - case_347(); +case 346: + case_346(); break; case 348: case_348(); @@ -2328,202 +2386,213 @@ case 350: case_350(); break; case 351: -#line 2782 "cs-parser.jay" - { - lexer.parsing_generic_declaration = true; - } + case_351(); break; case 352: case_352(); break; -case 353: - case_353(); - break; -case 355: - case_355(); - break; -case 356: - case_356(); - break; -case 357: - case_357(); - break; -case 358: - case_358(); - break; -case 359: - case_359(); - break; -case 360: - case_360(); - break; -case 362: - case_362(); - break; -case 363: - case_363(); - break; -case 364: - case_364(); - break; -case 365: - case_365(); - break; -case 366: - case_366(); - break; -case 368: -#line 2900 "cs-parser.jay" +case 354: +#line 2943 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } break; -case 369: -#line 2907 "cs-parser.jay" +case 355: +#line 2950 "cs-parser.jay" { lexer.parsing_generic_declaration = true; } break; -case 371: - case_371(); +case 357: + case_357(); break; -case 373: - case_373(); +case 359: + case_359(); break; -case 375: - case_375(); +case 361: + case_361(); break; -case 377: -#line 2945 "cs-parser.jay" +case 363: +#line 2988 "cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; -case 378: - case_378(); +case 364: + case_364(); break; -case 379: -#line 2965 "cs-parser.jay" +case 365: +#line 3008 "cs-parser.jay" { yyVal = new ComposedCast (((MemberName) yyVals[-1+yyTop]).GetTypeExpression (), (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; -case 380: - case_380(); +case 366: + case_366(); break; -case 381: -#line 2974 "cs-parser.jay" +case 367: +#line 3017 "cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; -case 382: -#line 2978 "cs-parser.jay" +case 368: +#line 3021 "cs-parser.jay" { yyVal = new ComposedCast (new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-1+yyTop])), (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; -case 383: - case_383(); +case 369: + case_369(); break; -case 384: - case_384(); +case 370: + case_370(); break; -case 385: - case_385(); +case 371: + case_371(); break; -case 386: - case_386(); +case 372: + case_372(); break; -case 387: -#line 3017 "cs-parser.jay" +case 373: +#line 3060 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Object, GetLocation (yyVals[0+yyTop])); } break; -case 388: -#line 3018 "cs-parser.jay" +case 374: +#line 3061 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.String, GetLocation (yyVals[0+yyTop])); } break; -case 389: -#line 3019 "cs-parser.jay" +case 375: +#line 3062 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Bool, GetLocation (yyVals[0+yyTop])); } break; -case 390: -#line 3020 "cs-parser.jay" +case 376: +#line 3063 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Decimal, GetLocation (yyVals[0+yyTop])); } break; -case 391: -#line 3021 "cs-parser.jay" +case 377: +#line 3064 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Float, GetLocation (yyVals[0+yyTop])); } break; -case 392: -#line 3022 "cs-parser.jay" +case 378: +#line 3065 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Double, GetLocation (yyVals[0+yyTop])); } break; -case 394: -#line 3027 "cs-parser.jay" +case 380: +#line 3070 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.SByte, GetLocation (yyVals[0+yyTop])); } break; -case 395: -#line 3028 "cs-parser.jay" +case 381: +#line 3071 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Byte, GetLocation (yyVals[0+yyTop])); } break; -case 396: -#line 3029 "cs-parser.jay" +case 382: +#line 3072 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Short, GetLocation (yyVals[0+yyTop])); } break; -case 397: -#line 3030 "cs-parser.jay" +case 383: +#line 3073 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.UShort, GetLocation (yyVals[0+yyTop])); } break; -case 398: -#line 3031 "cs-parser.jay" +case 384: +#line 3074 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Int, GetLocation (yyVals[0+yyTop])); } break; -case 399: -#line 3032 "cs-parser.jay" +case 385: +#line 3075 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.UInt, GetLocation (yyVals[0+yyTop])); } break; -case 400: -#line 3033 "cs-parser.jay" +case 386: +#line 3076 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Long, GetLocation (yyVals[0+yyTop])); } break; -case 401: -#line 3034 "cs-parser.jay" +case 387: +#line 3077 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.ULong, GetLocation (yyVals[0+yyTop])); } break; -case 402: -#line 3035 "cs-parser.jay" +case 388: +#line 3078 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Char, GetLocation (yyVals[0+yyTop])); } break; +case 409: + case_409(); + break; +case 410: + case_410(); + break; +case 414: +#line 3125 "cs-parser.jay" + { yyVal = new NullLiteral (GetLocation (yyVals[0+yyTop])); } + break; +case 415: +#line 3129 "cs-parser.jay" + { yyVal = new BoolLiteral (compiler.BuiltinTypes, true, GetLocation (yyVals[0+yyTop])); } + break; +case 416: +#line 3130 "cs-parser.jay" + { yyVal = new BoolLiteral (compiler.BuiltinTypes, false, GetLocation (yyVals[0+yyTop])); } + break; +case 421: + case_421(); + break; +case 422: +#line 3163 "cs-parser.jay" + { + yyVal = new ParenthesizedExpression ((Expression) yyVals[-1+yyTop]); + } + break; case 423: case_423(); break; case 424: case_424(); break; +case 425: + case_425(); + break; +case 426: + case_426(); + break; +case 427: +#line 3198 "cs-parser.jay" + { + yyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null,GetLocation (yyVals[0+yyTop])); + } + break; case 428: -#line 3082 "cs-parser.jay" - { yyVal = new NullLiteral (GetLocation (yyVals[0+yyTop])); } + case_428(); break; case 429: -#line 3086 "cs-parser.jay" - { yyVal = new BoolLiteral (compiler.BuiltinTypes, true, GetLocation (yyVals[0+yyTop])); } +#line 3206 "cs-parser.jay" + { + yyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null, lexer.Location); + } break; case 430: -#line 3087 "cs-parser.jay" - { yyVal = new BoolLiteral (compiler.BuiltinTypes, false, GetLocation (yyVals[0+yyTop])); } + case_430(); + break; +case 431: + case_431(); + break; +case 432: +#line 3222 "cs-parser.jay" + { yyVal = null; } + break; +case 434: + case_434(); break; case 435: case_435(); break; case 436: -#line 3120 "cs-parser.jay" - { - yyVal = new ParenthesizedExpression ((Expression) yyVals[-1+yyTop]); - } +#line 3245 "cs-parser.jay" + { yyVal = null; } break; case 437: - case_437(); +#line 3249 "cs-parser.jay" + { + yyVal = yyVals[0+yyTop]; + } break; case 438: case_438(); @@ -2535,45 +2604,32 @@ case 440: case_440(); break; case 441: -#line 3152 "cs-parser.jay" - { - yyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null,GetLocation (yyVals[0+yyTop])); - } + case_441(); break; case 442: - case_442(); - break; -case 443: -#line 3160 "cs-parser.jay" +#line 3282 "cs-parser.jay" { - yyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null, lexer.Location); + yyVal = new CompletionElementInitializer (null, GetLocation (yyVals[0+yyTop])); } break; +case 443: + case_443(); + break; case 444: case_444(); break; case 445: case_445(); break; -case 446: -#line 3176 "cs-parser.jay" - { yyVal = null; } - break; case 448: - case_448(); - break; -case 449: - case_449(); +#line 3310 "cs-parser.jay" + { yyVal = null; } break; case 450: -#line 3199 "cs-parser.jay" - { yyVal = null; } + case_450(); break; case 451: -#line 3203 "cs-parser.jay" - { - yyVal = yyVals[0+yyTop]; - } + case_451(); break; case 452: case_452(); @@ -2585,26 +2641,22 @@ case 454: case_454(); break; case 455: - case_455(); - break; -case 456: -#line 3236 "cs-parser.jay" +#line 3362 "cs-parser.jay" { - yyVal = new CompletionElementInitializer (null, GetLocation (yyVals[0+yyTop])); + yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; -case 457: - case_457(); - break; -case 458: - case_458(); - break; case 459: case_459(); break; +case 460: + case_460(); + break; +case 461: + case_461(); + break; case 462: -#line 3264 "cs-parser.jay" - { yyVal = null; } + case_462(); break; case 464: case_464(); @@ -2622,9 +2674,18 @@ case 468: case_468(); break; case 469: -#line 3316 "cs-parser.jay" + case_469(); + break; +case 470: +#line 3449 "cs-parser.jay" { - yyVal = new Argument ((Expression) yyVals[0+yyTop]); + yyVal = new Argument ((Expression) yyVals[0+yyTop]); + } + break; +case 472: +#line 3457 "cs-parser.jay" + { + yyVal = new This (GetLocation (yyVals[0+yyTop])); } break; case 473: @@ -2634,10 +2695,19 @@ case 474: case_474(); break; case 475: - case_475(); +#line 3477 "cs-parser.jay" + { + yyVal = new UnaryMutator (UnaryMutator.Mode.PostIncrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); + } break; case 476: - case_476(); +#line 3484 "cs-parser.jay" + { + yyVal = new UnaryMutator (UnaryMutator.Mode.PostDecrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); + } + break; +case 477: + case_477(); break; case 478: case_478(); @@ -2658,34 +2728,20 @@ case 483: case_483(); break; case 484: -#line 3403 "cs-parser.jay" +#line 3550 "cs-parser.jay" { - yyVal = new Argument ((Expression) yyVals[0+yyTop]); - } - break; -case 486: -#line 3411 "cs-parser.jay" - { - yyVal = new This (GetLocation (yyVals[0+yyTop])); + ++lexer.parsing_type; } break; -case 487: - case_487(); +case 485: + case_485(); break; -case 488: - case_488(); +case 486: + case_486(); break; case 489: -#line 3431 "cs-parser.jay" - { - yyVal = new UnaryMutator (UnaryMutator.Mode.PostIncrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); - } - break; -case 490: -#line 3438 "cs-parser.jay" - { - yyVal = new UnaryMutator (UnaryMutator.Mode.PostDecrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); - } +#line 3577 "cs-parser.jay" + { yyVal = null; } break; case 491: case_491(); @@ -2705,30 +2761,38 @@ case 495: case 496: case_496(); break; -case 497: - case_497(); - break; -case 498: -#line 3504 "cs-parser.jay" - { - ++lexer.parsing_type; - } - break; -case 499: - case_499(); - break; case 500: case_500(); break; +case 501: + case_501(); + break; +case 502: + case_502(); + break; case 503: -#line 3531 "cs-parser.jay" - { yyVal = null; } +#line 3655 "cs-parser.jay" + { + yyVal = 2; + } + break; +case 504: +#line 3659 "cs-parser.jay" + { + yyVal = ((int) yyVals[-1+yyTop]) + 1; + } break; case 505: - case_505(); +#line 3666 "cs-parser.jay" + { + yyVal = null; + } break; case 506: - case_506(); +#line 3670 "cs-parser.jay" + { + yyVal = yyVals[0+yyTop]; + } break; case 507: case_507(); @@ -2742,8 +2806,14 @@ case 509: case 510: case_510(); break; -case 514: - case_514(); +case 511: +#line 3714 "cs-parser.jay" + { + lexer.TypeOfParsing = true; + } + break; +case 512: + case_512(); break; case 515: case_515(); @@ -2752,28 +2822,16 @@ case 516: case_516(); break; case 517: -#line 3609 "cs-parser.jay" - { - yyVal = 2; - } + case_517(); break; case 518: -#line 3613 "cs-parser.jay" - { - yyVal = ((int) yyVals[-1+yyTop]) + 1; - } + case_518(); break; case 519: -#line 3620 "cs-parser.jay" - { - yyVal = null; - } + case_519(); break; case 520: -#line 3624 "cs-parser.jay" - { - yyVal = yyVals[0+yyTop]; - } + case_520(); break; case 521: case_521(); @@ -2788,28 +2846,43 @@ case 524: case_524(); break; case 525: -#line 3668 "cs-parser.jay" - { - lexer.TypeOfParsing = true; - } + case_525(); break; case 526: case_526(); break; +case 527: +#line 3834 "cs-parser.jay" + { + start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], false, GetLocation (yyVals[-1+yyTop])); + } + break; +case 528: + case_528(); + break; case 529: - case_529(); +#line 3847 "cs-parser.jay" + { + start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], true, GetLocation (yyVals[-2+yyTop])); + } break; case 530: - case_530(); +#line 3851 "cs-parser.jay" + { + yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); + } break; case 531: - case_531(); - break; -case 532: - case_532(); +#line 3858 "cs-parser.jay" + { + yyVal = ParametersCompiled.Undefined; + } break; case 533: - case_533(); +#line 3866 "cs-parser.jay" + { + valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; + } break; case 534: case_534(); @@ -2817,113 +2890,101 @@ case 534: case 535: case_535(); break; -case 536: - case_536(); - break; case 537: - case_537(); +#line 3892 "cs-parser.jay" + { + yyVal = new Unary (Unary.Operator.LogicalNot, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + } break; case 538: - case_538(); - break; -case 539: - case_539(); - break; -case 540: - case_540(); - break; -case 541: -#line 3782 "cs-parser.jay" +#line 3896 "cs-parser.jay" { - start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], false, GetLocation (yyVals[-1+yyTop])); + yyVal = new Unary (Unary.Operator.OnesComplement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; +case 541: + case_541(); + break; case 542: case_542(); break; -case 543: -#line 3795 "cs-parser.jay" - { - start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], true, GetLocation (yyVals[-2+yyTop])); - } - break; case 544: -#line 3799 "cs-parser.jay" - { - yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); +#line 3926 "cs-parser.jay" + { + yyVal = new Unary (Unary.Operator.UnaryPlus, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 545: -#line 3806 "cs-parser.jay" +#line 3930 "cs-parser.jay" + { + yyVal = new Unary (Unary.Operator.UnaryNegation, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + } + break; +case 546: +#line 3934 "cs-parser.jay" { - yyVal = ParametersCompiled.Undefined; + yyVal = new UnaryMutator (UnaryMutator.Mode.PreIncrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 547: -#line 3814 "cs-parser.jay" +#line 3938 "cs-parser.jay" { - valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; + yyVal = new UnaryMutator (UnaryMutator.Mode.PreDecrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 548: - case_548(); +#line 3942 "cs-parser.jay" + { + yyVal = new Indirection ((Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + } break; case 549: - case_549(); - break; -case 551: -#line 3840 "cs-parser.jay" +#line 3946 "cs-parser.jay" { - yyVal = new Unary (Unary.Operator.LogicalNot, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + yyVal = new Unary (Unary.Operator.AddressOf, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; +case 551: + case_551(); + break; case 552: -#line 3844 "cs-parser.jay" - { - yyVal = new Unary (Unary.Operator.OnesComplement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); - } + case_552(); + break; +case 553: + case_553(); break; case 555: case_555(); break; case 556: - case_556(); +#line 3978 "cs-parser.jay" + { + yyVal = new Binary (Binary.Operator.Subtraction, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + } + break; +case 557: + case_557(); break; case 558: -#line 3874 "cs-parser.jay" - { - yyVal = new Unary (Unary.Operator.UnaryPlus, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); +#line 3987 "cs-parser.jay" + { + yyVal = new As ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 559: -#line 3878 "cs-parser.jay" - { - yyVal = new Unary (Unary.Operator.UnaryNegation, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); - } - break; -case 560: -#line 3882 "cs-parser.jay" +#line 3991 "cs-parser.jay" { - yyVal = new UnaryMutator (UnaryMutator.Mode.PreIncrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + yyVal = new Is ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 561: -#line 3886 "cs-parser.jay" - { - yyVal = new UnaryMutator (UnaryMutator.Mode.PreDecrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); - } + case_561(); break; case 562: -#line 3890 "cs-parser.jay" - { - yyVal = new Indirection ((Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); - } + case_562(); break; -case 563: -#line 3894 "cs-parser.jay" - { - yyVal = new Unary (Unary.Operator.AddressOf, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); - } +case 564: + case_564(); break; case 565: case_565(); @@ -2938,28 +2999,13 @@ case 569: case_569(); break; case 570: -#line 3926 "cs-parser.jay" - { - yyVal = new Binary (Binary.Operator.Subtraction, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); - } - break; -case 571: - case_571(); + case_570(); break; case 572: -#line 3935 "cs-parser.jay" - { - yyVal = new As ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); - } - break; -case 573: -#line 3939 "cs-parser.jay" - { - yyVal = new Is ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); - } + case_572(); break; -case 575: - case_575(); +case 574: + case_574(); break; case 576: case_576(); @@ -2967,72 +3013,82 @@ case 576: case 578: case_578(); break; -case 579: - case_579(); - break; case 580: case_580(); break; -case 581: - case_581(); - break; -case 583: - case_583(); +case 582: + case_582(); break; case 584: case_584(); break; +case 585: +#line 4115 "cs-parser.jay" + { + yyVal = new SimpleAssign ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + } + break; case 586: case_586(); break; +case 587: + case_587(); + break; case 588: case_588(); break; +case 589: + case_589(); + break; case 590: case_590(); break; +case 591: + case_591(); + break; case 592: case_592(); break; +case 593: + case_593(); + break; case 594: case_594(); break; +case 595: + case_595(); + break; case 596: case_596(); break; +case 597: + case_597(); + break; case 598: case_598(); break; case 599: -#line 4063 "cs-parser.jay" - { - yyVal = new SimpleAssign ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); - } + case_599(); break; case 600: case_600(); break; case 601: - case_601(); +#line 4212 "cs-parser.jay" + { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } break; case 602: case_602(); break; -case 603: - case_603(); - break; -case 604: - case_604(); - break; case 605: - case_605(); +#line 4228 "cs-parser.jay" + { + start_block (lexer.Location); + } break; case 606: case_606(); break; -case 607: - case_607(); - break; case 608: case_608(); break; @@ -3049,35 +3105,34 @@ case 612: case_612(); break; case 613: - case_613(); +#line 4273 "cs-parser.jay" + { + valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; + } break; case 614: case_614(); break; case 615: -#line 4160 "cs-parser.jay" - { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } + case_615(); break; case 616: - case_616(); - break; -case 619: -#line 4175 "cs-parser.jay" +#line 4287 "cs-parser.jay" { - start_block (lexer.Location); + valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; -case 620: - case_620(); +case 617: + case_617(); break; -case 622: - case_622(); - break; -case 623: - case_623(); +case 618: + case_618(); break; case 624: - case_624(); +#line 4312 "cs-parser.jay" + { + yyVal = new ArglistAccess (GetLocation (yyVals[0+yyTop])); + } break; case 625: case_625(); @@ -3086,21 +3141,18 @@ case 626: case_626(); break; case 627: -#line 4220 "cs-parser.jay" - { - valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; - } - break; -case 628: - case_628(); + case_627(); break; case 629: - case_629(); +#line 4341 "cs-parser.jay" + { + yyVal = new BooleanExpression ((Expression) yyVals[0+yyTop]); + } break; case 630: -#line 4234 "cs-parser.jay" +#line 4354 "cs-parser.jay" { - valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; + lexer.ConstraintsParsing = true; } break; case 631: @@ -3109,32 +3161,43 @@ case 631: case 632: case_632(); break; +case 633: + case_633(); + break; +case 634: + case_634(); + break; +case 635: +#line 4397 "cs-parser.jay" + { yyVal = null; } + break; +case 636: +#line 4399 "cs-parser.jay" + { yyVal = yyVals[0+yyTop]; StoreModifierLocation (Modifiers.PARTIAL, GetLocation (yyVals[0+yyTop])); } + break; +case 637: + case_637(); + break; case 638: -#line 4259 "cs-parser.jay" +#line 4412 "cs-parser.jay" { - yyVal = new ArglistAccess (GetLocation (yyVals[0+yyTop])); + lexer.parsing_modifiers = false; } break; -case 639: - case_639(); - break; case 640: case_640(); break; case 641: case_641(); break; +case 642: + case_642(); + break; case 643: -#line 4288 "cs-parser.jay" - { - yyVal = new BooleanExpression ((Expression) yyVals[0+yyTop]); - } + case_643(); break; case 644: -#line 4301 "cs-parser.jay" - { - lexer.ConstraintsParsing = true; - } + case_644(); break; case 645: case_645(); @@ -3149,33 +3212,34 @@ case 648: case_648(); break; case 649: -#line 4340 "cs-parser.jay" - { yyVal = null; } + case_649(); break; case 650: -#line 4342 "cs-parser.jay" - { yyVal = yyVals[0+yyTop]; StoreModifierLocation (Modifiers.PARTIAL, GetLocation (yyVals[0+yyTop])); } + case_650(); break; case 651: case_651(); break; +case 652: + case_652(); + break; +case 653: + case_653(); + break; case 654: case_654(); break; case 655: case_655(); break; -case 656: - case_656(); - break; case 657: case_657(); break; -case 658: - case_658(); - break; case 659: - case_659(); +#line 4532 "cs-parser.jay" + { + yyVal = yyVals[0+yyTop]; + } break; case 660: case_660(); @@ -3202,28 +3266,40 @@ case 667: case_667(); break; case 668: - case_668(); +#line 4623 "cs-parser.jay" + { + yyVal = new SpecialContraintExpr (SpecialConstraint.Class, GetLocation (yyVals[0+yyTop])); + } break; case 669: - case_669(); - break; -case 671: -#line 4462 "cs-parser.jay" +#line 4627 "cs-parser.jay" { - current_container.AddBasesForPart (current_class, (List) yyVals[0+yyTop]); - } + yyVal = new SpecialContraintExpr (SpecialConstraint.Struct, GetLocation (yyVals[0+yyTop])); + } break; -case 673: -#line 4470 "cs-parser.jay" +case 670: +#line 4634 "cs-parser.jay" { - yyVal = yyVals[0+yyTop]; + yyVal = Variance.None; } break; +case 671: + case_671(); + break; +case 672: + case_672(); + break; +case 673: + case_673(); + break; case 674: case_674(); break; case 675: - case_675(); +#line 4679 "cs-parser.jay" + { + yyVal = yyVals[0+yyTop]; + } break; case 676: case_676(); @@ -3231,107 +3307,89 @@ case 676: case 677: case_677(); break; -case 678: - case_678(); - break; -case 679: - case_679(); - break; -case 680: - case_680(); - break; -case 681: - case_681(); - break; -case 682: -#line 4559 "cs-parser.jay" - { - yyVal = new SpecialContraintExpr (SpecialConstraint.Class, GetLocation (yyVals[0+yyTop])); - } +case 678: + case_678(); break; -case 683: -#line 4563 "cs-parser.jay" - { - yyVal = new SpecialContraintExpr (SpecialConstraint.Struct, GetLocation (yyVals[0+yyTop])); - } +case 679: + case_679(); break; case 684: -#line 4570 "cs-parser.jay" +#line 4723 "cs-parser.jay" { - yyVal = Variance.None; + current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; case 685: - case_685(); - break; -case 686: -#line 4584 "cs-parser.jay" +#line 4727 "cs-parser.jay" { - yyVal = Variance.Covariant; + current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; case 687: -#line 4588 "cs-parser.jay" + case_687(); + break; +case 690: +#line 4751 "cs-parser.jay" { - yyVal = Variance.Contravariant; + current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; -case 688: - case_688(); - break; -case 689: -#line 4613 "cs-parser.jay" +case 691: +#line 4755 "cs-parser.jay" { - yyVal = yyVals[0+yyTop]; + current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; -case 690: - case_690(); +case 720: + case_720(); break; -case 691: - case_691(); +case 721: + case_721(); break; -case 692: - case_692(); +case 722: + case_722(); break; -case 693: - case_693(); +case 723: + case_723(); break; -case 698: -#line 4657 "cs-parser.jay" - { - current_block.AddStatement ((Statement) yyVals[0+yyTop]); - } +case 724: + case_724(); break; -case 699: -#line 4661 "cs-parser.jay" - { - current_block.AddStatement ((Statement) yyVals[0+yyTop]); - } +case 727: + case_727(); break; -case 701: - case_701(); +case 728: + case_728(); break; -case 704: -#line 4685 "cs-parser.jay" +case 729: + case_729(); + break; +case 730: + case_730(); + break; +case 731: +#line 4899 "cs-parser.jay" { - current_block.AddStatement ((Statement) yyVals[0+yyTop]); + yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; -case 705: -#line 4689 "cs-parser.jay" +case 732: +#line 4903 "cs-parser.jay" { - current_block.AddStatement ((Statement) yyVals[0+yyTop]); + yyVal = new ComposedCast (new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-1+yyTop])), (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; -case 734: - case_734(); +case 733: + case_733(); break; case 735: case_735(); break; case 736: - case_736(); +#line 4924 "cs-parser.jay" + { + yyVal = ComposedTypeSpecifier.CreatePointer (GetLocation (yyVals[0+yyTop])); + } break; case 737: case_737(); @@ -3339,8 +3397,11 @@ case 737: case 738: case_738(); break; -case 741: - case_741(); +case 739: + case_739(); + break; +case 740: + case_740(); break; case 742: case_742(); @@ -3348,89 +3409,77 @@ case 742: case 743: case_743(); break; -case 744: - case_744(); - break; -case 745: -#line 4833 "cs-parser.jay" - { - yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); - } - break; -case 746: -#line 4837 "cs-parser.jay" - { - yyVal = new ComposedCast (new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-1+yyTop])), (ComposedTypeSpecifier) yyVals[0+yyTop]); - } - break; case 747: case_747(); break; -case 749: - case_749(); - break; case 750: -#line 4858 "cs-parser.jay" - { - yyVal = ComposedTypeSpecifier.CreatePointer (GetLocation (yyVals[0+yyTop])); - } + case_750(); break; case 751: case_751(); break; case 752: - case_752(); +#line 5024 "cs-parser.jay" + { + report.Error (145, lexer.Location, "A const field requires a value to be provided"); + } break; case 753: case_753(); break; -case 754: - case_754(); +case 758: + case_758(); break; -case 756: - case_756(); +case 760: + case_760(); break; -case 757: - case_757(); +case 761: + case_761(); break; case 762: case_762(); break; case 763: - case_763(); +#line 5074 "cs-parser.jay" + { yyVal = yyVals[-1+yyTop]; } break; case 764: -#line 4947 "cs-parser.jay" - { - report.Error (145, lexer.Location, "A const field requires a value to be provided"); - } +#line 5078 "cs-parser.jay" + { yyVal = yyVals[-1+yyTop]; } break; case 765: - case_765(); +#line 5079 "cs-parser.jay" + { yyVal = yyVals[-1+yyTop]; } break; -case 770: - case_770(); +case 766: + case_766(); + break; +case 767: + case_767(); + break; +case 768: + case_768(); + break; +case 771: + case_771(); break; case 772: case_772(); break; case 773: - case_773(); +#line 5147 "cs-parser.jay" + { + start_block (GetLocation (yyVals[0+yyTop])); + } break; case 774: case_774(); break; case 775: -#line 4997 "cs-parser.jay" - { yyVal = yyVals[-1+yyTop]; } - break; -case 776: -#line 5001 "cs-parser.jay" - { yyVal = yyVals[-1+yyTop]; } + case_775(); break; case 777: -#line 5002 "cs-parser.jay" - { yyVal = yyVals[-1+yyTop]; } + case_777(); break; case 778: case_778(); @@ -3439,7 +3488,19 @@ case 779: case_779(); break; case 780: - case_780(); +#line 5191 "cs-parser.jay" + { + current_block = current_block.CreateSwitchBlock (lexer.Location); + } + break; +case 781: +#line 5195 "cs-parser.jay" + { + yyVal = new SwitchSection ((List) yyVals[-2+yyTop], current_block); + } + break; +case 782: + case_782(); break; case 783: case_783(); @@ -3448,20 +3509,11 @@ case 784: case_784(); break; case 785: -#line 5070 "cs-parser.jay" +#line 5224 "cs-parser.jay" { - start_block (GetLocation (yyVals[0+yyTop])); + yyVal = new SwitchLabel (null, GetLocation (yyVals[0+yyTop])); } break; -case 786: - case_786(); - break; -case 787: - case_787(); - break; -case 789: - case_789(); - break; case 790: case_790(); break; @@ -3469,15 +3521,12 @@ case 791: case_791(); break; case 792: -#line 5114 "cs-parser.jay" - { - current_block = current_block.CreateSwitchBlock (lexer.Location); - } + case_792(); break; case 793: -#line 5118 "cs-parser.jay" +#line 5263 "cs-parser.jay" { - yyVal = new SwitchSection ((List) yyVals[-2+yyTop], current_block); + yyVal = yyVals[0+yyTop]; } break; case 794: @@ -3487,52 +3536,40 @@ case 795: case_795(); break; case 796: - case_796(); - break; -case 797: -#line 5147 "cs-parser.jay" - { - yyVal = new SwitchLabel (null, GetLocation (yyVals[0+yyTop])); - } - break; -case 802: - case_802(); +#line 5291 "cs-parser.jay" + { yyVal = new EmptyStatement (lexer.Location); } break; -case 803: - case_803(); +case 798: + case_798(); break; -case 804: - case_804(); +case 799: + case_799(); break; -case 805: -#line 5186 "cs-parser.jay" - { - yyVal = yyVals[0+yyTop]; - } +case 801: +#line 5312 "cs-parser.jay" + { yyVal = null; } break; -case 806: - case_806(); +case 803: +#line 5317 "cs-parser.jay" + { yyVal = new EmptyStatement (lexer.Location); } break; case 807: case_807(); break; case 808: -#line 5214 "cs-parser.jay" - { yyVal = new EmptyStatement (lexer.Location); } + case_808(); + break; +case 809: + case_809(); break; case 810: case_810(); break; -case 811: - case_811(); - break; -case 813: -#line 5235 "cs-parser.jay" - { yyVal = null; } +case 817: + case_817(); break; -case 815: -#line 5240 "cs-parser.jay" - { yyVal = new EmptyStatement (lexer.Location); } +case 818: + case_818(); break; case 819: case_819(); @@ -3546,6 +3583,21 @@ case 821: case 822: case_822(); break; +case 823: + case_823(); + break; +case 824: + case_824(); + break; +case 825: + case_825(); + break; +case 828: +#line 5472 "cs-parser.jay" + { + yyVal = new TryCatch ((Block) yyVals[-1+yyTop], (List) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]), false); + } + break; case 829: case_829(); break; @@ -3561,32 +3613,44 @@ case 832: case 833: case_833(); break; -case 834: - case_834(); - break; -case 835: - case_835(); - break; case 836: - case_836(); +#line 5525 "cs-parser.jay" + { + yyVal = new Catch ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + } break; case 837: case_837(); break; +case 838: +#line 5544 "cs-parser.jay" + { + yyVal = yyVals[-1+yyTop]; + } + break; +case 839: + case_839(); + break; case 840: -#line 5395 "cs-parser.jay" +#line 5562 "cs-parser.jay" { - yyVal = new TryCatch ((Block) yyVals[-1+yyTop], (List) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]), false); + yyVal = new Checked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 841: - case_841(); +#line 5569 "cs-parser.jay" + { + yyVal = new Unchecked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + } break; case 842: case_842(); break; case 843: - case_843(); +#line 5579 "cs-parser.jay" + { + yyVal = new Unsafe ((Block) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); + } break; case 844: case_844(); @@ -3594,44 +3658,38 @@ case 844: case 845: case_845(); break; +case 846: + case_846(); + break; +case 847: + case_847(); + break; case 848: -#line 5448 "cs-parser.jay" - { - yyVal = new Catch ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); - } + case_848(); break; case 849: case_849(); break; case 850: -#line 5467 "cs-parser.jay" - { - yyVal = yyVals[-1+yyTop]; - } + case_850(); break; case 851: case_851(); break; case 852: -#line 5485 "cs-parser.jay" +#line 5662 "cs-parser.jay" { - yyVal = new Checked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); + Error_MissingInitializer (lexer.Location); } break; case 853: -#line 5492 "cs-parser.jay" - { - yyVal = new Unchecked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); - } + case_853(); break; case 854: case_854(); break; case 855: -#line 5502 "cs-parser.jay" - { - yyVal = new Unsafe ((Block) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); - } + case_855(); break; case 856: case_856(); @@ -3652,15 +3710,18 @@ case 861: case_861(); break; case 862: - case_862(); +#line 5763 "cs-parser.jay" + { + current_block = new Linq.QueryBlock (current_block, lexer.Location); + } break; case 863: case_863(); break; case 864: -#line 5585 "cs-parser.jay" +#line 5778 "cs-parser.jay" { - report.Error (210, lexer.Location, "You must provide an initializer in a fixed or using statement declaration"); + current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; case 865: @@ -3669,14 +3730,14 @@ case 865: case 866: case_866(); break; -case 867: - case_867(); - break; case 868: case_868(); break; case 869: - case_869(); +#line 5823 "cs-parser.jay" + { + current_block = new Linq.QueryBlock (current_block, lexer.Location); + } break; case 870: case_870(); @@ -3690,81 +3751,72 @@ case 872: case 873: case_873(); break; -case 874: -#line 5685 "cs-parser.jay" +case 877: + case_877(); + break; +case 883: +#line 5882 "cs-parser.jay" { - current_block = new Linq.QueryBlock (current_block, lexer.Location); + current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; -case 875: - case_875(); +case 884: + case_884(); break; -case 876: -#line 5700 "cs-parser.jay" +case 885: +#line 5901 "cs-parser.jay" { - current_block = new Linq.QueryBlock (current_block, lexer.Location); + current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; -case 877: - case_877(); +case 886: + case_886(); break; -case 878: - case_878(); +case 887: + case_887(); break; -case 880: - case_880(); +case 888: + case_888(); break; -case 881: -#line 5745 "cs-parser.jay" - { - current_block = new Linq.QueryBlock (current_block, lexer.Location); - } +case 889: + case_889(); break; -case 882: - case_882(); +case 890: + case_890(); break; -case 883: - case_883(); +case 891: + case_891(); break; -case 884: - case_884(); +case 892: + case_892(); break; -case 885: - case_885(); +case 893: + case_893(); break; -case 889: - case_889(); +case 894: + case_894(); break; -case 895: -#line 5804 "cs-parser.jay" +case 896: +#line 6045 "cs-parser.jay" { - current_block = new Linq.QueryBlock (current_block, lexer.Location); + yyVal = yyVals[0+yyTop]; } break; -case 896: - case_896(); - break; case 897: -#line 5823 "cs-parser.jay" +#line 6052 "cs-parser.jay" { - current_block = new Linq.QueryBlock (current_block, lexer.Location); + current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; case 898: case_898(); break; -case 899: - case_899(); - break; case 900: case_900(); break; case 901: case_901(); break; -case 902: - case_902(); - break; case 903: case_903(); break; @@ -3772,22 +3824,25 @@ case 904: case_904(); break; case 905: - case_905(); +#line 6098 "cs-parser.jay" + { + yyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); + } break; case 906: case_906(); break; +case 907: + case_907(); + break; case 908: -#line 5967 "cs-parser.jay" +#line 6115 "cs-parser.jay" { - yyVal = yyVals[0+yyTop]; + yyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); } break; case 909: -#line 5974 "cs-parser.jay" - { - current_block = new Linq.QueryBlock (current_block, lexer.Location); - } + case_909(); break; case 910: case_910(); @@ -3798,122 +3853,86 @@ case 912: case 913: case_913(); break; -case 915: - case_915(); - break; case 916: case_916(); break; case 917: -#line 6020 "cs-parser.jay" - { - yyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); - } - break; -case 918: - case_918(); - break; -case 919: - case_919(); - break; -case 920: -#line 6037 "cs-parser.jay" - { - yyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); - } - break; -case 921: - case_921(); - break; -case 922: - case_922(); - break; -case 924: - case_924(); + case_917(); break; case 925: - case_925(); - break; -case 928: - case_928(); - break; -case 929: - case_929(); - break; -case 937: -#line 6161 "cs-parser.jay" +#line 6239 "cs-parser.jay" { module.DocumentationBuilder.ParsedName = (MemberName) yyVals[0+yyTop]; } break; -case 938: -#line 6168 "cs-parser.jay" +case 926: +#line 6246 "cs-parser.jay" { module.DocumentationBuilder.ParsedParameters = (List)yyVals[0+yyTop]; } break; -case 939: - case_939(); +case 927: + case_927(); break; -case 940: - case_940(); +case 928: + case_928(); break; -case 941: -#line 6185 "cs-parser.jay" +case 929: +#line 6263 "cs-parser.jay" { yyVal = new MemberName ((MemberName) yyVals[-2+yyTop], new MemberName (MemberCache.IndexerNameAlias)); } break; -case 942: -#line 6189 "cs-parser.jay" +case 930: +#line 6267 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; -case 943: - case_943(); +case 931: + case_931(); break; -case 944: - case_944(); +case 932: + case_932(); break; -case 945: - case_945(); +case 933: + case_933(); break; -case 946: - case_946(); +case 934: + case_934(); break; -case 948: -#line 6225 "cs-parser.jay" +case 936: +#line 6303 "cs-parser.jay" { yyVal = new MemberName (((MemberName) yyVals[-2+yyTop]), (MemberName) yyVals[0+yyTop]); } break; -case 950: -#line 6233 "cs-parser.jay" +case 938: +#line 6311 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; -case 951: -#line 6237 "cs-parser.jay" +case 939: +#line 6315 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; -case 952: -#line 6244 "cs-parser.jay" +case 940: +#line 6322 "cs-parser.jay" { yyVal = new List (0); } break; -case 954: - case_954(); +case 942: + case_942(); break; -case 955: - case_955(); +case 943: + case_943(); break; -case 956: - case_956(); +case 944: + case_944(); break; #line default } @@ -3951,7 +3970,7 @@ case 956: All more than 3 lines long rules are wrapped into a method */ void case_6() -#line 404 "cs-parser.jay" +#line 408 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { Attributes attrs = (Attributes) yyVals[0+yyTop]; @@ -3961,7 +3980,7 @@ void case_6() } void case_8() -#line 416 "cs-parser.jay" +#line 420 "cs-parser.jay" { if (yyToken == Token.EXTERN_ALIAS) report.Error (439, lexer.Location, "An extern alias declaration must precede all other elements"); @@ -3970,7 +3989,7 @@ void case_8() } void case_13() -#line 436 "cs-parser.jay" +#line 440 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; string s = lt.Value; @@ -3986,21 +4005,21 @@ void case_13() } void case_17() -#line 462 "cs-parser.jay" +#line 466 "cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } void case_18() -#line 467 "cs-parser.jay" +#line 471 "cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } void case_19() -#line 475 "cs-parser.jay" +#line 479 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; if (lang_version != LanguageVersion.ISO_1 && lt.Value == "global") { @@ -4013,21 +4032,21 @@ void case_19() } void case_20() -#line 486 "cs-parser.jay" +#line 490 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } void case_21() -#line 494 "cs-parser.jay" +#line 498 "cs-parser.jay" { current_namespace.AddUsing ((MemberName) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); ubag.AddUsing (GetLocation (yyVals[-2+yyTop]), (MemberName) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); } void case_22() -#line 507 "cs-parser.jay" +#line 511 "cs-parser.jay" { Attributes attrs = (Attributes) yyVals[-2+yyTop]; MemberName name = (MemberName) yyVals[0+yyTop]; @@ -4060,7 +4079,7 @@ void case_22() } void case_23() -#line 538 "cs-parser.jay" +#line 542 "cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; @@ -4068,43 +4087,43 @@ void case_23() } void case_24() -#line 544 "cs-parser.jay" +#line 548 "cs-parser.jay" { - if (yyVals[0+yyTop] != null) - lbag.AddLocation (current_namespace, GetLocation (yyVals[-9+yyTop]), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); - else - lbag.AddLocation (current_namespace, GetLocation (yyVals[-9+yyTop]), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-1+yyTop])); - current_namespace = current_namespace.Parent; current_class = current_namespace.SlaveDeclSpace; current_container = current_class.PartialContainer; ubag.CloseNamespace (GetLocation (yyVals[-1+yyTop])); - ubag.EndNamespace (GetLocation (yyVals[-1+yyTop])); + if (yyVals[0+yyTop] != null) + ubag.EndNamespace (GetLocation (yyVals[0+yyTop])); + else + ubag.EndNamespace (); } void case_25() -#line 560 "cs-parser.jay" +#line 562 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new MemberName (lt.Value, lt.Location); } void case_26() -#line 565 "cs-parser.jay" +#line 567 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; - yyVal = new MemberName ((MemberName) yyVals[-2+yyTop], lt.Value, lt.Location); + yyVal = new MemberName ((MemberName) yyVals[-2+yyTop], lt.Value, lt.Location) { + DotLocation = GetLocation (yyVals[-1+yyTop]) + }; } void case_27() -#line 570 "cs-parser.jay" +#line 574 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new MemberName ("", lexer.Location); } void case_32() -#line 588 "cs-parser.jay" +#line 592 "cs-parser.jay" { MemberName name = (MemberName) yyVals[0+yyTop]; @@ -4115,7 +4134,7 @@ void case_32() } void case_41() -#line 620 "cs-parser.jay" +#line 624 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { TypeContainer ds = (TypeContainer)yyVals[0+yyTop]; @@ -4136,11 +4155,12 @@ void case_41() } void case_50() -#line 670 "cs-parser.jay" +#line 674 "cs-parser.jay" { var sect = (List) yyVals[0+yyTop]; yyVal = new Attributes (sect); - lbag.AddLocation (sect, savedOpenLocation, savedCloseLocation); + if (locationListStack.Count > 0) + lbag.AddLocation (sect, locationListStack.Pop ()); if (attributeCommas.Count > 0) { lbag.AppendTo (sect, attributeCommas); attributeCommas.Clear (); @@ -4148,10 +4168,13 @@ void case_50() } void case_51() -#line 680 "cs-parser.jay" +#line 685 "cs-parser.jay" { Attributes attrs = yyVals[-1+yyTop] as Attributes; var sect = (List) yyVals[0+yyTop]; + + if (locationListStack.Count > 0) + lbag.AddLocation (sect, locationListStack.Pop ()); if (attrs == null) attrs = new Attributes (sect); else @@ -4160,21 +4183,21 @@ void case_51() } void case_52() -#line 693 "cs-parser.jay" +#line 701 "cs-parser.jay" { lexer.parsing_attribute_section = true; savedOpenLocation = GetLocation (yyVals[0+yyTop]); } void case_53() -#line 698 "cs-parser.jay" +#line 706 "cs-parser.jay" { lexer.parsing_attribute_section = false; yyVal = yyVals[0+yyTop]; } void case_54() -#line 706 "cs-parser.jay" +#line 714 "cs-parser.jay" { current_attr_target = (string) yyVals[-1+yyTop]; if (current_attr_target == "assembly" || current_attr_target == "module") { @@ -4183,7 +4206,7 @@ void case_54() } void case_55() -#line 713 "cs-parser.jay" +#line 721 "cs-parser.jay" { /* when attribute target is invalid*/ if (current_attr_target == string.Empty) @@ -4193,25 +4216,34 @@ void case_55() current_attr_target = null; lexer.parsing_attribute_section = false; - savedCloseLocation = GetLocation (yyVals[0+yyTop]); + if (yyVals[-1+yyTop] != null) { + locationListStack.Push (new List(new [] { savedOpenLocation, savedCloseLocation, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]) })); + } else { + locationListStack.Push (new List(new [] { savedOpenLocation, savedCloseLocation, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[0+yyTop]) })); + } } void case_56() -#line 725 "cs-parser.jay" +#line 737 "cs-parser.jay" { yyVal = yyVals[-2+yyTop]; - savedCloseLocation = GetLocation (yyVals[0+yyTop]); + if (yyVals[-1+yyTop] != null) { + locationListStack.Push (new List(new [] { savedOpenLocation, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]) })); + } else { + locationListStack.Push (new List(new [] { savedOpenLocation, GetLocation (yyVals[0+yyTop]) })); + } } void case_57() -#line 733 "cs-parser.jay" +#line 749 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = CheckAttributeTarget (lt.Value, lt.Location); + savedCloseLocation = GetLocation (yyVals[0+yyTop]); } void case_60() -#line 740 "cs-parser.jay" +#line 757 "cs-parser.jay" { if (yyToken == Token.IDENTIFIER) { Error_SyntaxError (yyToken); @@ -4223,7 +4255,7 @@ void case_60() } void case_62() -#line 757 "cs-parser.jay" +#line 774 "cs-parser.jay" { var attrs = (List) yyVals[-2+yyTop]; attrs.Add ((Attribute) yyVals[0+yyTop]); @@ -4233,7 +4265,7 @@ void case_62() } void case_64() -#line 772 "cs-parser.jay" +#line 789 "cs-parser.jay" { --lexer.parsing_block; MemberName mname = (MemberName) yyVals[-2+yyTop]; @@ -4246,12 +4278,15 @@ void case_64() ATypeNameExpression expr = mname.GetTypeExpression (); yyVal = new Attribute (current_attr_target, expr, arguments, mname.Location, lexer.IsEscapedIdentifier (mname)); if (arguments != null) { - lbag.AddLocation (yyVal, savedAttrParenOpenLocation, savedAttrParenCloseLocation); + attributeArgumentCommas.Insert (0, savedAttrParenOpenLocation); + attributeArgumentCommas.Add (savedAttrParenCloseLocation); + lbag.AddLocation (yyVal, attributeArgumentCommas); + attributeArgumentCommas.Clear (); } } void case_67() -#line 796 "cs-parser.jay" +#line 816 "cs-parser.jay" { savedAttrParenOpenLocation = GetLocation (yyVals[-2+yyTop]); savedAttrParenCloseLocation = GetLocation (yyVals[0+yyTop]); @@ -4259,7 +4294,7 @@ void case_67() } void case_69() -#line 807 "cs-parser.jay" +#line 827 "cs-parser.jay" { Arguments a = new Arguments (4); a.Add ((Argument) yyVals[0+yyTop]); @@ -4267,7 +4302,7 @@ void case_69() } void case_70() -#line 813 "cs-parser.jay" +#line 833 "cs-parser.jay" { Arguments a = new Arguments (4); a.Add ((Argument) yyVals[0+yyTop]); @@ -4275,7 +4310,7 @@ void case_70() } void case_71() -#line 819 "cs-parser.jay" +#line 839 "cs-parser.jay" { Arguments[] o = (Arguments[]) yyVals[-2+yyTop]; if (o [1] != null) { @@ -4288,11 +4323,11 @@ void case_71() Error_NamedArgumentExpected ((NamedArgument) args [args.Count - 1]); args.Add ((Argument) yyVals[0+yyTop]); - lbag.AppendTo (args, GetLocation (yyVals[-1+yyTop])); + attributeArgumentCommas.Add (GetLocation (yyVals[-1+yyTop])); } void case_72() -#line 834 "cs-parser.jay" +#line 854 "cs-parser.jay" { Arguments[] o = (Arguments[]) yyVals[-2+yyTop]; if (o [1] == null) { @@ -4300,11 +4335,11 @@ void case_72() } ((Arguments) o [1]).Add ((Argument) yyVals[0+yyTop]); - lbag.AppendTo (o[1], GetLocation (yyVals[-1+yyTop])); + attributeArgumentCommas.Add (GetLocation (yyVals[-1+yyTop])); } void case_76() -#line 859 "cs-parser.jay" +#line 879 "cs-parser.jay" { --lexer.parsing_block; var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; @@ -4313,7 +4348,7 @@ void case_76() } void case_77() -#line 869 "cs-parser.jay" +#line 889 "cs-parser.jay" { if (lang_version <= LanguageVersion.V_3) FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "named argument"); @@ -4323,10 +4358,11 @@ void case_77() var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; yyVal = new NamedArgument (lt.Value, lt.Location, (Expression) yyVals[0+yyTop], arg_mod); + lbag.AddLocation (yyVal, GetLocation(yyVals[-2+yyTop])); } void case_95() -#line 916 "cs-parser.jay" +#line 942 "cs-parser.jay" { report.Error (1519, lexer.Location, "Unexpected symbol `{0}' in class, struct, or interface member declaration", GetSymbolName (yyToken)); @@ -4335,14 +4371,15 @@ void case_95() } void case_97() -#line 933 "cs-parser.jay" +#line 959 "cs-parser.jay" { MemberName name = MakeName ((MemberName) yyVals[0+yyTop]); push_current_class (new Struct (current_namespace, current_class, name, (Modifiers) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop]), yyVals[-3+yyTop]); + lbag.AddMember (current_class, GetModifierLocations (), GetLocation (yyVals[-2+yyTop])); } void case_98() -#line 939 "cs-parser.jay" +#line 966 "cs-parser.jay" { lexer.ConstraintsParsing = false; @@ -4351,33 +4388,36 @@ void case_98() if (doc_support) current_container.DocComment = Lexer.consume_doc_comment (); - lbag.AddMember (current_class, GetModifierLocations (), GetLocation (yyVals[-5+yyTop])); + + lexer.parsing_modifiers = true; } void case_99() -#line 950 "cs-parser.jay" +#line 978 "cs-parser.jay" { - --lexer.parsing_declaration; if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } void case_100() -#line 956 "cs-parser.jay" +#line 983 "cs-parser.jay" { - lbag.AppendToMember (current_class, GetLocation (yyVals[0+yyTop])); - yyVal = pop_current_class (); + lbag.AppendToMember (current_class, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); + --lexer.parsing_declaration; + if (doc_support) + Lexer.doc_state = XmlCommentState.Allowed; } -void case_102() -#line 968 "cs-parser.jay" +void case_101() +#line 990 "cs-parser.jay" { - if (doc_support) - Lexer.doc_state = XmlCommentState.Allowed; + if (yyVals[-1+yyTop] != null) + current_class.OptionalSemicolon = GetLocation (yyVals[-1+yyTop]); + yyVal = pop_current_class (); } -void case_118() -#line 1010 "cs-parser.jay" +void case_103() +#line 1005 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var mod = (Modifiers) yyVals[-3+yyTop]; @@ -4391,8 +4431,8 @@ void case_118() yyVal = current_field; } -void case_119() -#line 1023 "cs-parser.jay" +void case_104() +#line 1018 "cs-parser.jay" { if (doc_support) { current_field.DocComment = Lexer.consume_doc_comment (); @@ -4404,31 +4444,31 @@ void case_119() current_field = null; } -void case_124() -#line 1053 "cs-parser.jay" +void case_109() +#line 1048 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (ConstInitializer) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_126() -#line 1066 "cs-parser.jay" +void case_111() +#line 1061 "cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstInitializer (current_field, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_127() -#line 1072 "cs-parser.jay" +void case_112() +#line 1067 "cs-parser.jay" { report.Error (145, lexer.Location, "A const field requires a value to be provided"); yyVal = null; } -void case_130() -#line 1087 "cs-parser.jay" +void case_115() +#line 1082 "cs-parser.jay" { lexer.parsing_generic_declaration = false; @@ -4442,8 +4482,8 @@ void case_130() yyVal = current_field; } -void case_131() -#line 1102 "cs-parser.jay" +void case_116() +#line 1097 "cs-parser.jay" { if (doc_support) { current_field.DocComment = Lexer.consume_doc_comment (); @@ -4455,8 +4495,8 @@ void case_131() current_field = null; } -void case_132() -#line 1115 "cs-parser.jay" +void case_117() +#line 1110 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "fixed size buffers"); @@ -4468,8 +4508,8 @@ void case_132() current_container.AddField (current_field); } -void case_133() -#line 1126 "cs-parser.jay" +void case_118() +#line 1121 "cs-parser.jay" { if (doc_support) { current_field.DocComment = Lexer.consume_doc_comment (); @@ -4482,16 +4522,16 @@ void case_133() current_field = null; } -void case_136() -#line 1149 "cs-parser.jay" +void case_121() +#line 1144 "cs-parser.jay" { ++lexer.parsing_block; current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; start_block (GetLocation (yyVals[0+yyTop])); } -void case_137() -#line 1155 "cs-parser.jay" +void case_122() +#line 1150 "cs-parser.jay" { --lexer.parsing_block; current_field.Initializer = (Expression) yyVals[0+yyTop]; @@ -4500,16 +4540,16 @@ void case_137() current_local_parameters = null; } -void case_142() -#line 1182 "cs-parser.jay" +void case_127() +#line 1177 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), null); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_144() -#line 1192 "cs-parser.jay" +void case_129() +#line 1187 "cs-parser.jay" { --lexer.parsing_block; var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; @@ -4517,54 +4557,58 @@ void case_144() lbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); } -void case_149() -#line 1218 "cs-parser.jay" +void case_134() +#line 1213 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (ConstInitializer) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_151() -#line 1231 "cs-parser.jay" +void case_136() +#line 1226 "cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstInitializer (current_field, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_152() -#line 1237 "cs-parser.jay" +void case_137() +#line 1232 "cs-parser.jay" { report.Error (443, lexer.Location, "Value or constant expected"); yyVal = null; } -void case_155() -#line 1247 "cs-parser.jay" +void case_140() +#line 1242 "cs-parser.jay" { /* It has to be here for the parent to safely restore artificial block*/ Error_SyntaxError (yyToken); yyVal = null; } -void case_156() -#line 1256 "cs-parser.jay" +void case_141() +#line 1251 "cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.NotAllowed; - /* Add it early in the case of body being eof for full aot*/ - current_container.AddMethod ((Method) yyVals[0+yyTop]); + /* Add it early in the case of body being eof for full ast*/ + Method m = (Method) yyVals[0+yyTop]; + lexer.async_block = (m.ModFlags & Modifiers.ASYNC) != 0; + current_container.AddMethod (m); } -void case_157() -#line 1264 "cs-parser.jay" +void case_142() +#line 1261 "cs-parser.jay" { Method method = (Method) yyVals[-2+yyTop]; method.Block = (ToplevelBlock) yyVals[0+yyTop]; + lexer.async_block = false; if (method.Block == null) { + lbag.AppendToMember (method, savedLocation); /* semicolon*/ method.ParameterInfo.CheckParameters (method); if ((method.ModFlags & Modifiers.ASYNC) != 0) { @@ -4584,8 +4628,8 @@ void case_157() Lexer.doc_state = XmlCommentState.Allowed; } -void case_160() -#line 1302 "cs-parser.jay" +void case_145() +#line 1301 "cs-parser.jay" { lexer.ConstraintsParsing = false; valid_param_mod = 0; @@ -4619,15 +4663,15 @@ void case_160() yyVal = method; } -void case_162() -#line 1343 "cs-parser.jay" +void case_147() +#line 1342 "cs-parser.jay" { lexer.parsing_generic_declaration = false; valid_param_mod = ParameterModifierType.All; } -void case_164() -#line 1352 "cs-parser.jay" +void case_149() +#line 1351 "cs-parser.jay" { lexer.ConstraintsParsing = false; valid_param_mod = 0; @@ -4678,8 +4722,8 @@ void case_164() yyVal = method; } -void case_165() -#line 1405 "cs-parser.jay" +void case_150() +#line 1404 "cs-parser.jay" { MemberName name = (MemberName) yyVals[-3+yyTop]; report.Error (1585, name.Location, @@ -4696,91 +4740,104 @@ void case_165() yyVal = method; } -void case_170() -#line 1434 "cs-parser.jay" +void case_155() +#line 1433 "cs-parser.jay" { var pars_list = (List) yyVals[0+yyTop]; yyVal = new ParametersCompiled (pars_list.ToArray ()); - lbag.AddLocation (yyVal, lbag.GetLocations (pars_list)); + lbag.AddLocation (yyVal, parameterListCommas); } -void case_171() -#line 1440 "cs-parser.jay" +void case_156() +#line 1439 "cs-parser.jay" { var pars_list = (List) yyVals[-2+yyTop]; pars_list.Add ((Parameter) yyVals[0+yyTop]); - + parameterListCommas.Add (GetLocation (yyVals[-1+yyTop])); + yyVal = new ParametersCompiled (pars_list.ToArray ()); + lbag.AddLocation (yyVal, parameterListCommas); } -void case_172() -#line 1447 "cs-parser.jay" +void case_157() +#line 1448 "cs-parser.jay" { var pars_list = (List) yyVals[-2+yyTop]; pars_list.Add (new ArglistParameter (GetLocation (yyVals[0+yyTop]))); + parameterListCommas.Add (GetLocation (yyVals[-1+yyTop])); + yyVal = new ParametersCompiled (pars_list.ToArray (), true); + lbag.AddLocation (yyVal, parameterListCommas); } -void case_173() -#line 1453 "cs-parser.jay" +void case_158() +#line 1457 "cs-parser.jay" { if (yyVals[-2+yyTop] != null) report.Error (231, ((Parameter) yyVals[-2+yyTop]).Location, "A params parameter must be the last parameter in a formal parameter list"); yyVal = new ParametersCompiled (new Parameter[] { (Parameter) yyVals[-2+yyTop] } ); + lbag.AddLocation (yyVal, parameterListCommas); } -void case_174() -#line 1460 "cs-parser.jay" +void case_159() +#line 1465 "cs-parser.jay" { if (yyVals[-2+yyTop] != null) report.Error (231, ((Parameter) yyVals[-2+yyTop]).Location, "A params parameter must be the last parameter in a formal parameter list"); var pars_list = (List) yyVals[-4+yyTop]; pars_list.Add (new ArglistParameter (GetLocation (yyVals[-2+yyTop]))); - + parameterListCommas.Add (GetLocation (yyVals[-3+yyTop])); + parameterListCommas.Add (GetLocation (yyVals[-1+yyTop])); + yyVal = new ParametersCompiled (pars_list.ToArray (), true); + lbag.AddLocation (yyVal, parameterListCommas); } -void case_175() -#line 1470 "cs-parser.jay" +void case_160() +#line 1478 "cs-parser.jay" { report.Error (257, GetLocation (yyVals[-2+yyTop]), "An __arglist parameter must be the last parameter in a formal parameter list"); yyVal = new ParametersCompiled (new Parameter [] { new ArglistParameter (GetLocation (yyVals[-2+yyTop])) }, true); + lbag.AddLocation (yyVal, parameterListCommas); } -void case_176() -#line 1476 "cs-parser.jay" +void case_161() +#line 1485 "cs-parser.jay" { report.Error (257, GetLocation (yyVals[-2+yyTop]), "An __arglist parameter must be the last parameter in a formal parameter list"); var pars_list = (List) yyVals[-4+yyTop]; pars_list.Add (new ArglistParameter (GetLocation (yyVals[-2+yyTop]))); + parameterListCommas.Add (GetLocation (yyVals[-3+yyTop])); + parameterListCommas.Add (GetLocation (yyVals[-1+yyTop])); yyVal = new ParametersCompiled (pars_list.ToArray (), true); + lbag.AddLocation (yyVal, parameterListCommas); } -void case_179() -#line 1493 "cs-parser.jay" +void case_164() +#line 1505 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = ParametersCompiled.EmptyReadOnlyParameters; } -void case_180() -#line 1501 "cs-parser.jay" +void case_165() +#line 1513 "cs-parser.jay" { parameters_bucket.Clear (); Parameter p = (Parameter) yyVals[0+yyTop]; parameters_bucket.Add (p); - + parameterListCommas.Clear (); default_parameter_used = p.HasDefaultValue; yyVal = parameters_bucket; } -void case_181() -#line 1510 "cs-parser.jay" +void case_166() +#line 1522 "cs-parser.jay" { var pars = (List) yyVals[-2+yyTop]; Parameter p = (Parameter) yyVals[0+yyTop]; @@ -4793,22 +4850,22 @@ void case_181() default_parameter_used |= p.HasDefaultValue; pars.Add (p); - lbag.AppendTo (pars, GetLocation (yyVals[-1+yyTop])); + parameterListCommas.Add (GetLocation (yyVals[-1+yyTop])); } yyVal = yyVals[-2+yyTop]; } -void case_182() -#line 1534 "cs-parser.jay" +void case_167() +#line 1546 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Parameter.Modifier) yyVals[-2+yyTop], (Attributes) yyVals[-3+yyTop], lt.Location); lbag.AddLocation (yyVal, parameterModifierLocation); } -void case_183() -#line 1543 "cs-parser.jay" +void case_168() +#line 1555 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; report.Error (1552, lt.Location, "Array type specifier, [], must appear before parameter name"); @@ -4816,8 +4873,8 @@ void case_183() lbag.AddLocation (yyVal, parameterModifierLocation); } -void case_184() -#line 1553 "cs-parser.jay" +void case_169() +#line 1565 "cs-parser.jay" { Error_SyntaxError (yyToken); Location l = GetLocation (yyVals[0+yyTop]); @@ -4825,8 +4882,8 @@ void case_184() lbag.AddLocation (yyVal, parameterModifierLocation); } -void case_186() -#line 1568 "cs-parser.jay" +void case_171() +#line 1580 "cs-parser.jay" { --lexer.parsing_block; if (lang_version <= LanguageVersion.V_3) { @@ -4864,15 +4921,8 @@ void case_186() ((Parameter) yyVal).DefaultValue = new DefaultParameterValueExpression ((Expression) yyVals[0+yyTop]); } -void case_189() -#line 1613 "cs-parser.jay" -{ - yyVal = yyVals[0+yyTop]; - parameterModifierLocation = GetLocation (yyVals[0+yyTop]); - } - -void case_190() -#line 1618 "cs-parser.jay" +void case_175() +#line 1629 "cs-parser.jay" { Parameter.Modifier p2 = (Parameter.Modifier)yyVals[0+yyTop]; Parameter.Modifier mod = (Parameter.Modifier)yyVals[-1+yyTop] | p2; @@ -4894,68 +4944,71 @@ void case_190() yyVal = mod; } -void case_191() -#line 1642 "cs-parser.jay" +void case_176() +#line 1653 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Ref) == 0) Error_ParameterModifierNotValid ("ref", GetLocation (yyVals[0+yyTop])); - + parameterModifierLocation = GetLocation (yyVals[0+yyTop]); yyVal = Parameter.Modifier.REF; } -void case_192() -#line 1649 "cs-parser.jay" +void case_177() +#line 1660 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Out) == 0) Error_ParameterModifierNotValid ("out", GetLocation (yyVals[0+yyTop])); - + parameterModifierLocation = GetLocation (yyVals[0+yyTop]); yyVal = Parameter.Modifier.OUT; } -void case_193() -#line 1656 "cs-parser.jay" +void case_178() +#line 1667 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.This) == 0) Error_ParameterModifierNotValid ("this", GetLocation (yyVals[0+yyTop])); if (lang_version <= LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "extension methods"); - + parameterModifierLocation = GetLocation (yyVals[0+yyTop]); yyVal = Parameter.Modifier.This; } -void case_194() -#line 1669 "cs-parser.jay" +void case_179() +#line 1680 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new ParamsParameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Attributes) yyVals[-3+yyTop], lt.Location); + lbag.AddLocation (yyVal, savedLocation); } -void case_195() -#line 1674 "cs-parser.jay" +void case_180() +#line 1686 "cs-parser.jay" { report.Error (1751, GetLocation (yyVals[-4+yyTop]), "Cannot specify a default value for a parameter array"); var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new ParamsParameter ((FullNamedExpression) yyVals[-3+yyTop], lt.Value, (Attributes) yyVals[-5+yyTop], lt.Location); + lbag.AddLocation (yyVal, savedLocation); } -void case_196() -#line 1681 "cs-parser.jay" +void case_181() +#line 1694 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } -void case_197() -#line 1689 "cs-parser.jay" +void case_182() +#line 1702 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Params) == 0) report.Error (1670, (GetLocation (yyVals[0+yyTop])), "The `params' modifier is not allowed in current context"); + savedLocation = GetLocation (yyVals[0+yyTop]); } -void case_198() -#line 1694 "cs-parser.jay" +void case_183() +#line 1708 "cs-parser.jay" { Parameter.Modifier mod = (Parameter.Modifier)yyVals[0+yyTop]; if ((mod & Parameter.Modifier.This) != 0) { @@ -4963,24 +5016,25 @@ void case_198() } else { report.Error (1611, GetLocation (yyVals[-1+yyTop]), "The params parameter cannot be declared as ref or out"); } + savedLocation = GetLocation (yyVals[-1+yyTop]); } -void case_200() -#line 1710 "cs-parser.jay" +void case_185() +#line 1725 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Arglist) == 0) report.Error (1669, GetLocation (yyVals[0+yyTop]), "__arglist is not valid in this context"); } -void case_201() -#line 1721 "cs-parser.jay" +void case_186() +#line 1736 "cs-parser.jay" { if (doc_support) tmpComment = Lexer.consume_doc_comment (); } -void case_202() -#line 1726 "cs-parser.jay" +void case_187() +#line 1741 "cs-parser.jay" { var type = (FullNamedExpression) yyVals[-3+yyTop]; current_property = new Property (current_class, type, (Modifiers) yyVals[-4+yyTop], @@ -4995,8 +5049,8 @@ void case_202() lexer.PropertyParsing = true; } -void case_203() -#line 1740 "cs-parser.jay" +void case_188() +#line 1755 "cs-parser.jay" { lexer.PropertyParsing = false; @@ -5004,15 +5058,15 @@ void case_203() current_property.DocComment = ConsumeStoredComment (); } -void case_204() -#line 1747 "cs-parser.jay" +void case_189() +#line 1762 "cs-parser.jay" { lbag.AppendToMember (current_property, GetLocation (yyVals[0+yyTop])); current_property = null; } -void case_206() -#line 1761 "cs-parser.jay" +void case_191() +#line 1776 "cs-parser.jay" { valid_param_mod = 0; var type = (FullNamedExpression) yyVals[-6+yyTop]; @@ -5038,8 +5092,8 @@ void case_206() lexer.PropertyParsing = true; } -void case_208() -#line 1790 "cs-parser.jay" +void case_193() +#line 1805 "cs-parser.jay" { if (current_property.AccessorFirst != null && current_property.AccessorFirst.Block == null) ((Indexer) current_property).ParameterInfo.CheckParameters (current_property); @@ -5051,8 +5105,8 @@ void case_208() current_property = null; } -void case_213() -#line 1809 "cs-parser.jay" +void case_198() +#line 1824 "cs-parser.jay" { if (yyToken == Token.CLOSE_BRACE) { report.Error (548, lexer.Location, "`{0}': property or indexer must have at least one accessor", current_property.GetSignatureForError ()); @@ -5064,8 +5118,8 @@ void case_213() } } -void case_214() -#line 1823 "cs-parser.jay" +void case_199() +#line 1838 "cs-parser.jay" { if (yyVals[-1+yyTop] != ModifierNone && lang_version == LanguageVersion.ISO_1) { FeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), "access modifiers on properties"); @@ -5084,12 +5138,11 @@ void case_214() } current_local_parameters = current_property.Get.ParameterInfo; - lbag.AddMember (current_property.Get, GetModifierLocations ()); lexer.PropertyParsing = false; } -void case_215() -#line 1845 "cs-parser.jay" +void case_200() +#line 1859 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { current_property.Get.Block = (ToplevelBlock) yyVals[0+yyTop]; @@ -5097,7 +5150,10 @@ void case_215() if (current_container.Kind == MemberKind.Interface) { report.Error (531, current_property.Get.Block.StartLocation, "`{0}': interface members cannot have a definition", current_property.Get.GetSignatureForError ()); - } + } + lbag.AddMember (current_property.Get, GetModifierLocations ()); + } else { + lbag.AddMember (current_property.Get, GetModifierLocations (), savedLocation); } current_local_parameters = null; @@ -5108,8 +5164,8 @@ void case_215() Lexer.doc_state = XmlCommentState.NotAllowed; } -void case_216() -#line 1866 "cs-parser.jay" +void case_201() +#line 1883 "cs-parser.jay" { if (yyVals[-1+yyTop] != ModifierNone && lang_version == LanguageVersion.ISO_1) { FeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), "access modifiers on properties"); @@ -5133,12 +5189,11 @@ void case_216() } current_local_parameters = current_property.Set.ParameterInfo; - lbag.AddMember (current_property.Set, GetModifierLocations ()); lexer.PropertyParsing = false; } -void case_217() -#line 1893 "cs-parser.jay" +void case_202() +#line 1909 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { current_property.Set.Block = (ToplevelBlock) yyVals[0+yyTop]; @@ -5147,6 +5202,9 @@ void case_217() report.Error (531, current_property.Set.Block.StartLocation, "`{0}': interface members cannot have a definition", current_property.Set.GetSignatureForError ()); } + lbag.AddMember (current_property.Set, GetModifierLocations ()); + } else { + lbag.AddMember (current_property.Set, GetModifierLocations (), savedLocation); } current_local_parameters = null; @@ -5157,30 +5215,30 @@ void case_217() Lexer.doc_state = XmlCommentState.NotAllowed; } -void case_219() -#line 1915 "cs-parser.jay" +void case_204() +#line 1934 "cs-parser.jay" { - lbag.AppendToMember (lbag.LastMember, GetLocation (yyVals[0+yyTop])); + savedLocation = GetLocation (yyVals[0+yyTop]); yyVal = null; } -void case_220() -#line 1920 "cs-parser.jay" +void case_205() +#line 1939 "cs-parser.jay" { Error_SyntaxError (1043, yyToken, "Invalid accessor body"); yyVal = null; } -void case_222() -#line 1935 "cs-parser.jay" +void case_207() +#line 1954 "cs-parser.jay" { MemberName name = MakeName ((MemberName) yyVals[0+yyTop]); push_current_class (new Interface (current_namespace, current_class, name, (Modifiers) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop]), yyVals[-3+yyTop]); lbag.AddMember (current_class, GetModifierLocations (), GetLocation (yyVals[-2+yyTop])); } -void case_223() -#line 1942 "cs-parser.jay" +void case_208() +#line 1961 "cs-parser.jay" { lexer.ConstraintsParsing = false; @@ -5190,25 +5248,29 @@ void case_223() current_container.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } + + lexer.parsing_modifiers = true; } -void case_224() -#line 1953 "cs-parser.jay" +void case_209() +#line 1974 "cs-parser.jay" { --lexer.parsing_declaration; if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } -void case_225() -#line 1959 "cs-parser.jay" +void case_210() +#line 1980 "cs-parser.jay" { - lbag.AppendToMember (current_class, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); + if (yyVals[0+yyTop] != null) + current_class.OptionalSemicolon = GetLocation (yyVals[0+yyTop]); + lbag.AppendToMember (current_class, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); yyVal = pop_current_class (); } -void case_241() -#line 2011 "cs-parser.jay" +void case_226() +#line 2040 "cs-parser.jay" { OperatorDeclaration decl = (OperatorDeclaration) yyVals[-2+yyTop]; if (decl != null) { @@ -5229,20 +5291,23 @@ void case_241() current_container.AddOperator (op); lbag.AddMember (op, GetModifierLocations (), lbag.GetLocations (decl)); + if (yyVals[0+yyTop] == null) { /* Semicolon*/ + lbag.AppendTo (op, savedLocation); + } } current_local_parameters = null; } -void case_245() -#line 2045 "cs-parser.jay" +void case_230() +#line 2077 "cs-parser.jay" { report.Error (590, GetLocation (yyVals[0+yyTop]), "User-defined operators cannot return void"); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } -void case_247() -#line 2057 "cs-parser.jay" +void case_232() +#line 2089 "cs-parser.jay" { valid_param_mod = 0; @@ -5280,11 +5345,11 @@ void case_247() } yyVal = new OperatorDeclaration (op, (FullNamedExpression) yyVals[-6+yyTop], loc); - lbag.AddLocation (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); + lbag.AddLocation (yyVal, GetLocation (yyVals[-5+yyTop]), savedOperatorLocation, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_272() -#line 2133 "cs-parser.jay" +void case_257() +#line 2165 "cs-parser.jay" { valid_param_mod = 0; @@ -5300,8 +5365,8 @@ void case_272() lbag.AddLocation (yyVal, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_274() -#line 2152 "cs-parser.jay" +void case_259() +#line 2184 "cs-parser.jay" { valid_param_mod = 0; @@ -5317,24 +5382,24 @@ void case_274() lbag.AddLocation (yyVal, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_275() -#line 2167 "cs-parser.jay" +void case_260() +#line 2199 "cs-parser.jay" { Error_SyntaxError (yyToken); current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; yyVal = new OperatorDeclaration (Operator.OpType.Implicit, null, GetLocation (yyVals[-1+yyTop])); } -void case_276() -#line 2173 "cs-parser.jay" +void case_261() +#line 2205 "cs-parser.jay" { Error_SyntaxError (yyToken); current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; yyVal = new OperatorDeclaration (Operator.OpType.Explicit, null, GetLocation (yyVals[-1+yyTop])); } -void case_277() -#line 2183 "cs-parser.jay" +void case_262() +#line 2215 "cs-parser.jay" { Constructor c = (Constructor) yyVals[-1+yyTop]; c.Block = (ToplevelBlock) yyVals[0+yyTop]; @@ -5349,8 +5414,8 @@ void case_277() Lexer.doc_state = XmlCommentState.Allowed; } -void case_278() -#line 2202 "cs-parser.jay" +void case_263() +#line 2234 "cs-parser.jay" { if (doc_support) { tmpComment = Lexer.consume_doc_comment (); @@ -5360,8 +5425,8 @@ void case_278() valid_param_mod = ParameterModifierType.All; } -void case_279() -#line 2211 "cs-parser.jay" +void case_264() +#line 2243 "cs-parser.jay" { valid_param_mod = 0; current_local_parameters = (ParametersCompiled) yyVals[-1+yyTop]; @@ -5373,8 +5438,8 @@ void case_279() start_block (lexer.Location); } -void case_280() -#line 2222 "cs-parser.jay" +void case_265() +#line 2254 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-6+yyTop]; var mods = (Modifiers) yyVals[-7+yyTop]; @@ -5403,31 +5468,31 @@ void case_280() yyVal = c; } -void case_286() -#line 2267 "cs-parser.jay" +void case_271() +#line 2299 "cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstructorBaseInitializer ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_288() -#line 2277 "cs-parser.jay" +void case_273() +#line 2309 "cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstructorThisInitializer ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_289() -#line 2283 "cs-parser.jay" +void case_274() +#line 2315 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } -void case_290() -#line 2291 "cs-parser.jay" +void case_275() +#line 2323 "cs-parser.jay" { if (doc_support) { tmpComment = Lexer.consume_doc_comment (); @@ -5437,8 +5502,8 @@ void case_290() current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; } -void case_291() -#line 2300 "cs-parser.jay" +void case_276() +#line 2332 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; if (lt.Value != current_container.MemberName.Name){ @@ -5459,8 +5524,8 @@ void case_291() current_local_parameters = null; } -void case_292() -#line 2325 "cs-parser.jay" +void case_277() +#line 2357 "cs-parser.jay" { current_event_field = new EventField (current_class, (FullNamedExpression) yyVals[-1+yyTop], (Modifiers) yyVals[-3+yyTop], (MemberName) yyVals[0+yyTop], (Attributes) yyVals[-4+yyTop]); current_container.AddEvent (current_event_field); @@ -5473,8 +5538,8 @@ void case_292() yyVal = current_event_field; } -void case_293() -#line 2339 "cs-parser.jay" +void case_278() +#line 2371 "cs-parser.jay" { if (doc_support) { current_event_field.DocComment = Lexer.consume_doc_comment (); @@ -5485,8 +5550,8 @@ void case_293() current_event_field = null; } -void case_294() -#line 2352 "cs-parser.jay" +void case_279() +#line 2384 "cs-parser.jay" { current_event = new EventProperty (current_class, (FullNamedExpression) yyVals[-2+yyTop], (Modifiers) yyVals[-4+yyTop], (MemberName) yyVals[-1+yyTop], (Attributes) yyVals[-5+yyTop]); current_container.AddEvent (current_event); @@ -5495,8 +5560,8 @@ void case_294() lexer.EventParsing = true; } -void case_295() -#line 2360 "cs-parser.jay" +void case_280() +#line 2392 "cs-parser.jay" { if (current_container.Kind == MemberKind.Interface) report.Error (69, GetLocation (yyVals[-2+yyTop]), "Event in interface cannot have add or remove accessors"); @@ -5504,8 +5569,8 @@ void case_295() lexer.EventParsing = false; } -void case_296() -#line 2367 "cs-parser.jay" +void case_281() +#line 2399 "cs-parser.jay" { if (doc_support) { current_event.DocComment = Lexer.consume_doc_comment (); @@ -5517,23 +5582,23 @@ void case_296() current_local_parameters = null; } -void case_299() -#line 2386 "cs-parser.jay" +void case_284() +#line 2418 "cs-parser.jay" { --lexer.parsing_block; current_event_field.Initializer = (Expression) yyVals[0+yyTop]; } -void case_304() -#line 2410 "cs-parser.jay" +void case_289() +#line 2442 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), null); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_306() -#line 2420 "cs-parser.jay" +void case_291() +#line 2452 "cs-parser.jay" { --lexer.parsing_block; var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; @@ -5541,8 +5606,8 @@ void case_306() lbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); } -void case_307() -#line 2429 "cs-parser.jay" +void case_292() +#line 2461 "cs-parser.jay" { if (current_container.Kind == MemberKind.Interface) { report.Error (68, lexer.Location, "`{0}': event in interface cannot have an initializer", @@ -5555,29 +5620,29 @@ void case_307() } } -void case_311() -#line 2450 "cs-parser.jay" +void case_296() +#line 2482 "cs-parser.jay" { report.Error (65, lexer.Location, "`{0}': event property must have both add and remove accessors", current_event.GetSignatureForError ()); } -void case_312() -#line 2455 "cs-parser.jay" +void case_297() +#line 2487 "cs-parser.jay" { report.Error (65, lexer.Location, "`{0}': event property must have both add and remove accessors", current_event.GetSignatureForError ()); } -void case_313() -#line 2460 "cs-parser.jay" +void case_298() +#line 2492 "cs-parser.jay" { report.Error (1055, GetLocation (yyVals[0+yyTop]), "An add or remove accessor expected"); yyVal = null; } -void case_314() -#line 2468 "cs-parser.jay" +void case_299() +#line 2500 "cs-parser.jay" { if (yyVals[-1+yyTop] != ModifierNone) { report.Error (1609, GetLocation (yyVals[-1+yyTop]), "Modifiers cannot be placed on event accessor declarations"); @@ -5590,8 +5655,8 @@ void case_314() lexer.EventParsing = false; } -void case_315() -#line 2480 "cs-parser.jay" +void case_300() +#line 2512 "cs-parser.jay" { lexer.EventParsing = true; @@ -5605,8 +5670,8 @@ void case_315() current_local_parameters = null; } -void case_316() -#line 2496 "cs-parser.jay" +void case_301() +#line 2528 "cs-parser.jay" { if (yyVals[-1+yyTop] != ModifierNone) { report.Error (1609, GetLocation (yyVals[-1+yyTop]), "Modifiers cannot be placed on event accessor declarations"); @@ -5619,8 +5684,8 @@ void case_316() lexer.EventParsing = false; } -void case_317() -#line 2508 "cs-parser.jay" +void case_302() +#line 2540 "cs-parser.jay" { lexer.EventParsing = true; @@ -5634,85 +5699,88 @@ void case_317() current_local_parameters = null; } -void case_318() -#line 2524 "cs-parser.jay" +void case_303() +#line 2556 "cs-parser.jay" { report.Error (73, lexer.Location, "An add or remove accessor must have a body"); yyVal = null; } -void case_320() -#line 2536 "cs-parser.jay" +void case_306() +#line 2572 "cs-parser.jay" { if (doc_support) enumTypeComment = Lexer.consume_doc_comment (); } -void case_321() -#line 2541 "cs-parser.jay" +void case_307() +#line 2577 "cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; + enumCommas.Add (GetLocation (yyVals[0+yyTop])); MemberName name = (MemberName) yyVals[-3+yyTop]; if (name.IsGeneric) { report.Error (1675, name.Location, "Enums cannot have type parameters"); } - push_current_class (new Enum (current_namespace, current_class, (TypeExpression) yyVals[-2+yyTop], (Modifiers) yyVals[-5+yyTop], MakeName (name), (Attributes) yyVals[-6+yyTop]), null); + push_current_class (new Enum (current_namespace, current_class, (TypeExpression) yyVals[-2+yyTop], (Modifiers) yyVals[-6+yyTop], MakeName (name), (Attributes) yyVals[-7+yyTop]), null); } -void case_322() -#line 2553 "cs-parser.jay" +void case_308() +#line 2590 "cs-parser.jay" { /* here will be evaluated after CLOSE_BLACE is consumed.*/ if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } -void case_323() -#line 2559 "cs-parser.jay" +void case_309() +#line 2596 "cs-parser.jay" { + enumCommas.Add (GetLocation (yyVals[-1+yyTop])); + if (yyVals[0+yyTop] != null) + current_class.OptionalSemicolon = GetLocation (yyVals[0+yyTop]); if (doc_support) current_class.DocComment = enumTypeComment; --lexer.parsing_declaration; -/* if (doc_support)*/ -/* em.DocComment = ev.DocComment;*/ - - lbag.AddMember (current_class, GetModifierLocations (), GetLocation (yyVals[-9+yyTop]), GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-1+yyTop])); + lbag.AddMember (current_class, GetModifierLocations (), enumCommas); + enumCommas.Clear (); yyVal = pop_current_class (); } -void case_325() -#line 2576 "cs-parser.jay" +void case_311() +#line 2614 "cs-parser.jay" { var te = yyVals[0+yyTop] as TypeExpression; if (te == null || !EnumSpec.IsValidUnderlyingType (te.Type)) { Enum.Error_1008 (GetLocation (yyVals[0+yyTop]), report); yyVal = null; } else { + enumCommas.Add (GetLocation (yyVals[-1+yyTop])); yyVal = yyVals[0+yyTop]; } } -void case_326() -#line 2586 "cs-parser.jay" +void case_312() +#line 2625 "cs-parser.jay" { Error_TypeExpected (GetLocation (yyVals[-1+yyTop])); yyVal = null; } -void case_331() -#line 2604 "cs-parser.jay" +void case_317() +#line 2643 "cs-parser.jay" { - lbag.AddLocation (yyVals[-2+yyTop], GetLocation (yyVals[-1+yyTop])); + enumCommas.Add (GetLocation (yyVals[-1+yyTop])); yyVal = yyVals[0+yyTop]; } -void case_332() -#line 2612 "cs-parser.jay" +void case_318() +#line 2651 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var em = new EnumMember ((Enum) current_class, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-1+yyTop]); @@ -5726,8 +5794,8 @@ void case_332() yyVal = em; } -void case_333() -#line 2625 "cs-parser.jay" +void case_319() +#line 2664 "cs-parser.jay" { ++lexer.parsing_block; if (doc_support) { @@ -5736,8 +5804,8 @@ void case_333() } } -void case_334() -#line 2633 "cs-parser.jay" +void case_320() +#line 2672 "cs-parser.jay" { --lexer.parsing_block; @@ -5752,8 +5820,8 @@ void case_334() yyVal = em; } -void case_336() -#line 2658 "cs-parser.jay" +void case_322() +#line 2697 "cs-parser.jay" { valid_param_mod = 0; @@ -5772,8 +5840,8 @@ void case_336() lexer.ConstraintsParsing = true; } -void case_338() -#line 2680 "cs-parser.jay" +void case_324() +#line 2719 "cs-parser.jay" { if (doc_support) { current_delegate.DocComment = Lexer.consume_doc_comment (); @@ -5788,8 +5856,8 @@ void case_338() current_delegate = null; } -void case_340() -#line 2698 "cs-parser.jay" +void case_326() +#line 2737 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "nullable types"); @@ -5797,8 +5865,8 @@ void case_340() yyVal = ComposedTypeSpecifier.CreateNullable (GetLocation (yyVals[0+yyTop])); } -void case_342() -#line 2709 "cs-parser.jay" +void case_328() +#line 2748 "cs-parser.jay" { var lt1 = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var lt2 = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; @@ -5806,23 +5874,24 @@ void case_342() yyVal = new MemberName (lt1.Value, lt2.Value, (TypeArguments) yyVals[0+yyTop], lt1.Location); } -void case_344() -#line 2720 "cs-parser.jay" +void case_330() +#line 2759 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; - yyVal = new MemberName ((MemberName) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); - lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); + yyVal = new MemberName ((MemberName) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location) { + DotLocation = GetLocation (yyVals[-2+yyTop]) + }; } -void case_345() -#line 2729 "cs-parser.jay" +void case_331() +#line 2769 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberName (lt.Value, (TypeArguments)yyVals[0+yyTop], lt.Location); } -void case_347() -#line 2741 "cs-parser.jay" +void case_333() +#line 2781 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "generics"); @@ -5834,15 +5903,15 @@ void case_347() yyVal = yyVals[-1+yyTop];; } -void case_348() -#line 2752 "cs-parser.jay" +void case_334() +#line 2792 "cs-parser.jay" { Error_TypeExpected (lexer.Location); yyVal = new TypeArguments (); } -void case_349() -#line 2760 "cs-parser.jay" +void case_335() +#line 2800 "cs-parser.jay" { TypeArguments type_args = new TypeArguments (); type_args.Add ((FullNamedExpression) yyVals[0+yyTop]); @@ -5850,8 +5919,8 @@ void case_349() locationListStack.Push (new List ()); } -void case_350() -#line 2767 "cs-parser.jay" +void case_336() +#line 2807 "cs-parser.jay" { TypeArguments type_args = (TypeArguments) yyVals[-2+yyTop]; type_args.Add ((FullNamedExpression) yyVals[0+yyTop]); @@ -5859,16 +5928,16 @@ void case_350() locationListStack.Peek ().Add (GetLocation (yyVals[-1+yyTop])); } -void case_352() -#line 2784 "cs-parser.jay" +void case_338() +#line 2824 "cs-parser.jay" { lexer.parsing_generic_declaration = false; var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new MemberName (lt.Value, (TypeArguments)yyVals[0+yyTop], lt.Location); } -void case_353() -#line 2793 "cs-parser.jay" +void case_339() +#line 2833 "cs-parser.jay" { MemberName mn = (MemberName)yyVals[0+yyTop]; if (mn.TypeArguments != null) @@ -5876,38 +5945,38 @@ void case_353() mn.GetSignatureForError ())); } -void case_355() -#line 2804 "cs-parser.jay" +void case_341() +#line 2844 "cs-parser.jay" { lexer.parsing_generic_declaration = false; var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberName ((MemberName) yyVals[-2+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); } -void case_356() -#line 2813 "cs-parser.jay" +void case_342() +#line 2853 "cs-parser.jay" { lexer.parsing_generic_declaration = false; yyVal = new MemberName (TypeContainer.DefaultIndexerName, GetLocation (yyVals[0+yyTop])); } -void case_357() -#line 2818 "cs-parser.jay" +void case_343() +#line 2858 "cs-parser.jay" { lexer.parsing_generic_declaration = false; - yyVal = new MemberName ((MemberName) yyVals[-1+yyTop], TypeContainer.DefaultIndexerName, null, GetLocation (yyVals[-1+yyTop])); + yyVal = new MemberName ((MemberName) yyVals[-1+yyTop], TypeContainer.DefaultIndexerName, null, GetLocation (yyVals[0+yyTop])); } -void case_358() -#line 2826 "cs-parser.jay" +void case_344() +#line 2866 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new MemberName (lt.Value, (TypeArguments) yyVals[-1+yyTop], lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_359() -#line 2832 "cs-parser.jay" +void case_345() +#line 2872 "cs-parser.jay" { var lt1 = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var lt2 = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; @@ -5916,50 +5985,53 @@ void case_359() lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_360() -#line 2840 "cs-parser.jay" +void case_346() +#line 2880 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new MemberName ((MemberName) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[-1+yyTop], lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_362() -#line 2850 "cs-parser.jay" +void case_348() +#line 2890 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "generics"); yyVal = yyVals[-1+yyTop]; - lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); + lbag.AppendTo (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_363() -#line 2861 "cs-parser.jay" +void case_349() +#line 2901 "cs-parser.jay" { TypeArguments type_args = new TypeArguments (); type_args.Add ((FullNamedExpression)yyVals[0+yyTop]); yyVal = type_args; } -void case_364() -#line 2867 "cs-parser.jay" +void case_350() +#line 2907 "cs-parser.jay" { TypeArguments type_args = (TypeArguments) yyVals[-2+yyTop]; type_args.Add ((FullNamedExpression)yyVals[0+yyTop]); yyVal = type_args; - lbag.AddLocation (yyVals[0+yyTop], GetLocation (yyVals[0+yyTop])); + lbag.AppendTo (type_args, GetLocation (yyVals[-1+yyTop])); } -void case_365() -#line 2877 "cs-parser.jay" +void case_351() +#line 2917 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken)yyVals[0+yyTop]; - yyVal = new TypeParameterName (lt.Value, (Attributes)yyVals[-2+yyTop], (Variance) yyVals[-1+yyTop], lt.Location); + var variance = (Variance) yyVals[-1+yyTop]; + yyVal = new TypeParameterName (lt.Value, (Attributes)yyVals[-2+yyTop], variance, lt.Location); + if (variance != Variance.None) + lbag.AddLocation (yyVal, savedLocation); } -void case_366() -#line 2882 "cs-parser.jay" +void case_352() +#line 2925 "cs-parser.jay" { if (GetTokenName (yyToken) == "type") report.Error (81, GetLocation (yyVals[0+yyTop]), "Type parameter declaration must be an identifier not a type"); @@ -5969,29 +6041,29 @@ void case_366() yyVal = new TypeParameterName ("", null, lexer.Location); } -void case_371() -#line 2916 "cs-parser.jay" +void case_357() +#line 2959 "cs-parser.jay" { Expression.Error_VoidInvalidInTheContext (GetLocation (yyVals[0+yyTop]), report); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } -void case_373() -#line 2925 "cs-parser.jay" +void case_359() +#line 2968 "cs-parser.jay" { Expression.Error_VoidInvalidInTheContext (GetLocation (yyVals[0+yyTop]), report); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } -void case_375() -#line 2934 "cs-parser.jay" +void case_361() +#line 2977 "cs-parser.jay" { report.Error (1536, GetLocation (yyVals[0+yyTop]), "Invalid parameter type `void'"); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } -void case_378() -#line 2950 "cs-parser.jay" +void case_364() +#line 2993 "cs-parser.jay" { MemberName name = (MemberName) yyVals[-1+yyTop]; @@ -6005,23 +6077,23 @@ void case_378() } } -void case_380() -#line 2967 "cs-parser.jay" +void case_366() +#line 3010 "cs-parser.jay" { if (yyVals[0+yyTop] != null) yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } -void case_383() -#line 2983 "cs-parser.jay" +void case_369() +#line 3026 "cs-parser.jay" { var types = new List (2); types.Add ((FullNamedExpression) yyVals[0+yyTop]); yyVal = types; } -void case_384() -#line 2989 "cs-parser.jay" +void case_370() +#line 3032 "cs-parser.jay" { var types = (List) yyVals[-2+yyTop]; types.Add ((FullNamedExpression) yyVals[0+yyTop]); @@ -6029,8 +6101,8 @@ void case_384() yyVal = types; } -void case_385() -#line 2999 "cs-parser.jay" +void case_371() +#line 3042 "cs-parser.jay" { if (yyVals[0+yyTop] is ComposedCast) { report.Error (1521, GetLocation (yyVals[0+yyTop]), "Invalid base type `{0}'", ((ComposedCast)yyVals[0+yyTop]).GetSignatureForError ()); @@ -6038,60 +6110,63 @@ void case_385() yyVal = yyVals[0+yyTop]; } -void case_386() -#line 3006 "cs-parser.jay" +void case_372() +#line 3049 "cs-parser.jay" { Error_TypeExpected (lexer.Location); yyVal = null; } -void case_423() -#line 3068 "cs-parser.jay" +void case_409() +#line 3111 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new SimpleName (lt.Value, (TypeArguments)yyVals[0+yyTop], lt.Location); } -void case_424() -#line 3072 "cs-parser.jay" +void case_410() +#line 3115 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new CompletionSimpleName (MemberName.MakeName (lt.Value, null), lt.Location); } -void case_435() -#line 3113 "cs-parser.jay" +void case_421() +#line 3156 "cs-parser.jay" { yyVal = new ParenthesizedExpression ((Expression) yyVals[-1+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_437() -#line 3125 "cs-parser.jay" +void case_423() +#line 3168 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; - yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); - lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); + yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location) { + DotLocation = GetLocation (yyVals[-2+yyTop]) + }; } -void case_438() -#line 3131 "cs-parser.jay" +void case_424() +#line 3175 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; - yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); - lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); + yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location) { + DotLocation = GetLocation (yyVals[-2+yyTop]) + }; } -void case_439() -#line 3137 "cs-parser.jay" +void case_425() +#line 3182 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; - yyVal = new MemberAccess (new BaseThis (GetLocation (yyVals[-3+yyTop])), lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); - lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); + yyVal = new MemberAccess (new BaseThis (GetLocation (yyVals[-3+yyTop])), lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location) { + DotLocation = GetLocation (yyVals[-2+yyTop]) + }; } -void case_440() -#line 3143 "cs-parser.jay" +void case_426() +#line 3189 "cs-parser.jay" { var lt1 = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var lt2 = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; @@ -6100,29 +6175,29 @@ void case_440() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_442() -#line 3153 "cs-parser.jay" +void case_428() +#line 3199 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new CompletionMemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, lt.Location); } -void case_444() -#line 3161 "cs-parser.jay" +void case_430() +#line 3207 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new CompletionMemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, lt.Location); } -void case_445() -#line 3169 "cs-parser.jay" +void case_431() +#line 3215 "cs-parser.jay" { yyVal = new Invocation ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_448() -#line 3182 "cs-parser.jay" +void case_434() +#line 3228 "cs-parser.jay" { if (yyVals[-1+yyTop] == null) { yyVal = CollectionOrObjectInitializers.Empty; @@ -6133,23 +6208,23 @@ void case_448() } } -void case_449() -#line 3192 "cs-parser.jay" +void case_435() +#line 3238 "cs-parser.jay" { yyVal = new CollectionOrObjectInitializers ((List) yyVals[-2+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_452() -#line 3208 "cs-parser.jay" +void case_438() +#line 3254 "cs-parser.jay" { var a = new List (); a.Add ((Expression) yyVals[0+yyTop]); yyVal = a; } -void case_453() -#line 3214 "cs-parser.jay" +void case_439() +#line 3260 "cs-parser.jay" { var a = (List)yyVals[-2+yyTop]; a.Add ((Expression) yyVals[0+yyTop]); @@ -6157,23 +6232,23 @@ void case_453() yyVal = a; } -void case_454() -#line 3220 "cs-parser.jay" +void case_440() +#line 3266 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = yyVals[-1+yyTop]; } -void case_455() -#line 3228 "cs-parser.jay" +void case_441() +#line 3274 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new ElementInitializer (lt.Value, (Expression)yyVals[0+yyTop], lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_457() -#line 3237 "cs-parser.jay" +void case_443() +#line 3283 "cs-parser.jay" { CompletionSimpleName csn = yyVals[-1+yyTop] as CompletionSimpleName; if (csn == null) @@ -6182,8 +6257,8 @@ void case_457() yyVal = new CompletionElementInitializer (csn.Prefix, csn.Location); } -void case_458() -#line 3245 "cs-parser.jay" +void case_444() +#line 3291 "cs-parser.jay" { if (yyVals[-1+yyTop] == null) yyVal = null; @@ -6191,23 +6266,23 @@ void case_458() yyVal = new CollectionElementInitializer ((List)yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } -void case_459() -#line 3252 "cs-parser.jay" +void case_445() +#line 3298 "cs-parser.jay" { report.Error (1920, GetLocation (yyVals[-1+yyTop]), "An element initializer cannot be empty"); yyVal = null; } -void case_464() -#line 3270 "cs-parser.jay" +void case_450() +#line 3316 "cs-parser.jay" { Arguments list = new Arguments (4); list.Add ((Argument) yyVals[0+yyTop]); yyVal = list; } -void case_465() -#line 3276 "cs-parser.jay" +void case_451() +#line 3322 "cs-parser.jay" { Arguments list = (Arguments) yyVals[-2+yyTop]; if (list [list.Count - 1] is NamedArgument) @@ -6218,8 +6293,8 @@ void case_465() yyVal = list; } -void case_466() -#line 3286 "cs-parser.jay" +void case_452() +#line 3332 "cs-parser.jay" { Arguments list = (Arguments) yyVals[-2+yyTop]; NamedArgument a = (NamedArgument) yyVals[0+yyTop]; @@ -6235,65 +6310,65 @@ void case_466() yyVal = list; } -void case_467() -#line 3301 "cs-parser.jay" +void case_453() +#line 3347 "cs-parser.jay" { report.Error (839, GetLocation (yyVals[0+yyTop]), "An argument is missing"); yyVal = yyVals[-1+yyTop]; } -void case_468() -#line 3306 "cs-parser.jay" +void case_454() +#line 3352 "cs-parser.jay" { report.Error (839, GetLocation (yyVals[-1+yyTop]), "An argument is missing"); yyVal = null; } -void case_473() -#line 3327 "cs-parser.jay" +void case_459() +#line 3373 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop], Argument.AType.Ref); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_474() -#line 3332 "cs-parser.jay" +void case_460() +#line 3378 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop], Argument.AType.Out); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_475() -#line 3337 "cs-parser.jay" +void case_461() +#line 3383 "cs-parser.jay" { yyVal = new Argument (new Arglist ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]))); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_476() -#line 3342 "cs-parser.jay" +void case_462() +#line 3388 "cs-parser.jay" { yyVal = new Argument (new Arglist (GetLocation (yyVals[-2+yyTop]))); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_478() -#line 3354 "cs-parser.jay" +void case_464() +#line 3400 "cs-parser.jay" { yyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_479() -#line 3362 "cs-parser.jay" +void case_465() +#line 3408 "cs-parser.jay" { var list = new List (4); list.Add ((Expression) yyVals[0+yyTop]); yyVal = list; } -void case_480() -#line 3368 "cs-parser.jay" +void case_466() +#line 3414 "cs-parser.jay" { var list = (List) yyVals[-2+yyTop]; list.Add ((Expression) yyVals[0+yyTop]); @@ -6301,23 +6376,23 @@ void case_480() yyVal = list; } -void case_481() -#line 3374 "cs-parser.jay" +void case_467() +#line 3420 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = yyVals[-1+yyTop]; } -void case_482() -#line 3382 "cs-parser.jay" +void case_468() +#line 3428 "cs-parser.jay" { Arguments args = new Arguments (4); args.Add ((Argument) yyVals[0+yyTop]); yyVal = args; } -void case_483() -#line 3388 "cs-parser.jay" +void case_469() +#line 3434 "cs-parser.jay" { Arguments args = (Arguments) yyVals[-2+yyTop]; if (args [args.Count - 1] is NamedArgument && !(yyVals[0+yyTop] is NamedArgument)) @@ -6328,22 +6403,22 @@ void case_483() yyVal = args; } -void case_487() -#line 3416 "cs-parser.jay" +void case_473() +#line 3462 "cs-parser.jay" { yyVal = new ElementAccess (new BaseThis (GetLocation (yyVals[-3+yyTop])), (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_488() -#line 3421 "cs-parser.jay" +void case_474() +#line 3467 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new ElementAccess (null, null, GetLocation (yyVals[-1+yyTop])); } -void case_491() -#line 3443 "cs-parser.jay" +void case_477() +#line 3489 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { if (lang_version <= LanguageVersion.ISO_2) @@ -6357,8 +6432,8 @@ void case_491() lbag.AddLocation (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_492() -#line 3456 "cs-parser.jay" +void case_478() +#line 3502 "cs-parser.jay" { if (lang_version <= LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "collection initializers"); @@ -6366,8 +6441,8 @@ void case_492() yyVal = new NewInitialize ((FullNamedExpression) yyVals[-1+yyTop], null, (CollectionOrObjectInitializers) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); } -void case_493() -#line 3468 "cs-parser.jay" +void case_479() +#line 3514 "cs-parser.jay" { yyVal = new ArrayCreation ((FullNamedExpression) yyVals[-5+yyTop], (List) yyVals[-3+yyTop], new ComposedTypeSpecifier (((List) yyVals[-3+yyTop]).Count, GetLocation (yyVals[-4+yyTop])) { @@ -6376,8 +6451,8 @@ void case_493() lbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); } -void case_494() -#line 3476 "cs-parser.jay" +void case_480() +#line 3522 "cs-parser.jay" { if (yyVals[0+yyTop] == null) report.Error (1586, GetLocation (yyVals[-3+yyTop]), "Array creation must have array size or array initializer"); @@ -6385,8 +6460,8 @@ void case_494() yyVal = new ArrayCreation ((FullNamedExpression) yyVals[-2+yyTop], (ComposedTypeSpecifier) yyVals[-1+yyTop], (ArrayInitializer) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); } -void case_495() -#line 3483 "cs-parser.jay" +void case_481() +#line 3529 "cs-parser.jay" { if (lang_version <= LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "implicitly typed arrays"); @@ -6394,29 +6469,29 @@ void case_495() yyVal = new ImplicitlyTypedArrayCreation ((ComposedTypeSpecifier) yyVals[-1+yyTop], (ArrayInitializer) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); } -void case_496() -#line 3490 "cs-parser.jay" +void case_482() +#line 3536 "cs-parser.jay" { report.Error (178, GetLocation (yyVals[-1+yyTop]), "Invalid rank specifier, expecting `,' or `]'"); yyVal = new ArrayCreation ((FullNamedExpression) yyVals[-5+yyTop], null, GetLocation (yyVals[-6+yyTop])); } -void case_497() -#line 3495 "cs-parser.jay" +void case_483() +#line 3541 "cs-parser.jay" { Error_SyntaxError (1526, yyToken, "Unexpected symbol"); yyVal = new ArrayCreation ((FullNamedExpression) yyVals[-1+yyTop], null, GetLocation (yyVals[-2+yyTop])); } -void case_499() -#line 3506 "cs-parser.jay" +void case_485() +#line 3552 "cs-parser.jay" { --lexer.parsing_type; yyVal = yyVals[0+yyTop]; } -void case_500() -#line 3514 "cs-parser.jay" +void case_486() +#line 3560 "cs-parser.jay" { if (lang_version <= LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "anonymous types"); @@ -6427,16 +6502,16 @@ void case_500() lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_505() -#line 3537 "cs-parser.jay" +void case_491() +#line 3583 "cs-parser.jay" { var a = new List (4); a.Add ((AnonymousTypeParameter) yyVals[0+yyTop]); yyVal = a; } -void case_506() -#line 3543 "cs-parser.jay" +void case_492() +#line 3589 "cs-parser.jay" { var a = (List) yyVals[-2+yyTop]; a.Add ((AnonymousTypeParameter) yyVals[0+yyTop]); @@ -6445,60 +6520,60 @@ void case_506() yyVal = a; } -void case_507() -#line 3554 "cs-parser.jay" +void case_493() +#line 3600 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken)yyVals[-2+yyTop]; yyVal = new AnonymousTypeParameter ((Expression)yyVals[0+yyTop], lt.Value, lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_508() -#line 3560 "cs-parser.jay" +void case_494() +#line 3606 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken)yyVals[0+yyTop]; yyVal = new AnonymousTypeParameter (new SimpleName (lt.Value, lt.Location), lt.Value, lt.Location); } -void case_509() -#line 3566 "cs-parser.jay" +void case_495() +#line 3612 "cs-parser.jay" { MemberAccess ma = (MemberAccess) yyVals[0+yyTop]; yyVal = new AnonymousTypeParameter (ma, ma.Name, ma.Location); } -void case_510() -#line 3571 "cs-parser.jay" +void case_496() +#line 3617 "cs-parser.jay" { report.Error (746, lexer.Location, "Invalid anonymous type member declarator. Anonymous type members must be a member assignment, simple name or member access expression"); yyVal = null; } -void case_514() -#line 3586 "cs-parser.jay" +void case_500() +#line 3632 "cs-parser.jay" { ((ComposedTypeSpecifier) yyVals[-1+yyTop]).Next = (ComposedTypeSpecifier) yyVals[0+yyTop]; yyVal = yyVals[-1+yyTop]; } -void case_515() -#line 3594 "cs-parser.jay" +void case_501() +#line 3640 "cs-parser.jay" { yyVal = ComposedTypeSpecifier.CreateArrayDimension (1, GetLocation (yyVals[-1+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_516() -#line 3599 "cs-parser.jay" +void case_502() +#line 3645 "cs-parser.jay" { yyVal = ComposedTypeSpecifier.CreateArrayDimension ((int)yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_521() -#line 3629 "cs-parser.jay" +void case_507() +#line 3675 "cs-parser.jay" { var ai = new ArrayInitializer (0, GetLocation (yyVals[-1+yyTop])); ai.VariableDeclaration = current_variable; @@ -6506,8 +6581,8 @@ void case_521() yyVal = ai; } -void case_522() -#line 3636 "cs-parser.jay" +void case_508() +#line 3682 "cs-parser.jay" { var ai = new ArrayInitializer ((List) yyVals[-2+yyTop], GetLocation (yyVals[-3+yyTop])); ai.VariableDeclaration = current_variable; @@ -6519,16 +6594,16 @@ void case_522() yyVal = ai; } -void case_523() -#line 3650 "cs-parser.jay" +void case_509() +#line 3696 "cs-parser.jay" { var list = new List (4); list.Add ((Expression) yyVals[0+yyTop]); yyVal = list; } -void case_524() -#line 3656 "cs-parser.jay" +void case_510() +#line 3702 "cs-parser.jay" { var list = (List) yyVals[-2+yyTop]; list.Add ((Expression) yyVals[0+yyTop]); @@ -6536,31 +6611,31 @@ void case_524() yyVal = list; } -void case_526() -#line 3670 "cs-parser.jay" +void case_512() +#line 3716 "cs-parser.jay" { lexer.TypeOfParsing = false; yyVal = new TypeOf ((FullNamedExpression) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_529() -#line 3681 "cs-parser.jay" +void case_515() +#line 3727 "cs-parser.jay" { Error_TypeExpected (lexer.Location); yyVal = null; } -void case_530() -#line 3689 "cs-parser.jay" +void case_516() +#line 3735 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new SimpleName (lt.Value, (int) yyVals[0+yyTop], lt.Location); } -void case_531() -#line 3695 "cs-parser.jay" +void case_517() +#line 3741 "cs-parser.jay" { var lt1 = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var lt2 = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; @@ -6569,35 +6644,41 @@ void case_531() lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_532() -#line 3703 "cs-parser.jay" +void case_518() +#line 3749 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; - yyVal = new MemberAccess ((Expression) yyVals[-2+yyTop], lt.Value, lt.Location); + yyVal = new MemberAccess ((Expression) yyVals[-2+yyTop], lt.Value, lt.Location) { + DotLocation = GetLocation (yyVals[-1+yyTop]) + }; } -void case_533() -#line 3709 "cs-parser.jay" +void case_519() +#line 3757 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; - yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (int) yyVals[0+yyTop], lt.Location); + yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (int) yyVals[0+yyTop], lt.Location) { + DotLocation = GetLocation (yyVals[-2+yyTop]) + }; } -void case_534() -#line 3715 "cs-parser.jay" +void case_520() +#line 3765 "cs-parser.jay" { var te = ((MemberName) yyVals[-3+yyTop]).GetTypeExpression (); if (te.HasTypeArguments) Error_TypeExpected (GetLocation (yyVals[0+yyTop])); var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; - yyVal = new MemberAccess (te, lt.Value, (int) yyVals[0+yyTop], lt.Location); + yyVal = new MemberAccess (te, lt.Value, (int) yyVals[0+yyTop], lt.Location) { + DotLocation = GetLocation (yyVals[-2+yyTop]) + }; } -void case_535() -#line 3727 "cs-parser.jay" +void case_521() +#line 3779 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "generics"); @@ -6605,8 +6686,8 @@ void case_535() yyVal = yyVals[0+yyTop]; } -void case_536() -#line 3737 "cs-parser.jay" +void case_522() +#line 3789 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; if (lang_version == LanguageVersion.ISO_1) @@ -6615,36 +6696,36 @@ void case_536() yyVal = lt; } -void case_537() -#line 3748 "cs-parser.jay" +void case_523() +#line 3800 "cs-parser.jay" { yyVal = new SizeOf ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_538() -#line 3756 "cs-parser.jay" +void case_524() +#line 3808 "cs-parser.jay" { yyVal = new CheckedExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_539() -#line 3764 "cs-parser.jay" +void case_525() +#line 3816 "cs-parser.jay" { yyVal = new UnCheckedExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_540() -#line 3772 "cs-parser.jay" +void case_526() +#line 3824 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess (new Indirection ((Expression) yyVals[-3+yyTop], GetLocation (yyVals[-2+yyTop])), lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); } -void case_542() -#line 3784 "cs-parser.jay" +void case_528() +#line 3836 "cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); if ((ParametersCompiled) yyVals[-2+yyTop] != ParametersCompiled.Undefined) { @@ -6654,8 +6735,8 @@ void case_542() } } -void case_548() -#line 3816 "cs-parser.jay" +void case_534() +#line 3868 "cs-parser.jay" { valid_param_mod = 0; yyVal = yyVals[-1+yyTop]; @@ -6663,8 +6744,8 @@ void case_548() savedCloseLocation = GetLocation (yyVals[-2+yyTop]); } -void case_549() -#line 3826 "cs-parser.jay" +void case_535() +#line 3878 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "default value expression"); @@ -6673,148 +6754,148 @@ void case_549() lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_555() -#line 3851 "cs-parser.jay" +void case_541() +#line 3903 "cs-parser.jay" { yyVal = new Cast ((FullNamedExpression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_556() -#line 3859 "cs-parser.jay" +void case_542() +#line 3911 "cs-parser.jay" { current_block.ParametersBlock.IsAsync = true; yyVal = new Await ((Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); - } + } -void case_565() -#line 3900 "cs-parser.jay" +void case_551() +#line 3952 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Multiply, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_566() -#line 3905 "cs-parser.jay" +void case_552() +#line 3957 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Division, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_567() -#line 3910 "cs-parser.jay" +void case_553() +#line 3962 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Modulus, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_569() -#line 3919 "cs-parser.jay" +void case_555() +#line 3971 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Addition, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_571() -#line 3928 "cs-parser.jay" +void case_557() +#line 3980 "cs-parser.jay" { /* Shift/Reduce conflict*/ yyVal = new Binary (Binary.Operator.Subtraction, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_575() -#line 3945 "cs-parser.jay" +void case_561() +#line 3997 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.LeftShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_576() -#line 3950 "cs-parser.jay" +void case_562() +#line 4002 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.RightShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_578() -#line 3959 "cs-parser.jay" +void case_564() +#line 4011 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.LessThan, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_579() -#line 3964 "cs-parser.jay" +void case_565() +#line 4016 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.GreaterThan, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_580() -#line 3969 "cs-parser.jay" +void case_566() +#line 4021 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.LessThanOrEqual, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_581() -#line 3974 "cs-parser.jay" +void case_567() +#line 4026 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.GreaterThanOrEqual, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_583() -#line 3983 "cs-parser.jay" +void case_569() +#line 4035 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Equality, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_584() -#line 3988 "cs-parser.jay" +void case_570() +#line 4040 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Inequality, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_586() -#line 3997 "cs-parser.jay" +void case_572() +#line 4049 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.BitwiseAnd, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_588() -#line 4006 "cs-parser.jay" +void case_574() +#line 4058 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.ExclusiveOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_590() -#line 4015 "cs-parser.jay" +void case_576() +#line 4067 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.BitwiseOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_592() -#line 4024 "cs-parser.jay" +void case_578() +#line 4076 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.LogicalAnd, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_594() -#line 4033 "cs-parser.jay" +void case_580() +#line 4085 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.LogicalOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_596() -#line 4042 "cs-parser.jay" +void case_582() +#line 4094 "cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), "null coalescing operator"); @@ -6822,94 +6903,94 @@ void case_596() yyVal = new Nullable.NullCoalescingOperator ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_598() -#line 4053 "cs-parser.jay" +void case_584() +#line 4105 "cs-parser.jay" { yyVal = new Conditional (new BooleanExpression ((Expression) yyVals[-4+yyTop]), (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_600() -#line 4065 "cs-parser.jay" +void case_586() +#line 4117 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.Multiply, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_601() -#line 4070 "cs-parser.jay" +void case_587() +#line 4122 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.Division, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_602() -#line 4075 "cs-parser.jay" +void case_588() +#line 4127 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.Modulus, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_603() -#line 4080 "cs-parser.jay" +void case_589() +#line 4132 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.Addition, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_604() -#line 4085 "cs-parser.jay" +void case_590() +#line 4137 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.Subtraction, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_605() -#line 4090 "cs-parser.jay" +void case_591() +#line 4142 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.LeftShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_606() -#line 4095 "cs-parser.jay" +void case_592() +#line 4147 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.RightShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_607() -#line 4100 "cs-parser.jay" +void case_593() +#line 4152 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.BitwiseAnd, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_608() -#line 4105 "cs-parser.jay" +void case_594() +#line 4157 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.BitwiseOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_609() -#line 4110 "cs-parser.jay" +void case_595() +#line 4162 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.ExclusiveOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } -void case_610() -#line 4118 "cs-parser.jay" +void case_596() +#line 4170 "cs-parser.jay" { var pars = new List (4); pars.Add ((Parameter) yyVals[0+yyTop]); - + parameterListCommas.Clear (); yyVal = pars; } -void case_611() -#line 4125 "cs-parser.jay" +void case_597() +#line 4177 "cs-parser.jay" { var pars = (List) yyVals[-2+yyTop]; Parameter p = (Parameter)yyVals[0+yyTop]; @@ -6918,43 +6999,44 @@ void case_611() } pars.Add (p); - lbag.AppendTo (pars, GetLocation (yyVals[-1+yyTop])); + parameterListCommas.Add (GetLocation (yyVals[-1+yyTop])); yyVal = pars; } -void case_612() -#line 4141 "cs-parser.jay" +void case_598() +#line 4193 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Parameter.Modifier) yyVals[-2+yyTop], null, lt.Location); } -void case_613() -#line 4147 "cs-parser.jay" +void case_599() +#line 4199 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, Parameter.Modifier.NONE, null, lt.Location); } -void case_614() -#line 4153 "cs-parser.jay" +void case_600() +#line 4205 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new ImplicitLambdaParameter (lt.Value, lt.Location); } -void case_616() -#line 4161 "cs-parser.jay" +void case_602() +#line 4213 "cs-parser.jay" { var pars_list = (List) yyVals[0+yyTop]; yyVal = new ParametersCompiled (pars_list.ToArray ()); + lbag.AddLocation (yyVal, parameterListCommas); } -void case_620() -#line 4177 "cs-parser.jay" +void case_606() +#line 4230 "cs-parser.jay" { Block b = end_block (lexer.Location); b.IsCompilerGenerated = true; @@ -6962,142 +7044,147 @@ void case_620() yyVal = b; } -void case_622() -#line 4188 "cs-parser.jay" +void case_608() +#line 4241 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = EmptyExpression.Null; } -void case_623() -#line 4196 "cs-parser.jay" +void case_609() +#line 4249 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; Parameter p = new ImplicitLambdaParameter (lt.Value, lt.Location); start_anonymous (true, new ParametersCompiled (p), false, lt.Location); } -void case_624() -#line 4202 "cs-parser.jay" +void case_610() +#line 4255 "cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } -void case_625() -#line 4207 "cs-parser.jay" +void case_611() +#line 4260 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; Parameter p = new ImplicitLambdaParameter (lt.Value, lt.Location); start_anonymous (true, new ParametersCompiled (p), true, lt.Location); } -void case_626() -#line 4213 "cs-parser.jay" +void case_612() +#line 4266 "cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); } -void case_628() -#line 4222 "cs-parser.jay" +void case_614() +#line 4275 "cs-parser.jay" { valid_param_mod = 0; start_anonymous (true, (ParametersCompiled) yyVals[-2+yyTop], false, GetLocation (yyVals[-4+yyTop])); } -void case_629() -#line 4227 "cs-parser.jay" +void case_615() +#line 4280 "cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-2+yyTop])); } -void case_631() -#line 4236 "cs-parser.jay" +void case_617() +#line 4289 "cs-parser.jay" { valid_param_mod = 0; start_anonymous (true, (ParametersCompiled) yyVals[-2+yyTop], true, GetLocation (yyVals[-5+yyTop])); } -void case_632() -#line 4241 "cs-parser.jay" +void case_618() +#line 4294 "cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-7+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-2+yyTop])); } -void case_639() -#line 4264 "cs-parser.jay" +void case_625() +#line 4317 "cs-parser.jay" { yyVal = new RefValueExpr ((Expression) yyVals[-3+yyTop], (FullNamedExpression) yyVals[-1+yyTop], GetLocation (yyVals[-5+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_640() -#line 4269 "cs-parser.jay" +void case_626() +#line 4322 "cs-parser.jay" { yyVal = new RefTypeExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_641() -#line 4274 "cs-parser.jay" +void case_627() +#line 4327 "cs-parser.jay" { yyVal = new MakeRefExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_645() -#line 4303 "cs-parser.jay" +void case_631() +#line 4356 "cs-parser.jay" { MemberName name = MakeName ((MemberName) yyVals[0+yyTop]); Class c = new Class (current_namespace, current_class, name, (Modifiers) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop]); if (((c.ModFlags & Modifiers.STATIC) != 0) && lang_version == LanguageVersion.ISO_1) { FeatureIsNotAvailable (c.Location, "static classes"); } - + push_current_class (c, yyVals[-3+yyTop]); + lbag.AddMember (current_class, GetModifierLocations (), GetLocation (yyVals[-2+yyTop])); } -void case_646() -#line 4314 "cs-parser.jay" +void case_632() +#line 4368 "cs-parser.jay" { lexer.ConstraintsParsing = false; current_class.SetParameterInfo ((List) yyVals[0+yyTop]); - lbag.AddMember (current_class, GetModifierLocations (), GetLocation (yyVals[-5+yyTop])); if (doc_support) { current_container.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } + + lexer.parsing_modifiers = true; } -void case_647() -#line 4326 "cs-parser.jay" +void case_633() +#line 4381 "cs-parser.jay" { --lexer.parsing_declaration; if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } -void case_648() -#line 4332 "cs-parser.jay" +void case_634() +#line 4387 "cs-parser.jay" { - lbag.AppendToMember (current_class, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); + lbag.AppendToMember (current_class, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); + if (yyVals[0+yyTop] != null) + current_class.OptionalSemicolon = GetLocation (yyVals[0+yyTop]); yyVal = pop_current_class (); } -void case_651() -#line 4347 "cs-parser.jay" +void case_637() +#line 4404 "cs-parser.jay" { mod_locations = null; yyVal = ModifierNone; + lexer.parsing_modifiers = false; } -void case_654() -#line 4357 "cs-parser.jay" +void case_640() +#line 4418 "cs-parser.jay" { var m1 = (Modifiers) yyVals[-1+yyTop]; var m2 = (Modifiers) yyVals[0+yyTop]; @@ -7114,8 +7201,8 @@ void case_654() yyVal = m1 | m2; } -void case_655() -#line 4376 "cs-parser.jay" +void case_641() +#line 4437 "cs-parser.jay" { yyVal = Modifiers.NEW; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); @@ -7124,92 +7211,92 @@ void case_655() report.Error (1530, GetLocation (yyVals[0+yyTop]), "Keyword `new' is not allowed on namespace elements"); } -void case_656() -#line 4384 "cs-parser.jay" +void case_642() +#line 4445 "cs-parser.jay" { yyVal = Modifiers.PUBLIC; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_657() -#line 4389 "cs-parser.jay" +void case_643() +#line 4450 "cs-parser.jay" { yyVal = Modifiers.PROTECTED; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_658() -#line 4394 "cs-parser.jay" +void case_644() +#line 4455 "cs-parser.jay" { yyVal = Modifiers.INTERNAL; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_659() -#line 4399 "cs-parser.jay" +void case_645() +#line 4460 "cs-parser.jay" { yyVal = Modifiers.PRIVATE; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_660() -#line 4404 "cs-parser.jay" +void case_646() +#line 4465 "cs-parser.jay" { yyVal = Modifiers.ABSTRACT; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_661() -#line 4409 "cs-parser.jay" +void case_647() +#line 4470 "cs-parser.jay" { yyVal = Modifiers.SEALED; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_662() -#line 4414 "cs-parser.jay" +void case_648() +#line 4475 "cs-parser.jay" { yyVal = Modifiers.STATIC; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_663() -#line 4419 "cs-parser.jay" +void case_649() +#line 4480 "cs-parser.jay" { yyVal = Modifiers.READONLY; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_664() -#line 4424 "cs-parser.jay" +void case_650() +#line 4485 "cs-parser.jay" { yyVal = Modifiers.VIRTUAL; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_665() -#line 4429 "cs-parser.jay" +void case_651() +#line 4490 "cs-parser.jay" { yyVal = Modifiers.OVERRIDE; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_666() -#line 4434 "cs-parser.jay" +void case_652() +#line 4495 "cs-parser.jay" { yyVal = Modifiers.EXTERN; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_667() -#line 4439 "cs-parser.jay" +void case_653() +#line 4500 "cs-parser.jay" { yyVal = Modifiers.VOLATILE; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_668() -#line 4444 "cs-parser.jay" +void case_654() +#line 4505 "cs-parser.jay" { yyVal = Modifiers.UNSAFE; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); @@ -7217,30 +7304,37 @@ void case_668() Error_UnsafeCodeNotAllowed (GetLocation (yyVals[0+yyTop])); } -void case_669() -#line 4451 "cs-parser.jay" +void case_655() +#line 4512 "cs-parser.jay" { yyVal = Modifiers.ASYNC; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_674() -#line 4472 "cs-parser.jay" +void case_657() +#line 4521 "cs-parser.jay" +{ + lbag.AppendToMember (current_class, GetLocation (yyVals[-1+yyTop])); + current_container.AddBasesForPart (current_class, (List) yyVals[0+yyTop]); + } + +void case_660() +#line 4534 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } -void case_675() -#line 4480 "cs-parser.jay" +void case_661() +#line 4542 "cs-parser.jay" { var constraints = new List (1); constraints.Add ((Constraints) yyVals[0+yyTop]); yyVal = constraints; } -void case_676() -#line 4486 "cs-parser.jay" +void case_662() +#line 4548 "cs-parser.jay" { var constraints = (List) yyVals[-1+yyTop]; Constraints new_constraint = (Constraints)yyVals[0+yyTop]; @@ -7257,23 +7351,24 @@ void case_676() yyVal = constraints; } -void case_677() -#line 4505 "cs-parser.jay" +void case_663() +#line 4567 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new Constraints (new SimpleMemberName (lt.Value, lt.Location), (List) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); + lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_678() -#line 4513 "cs-parser.jay" +void case_664() +#line 4576 "cs-parser.jay" { var constraints = new List (1); constraints.Add ((FullNamedExpression) yyVals[0+yyTop]); yyVal = constraints; } -void case_679() -#line 4519 "cs-parser.jay" +void case_665() +#line 4582 "cs-parser.jay" { var constraints = (List) yyVals[-2+yyTop]; var prev = constraints [constraints.Count - 1] as SpecialContraintExpr; @@ -7294,11 +7389,12 @@ void case_679() } constraints.Add ((FullNamedExpression) yyVals[0+yyTop]); + lbag.AppendTo (constraints, GetLocation (yyVals[-1+yyTop])); yyVal = constraints; } -void case_680() -#line 4545 "cs-parser.jay" +void case_666() +#line 4609 "cs-parser.jay" { if (yyVals[0+yyTop] is ComposedCast) report.Error (706, GetLocation (yyVals[0+yyTop]), "Invalid constraint type `{0}'", ((ComposedCast)yyVals[0+yyTop]).GetSignatureForError ()); @@ -7306,15 +7402,15 @@ void case_680() yyVal = yyVals[0+yyTop]; } -void case_681() -#line 4552 "cs-parser.jay" +void case_667() +#line 4616 "cs-parser.jay" { yyVal = new SpecialContraintExpr (SpecialConstraint.Constructor, GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_685() -#line 4572 "cs-parser.jay" +void case_671() +#line 4636 "cs-parser.jay" { if (lang_version <= LanguageVersion.V_3) FeatureIsNotAvailable (lexer.Location, "generic type variance"); @@ -7322,88 +7418,102 @@ void case_685() yyVal = yyVals[0+yyTop]; } -void case_688() -#line 4606 "cs-parser.jay" +void case_672() +#line 4646 "cs-parser.jay" +{ + yyVal = Variance.Covariant; + savedLocation = GetLocation (yyVals[0+yyTop]); + } + +void case_673() +#line 4651 "cs-parser.jay" +{ + yyVal = Variance.Contravariant; + savedLocation = GetLocation (yyVals[0+yyTop]); + } + +void case_674() +#line 4672 "cs-parser.jay" { ++lexer.parsing_block; start_block (GetLocation (yyVals[0+yyTop])); } -void case_690() -#line 4618 "cs-parser.jay" +void case_676() +#line 4684 "cs-parser.jay" { --lexer.parsing_block; yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_691() -#line 4623 "cs-parser.jay" +void case_677() +#line 4689 "cs-parser.jay" { --lexer.parsing_block; yyVal = end_block (lexer.Location); } -void case_692() -#line 4632 "cs-parser.jay" +void case_678() +#line 4698 "cs-parser.jay" { ++lexer.parsing_block; current_block.StartLocation = GetLocation (yyVals[0+yyTop]); } -void case_693() -#line 4637 "cs-parser.jay" +void case_679() +#line 4703 "cs-parser.jay" { --lexer.parsing_block; yyVal = end_block (GetLocation (yyVals[0+yyTop])); } -void case_701() -#line 4664 "cs-parser.jay" +void case_687() +#line 4730 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } -void case_734() -#line 4728 "cs-parser.jay" +void case_720() +#line 4794 "cs-parser.jay" { report.Error (1023, GetLocation (yyVals[0+yyTop]), "An embedded statement may not be a declaration or labeled statement"); yyVal = null; } -void case_735() -#line 4733 "cs-parser.jay" +void case_721() +#line 4799 "cs-parser.jay" { report.Error (1023, GetLocation (yyVals[0+yyTop]), "An embedded statement may not be a declaration or labeled statement"); yyVal = null; } -void case_736() -#line 4738 "cs-parser.jay" +void case_722() +#line 4804 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new EmptyStatement (GetLocation (yyVals[0+yyTop])); } -void case_737() -#line 4746 "cs-parser.jay" +void case_723() +#line 4812 "cs-parser.jay" { /* Uses lexer.Location because semicolon location is not kept in quick mode*/ yyVal = new EmptyStatement (lexer.Location); } -void case_738() -#line 4754 "cs-parser.jay" +void case_724() +#line 4820 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; LabeledStatement labeled = new LabeledStatement (lt.Value, current_block, lt.Location); - + lbag.AddLocation (labeled, GetLocation (yyVals[0+yyTop])); current_block.AddLabel (labeled); current_block.AddStatement (labeled); } -void case_741() -#line 4767 "cs-parser.jay" +void case_727() +#line 4833 "cs-parser.jay" { if (yyVals[-1+yyTop] is VarExpr) yyVals[-1+yyTop] = new SimpleName ("var", ((VarExpr) yyVals[-1+yyTop]).Location); @@ -7411,8 +7521,8 @@ void case_741() yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } -void case_742() -#line 4783 "cs-parser.jay" +void case_728() +#line 4849 "cs-parser.jay" { /* Ok, the above "primary_expression" is there to get rid of*/ /* both reduce/reduce and shift/reduces in the grammar, it should*/ @@ -7443,8 +7553,8 @@ void case_742() } } -void case_743() -#line 4813 "cs-parser.jay" +void case_729() +#line 4879 "cs-parser.jay" { ATypeNameExpression expr = yyVals[-1+yyTop] as ATypeNameExpression; @@ -7456,8 +7566,8 @@ void case_743() } } -void case_744() -#line 4824 "cs-parser.jay" +void case_730() +#line 4890 "cs-parser.jay" { if (yyVals[0+yyTop] == null) yyVal = yyVals[-1+yyTop]; @@ -7465,22 +7575,22 @@ void case_744() yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } -void case_747() -#line 4839 "cs-parser.jay" +void case_733() +#line 4905 "cs-parser.jay" { Expression.Error_VoidInvalidInTheContext (GetLocation (yyVals[0+yyTop]), report); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } -void case_749() -#line 4848 "cs-parser.jay" +void case_735() +#line 4914 "cs-parser.jay" { ((ComposedTypeSpecifier) yyVals[-1+yyTop]).Next = (ComposedTypeSpecifier) yyVals[0+yyTop]; yyVal = yyVals[-1+yyTop]; } -void case_751() -#line 4863 "cs-parser.jay" +void case_737() +#line 4929 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_block, lt.Value, lt.Location); @@ -7488,16 +7598,16 @@ void case_751() current_variable = new BlockVariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li); } -void case_752() -#line 4870 "cs-parser.jay" +void case_738() +#line 4936 "cs-parser.jay" { yyVal = current_variable; current_variable = null; lbag.AppendTo (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_753() -#line 4876 "cs-parser.jay" +void case_739() +#line 4942 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.Constant, lt.Location); @@ -7505,8 +7615,8 @@ void case_753() current_variable = new BlockConstantDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li); } -void case_754() -#line 4883 "cs-parser.jay" +void case_740() +#line 4949 "cs-parser.jay" { if (current_variable.Initializer != null) { lbag.AddLocation (current_variable, GetLocation (yyVals[-6+yyTop]), savedLocation, GetLocation (yyVals[0+yyTop])); @@ -7517,15 +7627,15 @@ void case_754() current_variable = null; } -void case_756() -#line 4897 "cs-parser.jay" +void case_742() +#line 4963 "cs-parser.jay" { current_variable.Initializer = (Expression) yyVals[0+yyTop]; lbag.AppendTo (current_variable, GetLocation (yyVals[-1+yyTop])); } -void case_757() -#line 4902 "cs-parser.jay" +void case_743() +#line 4968 "cs-parser.jay" { if (yyToken == Token.OPEN_BRACKET_EXPR) { report.Error (650, lexer.Location, @@ -7535,8 +7645,17 @@ void case_757() } } -void case_762() -#line 4924 "cs-parser.jay" +void case_747() +#line 4986 "cs-parser.jay" +{ + foreach (var d in current_variable.Declarators) { + if (d.Initializer == null) + Error_MissingInitializer (d.Variable.Location); + } + } + +void case_750() +#line 5001 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_variable.Variable, lt.Value, lt.Location); @@ -7546,8 +7665,8 @@ void case_762() lbag.AddLocation (d, GetLocation (yyVals[-1+yyTop])); } -void case_763() -#line 4933 "cs-parser.jay" +void case_751() +#line 5010 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var li = new LocalVariable (current_variable.Variable, lt.Value, lt.Location); @@ -7557,15 +7676,15 @@ void case_763() lbag.AddLocation (d, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_765() -#line 4949 "cs-parser.jay" +void case_753() +#line 5026 "cs-parser.jay" { savedLocation = GetLocation (yyVals[-1+yyTop]); current_variable.Initializer = (Expression) yyVals[0+yyTop]; } -void case_770() -#line 4967 "cs-parser.jay" +void case_758() +#line 5044 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.Constant, lt.Location); @@ -7575,29 +7694,29 @@ void case_770() lbag.AddLocation (d, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_772() -#line 4980 "cs-parser.jay" +void case_760() +#line 5057 "cs-parser.jay" { yyVal = new StackAlloc ((Expression) yyVals[-3+yyTop], (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_773() -#line 4985 "cs-parser.jay" +void case_761() +#line 5062 "cs-parser.jay" { report.Error (1575, GetLocation (yyVals[-1+yyTop]), "A stackalloc expression requires [] after type"); yyVal = new StackAlloc ((Expression) yyVals[0+yyTop], null, GetLocation (yyVals[-1+yyTop])); } -void case_774() -#line 4993 "cs-parser.jay" +void case_762() +#line 5070 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_778() -#line 5011 "cs-parser.jay" +void case_766() +#line 5088 "cs-parser.jay" { ExpressionStatement s = yyVals[0+yyTop] as ExpressionStatement; if (s == null) { @@ -7608,8 +7727,8 @@ void case_778() } } -void case_779() -#line 5024 "cs-parser.jay" +void case_767() +#line 5101 "cs-parser.jay" { Expression expr = (Expression) yyVals[0+yyTop]; ExpressionStatement s; @@ -7618,15 +7737,15 @@ void case_779() yyVal = new StatementExpression (s); } -void case_780() -#line 5032 "cs-parser.jay" +void case_768() +#line 5109 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new EmptyStatement (GetLocation (yyVals[0+yyTop])); } -void case_783() -#line 5046 "cs-parser.jay" +void case_771() +#line 5123 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -7635,8 +7754,8 @@ void case_783() lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_784() -#line 5055 "cs-parser.jay" +void case_772() +#line 5132 "cs-parser.jay" { yyVal = new If ((BooleanExpression) yyVals[-4+yyTop], (Statement) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-6+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); @@ -7647,23 +7766,23 @@ void case_784() Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); } -void case_786() -#line 5072 "cs-parser.jay" +void case_774() +#line 5149 "cs-parser.jay" { yyVal = new Switch ((Expression) yyVals[-5+yyTop], (ExplicitBlock) current_block.Explicit, (List) yyVals[-1+yyTop], GetLocation (yyVals[-7+yyTop])); end_block (GetLocation (yyVals[0+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_787() -#line 5081 "cs-parser.jay" +void case_775() +#line 5158 "cs-parser.jay" { report.Warning (1522, 1, current_block.StartLocation, "Empty switch block"); yyVal = new List (); } -void case_789() -#line 5090 "cs-parser.jay" +void case_777() +#line 5167 "cs-parser.jay" { var sections = new List (4); @@ -7671,8 +7790,8 @@ void case_789() yyVal = sections; } -void case_790() -#line 5097 "cs-parser.jay" +void case_778() +#line 5174 "cs-parser.jay" { var sections = (List) yyVals[-1+yyTop]; @@ -7680,15 +7799,15 @@ void case_790() yyVal = sections; } -void case_791() -#line 5104 "cs-parser.jay" +void case_779() +#line 5181 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new List (); } -void case_794() -#line 5123 "cs-parser.jay" +void case_782() +#line 5200 "cs-parser.jay" { var labels = new List (2); @@ -7696,8 +7815,8 @@ void case_794() yyVal = labels; } -void case_795() -#line 5130 "cs-parser.jay" +void case_783() +#line 5207 "cs-parser.jay" { var labels = (List) (yyVals[-1+yyTop]); labels.Add ((SwitchLabel) yyVals[0+yyTop]); @@ -7705,15 +7824,15 @@ void case_795() yyVal = labels; } -void case_796() -#line 5140 "cs-parser.jay" +void case_784() +#line 5217 "cs-parser.jay" { yyVal = new SwitchLabel ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_802() -#line 5159 "cs-parser.jay" +void case_790() +#line 5236 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -7722,22 +7841,22 @@ void case_802() lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_803() -#line 5171 "cs-parser.jay" +void case_791() +#line 5248 "cs-parser.jay" { yyVal = new Do ((Statement) yyVals[-5+yyTop], (BooleanExpression) yyVals[-2+yyTop], GetLocation (yyVals[-6+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_804() -#line 5179 "cs-parser.jay" +void case_792() +#line 5256 "cs-parser.jay" { start_block (GetLocation (yyVals[0+yyTop])); current_block.IsCompilerGenerated = true; } -void case_806() -#line 5195 "cs-parser.jay" +void case_794() +#line 5272 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -7750,15 +7869,15 @@ void case_806() yyVal = end_block (GetLocation (yyVals[-5+yyTop])); } -void case_807() -#line 5207 "cs-parser.jay" +void case_795() +#line 5284 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = end_block (current_block.StartLocation); } -void case_810() -#line 5220 "cs-parser.jay" +void case_798() +#line 5297 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_block, lt.Value, lt.Location); @@ -7766,15 +7885,15 @@ void case_810() current_variable = new BlockVariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li); } -void case_811() -#line 5227 "cs-parser.jay" +void case_799() +#line 5304 "cs-parser.jay" { yyVal = current_variable; current_variable = null; } -void case_819() -#line 5251 "cs-parser.jay" +void case_807() +#line 5328 "cs-parser.jay" { var sl = yyVals[-2+yyTop] as StatementList; if (sl == null) { @@ -7788,15 +7907,15 @@ void case_819() yyVal = sl; } -void case_820() -#line 5267 "cs-parser.jay" +void case_808() +#line 5344 "cs-parser.jay" { report.Error (230, GetLocation (yyVals[-5+yyTop]), "Type and identifier are both required in a foreach statement"); yyVal = null; } -void case_821() -#line 5272 "cs-parser.jay" +void case_809() +#line 5349 "cs-parser.jay" { start_block (GetLocation (yyVals[-5+yyTop])); current_block.IsCompilerGenerated = true; @@ -7806,8 +7925,8 @@ void case_821() yyVal = li; } -void case_822() -#line 5281 "cs-parser.jay" +void case_810() +#line 5358 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -7819,58 +7938,58 @@ void case_822() yyVal = end_block (GetLocation (yyVals[-2+yyTop])); } -void case_829() -#line 5304 "cs-parser.jay" +void case_817() +#line 5381 "cs-parser.jay" { yyVal = new Break (GetLocation (yyVals[-1+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_830() -#line 5312 "cs-parser.jay" +void case_818() +#line 5389 "cs-parser.jay" { yyVal = new Continue (GetLocation (yyVals[-1+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_831() -#line 5320 "cs-parser.jay" +void case_819() +#line 5397 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new Goto (lt.Value, GetLocation (yyVals[-2+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_832() -#line 5326 "cs-parser.jay" +void case_820() +#line 5403 "cs-parser.jay" { yyVal = new GotoCase ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_833() -#line 5331 "cs-parser.jay" +void case_821() +#line 5408 "cs-parser.jay" { yyVal = new GotoDefault (GetLocation (yyVals[-2+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_834() -#line 5339 "cs-parser.jay" +void case_822() +#line 5416 "cs-parser.jay" { yyVal = new Return ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_835() -#line 5347 "cs-parser.jay" +void case_823() +#line 5424 "cs-parser.jay" { yyVal = new Throw ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_836() -#line 5355 "cs-parser.jay" +void case_824() +#line 5432 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; string s = lt.Value; @@ -7887,8 +8006,8 @@ void case_836() lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_837() -#line 5371 "cs-parser.jay" +void case_825() +#line 5448 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; string s = lt.Value; @@ -7903,29 +8022,29 @@ void case_837() lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } -void case_841() -#line 5397 "cs-parser.jay" +void case_829() +#line 5474 "cs-parser.jay" { yyVal = new TryFinally ((Statement) yyVals[-2+yyTop], (Block) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_842() -#line 5402 "cs-parser.jay" +void case_830() +#line 5479 "cs-parser.jay" { yyVal = new TryFinally (new TryCatch ((Block) yyVals[-3+yyTop], (List) yyVals[-2+yyTop], GetLocation (yyVals[-4+yyTop]), true), (Block) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop])); } -void case_843() -#line 5407 "cs-parser.jay" +void case_831() +#line 5484 "cs-parser.jay" { report.Error (1524, GetLocation (yyVals[-2+yyTop]), "Expected catch or finally"); yyVal = null; } -void case_844() -#line 5415 "cs-parser.jay" +void case_832() +#line 5492 "cs-parser.jay" { var l = new List (2); @@ -7933,8 +8052,8 @@ void case_844() yyVal = l; } -void case_845() -#line 5422 "cs-parser.jay" +void case_833() +#line 5499 "cs-parser.jay" { var l = (List) yyVals[-1+yyTop]; @@ -7951,8 +8070,8 @@ void case_845() yyVal = l; } -void case_849() -#line 5450 "cs-parser.jay" +void case_837() +#line 5527 "cs-parser.jay" { start_block (GetLocation (yyVals[-3+yyTop])); var c = new Catch (current_block, GetLocation (yyVals[-4+yyTop])); @@ -7968,8 +8087,8 @@ void case_849() yyVal = c; } -void case_851() -#line 5469 "cs-parser.jay" +void case_839() +#line 5546 "cs-parser.jay" { if (yyToken == Token.CLOSE_PARENS) { report.Error (1015, lexer.Location, @@ -7981,15 +8100,15 @@ void case_851() yyVal = new Catch (null, GetLocation (yyVals[-2+yyTop])); } -void case_854() -#line 5497 "cs-parser.jay" +void case_842() +#line 5574 "cs-parser.jay" { if (!settings.Unsafe) Error_UnsafeCodeNotAllowed (GetLocation (yyVals[0+yyTop])); } -void case_856() -#line 5507 "cs-parser.jay" +void case_844() +#line 5584 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -7998,8 +8117,8 @@ void case_856() lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } -void case_857() -#line 5518 "cs-parser.jay" +void case_845() +#line 5595 "cs-parser.jay" { start_block (GetLocation (yyVals[-2+yyTop])); @@ -8010,15 +8129,15 @@ void case_857() current_variable = new Fixed.VariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li); } -void case_858() -#line 5528 "cs-parser.jay" +void case_846() +#line 5605 "cs-parser.jay" { yyVal = current_variable; current_variable = null; } -void case_859() -#line 5533 "cs-parser.jay" +void case_847() +#line 5610 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -8029,8 +8148,8 @@ void case_859() yyVal = end_block (GetLocation (yyVals[-2+yyTop])); } -void case_860() -#line 5546 "cs-parser.jay" +void case_848() +#line 5623 "cs-parser.jay" { start_block (GetLocation (yyVals[-2+yyTop])); @@ -8041,15 +8160,15 @@ void case_860() current_variable = new Using.VariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li); } -void case_861() -#line 5556 "cs-parser.jay" +void case_849() +#line 5633 "cs-parser.jay" { yyVal = current_variable; current_variable = null; } -void case_862() -#line 5561 "cs-parser.jay" +void case_850() +#line 5638 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -8060,8 +8179,8 @@ void case_862() yyVal = end_block (GetLocation (yyVals[-2+yyTop])); } -void case_863() -#line 5571 "cs-parser.jay" +void case_851() +#line 5648 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); @@ -8071,15 +8190,16 @@ void case_863() yyVal = u; } -void case_865() -#line 5587 "cs-parser.jay" +void case_853() +#line 5664 "cs-parser.jay" { current_variable.Initializer = (Expression) yyVals[0+yyTop]; + lbag.AppendTo (current_variable, GetLocation (yyVals[-1+yyTop])); yyVal = current_variable; } -void case_866() -#line 5598 "cs-parser.jay" +void case_854() +#line 5676 "cs-parser.jay" { lexer.query_parsing = false; @@ -8092,8 +8212,8 @@ void case_866() current_block = current_block.Parent; } -void case_867() -#line 5610 "cs-parser.jay" +void case_855() +#line 5688 "cs-parser.jay" { Linq.AQueryClause from = yyVals[-1+yyTop] as Linq.AQueryClause; @@ -8104,8 +8224,8 @@ void case_867() current_block = current_block.Parent; } -void case_868() -#line 5621 "cs-parser.jay" +void case_856() +#line 5699 "cs-parser.jay" { lexer.query_parsing = false; yyVal = yyVals[-1+yyTop]; @@ -8114,16 +8234,16 @@ void case_868() current_block = current_block.Parent; } -void case_869() -#line 5628 "cs-parser.jay" +void case_857() +#line 5706 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } -void case_870() -#line 5637 "cs-parser.jay" +void case_858() +#line 5715 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); @@ -8132,8 +8252,8 @@ void case_870() yyVal = new Linq.QueryExpression (new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], rv, GetLocation (yyVals[-3+yyTop]))); } -void case_871() -#line 5645 "cs-parser.jay" +void case_859() +#line 5723 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); @@ -8146,8 +8266,8 @@ void case_871() ); } -void case_872() -#line 5660 "cs-parser.jay" +void case_860() +#line 5738 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); @@ -8156,8 +8276,8 @@ void case_872() yyVal = new Linq.QueryExpression (new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], rv, GetLocation (yyVals[-3+yyTop]))); } -void case_873() -#line 5668 "cs-parser.jay" +void case_861() +#line 5746 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); @@ -8170,8 +8290,8 @@ void case_873() ); } -void case_875() -#line 5687 "cs-parser.jay" +void case_863() +#line 5765 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var sn = new Linq.RangeVariable (lt.Value, lt.Location); @@ -8183,8 +8303,8 @@ void case_875() ((Linq.QueryBlock)current_block).AddRangeVariable (sn); } -void case_877() -#line 5702 "cs-parser.jay" +void case_865() +#line 5780 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var sn = new Linq.RangeVariable (lt.Value, lt.Location); @@ -8199,8 +8319,8 @@ void case_877() ((Linq.QueryBlock)current_block).AddRangeVariable (sn); } -void case_878() -#line 5719 "cs-parser.jay" +void case_866() +#line 5797 "cs-parser.jay" { Linq.AQueryClause head = (Linq.AQueryClause)yyVals[-1+yyTop]; @@ -8216,15 +8336,15 @@ void case_878() yyVal = head; } -void case_880() -#line 5735 "cs-parser.jay" +void case_868() +#line 5813 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } -void case_882() -#line 5747 "cs-parser.jay" +void case_870() +#line 5825 "cs-parser.jay" { yyVal = new Linq.Select ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); @@ -8232,8 +8352,8 @@ void case_882() current_block = current_block.Parent; } -void case_883() -#line 5754 "cs-parser.jay" +void case_871() +#line 5832 "cs-parser.jay" { if (linq_clause_blocks == null) linq_clause_blocks = new Stack (); @@ -8242,8 +8362,8 @@ void case_883() linq_clause_blocks.Push ((Linq.QueryBlock)current_block); } -void case_884() -#line 5762 "cs-parser.jay" +void case_872() +#line 5840 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -8251,8 +8371,8 @@ void case_884() current_block = new Linq.QueryBlock (current_block, lexer.Location); } -void case_885() -#line 5769 "cs-parser.jay" +void case_873() +#line 5847 "cs-parser.jay" { yyVal = new Linq.GroupBy ((Linq.QueryBlock)current_block, (Expression)yyVals[-3+yyTop], linq_clause_blocks.Pop (), (Expression)yyVals[0+yyTop], GetLocation (yyVals[-5+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); @@ -8261,15 +8381,15 @@ void case_885() current_block = current_block.Parent; } -void case_889() -#line 5786 "cs-parser.jay" +void case_877() +#line 5864 "cs-parser.jay" { ((Linq.AQueryClause)yyVals[-1+yyTop]).Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = yyVals[-1+yyTop]; } -void case_896() -#line 5806 "cs-parser.jay" +void case_884() +#line 5884 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var sn = new Linq.RangeVariable (lt.Value, lt.Location); @@ -8282,8 +8402,8 @@ void case_896() ((Linq.QueryBlock)current_block).AddRangeVariable (sn); } -void case_898() -#line 5825 "cs-parser.jay" +void case_886() +#line 5903 "cs-parser.jay" { yyVal = new Linq.Where ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); @@ -8291,8 +8411,8 @@ void case_898() current_block = current_block.Parent; } -void case_899() -#line 5835 "cs-parser.jay" +void case_887() +#line 5913 "cs-parser.jay" { if (linq_clause_blocks == null) linq_clause_blocks = new Stack (); @@ -8301,8 +8421,8 @@ void case_899() linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } -void case_900() -#line 5843 "cs-parser.jay" +void case_888() +#line 5921 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -8311,8 +8431,8 @@ void case_900() linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } -void case_901() -#line 5851 "cs-parser.jay" +void case_889() +#line 5929 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); @@ -8321,8 +8441,8 @@ void case_901() current_block = new Linq.QueryBlock (current_block, lexer.Location); } -void case_902() -#line 5859 "cs-parser.jay" +void case_890() +#line 5937 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); @@ -8361,8 +8481,8 @@ void case_902() ((Linq.QueryBlock)current_block).AddRangeVariable (into); } -void case_903() -#line 5897 "cs-parser.jay" +void case_891() +#line 5975 "cs-parser.jay" { if (linq_clause_blocks == null) linq_clause_blocks = new Stack (); @@ -8371,8 +8491,8 @@ void case_903() linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } -void case_904() -#line 5905 "cs-parser.jay" +void case_892() +#line 5983 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -8381,8 +8501,8 @@ void case_904() linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } -void case_905() -#line 5913 "cs-parser.jay" +void case_893() +#line 5991 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); @@ -8391,8 +8511,8 @@ void case_905() current_block = new Linq.QueryBlock (current_block, lexer.Location); } -void case_906() -#line 5921 "cs-parser.jay" +void case_894() +#line 5999 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); @@ -8433,8 +8553,8 @@ void case_906() ((Linq.QueryBlock)current_block).AddRangeVariable (into); } -void case_910() -#line 5976 "cs-parser.jay" +void case_898() +#line 6054 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -8442,8 +8562,8 @@ void case_910() yyVal = yyVals[0+yyTop]; } -void case_912() -#line 5987 "cs-parser.jay" +void case_900() +#line 6065 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -8451,15 +8571,15 @@ void case_912() current_block = new Linq.QueryBlock (current_block, lexer.Location); } -void case_913() -#line 5994 "cs-parser.jay" +void case_901() +#line 6072 "cs-parser.jay" { ((Linq.AQueryClause)yyVals[-3+yyTop]).Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = yyVals[-3+yyTop]; } -void case_915() -#line 6003 "cs-parser.jay" +void case_903() +#line 6081 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; @@ -8467,43 +8587,43 @@ void case_915() current_block = new Linq.QueryBlock ((Linq.QueryBlock) current_block, lexer.Location); } -void case_916() -#line 6010 "cs-parser.jay" +void case_904() +#line 6088 "cs-parser.jay" { ((Linq.AQueryClause)yyVals[-3+yyTop]).Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = yyVals[-3+yyTop]; } -void case_918() -#line 6022 "cs-parser.jay" +void case_906() +#line 6100 "cs-parser.jay" { yyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_919() -#line 6027 "cs-parser.jay" +void case_907() +#line 6105 "cs-parser.jay" { yyVal = new Linq.OrderByDescending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_921() -#line 6039 "cs-parser.jay" +void case_909() +#line 6117 "cs-parser.jay" { yyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_922() -#line 6044 "cs-parser.jay" +void case_910() +#line 6122 "cs-parser.jay" { yyVal = new Linq.ThenByDescending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } -void case_924() -#line 6054 "cs-parser.jay" +void case_912() +#line 6132 "cs-parser.jay" { /* query continuation block is not linked with query block but with block*/ /* before. This means each query can use same range variable names for*/ @@ -8520,8 +8640,8 @@ void case_924() linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } -void case_925() -#line 6070 "cs-parser.jay" +void case_913() +#line 6148 "cs-parser.jay" { var current_block = linq_clause_blocks.Pop (); var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; @@ -8531,8 +8651,8 @@ void case_925() }; } -void case_928() -#line 6097 "cs-parser.jay" +void case_916() +#line 6175 "cs-parser.jay" { current_container = new Class (current_namespace, current_class, new MemberName (""), Modifiers.PUBLIC, null); current_class = current_container; @@ -8563,8 +8683,8 @@ void case_928() start_block (lexer.Location); } -void case_929() -#line 6127 "cs-parser.jay" +void case_917() +#line 6205 "cs-parser.jay" { --lexer.parsing_block; Method method = (Method) oob_stack.Pop (); @@ -8575,16 +8695,16 @@ void case_929() current_local_parameters = null; } -void case_939() -#line 6170 "cs-parser.jay" +void case_927() +#line 6248 "cs-parser.jay" { module.DocumentationBuilder.ParsedBuiltinType = (TypeExpression)yyVals[-1+yyTop]; module.DocumentationBuilder.ParsedParameters = (List)yyVals[0+yyTop]; yyVal = null; } -void case_940() -#line 6176 "cs-parser.jay" +void case_928() +#line 6254 "cs-parser.jay" { module.DocumentationBuilder.ParsedBuiltinType = (TypeExpression)yyVals[-3+yyTop]; module.DocumentationBuilder.ParsedParameters = (List)yyVals[0+yyTop]; @@ -8592,15 +8712,15 @@ void case_940() yyVal = new MemberName (lt.Value); } -void case_943() -#line 6191 "cs-parser.jay" +void case_931() +#line 6269 "cs-parser.jay" { module.DocumentationBuilder.ParsedParameters = (List)yyVals[-1+yyTop]; yyVal = new MemberName ((MemberName) yyVals[-6+yyTop], new MemberName (MemberCache.IndexerNameAlias)); } -void case_944() -#line 6196 "cs-parser.jay" +void case_932() +#line 6274 "cs-parser.jay" { var p = (List)yyVals[0+yyTop] ?? new List (1); p.Add (new DocumentationParameter ((FullNamedExpression) yyVals[-1+yyTop])); @@ -8609,8 +8729,8 @@ void case_944() yyVal = null; } -void case_945() -#line 6204 "cs-parser.jay" +void case_933() +#line 6282 "cs-parser.jay" { var p = (List)yyVals[0+yyTop] ?? new List (1); p.Add (new DocumentationParameter ((FullNamedExpression) yyVals[-1+yyTop])); @@ -8619,8 +8739,8 @@ void case_945() yyVal = null; } -void case_946() -#line 6212 "cs-parser.jay" +void case_934() +#line 6290 "cs-parser.jay" { var p = (List)yyVals[0+yyTop] ?? new List (1); module.DocumentationBuilder.ParsedParameters = p; @@ -8628,24 +8748,24 @@ void case_946() yyVal = null; } -void case_954() -#line 6250 "cs-parser.jay" +void case_942() +#line 6328 "cs-parser.jay" { var parameters = new List (); parameters.Add ((DocumentationParameter) yyVals[0+yyTop]); yyVal = parameters; } -void case_955() -#line 6256 "cs-parser.jay" +void case_943() +#line 6334 "cs-parser.jay" { var parameters = yyVals[-2+yyTop] as List; parameters.Add ((DocumentationParameter) yyVals[0+yyTop]); yyVal = parameters; } -void case_956() -#line 6265 "cs-parser.jay" +void case_944() +#line 6343 "cs-parser.jay" { if (yyVals[-1+yyTop] != null) yyVal = new DocumentationParameter ((Parameter.Modifier) yyVals[-1+yyTop], (FullNamedExpression) yyVals[0+yyTop]); @@ -8664,93 +8784,92 @@ void case_956() 37, 37, 42, 39, 40, 41, 41, 43, 43, 43, 43, 43, 44, 44, 48, 45, 47, 49, 49, 49, 50, 50, 51, 51, 52, 52, 52, 52, 52, 52, - 52, 52, 52, 52, 52, 65, 67, 70, 71, 29, - 29, 73, 69, 72, 72, 74, 74, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 78, 53, 79, - 79, 80, 80, 81, 83, 77, 77, 82, 82, 88, - 54, 92, 54, 54, 87, 95, 87, 89, 89, 96, - 96, 97, 98, 97, 93, 93, 99, 99, 100, 101, - 91, 91, 94, 94, 94, 104, 55, 107, 108, 102, - 109, 110, 111, 102, 102, 103, 103, 106, 106, 114, - 114, 114, 114, 114, 114, 114, 114, 114, 114, 115, - 115, 118, 118, 118, 121, 118, 119, 119, 122, 122, - 123, 123, 123, 116, 116, 116, 124, 124, 124, 117, - 126, 128, 129, 56, 131, 132, 133, 58, 127, 127, - 127, 127, 127, 137, 134, 138, 135, 136, 136, 136, - 139, 140, 141, 143, 30, 30, 142, 142, 144, 144, - 145, 145, 145, 145, 145, 145, 145, 145, 145, 148, - 59, 147, 147, 149, 149, 152, 146, 146, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 154, 153, 155, 153, 153, 153, 60, 158, 160, 156, - 157, 157, 159, 159, 164, 162, 165, 162, 162, 166, - 61, 168, 57, 171, 172, 57, 167, 174, 167, 169, - 169, 175, 175, 176, 177, 176, 178, 173, 170, 170, - 170, 170, 170, 182, 179, 183, 180, 181, 181, 185, - 187, 188, 31, 184, 184, 184, 186, 186, 186, 189, - 189, 190, 191, 190, 192, 193, 194, 32, 195, 195, - 17, 17, 196, 196, 199, 198, 198, 198, 200, 200, - 202, 64, 125, 105, 105, 130, 130, 203, 203, 203, - 201, 201, 204, 204, 205, 205, 207, 207, 86, 76, - 76, 90, 90, 120, 120, 150, 150, 208, 208, 208, - 208, 208, 212, 212, 213, 213, 211, 211, 211, 211, - 211, 211, 211, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 215, 216, 216, 216, 217, 217, 217, 237, 237, - 238, 238, 239, 239, 219, 219, 236, 236, 236, 236, - 236, 236, 236, 236, 221, 240, 240, 241, 241, 242, - 242, 244, 244, 244, 245, 245, 245, 245, 245, 246, - 246, 163, 163, 250, 250, 250, 250, 250, 252, 252, - 251, 251, 253, 253, 253, 253, 254, 222, 249, 249, - 249, 255, 255, 256, 256, 223, 224, 224, 225, 226, - 227, 227, 218, 218, 218, 218, 218, 261, 257, 228, - 262, 262, 263, 263, 264, 264, 265, 265, 265, 265, - 258, 258, 209, 209, 260, 260, 266, 266, 259, 259, - 85, 85, 267, 267, 268, 229, 269, 269, 269, 270, - 270, 270, 270, 270, 271, 197, 230, 231, 232, 233, - 273, 234, 274, 234, 272, 272, 276, 275, 220, 277, - 277, 277, 277, 277, 279, 280, 278, 278, 278, 278, - 278, 278, 278, 281, 281, 281, 281, 282, 282, 282, - 282, 282, 282, 283, 283, 283, 284, 284, 284, 284, - 284, 285, 285, 285, 286, 286, 287, 287, 288, 288, - 289, 289, 290, 290, 291, 291, 292, 292, 293, 293, - 293, 293, 293, 293, 293, 293, 293, 293, 293, 294, - 294, 295, 295, 295, 296, 296, 297, 297, 300, 298, - 299, 299, 302, 301, 303, 301, 304, 305, 301, 306, - 307, 301, 46, 46, 247, 247, 247, 247, 235, 235, - 235, 84, 309, 310, 311, 312, 313, 28, 63, 63, - 62, 62, 112, 112, 314, 314, 314, 314, 314, 314, - 314, 314, 314, 314, 314, 314, 314, 314, 314, 66, - 66, 68, 68, 68, 315, 315, 316, 317, 317, 318, - 318, 318, 318, 206, 206, 319, 319, 321, 113, 322, - 322, 323, 161, 320, 320, 324, 324, 325, 325, 325, - 325, 329, 329, 330, 330, 330, 327, 327, 327, 327, - 327, 327, 327, 327, 327, 327, 327, 327, 327, 331, - 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, - 331, 331, 345, 345, 345, 345, 332, 346, 328, 347, - 347, 348, 348, 348, 348, 348, 348, 210, 210, 349, - 351, 326, 354, 326, 350, 350, 350, 352, 352, 357, - 357, 358, 358, 353, 353, 355, 355, 359, 359, 360, - 356, 356, 356, 333, 333, 344, 344, 361, 362, 362, - 334, 334, 363, 363, 366, 364, 365, 365, 367, 367, - 367, 370, 368, 369, 369, 371, 371, 335, 335, 335, - 335, 372, 373, 377, 374, 376, 376, 378, 378, 382, - 381, 381, 379, 379, 380, 380, 384, 383, 383, 375, - 385, 375, 336, 336, 336, 336, 336, 336, 386, 387, - 388, 388, 388, 389, 390, 391, 391, 392, 392, 337, - 337, 337, 337, 393, 393, 395, 395, 394, 396, 394, - 394, 338, 339, 397, 342, 340, 399, 400, 343, 401, - 402, 341, 341, 398, 398, 308, 308, 308, 308, 403, - 403, 405, 405, 407, 406, 408, 406, 404, 404, 404, - 412, 410, 413, 414, 410, 409, 409, 415, 415, 416, - 416, 416, 416, 416, 421, 417, 422, 418, 423, 424, - 425, 419, 427, 428, 429, 419, 426, 426, 431, 420, - 430, 434, 430, 433, 436, 433, 432, 432, 432, 435, - 435, 435, 411, 437, 411, 3, 3, 438, 3, 3, - 439, 439, 248, 248, 243, 243, 5, 440, 440, 440, - 440, 444, 440, 440, 440, 440, 441, 441, 442, 445, - 442, 443, 443, 446, 446, 447, + 52, 52, 52, 52, 52, 65, 67, 69, 70, 71, + 29, 29, 74, 53, 75, 75, 76, 76, 77, 79, + 73, 73, 78, 78, 84, 54, 88, 54, 54, 83, + 91, 83, 85, 85, 92, 92, 93, 94, 93, 89, + 89, 95, 95, 96, 97, 87, 87, 90, 90, 90, + 100, 55, 103, 104, 98, 105, 106, 107, 98, 98, + 99, 99, 102, 102, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 111, 111, 114, 114, 114, 117, + 114, 115, 115, 118, 118, 119, 119, 119, 112, 112, + 112, 120, 120, 120, 113, 122, 124, 125, 56, 127, + 128, 129, 58, 123, 123, 123, 123, 123, 133, 130, + 134, 131, 132, 132, 132, 135, 136, 137, 139, 30, + 30, 138, 138, 140, 140, 141, 141, 141, 141, 141, + 141, 141, 141, 141, 144, 59, 143, 143, 145, 145, + 148, 142, 142, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 150, 149, 151, 149, 149, + 149, 60, 154, 156, 152, 153, 153, 155, 155, 160, + 158, 161, 158, 158, 162, 61, 164, 57, 167, 168, + 57, 163, 170, 163, 165, 165, 171, 171, 172, 173, + 172, 174, 169, 166, 166, 166, 166, 166, 178, 175, + 179, 176, 177, 177, 180, 182, 184, 185, 31, 181, + 181, 181, 183, 183, 183, 186, 186, 187, 188, 187, + 189, 190, 191, 32, 192, 192, 17, 17, 193, 193, + 196, 195, 195, 195, 197, 197, 199, 64, 121, 101, + 101, 126, 126, 200, 200, 200, 198, 198, 201, 201, + 202, 202, 204, 204, 82, 72, 72, 86, 86, 116, + 116, 146, 146, 205, 205, 205, 205, 205, 209, 209, + 210, 210, 208, 208, 208, 208, 208, 208, 208, 211, + 211, 211, 211, 211, 211, 211, 211, 211, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 213, 213, + 213, 214, 214, 214, 234, 234, 235, 235, 236, 236, + 216, 216, 233, 233, 233, 233, 233, 233, 233, 233, + 218, 237, 237, 238, 238, 239, 239, 241, 241, 241, + 242, 242, 242, 242, 242, 243, 243, 159, 159, 247, + 247, 247, 247, 247, 249, 249, 248, 248, 250, 250, + 250, 250, 251, 219, 246, 246, 246, 252, 252, 253, + 253, 220, 221, 221, 222, 223, 224, 224, 215, 215, + 215, 215, 215, 258, 254, 225, 259, 259, 260, 260, + 261, 261, 262, 262, 262, 262, 255, 255, 206, 206, + 257, 257, 263, 263, 256, 256, 81, 81, 264, 264, + 265, 226, 266, 266, 266, 267, 267, 267, 267, 267, + 268, 194, 227, 228, 229, 230, 270, 231, 271, 231, + 269, 269, 273, 272, 217, 274, 274, 274, 274, 274, + 276, 277, 275, 275, 275, 275, 275, 275, 275, 278, + 278, 278, 278, 279, 279, 279, 279, 279, 279, 280, + 280, 280, 281, 281, 281, 281, 281, 282, 282, 282, + 283, 283, 284, 284, 285, 285, 286, 286, 287, 287, + 288, 288, 289, 289, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 291, 291, 292, 292, 292, + 293, 293, 294, 294, 297, 295, 296, 296, 299, 298, + 300, 298, 301, 302, 298, 303, 304, 298, 46, 46, + 244, 244, 244, 244, 232, 232, 232, 80, 306, 307, + 308, 309, 310, 28, 63, 63, 62, 62, 108, 108, + 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, + 311, 311, 311, 311, 311, 66, 66, 68, 68, 68, + 312, 312, 313, 314, 314, 315, 315, 315, 315, 203, + 203, 316, 316, 318, 109, 319, 319, 320, 157, 317, + 317, 321, 321, 322, 322, 322, 322, 326, 326, 327, + 327, 327, 324, 324, 324, 324, 324, 324, 324, 324, + 324, 324, 324, 324, 324, 328, 328, 328, 328, 328, + 328, 328, 328, 328, 328, 328, 328, 328, 342, 342, + 342, 342, 329, 343, 325, 344, 344, 345, 345, 345, + 345, 345, 345, 207, 207, 346, 348, 323, 351, 323, + 347, 347, 347, 349, 349, 355, 355, 354, 354, 356, + 356, 350, 350, 352, 352, 357, 357, 358, 353, 353, + 353, 330, 330, 341, 341, 359, 360, 360, 331, 331, + 361, 361, 364, 362, 363, 363, 365, 365, 365, 368, + 366, 367, 367, 369, 369, 332, 332, 332, 332, 370, + 371, 375, 372, 374, 374, 376, 376, 380, 379, 379, + 377, 377, 378, 378, 382, 381, 381, 373, 383, 373, + 333, 333, 333, 333, 333, 333, 384, 385, 386, 386, + 386, 387, 388, 389, 389, 390, 390, 334, 334, 334, + 334, 391, 391, 393, 393, 392, 394, 392, 392, 335, + 336, 395, 339, 337, 397, 398, 340, 399, 400, 338, + 338, 396, 396, 305, 305, 305, 305, 401, 401, 403, + 403, 405, 404, 406, 404, 402, 402, 402, 410, 408, + 411, 412, 408, 407, 407, 413, 413, 414, 414, 414, + 414, 414, 419, 415, 420, 416, 421, 422, 423, 417, + 425, 426, 427, 417, 424, 424, 429, 418, 428, 432, + 428, 431, 434, 431, 430, 430, 430, 433, 433, 433, + 409, 435, 409, 3, 3, 436, 3, 3, 437, 437, + 245, 245, 240, 240, 5, 438, 438, 438, 438, 442, + 438, 438, 438, 438, 439, 439, 440, 443, 440, 441, + 441, 444, 444, 445, }; static readonly short [] yyLen = { 2, 2, 0, 3, 1, 2, 4, 3, 1, 0, 1, @@ -8762,932 +8881,939 @@ void case_956() 1, 3, 0, 3, 1, 0, 3, 0, 1, 1, 3, 3, 1, 1, 0, 4, 4, 0, 1, 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 0, 0, 0, 0, 13, - 5, 0, 4, 0, 1, 1, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 9, 0, - 1, 1, 2, 3, 0, 3, 1, 1, 1, 0, - 8, 0, 9, 6, 0, 0, 3, 0, 1, 1, - 2, 2, 0, 5, 0, 1, 1, 2, 3, 0, - 4, 2, 1, 1, 1, 0, 3, 0, 0, 10, - 0, 0, 0, 12, 8, 1, 1, 0, 1, 1, - 3, 3, 3, 5, 3, 5, 1, 1, 1, 1, - 3, 4, 6, 4, 0, 7, 0, 1, 1, 2, - 1, 1, 1, 4, 6, 4, 1, 2, 2, 1, - 0, 0, 0, 10, 0, 0, 0, 13, 1, 2, - 1, 2, 1, 0, 5, 0, 5, 1, 1, 1, - 0, 0, 0, 0, 15, 5, 0, 1, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 5, 1, 1, 1, 1, 0, 7, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, + 16, 5, 0, 9, 0, 1, 1, 2, 3, 0, + 3, 1, 1, 1, 0, 8, 0, 9, 6, 0, + 0, 3, 0, 1, 1, 2, 2, 0, 5, 0, + 1, 1, 2, 3, 0, 4, 2, 1, 1, 1, + 0, 3, 0, 0, 10, 0, 0, 0, 12, 8, + 1, 1, 0, 1, 1, 3, 3, 3, 5, 3, + 5, 1, 1, 1, 1, 3, 4, 6, 4, 0, + 7, 0, 1, 1, 2, 1, 1, 1, 4, 6, + 4, 1, 2, 2, 1, 0, 0, 0, 10, 0, + 0, 0, 13, 1, 2, 1, 2, 1, 0, 5, + 0, 5, 1, 1, 1, 0, 0, 0, 0, 15, + 5, 0, 1, 1, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 0, 5, 1, 1, 1, 1, + 0, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 7, 0, 7, 2, + 2, 2, 0, 0, 9, 1, 1, 0, 1, 0, + 6, 0, 6, 1, 0, 8, 0, 9, 0, 0, + 10, 0, 0, 3, 0, 1, 1, 2, 2, 0, + 5, 0, 2, 2, 2, 1, 1, 1, 0, 5, + 0, 5, 1, 1, 0, 0, 0, 0, 13, 0, + 2, 2, 0, 1, 2, 1, 3, 2, 0, 5, + 0, 0, 0, 13, 0, 1, 1, 3, 1, 4, + 2, 0, 3, 2, 1, 3, 0, 3, 1, 1, + 3, 1, 2, 3, 4, 4, 0, 3, 1, 3, + 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 7, 0, 7, 2, 2, 2, 0, 0, 9, - 1, 1, 0, 1, 0, 6, 0, 6, 1, 0, - 8, 0, 9, 0, 0, 10, 0, 0, 3, 0, - 1, 1, 2, 2, 0, 5, 0, 2, 2, 2, - 1, 1, 1, 0, 5, 0, 5, 1, 1, 0, - 0, 0, 12, 0, 2, 2, 0, 1, 2, 1, - 3, 2, 0, 5, 0, 0, 0, 13, 0, 1, - 1, 3, 1, 4, 2, 0, 3, 2, 1, 3, - 0, 3, 1, 1, 3, 1, 2, 3, 4, 4, - 0, 3, 1, 3, 3, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, - 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 3, 4, 4, 4, 3, - 3, 4, 3, 4, 4, 0, 1, 3, 4, 0, - 1, 1, 3, 2, 3, 1, 2, 3, 2, 1, - 1, 0, 1, 1, 3, 3, 2, 2, 1, 1, - 1, 1, 2, 2, 4, 3, 1, 4, 1, 3, - 2, 1, 3, 1, 1, 1, 4, 3, 2, 2, - 6, 3, 7, 4, 3, 7, 3, 0, 2, 4, - 1, 2, 0, 1, 1, 3, 3, 1, 1, 1, - 0, 1, 1, 2, 2, 3, 1, 2, 0, 1, - 2, 4, 1, 3, 0, 5, 1, 1, 1, 2, - 3, 3, 4, 4, 1, 2, 4, 4, 4, 4, - 0, 4, 0, 5, 0, 1, 0, 4, 4, 1, - 2, 2, 1, 1, 4, 2, 1, 2, 2, 2, - 2, 2, 2, 1, 3, 3, 3, 1, 3, 3, - 3, 3, 3, 1, 3, 3, 1, 3, 3, 3, - 3, 1, 3, 3, 1, 3, 1, 3, 1, 3, - 1, 3, 1, 3, 1, 3, 1, 5, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, - 3, 3, 2, 1, 0, 1, 1, 1, 0, 2, - 1, 1, 0, 4, 0, 5, 0, 0, 7, 0, - 0, 8, 1, 1, 1, 1, 1, 1, 6, 4, - 4, 1, 1, 0, 0, 0, 0, 15, 0, 1, - 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 2, 0, 1, 1, 1, 2, 4, 1, 3, 1, - 3, 1, 1, 0, 1, 1, 1, 0, 4, 1, - 1, 0, 4, 0, 1, 1, 2, 1, 1, 1, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 3, 3, 4, 4, 4, 3, 3, 4, 3, 4, + 4, 0, 1, 3, 4, 0, 1, 1, 3, 2, + 3, 1, 2, 3, 2, 1, 1, 0, 1, 1, + 3, 3, 2, 2, 1, 1, 1, 1, 2, 2, + 4, 3, 1, 4, 1, 3, 2, 1, 3, 1, + 1, 1, 4, 3, 2, 2, 6, 3, 7, 4, + 3, 7, 3, 0, 2, 4, 1, 2, 0, 1, + 1, 3, 3, 1, 1, 1, 0, 1, 1, 2, + 2, 3, 1, 2, 0, 1, 2, 4, 1, 3, + 0, 5, 1, 1, 1, 2, 3, 3, 4, 4, + 1, 2, 4, 4, 4, 4, 0, 4, 0, 5, + 0, 1, 0, 4, 4, 1, 2, 2, 1, 1, + 4, 2, 1, 2, 2, 2, 2, 2, 2, 1, + 3, 3, 3, 1, 3, 3, 3, 3, 3, 1, + 3, 3, 1, 3, 3, 3, 3, 1, 3, 3, + 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, + 1, 3, 1, 5, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 1, 3, 3, 2, 1, + 0, 1, 1, 1, 0, 2, 1, 1, 0, 4, + 0, 5, 0, 0, 7, 0, 0, 8, 1, 1, + 1, 1, 1, 1, 6, 4, 4, 1, 1, 0, + 0, 0, 0, 15, 0, 1, 0, 1, 1, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 2, 0, 1, 1, + 1, 2, 4, 1, 3, 1, 3, 1, 1, 0, + 1, 1, 1, 0, 4, 1, 1, 0, 4, 0, + 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 4, 1, - 2, 2, 2, 2, 2, 2, 1, 1, 2, 1, - 0, 6, 0, 7, 0, 2, 1, 0, 1, 1, - 2, 2, 4, 0, 2, 0, 1, 1, 2, 4, - 1, 5, 2, 2, 2, 2, 2, 1, 1, 1, - 1, 1, 5, 7, 0, 8, 0, 1, 1, 2, - 1, 0, 3, 1, 2, 3, 1, 1, 1, 1, - 1, 5, 7, 0, 4, 7, 1, 0, 1, 0, - 5, 1, 0, 1, 0, 1, 1, 1, 3, 6, - 0, 9, 1, 1, 1, 1, 1, 1, 2, 2, - 3, 4, 3, 3, 3, 4, 3, 0, 1, 3, - 4, 5, 3, 1, 2, 0, 1, 2, 0, 7, - 3, 2, 2, 0, 3, 5, 0, 0, 10, 0, - 0, 10, 5, 0, 2, 2, 2, 2, 2, 4, - 5, 4, 5, 0, 5, 0, 6, 3, 2, 1, - 0, 3, 0, 0, 6, 0, 1, 1, 2, 1, - 1, 1, 1, 1, 0, 5, 0, 3, 0, 0, - 0, 12, 0, 0, 0, 13, 0, 2, 0, 3, - 1, 0, 4, 1, 0, 4, 1, 2, 2, 1, - 2, 2, 0, 0, 4, 2, 3, 0, 4, 2, - 2, 3, 0, 1, 1, 1, 2, 2, 2, 4, - 3, 0, 7, 4, 4, 3, 1, 3, 0, 0, - 4, 0, 1, 1, 3, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 4, 1, 2, 2, 2, 2, + 2, 2, 1, 1, 2, 1, 0, 6, 0, 7, + 0, 2, 1, 0, 1, 0, 1, 1, 2, 2, + 4, 0, 2, 0, 1, 1, 2, 4, 1, 5, + 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, + 5, 7, 0, 8, 0, 1, 1, 2, 1, 0, + 3, 1, 2, 3, 1, 1, 1, 1, 1, 5, + 7, 0, 4, 7, 1, 0, 1, 0, 5, 1, + 0, 1, 0, 1, 1, 1, 3, 6, 0, 9, + 1, 1, 1, 1, 1, 1, 2, 2, 3, 4, + 3, 3, 3, 4, 3, 0, 1, 3, 4, 5, + 3, 1, 2, 0, 1, 2, 0, 7, 3, 2, + 2, 0, 3, 5, 0, 0, 10, 0, 0, 10, + 5, 0, 2, 2, 2, 2, 2, 4, 5, 4, + 5, 0, 5, 0, 6, 3, 2, 1, 0, 3, + 0, 0, 6, 0, 1, 1, 2, 1, 1, 1, + 1, 1, 0, 5, 0, 3, 0, 0, 0, 12, + 0, 0, 0, 13, 0, 2, 0, 3, 1, 0, + 4, 1, 0, 4, 1, 2, 2, 1, 2, 2, + 0, 0, 4, 2, 3, 0, 4, 2, 2, 3, + 0, 1, 1, 1, 2, 2, 2, 4, 3, 0, + 7, 4, 4, 3, 1, 3, 0, 0, 4, 0, + 1, 1, 3, 2, }; static readonly short [] yyDefRed = { 0, 8, 0, 0, 0, 0, 0, 0, 0, 2, 4, - 0, 0, 11, 14, 0, 926, 0, 0, 930, 0, - 0, 15, 17, 18, 389, 395, 402, 390, 392, 0, - 391, 0, 398, 400, 387, 0, 394, 396, 388, 399, - 401, 397, 351, 947, 0, 393, 937, 0, 10, 1, - 0, 0, 0, 12, 0, 780, 0, 0, 0, 0, - 0, 0, 0, 0, 430, 0, 0, 0, 0, 0, - 0, 0, 428, 0, 0, 0, 486, 0, 429, 0, - 525, 0, 854, 0, 0, 0, 638, 0, 0, 0, - 0, 0, 0, 0, 688, 0, 737, 0, 0, 0, - 0, 0, 0, 0, 0, 427, 0, 627, 0, 779, - 720, 0, 0, 0, 0, 404, 405, 0, 407, 408, - 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 425, 426, 634, 557, 0, 553, - 554, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 635, 633, 636, 637, 704, 706, 0, 702, - 705, 721, 723, 724, 725, 726, 727, 728, 729, 730, - 731, 732, 722, 0, 0, 0, 781, 782, 798, 799, - 800, 801, 823, 824, 825, 826, 827, 828, 0, 0, - 0, 20, 0, 0, 0, 341, 0, 343, 934, 16, - 927, 0, 0, 254, 253, 250, 255, 256, 249, 268, - 267, 260, 261, 257, 259, 258, 262, 251, 252, 263, - 264, 270, 269, 265, 266, 0, 0, 950, 0, 939, - 0, 938, 3, 52, 0, 0, 0, 42, 39, 41, + 0, 0, 11, 14, 0, 914, 0, 0, 918, 0, + 0, 15, 17, 18, 375, 381, 388, 376, 378, 0, + 377, 0, 384, 386, 373, 0, 380, 382, 374, 385, + 387, 383, 337, 935, 0, 379, 925, 0, 10, 1, + 0, 0, 0, 12, 0, 768, 0, 0, 0, 0, + 0, 0, 0, 0, 416, 0, 0, 0, 0, 0, + 0, 0, 414, 0, 0, 0, 472, 0, 415, 0, + 511, 0, 842, 0, 0, 0, 624, 0, 0, 0, + 0, 0, 0, 0, 674, 0, 723, 0, 0, 0, + 0, 0, 0, 0, 0, 413, 0, 613, 0, 767, + 706, 0, 0, 0, 0, 390, 391, 0, 393, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 411, 412, 620, 543, 0, 539, + 540, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 621, 619, 622, 623, 690, 692, 0, 688, + 691, 707, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 708, 0, 0, 0, 769, 770, 786, 787, + 788, 789, 811, 812, 813, 814, 815, 816, 0, 0, + 0, 20, 0, 0, 0, 327, 0, 329, 922, 16, + 915, 0, 0, 239, 238, 235, 240, 241, 234, 253, + 252, 245, 246, 242, 244, 243, 247, 236, 237, 248, + 249, 255, 254, 250, 251, 0, 0, 938, 0, 927, + 0, 926, 3, 52, 0, 0, 0, 42, 39, 41, 43, 44, 45, 46, 47, 50, 13, 0, 0, 0, - 829, 431, 432, 852, 0, 0, 0, 0, 0, 0, - 406, 0, 830, 0, 547, 541, 546, 736, 778, 707, - 734, 733, 735, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 0, 0, 0, 804, 0, + 817, 417, 418, 840, 0, 0, 0, 0, 0, 0, + 392, 0, 818, 0, 533, 527, 532, 722, 766, 693, + 720, 719, 721, 694, 695, 696, 697, 698, 699, 700, + 701, 702, 703, 704, 705, 0, 0, 0, 792, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 839, 0, 403, 0, 0, 0, 0, 0, 0, - 853, 0, 0, 0, 750, 746, 0, 0, 0, 0, - 0, 0, 370, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 630, 556, 0, 0, 552, 558, 559, 551, - 563, 562, 560, 561, 0, 0, 623, 738, 536, 0, - 424, 423, 0, 0, 0, 0, 340, 0, 744, 745, - 0, 489, 490, 0, 0, 0, 742, 743, 0, 0, + 0, 827, 0, 389, 0, 0, 0, 0, 0, 0, + 841, 0, 0, 0, 736, 732, 0, 0, 0, 0, + 0, 0, 356, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 616, 542, 0, 0, 538, 544, 545, 537, + 549, 548, 546, 547, 0, 0, 609, 724, 522, 0, + 410, 409, 0, 0, 0, 0, 326, 0, 730, 731, + 0, 475, 476, 0, 0, 0, 728, 729, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 929, 703, 751, 741, 0, 776, 777, 880, - 897, 0, 0, 0, 909, 868, 866, 890, 0, 0, - 888, 891, 892, 893, 894, 869, 867, 0, 0, 0, - 345, 0, 21, 0, 0, 0, 946, 0, 352, 0, - 0, 0, 948, 0, 0, 40, 660, 666, 658, 0, - 655, 665, 659, 657, 656, 663, 661, 662, 668, 664, - 667, 669, 0, 0, 653, 51, 488, 0, 0, 484, - 485, 0, 482, 0, 753, 0, 0, 0, 0, 774, - 775, 0, 0, 0, 642, 0, 833, 831, 643, 0, - 0, 510, 0, 0, 0, 501, 0, 505, 515, 517, - 0, 497, 0, 0, 0, 0, 0, 492, 0, 495, - 0, 499, 372, 834, 0, 0, 835, 843, 0, 0, - 0, 844, 0, 0, 855, 0, 0, 749, 0, 382, - 0, 378, 379, 0, 377, 380, 381, 0, 0, 0, - 564, 0, 0, 543, 625, 0, 701, 0, 0, 696, - 698, 699, 700, 435, 436, 837, 0, 0, 0, 348, - 349, 0, 192, 191, 193, 0, 0, 0, 0, 374, - 0, 610, 0, 0, 440, 0, 443, 0, 441, 0, - 0, 0, 0, 0, 0, 469, 472, 0, 0, 464, - 471, 470, 0, 599, 600, 601, 602, 603, 604, 605, - 606, 607, 609, 608, 565, 567, 566, 572, 573, 0, + 0, 0, 917, 689, 737, 727, 0, 764, 765, 868, + 885, 0, 0, 0, 897, 856, 854, 878, 0, 0, + 876, 879, 880, 881, 882, 857, 855, 0, 0, 0, + 331, 0, 21, 0, 0, 0, 934, 0, 338, 0, + 0, 0, 936, 0, 0, 40, 646, 652, 644, 0, + 641, 651, 645, 643, 642, 649, 647, 648, 654, 650, + 653, 655, 0, 0, 639, 51, 474, 0, 0, 470, + 471, 0, 468, 0, 739, 0, 0, 0, 0, 762, + 763, 0, 0, 0, 628, 0, 821, 819, 629, 0, + 0, 496, 0, 0, 0, 487, 0, 491, 501, 503, + 0, 483, 0, 0, 0, 0, 0, 478, 0, 481, + 0, 485, 358, 822, 0, 0, 823, 831, 0, 0, + 0, 832, 0, 0, 843, 0, 0, 735, 0, 368, + 0, 364, 365, 0, 363, 366, 367, 0, 0, 0, + 550, 0, 0, 529, 611, 0, 687, 0, 0, 682, + 684, 685, 686, 421, 422, 825, 0, 0, 0, 334, + 335, 0, 177, 176, 178, 0, 0, 0, 0, 360, + 0, 596, 0, 0, 426, 0, 429, 0, 427, 0, + 0, 0, 0, 0, 0, 455, 458, 0, 0, 450, + 457, 456, 0, 585, 586, 587, 588, 589, 590, 591, + 592, 593, 595, 594, 551, 553, 552, 558, 559, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 596, 0, 0, 514, 0, 0, - 0, 0, 0, 0, 0, 881, 883, 879, 0, 889, - 0, 0, 342, 944, 945, 366, 0, 0, 363, 0, - 0, 189, 0, 0, 954, 940, 942, 60, 58, 59, + 0, 0, 0, 0, 582, 0, 0, 500, 0, 0, + 0, 0, 0, 0, 0, 869, 871, 867, 0, 877, + 0, 0, 328, 932, 933, 352, 0, 0, 349, 0, + 0, 174, 0, 0, 942, 928, 930, 60, 58, 59, 0, 0, 53, 0, 0, 61, 63, 27, 25, 0, - 0, 0, 650, 0, 654, 439, 0, 487, 0, 538, - 0, 549, 179, 200, 0, 0, 169, 0, 0, 0, - 180, 542, 0, 857, 807, 0, 818, 805, 0, 809, - 0, 0, 0, 832, 0, 0, 0, 500, 0, 516, - 518, 0, 0, 456, 0, 0, 452, 0, 0, 479, - 0, 520, 494, 0, 155, 521, 153, 154, 523, 0, - 537, 0, 848, 0, 841, 0, 845, 529, 0, 0, - 0, 367, 0, 527, 0, 0, 539, 0, 860, 0, - 872, 0, 870, 0, 0, 640, 641, 0, 0, 0, - 690, 691, 689, 697, 836, 618, 624, 617, 0, 739, - 0, 347, 613, 0, 0, 0, 555, 444, 438, 442, - 437, 540, 478, 477, 474, 473, 0, 468, 433, 434, - 445, 0, 0, 757, 0, 0, 898, 874, 0, 899, - 0, 895, 0, 910, 0, 0, 0, 0, 878, 19, - 344, 687, 686, 0, 685, 0, 362, 956, 190, 951, - 0, 0, 54, 0, 0, 0, 0, 0, 0, 369, - 0, 644, 0, 0, 80, 79, 0, 483, 0, 0, - 0, 0, 0, 548, 0, 0, 0, 0, 0, 810, - 0, 0, 0, 0, 0, 856, 507, 506, 459, 0, - 0, 935, 936, 448, 454, 0, 457, 0, 481, 0, - 0, 0, 0, 0, 785, 851, 0, 842, 535, 530, - 0, 0, 526, 0, 863, 0, 802, 873, 871, 0, - 544, 626, 0, 622, 621, 620, 350, 612, 611, 628, - 476, 0, 466, 465, 598, 0, 771, 756, 0, 0, - 0, 760, 0, 876, 0, 903, 0, 918, 919, 912, - 882, 884, 924, 365, 364, 955, 0, 0, 62, 56, - 0, 64, 26, 23, 0, 0, 320, 0, 226, 0, - 101, 0, 77, 765, 128, 129, 0, 0, 0, 768, - 198, 199, 0, 0, 0, 0, 172, 181, 173, 175, - 0, 0, 0, 0, 814, 0, 819, 820, 0, 0, - 458, 460, 461, 455, 449, 453, 0, 512, 0, 480, - 491, 447, 524, 522, 0, 847, 0, 0, 531, 0, - 0, 639, 631, 0, 475, 0, 0, 752, 761, 875, - 0, 0, 0, 896, 0, 0, 0, 943, 0, 0, - 0, 69, 70, 73, 74, 0, 335, 326, 325, 0, - 645, 222, 97, 0, 754, 769, 184, 0, 196, 0, - 0, 0, 803, 865, 0, 0, 0, 821, 784, 496, - 493, 791, 0, 797, 0, 0, 789, 0, 794, 849, - 534, 533, 0, 0, 629, 0, 0, 877, 900, 0, - 0, 0, 914, 0, 925, 0, 75, 67, 0, 0, - 0, 321, 0, 0, 0, 0, 0, 185, 0, 176, - 174, 858, 811, 0, 0, 816, 0, 0, 786, 790, - 0, 795, 0, 861, 632, 0, 763, 0, 904, 921, - 922, 915, 885, 55, 0, 71, 72, 0, 0, 0, - 0, 0, 0, 0, 770, 183, 0, 195, 0, 0, - 822, 796, 0, 692, 850, 0, 772, 0, 0, 0, - 76, 0, 0, 336, 0, 322, 0, 330, 386, 385, - 0, 383, 674, 0, 646, 0, 675, 223, 98, 186, - 859, 806, 0, 862, 901, 0, 916, 0, 0, 0, - 0, 0, 0, 0, 0, 676, 0, 0, 0, 0, - 905, 29, 24, 337, 0, 0, 331, 384, 0, 0, - 0, 102, 99, 693, 0, 0, 0, 0, 323, 682, - 0, 683, 680, 0, 678, 95, 0, 94, 0, 0, - 83, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 156, 0, 0, 239, 231, 232, 233, 234, 235, 236, - 237, 238, 0, 0, 229, 0, 0, 0, 902, 0, - 338, 334, 0, 0, 0, 647, 84, 0, 282, 277, - 281, 0, 224, 230, 116, 108, 109, 110, 111, 112, - 113, 114, 115, 117, 0, 0, 106, 100, 908, 906, - 681, 679, 0, 0, 0, 0, 0, 0, 0, 290, - 0, 0, 240, 0, 0, 248, 0, 167, 157, 166, - 0, 103, 107, 0, 0, 276, 0, 0, 275, 0, - 161, 0, 0, 356, 0, 354, 0, 0, 201, 0, - 0, 0, 0, 0, 648, 225, 118, 0, 353, 0, - 0, 0, 0, 132, 0, 0, 0, 0, 0, 0, - 158, 0, 0, 205, 0, 357, 0, 243, 242, 241, - 0, 0, 294, 0, 273, 134, 0, 271, 0, 0, - 0, 136, 0, 358, 0, 0, 202, 0, 0, 0, - 355, 246, 127, 125, 0, 0, 298, 0, 0, 0, - 0, 0, 162, 0, 279, 0, 0, 0, 0, 140, - 0, 0, 0, 0, 359, 360, 0, 0, 0, 0, - 0, 122, 313, 0, 295, 0, 0, 307, 0, 0, - 0, 302, 0, 152, 0, 0, 0, 0, 147, 0, - 0, 291, 0, 137, 0, 131, 141, 159, 165, 213, - 0, 203, 0, 0, 0, 0, 126, 0, 119, 123, - 0, 0, 0, 309, 0, 310, 299, 0, 0, 293, - 303, 274, 0, 0, 133, 148, 272, 0, 289, 0, - 280, 284, 143, 0, 0, 0, 210, 212, 206, 247, - 124, 314, 316, 296, 0, 0, 308, 305, 151, 149, - 163, 0, 0, 0, 160, 214, 216, 204, 0, 0, - 0, 307, 0, 285, 287, 144, 0, 0, 207, 318, - 319, 315, 317, 306, 164, 0, 0, 220, 219, 218, - 215, 217, 0, 0, 0, 208, 286, 288, + 0, 305, 636, 0, 640, 425, 0, 473, 0, 524, + 0, 535, 164, 185, 0, 0, 154, 0, 0, 0, + 165, 528, 0, 845, 795, 0, 806, 793, 0, 797, + 0, 0, 0, 820, 0, 0, 0, 486, 0, 502, + 504, 0, 0, 442, 0, 0, 438, 0, 0, 465, + 0, 506, 480, 0, 140, 507, 138, 139, 509, 0, + 523, 0, 836, 0, 829, 0, 833, 515, 0, 0, + 0, 353, 0, 513, 0, 0, 525, 0, 848, 0, + 860, 0, 858, 0, 0, 626, 627, 0, 0, 0, + 676, 677, 675, 683, 824, 604, 610, 603, 0, 725, + 0, 333, 599, 0, 0, 0, 541, 430, 424, 428, + 423, 526, 464, 463, 460, 459, 0, 454, 419, 420, + 431, 0, 0, 743, 0, 0, 886, 862, 0, 887, + 0, 883, 0, 898, 0, 0, 0, 0, 866, 19, + 330, 673, 672, 0, 671, 0, 348, 944, 175, 939, + 0, 0, 54, 0, 0, 0, 0, 0, 0, 355, + 0, 630, 0, 0, 80, 79, 0, 469, 0, 0, + 0, 0, 0, 534, 0, 0, 0, 0, 0, 798, + 0, 0, 0, 0, 0, 844, 493, 492, 445, 0, + 0, 923, 924, 434, 440, 0, 443, 0, 467, 0, + 0, 0, 0, 0, 773, 839, 0, 830, 521, 516, + 0, 0, 512, 0, 851, 0, 790, 861, 859, 0, + 530, 612, 0, 608, 607, 606, 336, 598, 597, 614, + 462, 0, 452, 451, 584, 0, 759, 742, 0, 0, + 0, 748, 0, 864, 0, 891, 0, 906, 907, 900, + 870, 872, 912, 351, 350, 943, 0, 0, 62, 56, + 0, 64, 26, 23, 0, 0, 0, 211, 0, 102, + 0, 77, 753, 113, 114, 0, 0, 0, 756, 183, + 184, 0, 0, 0, 0, 157, 166, 158, 160, 0, + 0, 0, 0, 802, 0, 807, 808, 0, 0, 444, + 446, 447, 441, 435, 439, 0, 498, 0, 466, 477, + 433, 510, 508, 0, 835, 0, 0, 517, 0, 0, + 625, 617, 0, 461, 0, 0, 738, 749, 863, 0, + 0, 0, 884, 0, 0, 0, 931, 0, 0, 0, + 69, 70, 73, 74, 0, 321, 0, 306, 631, 207, + 97, 0, 740, 757, 169, 0, 181, 0, 0, 0, + 791, 853, 0, 0, 0, 0, 809, 772, 482, 479, + 779, 0, 785, 0, 0, 777, 0, 782, 837, 520, + 519, 0, 0, 615, 0, 0, 865, 888, 0, 0, + 0, 902, 0, 913, 0, 75, 67, 0, 0, 0, + 312, 311, 0, 0, 0, 0, 0, 0, 170, 0, + 161, 159, 846, 799, 0, 0, 804, 0, 0, 774, + 778, 0, 783, 0, 849, 618, 0, 751, 0, 892, + 909, 910, 903, 873, 55, 0, 71, 72, 0, 0, + 307, 0, 0, 0, 0, 758, 168, 0, 180, 0, + 0, 810, 784, 0, 678, 838, 0, 760, 0, 0, + 0, 76, 0, 0, 322, 0, 372, 371, 0, 369, + 660, 0, 632, 0, 661, 208, 98, 171, 847, 794, + 0, 850, 889, 0, 904, 0, 0, 0, 308, 0, + 316, 0, 0, 0, 662, 0, 0, 0, 0, 893, + 29, 24, 323, 0, 0, 0, 370, 0, 0, 0, + 99, 679, 0, 0, 0, 0, 0, 317, 668, 0, + 669, 666, 0, 664, 95, 0, 94, 0, 0, 83, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 141, + 0, 0, 224, 216, 217, 218, 219, 220, 221, 222, + 223, 0, 0, 214, 0, 0, 890, 0, 324, 0, + 309, 0, 0, 0, 633, 84, 0, 267, 262, 266, + 0, 209, 215, 0, 896, 894, 320, 667, 665, 0, + 0, 0, 0, 0, 0, 0, 275, 0, 0, 225, + 0, 0, 233, 0, 152, 142, 151, 0, 100, 0, + 0, 261, 0, 0, 260, 0, 146, 0, 0, 342, + 0, 340, 0, 0, 186, 0, 0, 0, 0, 0, + 634, 210, 0, 103, 0, 339, 0, 0, 0, 0, + 117, 0, 0, 0, 0, 0, 0, 143, 0, 0, + 190, 0, 343, 0, 228, 227, 226, 0, 101, 0, + 279, 0, 258, 119, 0, 256, 0, 0, 0, 121, + 0, 344, 0, 0, 187, 0, 0, 0, 341, 231, + 112, 110, 0, 0, 283, 0, 0, 0, 0, 0, + 147, 0, 264, 0, 0, 0, 0, 125, 0, 0, + 0, 0, 345, 346, 0, 0, 0, 0, 0, 107, + 298, 0, 280, 0, 0, 292, 0, 0, 0, 287, + 0, 137, 0, 0, 0, 0, 132, 0, 0, 276, + 0, 122, 0, 116, 126, 144, 150, 198, 0, 188, + 0, 0, 0, 0, 111, 0, 104, 108, 0, 0, + 0, 294, 0, 295, 284, 0, 0, 278, 288, 259, + 0, 0, 118, 133, 257, 0, 274, 0, 265, 269, + 128, 0, 0, 0, 195, 197, 191, 232, 109, 299, + 301, 281, 0, 0, 293, 290, 136, 134, 148, 0, + 0, 0, 145, 199, 201, 189, 0, 0, 0, 292, + 0, 270, 272, 129, 0, 0, 192, 303, 304, 300, + 302, 291, 149, 0, 0, 205, 204, 203, 200, 202, + 0, 0, 0, 193, 271, 273, }; protected static readonly short [] yyDgoto = { 7, 8, 50, 9, 51, 10, 11, 52, 235, 685, 429, 12, 13, 53, 22, 23, 24, 321, 195, 238, 670, - 828, 1016, 1133, 1480, 825, 239, 240, 241, 242, 243, + 828, 1015, 1134, 1468, 825, 239, 240, 241, 242, 243, 244, 245, 246, 663, 444, 664, 665, 928, 666, 667, - 932, 826, 1011, 1012, 1013, 269, 587, 1105, 837, 1199, - 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, - 1210, 463, 674, 1296, 942, 1112, 1075, 1145, 1183, 1168, - 1227, 1255, 1226, 1256, 1257, 1140, 1355, 1332, 1380, 1381, - 1382, 944, 1378, 945, 728, 1272, 1343, 1319, 1368, 512, - 1361, 1337, 1397, 907, 1366, 1369, 1370, 1464, 1398, 1399, - 1395, 1211, 1279, 1238, 1297, 686, 1345, 1444, 1316, 1401, - 1473, 464, 270, 687, 688, 689, 690, 691, 650, 568, - 1117, 651, 652, 843, 1299, 1323, 1412, 1373, 1446, 1300, - 1348, 1469, 1493, 1413, 1414, 1491, 1477, 1478, 940, 1074, - 1167, 1223, 1281, 1224, 1225, 1273, 1330, 1303, 1274, 323, - 226, 1377, 1276, 1362, 1359, 1212, 1240, 1293, 1441, 1403, - 1125, 1442, 588, 1486, 1487, 1292, 1358, 1334, 1390, 1385, - 1356, 1422, 1427, 1388, 1391, 1392, 1472, 1428, 1386, 1387, - 1482, 1470, 1471, 937, 1020, 1136, 1110, 1161, 1137, 1138, - 1175, 1071, 1159, 1187, 532, 196, 112, 431, 198, 562, - 439, 227, 1311, 648, 649, 814, 830, 324, 406, 530, - 303, 1141, 1142, 46, 114, 304, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 255, 791, 981, - 508, 715, 864, 716, 717, 974, 137, 201, 721, 589, - 590, 591, 592, 785, 472, 473, 298, 979, 723, 407, - 300, 495, 496, 497, 498, 501, 730, 310, 745, 746, - 880, 266, 478, 758, 267, 477, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 571, 572, 573, 767, 768, 896, 769, - 155, 558, 759, 353, 994, 546, 1054, 156, 490, 938, - 1073, 1165, 1277, 465, 1146, 1147, 1194, 1195, 815, 548, - 335, 763, 1153, 549, 550, 271, 272, 273, 159, 160, - 161, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 173, 286, 559, 174, 175, 317, 796, - 627, 910, 840, 681, 948, 908, 911, 912, 949, 950, - 287, 176, 177, 178, 1045, 985, 1046, 1047, 1048, 1091, - 1049, 179, 180, 181, 182, 698, 483, 699, 966, 1084, - 700, 964, 701, 1086, 1087, 183, 184, 185, 186, 187, - 188, 305, 521, 522, 987, 1093, 313, 963, 849, 1119, - 886, 1126, 189, 417, 190, 418, 913, 1001, 419, 639, - 809, 806, 807, 1006, 420, 421, 422, 423, 424, 425, - 917, 629, 915, 1098, 1170, 1229, 1003, 1129, 1186, 804, - 635, 805, 1062, 1005, 1063, 1130, 1007, 17, 19, 47, - 48, 230, 653, 822, 440, 654, 655, + 932, 826, 1010, 1011, 1012, 269, 587, 1106, 837, 1198, + 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, + 1209, 463, 674, 1282, 941, 1113, 1076, 1143, 1167, 1225, + 1293, 1138, 1343, 1320, 1368, 1369, 1370, 943, 1366, 944, + 728, 1259, 1331, 1306, 1356, 512, 1349, 1325, 1385, 907, + 1354, 1357, 1358, 1452, 1386, 1387, 1383, 1210, 1266, 1237, + 1283, 686, 1333, 1432, 1303, 1389, 1461, 464, 270, 687, + 688, 689, 690, 691, 650, 568, 1118, 651, 652, 843, + 1285, 1310, 1400, 1361, 1434, 1286, 1336, 1457, 1481, 1401, + 1402, 1479, 1465, 1466, 939, 1075, 1166, 1222, 1268, 1223, + 1224, 1260, 1317, 1289, 1261, 323, 226, 1365, 1263, 1350, + 1347, 1211, 1239, 1279, 1429, 1391, 1126, 1430, 588, 1474, + 1475, 1278, 1346, 1322, 1378, 1373, 1344, 1410, 1415, 1376, + 1379, 1380, 1460, 1416, 1374, 1375, 1470, 1458, 1459, 831, + 1018, 1073, 1159, 1136, 1175, 1160, 1161, 1186, 1070, 1157, + 1185, 532, 196, 112, 431, 198, 562, 439, 227, 1298, + 648, 649, 814, 830, 324, 406, 530, 303, 1139, 1140, + 46, 114, 304, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 255, 791, 980, 508, 715, 864, + 716, 717, 973, 137, 201, 721, 589, 590, 591, 592, + 785, 472, 473, 298, 978, 723, 407, 300, 495, 496, + 497, 498, 501, 730, 310, 745, 746, 880, 266, 478, + 758, 267, 477, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 571, 572, 573, 767, 768, 896, 769, 155, 558, 759, + 353, 993, 546, 1053, 156, 490, 937, 1074, 1164, 1264, + 465, 1144, 1145, 1193, 1194, 815, 548, 335, 763, 1151, + 549, 550, 271, 272, 273, 159, 160, 161, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 173, 286, 559, 174, 175, 317, 796, 627, 910, 840, + 681, 947, 908, 911, 1034, 912, 948, 949, 287, 176, + 177, 178, 1044, 984, 1045, 1046, 1047, 1092, 1048, 179, + 180, 181, 182, 698, 483, 699, 965, 1085, 700, 963, + 701, 1087, 1088, 183, 184, 185, 186, 187, 188, 305, + 521, 522, 986, 1094, 313, 962, 849, 1120, 886, 1127, + 189, 417, 190, 418, 913, 1000, 419, 639, 809, 806, + 807, 1005, 420, 421, 422, 423, 424, 425, 917, 629, + 915, 1099, 1169, 1227, 1002, 1130, 1184, 804, 635, 805, + 1061, 1004, 1062, 1131, 1006, 17, 19, 47, 48, 230, + 653, 822, 440, 654, 655, }; - protected static readonly short [] yySindex = { -157, - 0, -201, -137, -18, 44,11653, 0, 248, 0, 0, - 44, -18, 0, 0, 104, 0, 6498, 44, 0, -196, - -237, 0, 0, 0, 0, 0, 0, 0, 0, 99, - 0, 223, 0, 0, 0, 1006, 0, 0, 0, 0, - 0, 0, 0, 0, 93, 0, 0, 544, 0, 0, - 248, 259, 44, 0, 258, 0, 87, 294, 353,11153, - 318, -29, 328, 6655, 0, -29, -29, -29, -175, -29, - -29, 587, 0,10172, -29, -29, 0,10172, 0, 388, - 0, 353, 0, -29, 330, -29, 0, 8204,11672, 390, - -29, -29, -162,10976, 0,10172, 0,10852,10852,10852, -10852,10852,10852,10852,10852, 0, -103, 0,11726, 0, - 0, 363, -260, 795, 302, 0, 0, 447, 0, 0, + protected static readonly short [] yySindex = { -185, + 0, -190, -128, -221, -14,11657, 0, -93, 0, 0, + -14, -221, 0, 0, -72, 0, 6676, -14, 0, -173, + -247, 0, 0, 0, 0, 0, 0, 0, 0, 46, + 0, 112, 0, 0, 0, 5062, 0, 0, 0, 0, + 0, 0, 0, 0, 288, 0, 0, 335, 0, 0, + -93, 128, -14, 0, 5, 0, -36, 103, 129,11157, + 147, -272, 230, 6833, 0, -272, -272, -272, -166, -272, + -272, 374, 0,10176, -272, -272, 0,10176, 0, 267, + 0, 129, 0, -272, 228, -272, 0, 7930, 8225, 329, + -272, -272, -219,10980, 0,10176, 0,10856,10856,10856, +10856,10856,10856,10856,10856, 0, 70, 0, 8382, 0, + 0, 394, 341, 252, -233, 0, 0, 409, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1069, 0, - 0, 685, 66, 498, 616, 597, 456, 462, 480, 505, - 137, 548, 0, 0, 0, 0, 0, 0, 3318, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 893, 0, + 0, 708, 168, 373, 475, 556, 447, 460, 480, 445, + -74, 498, 0, 0, 0, 0, 0, 0, 3428, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 571, 600, -285, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -105, 95, - 259, 0, 401, 606, 627, 0, 615, 0, 0, 0, - 0,11726,11726, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 491, 570, 75, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, -208, -174, + 128, 0, 391, 574, 589, 0, 564, 0, 0, 0, + 0, 8382, 8382, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 674, 633, 0, 646, 0, - -249, 0, 0, 0, 259,12475, 259, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 830, 688,10308, - 0, 0, 0, 0,10172, -29, -29, 834, 512, 795, - 0, 698, 0,11726, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 624, 583, 0, 586, 0, + -249, 0, 0, 0, 128,12382, 128, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 775, 630,10312, + 0, 0, 0, 0,10176, -272, -272, 781, 311, 252, + 0, 643, 0, 8382, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 801, 74,11153, 0,11726, -10172, 757, 776,10172,10172, 4520, 326, 109, 779,11743, - 264, 0, 782, 0, 822,11726,10172, 840, 516, -29, - 0,10172, 388, 9628, 0, 0, 330,10172, 330, -205, - 547, 803, 0, 600, 302, -1, 810,10172,10172,10172, - 328, 892, 0, 0, 6812, -56, 0, 0, 0, 0, - 0, 0, 0, 0, 870,10172, 0, 0, 0, 1324, - 0, 0,11582, -289, 860, 839, 0, -84, 0, 0, - 263, 0, 0, 842,10308, 9356, 0, 0,10852,10172, -10172,10172,10172,10172,10172,10172,10172,10172,10172,10172, -10852,10852,10852,11726,11726,10852,10852,10852,10852,10852, -10852,10852,10852,10852,10852,10852,10852,10852,10852,10852, -10852,10172, 0, 0, 0, 0, 600, 0, 0, 0, - 0,11797,11821, 849, 0, 0, 0, 0, 33, 856, - 0, 0, 0, 0, 0, 0, 0, 259, 259, 853, - 0, 867, 0, 839, 674, 674, 0, -86, 0, -206, - 674, 909, 0, -198,12475, 0, 0, 0, 0, -192, + 0, 0, 0, 0, 0, 725, 95,11157, 0, 8382, +10176, 697, 712,10176,10176, 4630, 604, -144, 717,11676, + 183, 0, 706, 0, 715, 8382,10176, 727, 561, -272, + 0,10176, 267, 9632, 0, 0, 228,10176, 228, -92, + 456, 710, 0, 570, -233, -83, 743,10176,10176,10176, + 230, 772, 0, 0, 6990, -258, 0, 0, 0, 0, + 0, 0, 0, 0, 734,10176, 0, 0, 0, 320, + 0, 0,11586, 235, 752, 755, 0, -126, 0, 0, + 240, 0, 0, 747,10312, 9360, 0, 0,10856,10176, +10176,10176,10176,10176,10176,10176,10176,10176,10176,10176, +10856,10856,10856, 8382, 8382,10856,10856,10856,10856,10856, +10856,10856,10856,10856,10856,10856,10856,10856,10856,10856, +10856,10176, 0, 0, 0, 0, 570, 0, 0, 0, + 0,11730,11747, 758, 0, 0, 0, 0, -252, 617, + 0, 0, 0, 0, 0, 0, 0, 128, 128, 761, + 0, 778, 0, 755, 624, 624, 0, -145, 0, 399, + 624, 764, 0, -192,12382, 0, 0, 0, 0, -171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 235,12518, 0, 0, 0, 839, 419, 0, - 0, 561, 0, 886, 0, 920, 67, 388, -29, 0, - 0, 881, 7735, -147, 0, 940, 0, 0, 0, 945, - 946, 0, 417, 0, 951, 0, 947, 0, 0, 0, - 680, 0, 7871, 681,10172, 779, 9356, 0, 7283, 0, - 330, 0, 0, 0, 948, 950, 0, 0, 353, 388, - 267, 0, 4201, 952, 0, 953, 908, 0, 956, 0, -10172, 0, 0, 1035, 0, 0, 0,10172, 1036, 972, - 0, 975, 976, 0, 0,11582, 0, -288, 6812, 0, - 0, 0, 0, 0, 0, 0, 974, 388, 6812, 0, - 0, -286, 0, 0, 0, 330, -289, 935,11871, 0, - 980, 0, 987,10852, 0, 275, 0, 349, 0, 839, - 793,10172,10172, 994, 1110, 0, 0, -36, 993, 0, - 0, 0, 685, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 685, - 685, 66, 66, 498, 498, 498, 498, 616, 616, 597, - 456, 462, 480, 505, 0, 995, -186, 0,10172, 80, - 955, 113, 957, 996,10172, 0, 0, 0, 1012, 0, - 200, 839, 0, 0, 0, 0, 517, 242, 0,11871, - -206, 0, 997, 1000, 0, 0, 0, 0, 0, 0, - -289, 606, 0, 1001, 1005, 0, 0, 0, 0, 1007, -11895, 963, 0, 361, 0, 0, 542, 0,10308, 0, - 1016, 0, 0, 0, 711, 1010, 0, 1041, 1042, 1044, - 0, 0,10172, 0, 0, 1002, 0, 0, 1043, 0, - 1049,10172, 1130, 0, 6655, 6655, 8030, 0, 4520, 0, - 0, 9764, 236, 0, -281, 58, 0, 999, 1003, 0, - -185, 0, 0, 1053, 0, 0, 0, 0, 0, 1055, - 0, 1063, 0, 4360, 0, 388, 0, 0, 330, 428, - 573, 0, 1013, 0, 1060, 1061, 0, 6655, 0, 6655, - 0,10172, 0,10172,11726, 0, 0, 388, 388, 1066, - 0, 0, 0, 0, 0, 0, 0, 0, 8187, 0, -11726, 0, 0, 1015,11582, 1092, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 9220, 0, 0, 0, - 0, 9492,10172, 0, 7440, 1065, 0, 0, 1146, 0, - 1147, 0, 667, 0, 1068,10172,10172, 1025, 0, 0, - 0, 0, 0, 1028, 0, -86, 0, 0, 0, 0, - -206, -206, 0, 853, 1075, 1078, 1033, 1085, 963, 0, - 1079, 0, 1197, 1199, 0, 0,10172, 0, 9900, 1082, - 711,11871,11726, 0, 128, 1203, 1205, 1090, 1086, 0, -10172,10172, 1094,10172, 1188, 0, 0, 0, 0, 31, -10036, 0, 0, 0, 0, 7576, 0, 1225, 0, 600, -10172, 1115, 8030, 1116, 0, 0, 1067, 0, 0, 0, - 1072, 556, 0, 1073, 0, 1086, 0, 0, 0, 1111, - 0, 0, 1143, 0, 0, 0, 0, 0, 0, 0, - 0, 637, 0, 0, 0,11743, 0, 0, 1074, 1117, - 1065, 0,10172, 0,10172, 0,10172, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1125, 853, 0, 0, -10444, 0, 0, 0, 1136, 7300, 0, 963, 0, 963, - 0, 963, 0, 0, 0, 0, 1091, 1132, 1082, 0, - 0, 0, -188, -181, 1113, 1137, 0, 0, 0, 0, - 1134, 8030, 1065, -186, 0, 1138, 0, 0, 1140, 6655, - 0, 0, 0, 0, 0, 0, 1145, 0, 779, 0, - 0, 0, 0, 0, -203, 0, 1141, 556, 0, 1095, - 1065, 0, 0, 388, 0, 1096, 1142, 0, 0, 0, -10172, 1180,10172, 0,10172, 1179, 461, 0, 1005, 238, - 762, 0, 0, 0, 0, -18, 0, 0, 0, 1164, - 0, 0, 0, 1155, 0, 0, 0, 481, 0, 1156, - 1285, 1287, 0, 0, 1181, 1065,10172, 0, 0, 0, - 0, 0,10172, 0, 1184, -191, 0, -191, 0, 0, - 0, 0, 1182, 388, 0,10172, 7440, 0, 0, 1208, - 702, 1183, 0,10172, 0, 1186, 0, 0,10444, 44, - 67, 0, 1185, 1185, 1185, 9900, 1189, 0,10172, 0, - 0, 0, 0, 1192, 1049, 0, 6655, 1190, 0, 0, - 6812, 0, 1191, 0, 0, 1202, 0,10172, 0, 0, - 0, 0, 0, 0,10172, 0, 0, 259, 1195, 259, - 7457, 71, 71, 71, 0, 0,10172, 0, 6655, 6655, - 0, 0, 6812, 0, 0, 6655, 0, 1213,10172,10172, - 0, 259, 1201, 0, 1157, 0, 1204, 0, 0, 0, - 1207, 0, 0, 1158, 0, 1234, 0, 0, 0, 0, - 0, 0, 6812, 0, 0, 1235, 0, 1206, 71, 0, - 1216, 259, 7457, 1210, 1219, 0, 1220, 1221, 1224,10172, - 0, 0, 0, 0, 1212, 1206, 0, 0,11232, -65, - 259, 0, 0, 0, 1239,10172, 1222,10172, 0, 0, - 1226, 0, 0, 1228, 0, 0,12518, 0, 1232, -65, + 0, 0, -168, 9092, 0, 0, 0, 755, 111, 0, + 0, 631, 0, 774, 0, 832, -161, 267, -272, 0, + 0, 797, 7913, -202, 0, 840, 0, 0, 0, 845, + 848, 0, 241, 0, 853, 0, 849, 0, 0, 0, + 654, 0, 8049, 662,10176, 717, 9360, 0, 7461, 0, + 228, 0, 0, 0, 855, 857, 0, 0, 129, 267, + 463, 0, 1429, 858, 0, 859, 814, 0, 861, 0, +10176, 0, 0, 940, 0, 0, 0,10176, 943, 865, + 0, 868, 869, 0, 0,11586, 0, -261, 6990, 0, + 0, 0, 0, 0, 0, 0, 872, 267, 6990, 0, + 0, -254, 0, 0, 0, 228, 235, 831,11801, 0, + 877, 0, 880,10856, 0, 355, 0, 366, 0, 755, + 663,10176,10176, 882, 998, 0, 0, 38, 881, 0, + 0, 0, 708, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 708, + 708, 168, 168, 373, 373, 373, 373, 475, 475, 556, + 447, 460, 480, 445, 0, 884, -191, 0,10176, -48, + 839, 20, 842, 883,10176, 0, 0, 0, 906, 0, + 545, 755, 0, 0, 0, 0, 520, 247, 0,11801, + 399, 0, 891, 892, 0, 0, 0, 0, 0, 0, + 235, 574, 0, 895, 897, 0, 0, 0, 0, 894, +11825, 0, 0, 68, 0, 0, 204, 0,10312, 0, + 896, 0, 0, 0, 542, 903, 0, 907, 909, 910, + 0, 0,10176, 0, 0, 862, 0, 0, 911, 0, + 912,10176, 995, 0, 6833, 6833, 8208, 0, 4630, 0, + 0, 9768, 189, 0, -61, -138, 0, 863, 867, 0, + -90, 0, 0, 919, 0, 0, 0, 0, 0, 932, + 0, 941, 0, 4152, 0, 267, 0, 0, 228, 370, + 560, 0, 889, 0, 951, 953, 0, 6833, 0, 6833, + 0,10176, 0,10176, 8382, 0, 0, 267, 267, 957, + 0, 0, 0, 0, 0, 0, 0, 0, 8365, 0, + 8382, 0, 0, 913,11586, 987, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 9224, 0, 0, 0, + 0, 9496,10176, 0, 7618, 958, 0, 0, 1039, 0, + 1041, 0, 744, 0, 969,10176,10176, 926, 0, 0, + 0, 0, 0, 927, 0, -145, 0, 0, 0, 0, + 399, 399, 0, 761, 976, 977, 929, 983, 935, 0, + 935, 0, 1099, 1101, 0, 0,10176, 0, 9904, 990, + 542,11801, 8382, 0, 332, 1105, 1109, 997, 992, 0, +10176,10176, 999,10176, 1095, 0, 0, 0, 0, 85, +10040, 0, 0, 0, 0, 7754, 0, 1123, 0, 570, +10176, 1014, 8208, 1017, 0, 0, 964, 0, 0, 0, + 970, 239, 0, 971, 0, 992, 0, 0, 0, 1015, + 0, 0, 1047, 0, 0, 0, 0, 0, 0, 0, + 0, 421, 0, 0, 0,11676, 0, 0, 973, 1016, + 958, 0,10176, 0,10176, 0,10176, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1024, 761, 0, 0, +10448, 0, 0, 0, 1025, 1023, 935, 0, 935, 0, + 935, 0, 0, 0, 0, 982, 1026, 990, 0, 0, + 0, -167, -156, 1027, 1029, 0, 0, 0, 0, 1028, + 8208, 958, -191, 0, 1032, 0, 0, 1033, 6833, 0, + 0, 0, 0, 0, 0, 1040, 0, 717, 0, 0, + 0, 0, 0, -213, 0, 1037, 239, 0, 991, 958, + 0, 0, 267, 0, 988, 1034, 0, 0, 0,10176, + 1067,10176, 0,10176, 1065, 225, 0, 897, 219, 557, + 0, 0, 0, 0, -221, 0, 4311, 0, 0, 0, + 0, 1036, 0, 0, 0, 493, 0, 1038, 1162, 1164, + 0, 0, 958, 1049, 958,10176, 0, 0, 0, 0, + 0,10176, 0, 1055, -224, 0, -224, 0, 0, 0, + 0, 1052, 267, 0,10176, 7618, 0, 0, 1078, 782, + 1053, 0,10176, 0, 1056, 0, 0,10448, -14, -161, + 0, 0, 1061, 1054, 1054, 1054, 9904, 1060, 0,10176, + 0, 0, 0, 0, 1059, 912, 0, 6833, 1057, 0, + 0, 6990, 0, 1066, 0, 0, 1064, 0,10176, 0, + 0, 0, 0, 0, 0,10176, 0, 0, 128, 1068, + 0, 4470, -153, -153, -153, 0, 0,10176, 0, 6833, + 6833, 0, 0, 6990, 0, 0, 6833, 0, 1088,10176, +10176, 0, 128, 1069, 0, 128, 0, 0, 1070, 0, + 0, 1020, 0, 1100, 0, 0, 0, 0, 0, 0, + 6990, 0, 0, 1093, 0, 1071, -153, 1030, 0, 1075, + 0, 4470, 1076, 1083, 0, 1089, 1092, 1074,10176, 0, + 0, 0, 0, 0, 1087, 128, 0,11236, -75, 128, + 0, 0, 1104,10176, 1086, 1062, 1071, 0, 0, 1090, + 0, 0, 1096, 0, 0, 9092, 0, 1120, -75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -262,12518, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1238, 259, 0, 259, 1206, 1178, 0, 1239, - 0, 0, 1236,11232,11398, 0, 0, -255, 0, 0, - 0,11430, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1242, 259, 0, 0, 0, 0, - 0, 0,11726,11726, 225,11743, 316, 330, 1270, 0, - -289, 640, 0, 1306, 0, 0, 1206, 0, 0, 0, - 1206, 0, 0, 1198, 1200, 0,11726, -164, 0,11726, - 0, 1209, 1244, 0, -289, 0, 1246, 9112, 0, 1251, - 1211, -46, 351, 1006, 0, 0, 0, -289, 0, 1254, - 1214, 1252, 1237, 0, 1255, 1200, 1260, 67, 1241, 1261, - 0, 1262, 1258, 0, 839, 0, 678, 0, 0, 0, - 1264, -184, 0, 1266, 0, 0, 1267, 0, 1268, 1271, - 1273, 0, 1274, 0, 67, 67, 0, 67, 1276, 1277, - 0, 0, 0, 0, 1278, 62, 0, 1282, 67, 1401, - 1286, 67, 0, -255, 0, 8030, 1245, 1283, 1274, 0, - 1290, 1292, 77, 1295, 0, 0, 67, 9900, 1248, 1291, - 1278, 0, 0,12518, 0, 259, 259, 0, 1250, 1293, - 1282, 0, 1298, 0,10172, 1257, 1296, 1286, 0, 1301, - 67, 0, -77, 0, 1299, 0, 0, 0, 0, 0, -12518, 0, 77, 77, 1309, 1305, 0, -184, 0, 0, - 219, 1311,12518, 0,12518, 0, 0, 8030, 1300, 0, - 0, 0, 1312, 1267, 0, 0, 0, 1316, 0, 20, - 0, 0, 0, 71, 848, 1321, 0, 0, 0, 0, - 0, 0, 0, 0, 1375, 1428, 0, 0, 0, 0, - 0, 1323, 1325, 8030, 0, 0, 0, 0, 77, 412, - 412, 0, 71, 0, 0, 0, 110, 110, 0, 0, - 0, 0, 0, 0, 0, 9356, 9356, 0, 0, 0, - 0, 0, 1327, 1326, 1331, 0, 0, 0, + -248, 9092, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1121, 128, 0, -75, 1045, 0, 1104, 0,10176, + 0, 1097,11236,11402, 0, 0, -244, 0, 0, 0, +11434, 0, 0, 1122, 0, 0, 0, 0, 0, 8382, + 8382, -122,11676, -109, 228, 1154, 0, 235, 9160, 0, + 1188, 0, 0, 1071, 0, 0, 0, 1071, 0, 1081, + 1082, 0, 8382, -152, 0, 8382, 0, 1108, 1125, 0, + 235, 0, 1130, 682, 0, 1135, 1112, 1, 354, 5062, + 0, 0, 1071, 0, 235, 0, 1127, 1113, 1134, 1139, + 0, 1156, 1082, 1163, -161, 1152, 1165, 0, 1168, 1173, + 0, 755, 0, 736, 0, 0, 0, 1170, 0, -178, + 0, 1161, 0, 0, 1174, 0, 1175, 1176, 1178, 0, + 1171, 0, -161, -161, 0, -161, 1181, 1182, 0, 0, + 0, 0, 1177, -59, 0, 1183, -161, 1300, 1184, -161, + 0, -244, 0, 8208, 1141, 1185, 1171, 0, 1190, 1191, + 27, 1194, 0, 0, -161, 9904, 1142, 1189, 1177, 0, + 0, 9092, 0, 128, 128, 0, 1148, 1192, 1183, 0, + 1197, 0,10176, 1155, 1196, 1184, 0, 1202, -161, 0, + -107, 0, 1195, 0, 0, 0, 0, 0, 9092, 0, + 27, 27, 1220, 1217, 0, -178, 0, 0, -148, 1224, + 9092, 0, 9092, 0, 0, 8208, 1212, 0, 0, 0, + 1225, 1174, 0, 0, 0, 1222, 0, 83, 0, 0, + 0, -153, 834, 1228, 0, 0, 0, 0, 0, 0, + 0, 0, 1282, 1335, 0, 0, 0, 0, 0, 1229, + 1233, 8208, 0, 0, 0, 0, 27, 484, 484, 0, + -153, 0, 0, 0, -80, -80, 0, 0, 0, 0, + 0, 0, 0, 9360, 9360, 0, 0, 0, 0, 0, + 1240, 1237, 1238, 0, 0, 0, }; - protected static readonly short [] yyRindex = { 2851, - 0, 0, 6969, 2851, 0, 0, 0, 1704, 0, 0, - 3004, 2782, 0, 0, 0, 0, 0, 3004, 0, 0, - 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, + protected static readonly short [] yyRindex = { 2961, + 0, 0, 7147, 2961, 0, 0, 0, 1611, 0, 0, + 3114, 2892, 0, 0, 0, 0, 0, 3114, 0, 0, + 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1613, 0, 0, 1613, 0, 0, + 1611, 3157, 3008, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1247, 0, 0, 0, 0, 0, 0, 0, + 0,11875, 0, 1239, 0, 0, 0, 1239, 0, 0, + 0, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1708, 0, 0, 1708, 0, 0, - 1704, 3047, 2898, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1342, 0, 0, 0, 0, 0, 0, 0, - 0,11949, 0, 1334, 0, 0, 0, 1334, 0, 0, - 0, 0, 0, 0, 206, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3740, 0, 0, 0, + 0, 0, 171, 4628, 3581, 0, 0, 4469, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3630, 0, 0, 0, - 0, 0, 313, 4518, 3789, 0, 0, 4359, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 4784, 0, + 0, 4852, 5196, 5400, 5740, 5944, 6080, 6216, 6352, 6488, + 529, 966, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 4674, 0, - 0, 4742, 5086, 5290, 5630, 358, 5902, 6038, 6174, 6310, - -194, 293, 0, 0, 0, 0, 0, 0, 42, 0, + 0, 0, 0, 0, 1198, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 805, 805, + 3200, 0, 572, 1242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1294, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 939, 939, - 3090, 0, 595, 1337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1613, 47, 0, 0, 0, + 0, 0, 0, 0, 3243, 432, 3286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1708, 228, 0, 0, 0, - 0, 0, 0, 0, 3133, 402, 3176, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3515, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 3405, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1262, 0, 0, 0, 0, + 3515, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 2149, 0, 1273, 132, + 2279, 0, 0, 2426, 2279, 132, 0, 0, 0, 0, + 1247, 0, 0, 0, 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1239, 0, 0, 0, 0, + 0, 0, 1259, 2551, 0, 3515, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1350, 0, 0, 0, 0, - 3405, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2039, 0, 1150, 692, - 2169, 0, 0, 2316, 2169, 692, 0, 0, 0, 0, - 1342, 0, 0, 0, 145, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1334, 0, 0, 0, 0, - 0, 0, 1349, 2441, 0, 3405, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1532, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, + 0, 0, 0, 0, 0, 0, 0, 3349, 2716, 0, + 0, 0, 0, 1996, 1613, 1613, 0, -189, 0, 7478, + 1613, 1632, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1422, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 169, - 0, 0, 0, 0, 0, 0, 0, 3239, 2606, 0, - 0, 0, 0, 1886, 1708, 1708, 0, -122, 0, 7752, - 1708, 1722, 0, 0, 45, 0, 0, 0, 0, 0, + 0, 0, 296,11089, 0, 0, 0, 3515, 3899, 0, + 0, 0, 0, 0, 0, 0,11478, 0, 0, 0, + 0, 0, 1257, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 719, 785, 0, 0, 1266, 0, 0, 0, + 0, 0, 6, 0, 0, 3992, 1263, 0, 0, 0, + 184, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1700, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 364,11085, 0, 0, 0, 3405, 3948, 0, - 0, 0, 0, 0, 0, 0,11474, 0, 0, 0, - 0, 0, 1354, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 731, 818, 0, 0, 1357, 0, 0, 0, - 0, 0, 191, 0, 0, 3882, 1363, 0, 0, 0, - 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1590, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1259, 0, 0, 31, 0, + 0, 0, 0, 0, 0, 0, 0, 8522, 0, 0, + 0, 0, 0, 0, 0, -181, 385, 0, 0, 0, + 1264, 0, 0, 0, 0, 3515, 0, 3515, 0, 4151, + 0, 0, 0, 90, 0, 0, 0, 0, 144, 0, + 0, 0, 4956, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 5024, + 5128, 5264, 5332, 5468, 5536, 5604, 5672, 5808, 5876, 6012, + 6148, 6284, 6420, 6544, 0, 0, 597, 0, 0, 132, + 0, 132, 0, 0, 0, 0, 0, 0, 1231, 0, + 0, 1996, 0, 0, 0, 0, 1219, 0, 0, 0, +11899, 0, 0, 641, 0, 0, 0, 0, 0, 0, + 519, 626, 0, 0, 1268, 0, 0, 0, 0, 1275, + 0, 0, 0, 0, 0, 0,10584, 0, 0, 0, + 733, 0, 0, 0,11953, 0, 0, 732, 746, 749, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1349, 0, 0, 201, 0, - 0, 0, 0, 0, 0, 0, 0, 8344, 0, 0, - 0, 0, 0, 0, 0, -197, 537, 0, 0, 0, - 1365, 0, 0, 0, 0, 3405, 0, 3405, 0, 4041, - 0, 0, 0, 127, 0, 0, 0, 0, -20, 0, - 0, 0, 4846, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 4914, - 5018, 5154, 5222, 5358, 5426, 5494, 5562, 5698, 5766, 5834, - 5970, 6106, 6242, 6366, 0, 0, 786, 0, 0, 692, - 0, 692, 0, 0, 0, 0, 0, 0, 988, 0, - 0, 1886, 0, 0, 0, 0, 1322, 0, 0, 0, -11966, 0, 0, 800, 0, 0, 0, 0, 0, 0, - 744, 664, 0, 0, 1374, 0, 0, 0, 0, 1378, - 0, 0, 0, 0, 0, 0,10580, 0, 0, 0, - 807, 0, 0, 0,12020, 0, 0, 808, 824, 833, + 1270, 0, 0, 0, 0, 0, 0, 0, 1285, 0, + 0, 0, 1124, 0, 0, 41, 0, 117, 3674, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1286, + 0, 0, 0, 0, 0, 0, 0, 0, -68, 595, + 650, 0, 0, 0, 0, 1278, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 8522, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1370, 0, 0, 0, 0, 0, 0, 0, 1380, 0, - 0, 0, 3471, 0, 0, 202, 0, 49, 3564, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1381, - 0, 0, 0, 0, 0, 0, 0, 0, 254, 804, - 658, 0, 0, 0, 0, 1379, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 8344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 162, 0, 0, 0, 1288, 0, 0, 0, 0, + 0, 0, 458, 0, 677, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -189, 0, 0, 0, 0, +11953, 7635, 0, 1291, 0, 680, 0, 0, 0, 0, + 0, 0, 1248, 1258, 0, 0, 0, 0, 0, 1289, +11970, 0, 0, 0,11554, 0, 0, 0, 748, 0, + 1299, 0, 0, 0, 1867, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 3833, + 0, 4310, 1309, 0, 0, 0, 1306, 0, 0, 0, + 0, 595, 0, 0, 0, 748, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 251, 0, 0, 0, 1377, 0, 0, 0, 0, - 0, 0, 641, 0, 614, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -122, 0, 0, 0, 0, -12020, 8047, 0, 1384, 0, 805, 0, 0, 0, 0, - 1383, 0, 1338, 1341, 0, 0, 0, 0, 0, 1386, -12044, 0, 0, 0,11550, 0, 0, 0, 857, 0, - 1387, 0, 0, 0, 1757, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 3723, - 0, 4200, 1396, 0, 0, 0, 1393, 0, 0, 0, - 0, 804, 0, 0, 0, 857, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1303, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 821, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 751, 0, 0, 0, 0, 1313, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1305, 0, 0, + 0, 0, 0, 790, 794, 0, 0, 0, 0, 0, + 0, 1310, 597, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3992, 0, 0, + 0, 0, 0, 1315, 0, 0, 595, 0, 828, 1310, + 0, 0, 8522, 0, 614, 636, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 44, 0, 1268, 8572, 0, + 0, 0, 0, 0,12001, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 671, 0, 692, 0, 0, + 0, 0, 858, 0, 1288, 1312, 0, 0, 0, 0, + 0, 0, 0, 0, 1319, 0, 7304, 0, 0, 0, + 0, 0, 8522, 0, 0, 0, 0, 0, 0, 588, + 703, 0, 0, 0, 0, 0, 0, 0,12044,11478, + 0, 0, 0, -51, -51, -51, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1316, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 871, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1391, 0, - 0, 0, 0, 0, 880, 884, 0, 0, 0, 0, - 0, 0, 1407, 786, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 3882, 0, - 0, 0, 0, 0, 1412, 0, 0, 804, 0, 932, - 1407, 0, 0, 8344, 0, 632, 670, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 176, 0, 1374, 8394, - 0, 0, 0, 0, 0,12092, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 770, 0, 775, - 0, 0, 0, 0, 0, 1377, 1409, 0, 0, 0, - 0, 0, 0, 0, 0, 1414, 0, 7126, 0, 0, - 0, 0, 0, 8344, 0, 0, 0, 0, 0, 0, - 679, 730, 0, 0, 0, 0, 0, 0, 0,12135, -11474, 0, 170, 170, 170, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1411, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0,12113, 0, + 0, 0, 1323, 1323, 1323, 0, 0, 0, 0, 0, + 0, 0, 0, -205, 0, 0, 0, 0, 0, 0, + 0, 0,12156, 0, 0, 64, 0, 0, 109, 0, + 0, 0, 0, 540, 0, 0, 0, 0, 0, 0, + 1324, 0, 0, 0, 0, 3071, 1317, 0, 0, 1327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0,12246, 0, -290, - 0, 1418, 1418, 1418, 0, 0, 0, 0, 0, 0, - 0, 0, -178, 0, 0, 0, 0, 0, 0, 0, - 0,12289, 0, 0, 0, 0, 1419, 0, 0, 0, - 216, 0, 0, 0, 0, 445, 0, 0, 0, 0, - 0, 0, 1420, 0, 0, 0, 0, 2961, 1410, -257, - 0, 65, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 2719, 0, 0, 0, 8548, - 8944, 0, 0, 0, 745, 0, 0, 0, 0, 0, - 0, 0, 0, -244, 0, 0,11256, 0, 0, 8647, + 0, 0, 0, 485, 0, 154, 0, 0, 8726, 8924, + 0, 0, 728, 0, 0, 0, 2829, 0, 0, 0, + 0, 0, 397, 0, 0,11260, 0, 0, 8825, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,11324, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 9038, 0, 8746, 2719, 0, 0, 745, - 0, 0, 0, 0, 364, 0, 0, 0, 0, 0, - 0, 364, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 8845, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 4648, 457, 0, - 9080, 0, 0, 0, 9150, 0, 2719, 0, 0, 0, - 2719, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 866, 0, 1424, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 888, 0, 551, - 0, 0, 0, 0, 0, 0, 0,11474, 889, 0, - 0, 0, 0, 0, 1426, 0, 906, 0, 0, 0, - 0, 0, 0, 900, 0, 0, 0, 0, 0, 0, - 0, 0, 1437, 0,11474,11474, 0,11506, 0, 0, - 0, 0, 0, 0, 1460, 1390, 0, 1461,11474,10716, - 1463,11474, 0, 0, 0, 0, 0, 0, 1465, 0, - 0, 0,12445, 0, 0, 0,11474, 0, 0, 0, - 1467, 0, 0, 285, 0,11007,12407, 0, 0, 0, - 1468, 0, 0, 0, 0, 0, 0, 1472, 0, 0, -11474, 0, 490, 0, 910, 0, 0, 0, 0, 0, - 942, 0,12331,12369, 0, 0, 0, 0, 0, 0, - 0, 0, 1487, 0, 1586, 0, 0, 0, 926, 0, + 0,11328, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 9018, 0, 8726, 0, 0, 728, 0, 0, + 0, 0, 0, 296, 0, 0, 0, 0, 0, 0, + 296, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 4758, 344, 0, 9060, 0, 0, + 0, 9130, 0, 2829, 0, 0, 0, 2829, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 492, 0, 0, 0, 0, 0, 0, + 307, 0, 1330, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 2829, 0, 425, 0, 442, 0, 0, 0, + 0, 0, 0, 0,11478, 798, 0, 0, 0, 0, + 0, 1325, 0, 767, 0, 0, 0, 0, 0, 0, + 0, 806, 0, 0, 0, 0, 0, 0, 0, 0, + 1329, 0,11478,11478, 0,11510, 0, 0, 0, 0, + 0, 0, 1331,12342, 0, 1333,11478,10720, 1336,11478, + 0, 0, 0, 0, 0, 0, 1337, 0, 0, 0, +12312, 0, 0, 0,11478, 0, 0, 0, 1339, 0, + 0, 266, 0, 1470,12274, 0, 0, 0, 1340, 0, + 0, 0, 0, 0, 0, 1342, 0, 0,11478, 0, + 548, 0, 818, 0, 0, 0, 0, 0, 838, 0, +12198,12236, 0, 0, 0, 0, 0, 0, 0, 0, + 1386, 0, 1440, 0, 0, 0, 819, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,12445,10888, -12203, 0, 492, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1363, 1363, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 559, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,12312, 382,10892, 0, + 559, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1263, 1263, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, }; protected static readonly short [] yyGindex = { 0, - 0, 1799, 0, 0, 0, -2, -10, -179, -42, 1800, - 0, 1841, 1854, 83, 0, 0, -6, 0, 0, 0, - 0, 0, 0, -826, -694, -224, -431, 0, 0, 0, - 0, 0, -193, 0, 0, 0, 934, 0, 1047, 0, - 0, 0, 0, 814, 815, -17, -230, 0, 0, 0, - 0, 672,-1118, -618, -488, -460, -427, -357, -308, -219, --1116,-1131, 0, 1, 0, 234, 0,-1073, 0, 0, - 0, 0, 0, 0, 617, 173, 458, 0, 0, 0, - 493,-1039, 0, -276, -293, 1217, 0, 0, 0, -863, - 453, 0, 0, -492, 0, 0, 522, 0, 0, 497, - 0, 0, 532, 0,-1189, -934, 0, 0, 0, 0, - 0, 625, -13, 0, 0, 1054, 1056, 1057, 1215, -521, - 0, 0, -321, 1062, 613, 0, -995, 0, 0, 0, - 0, 0, 0, 0, 0, 427, 0, 0, 0, 0, - 0, 0, 0, 0, 683, 0, 0, 0, 0, -340, - 607, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 701, 0, -504, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 438, 0, 0, 535, 0, 0, 541, 543, - 465, 0, 0, 0, 0, 0, 0, 0, 0, 771, - 0, 0, 0, 0, -59, 0, -15, -91, 0, 0, - 605, 0, 665, 0, 1122, 0, 1416, -291, -274, -66, - 451, 0, 777, 0, -38, 518, 0, 0, 1027, 0, + 0, 1655, 0, 0, 0, -1, -12, -179, -50, 1659, + 0, 1707, 1715, 87, 0, 0, -3, 0, 0, 0, + 0, 0, 0, -781, -693, -222, -446, 0, 0, 0, + 0, 0, -198, 0, 0, 0, 793, 0, 898, 0, + 0, 0, 0, 655, 657, -17, -235, 0, 0, 501, + 0, 528, -686, -685, -617, -594, -592, -575, -571, -553, + 0,-1140, 0, 12, 0, 131, 0,-1061, 0, 0, + 0, -8, 322, 0, 0, 0, 361,-1046, 0, -280, + -291, 1073, 0, 0, 0, -871, 310, 0, 0, -493, + 0, 0, 378, 0, 0, 350, 0, 0, 386, 0, + -555, -806, 0, 0, 0, 0, 0, 478, -13, 0, + 0, 905, 908, 916, 1063, -524, 0, 0, -326, 899, + 468, 0,-1078, 0, 0, 0, 0, 0, 0, 0, + 0, 275, 0, 0, 0, 0, 0, 0, 0, 0, + 532, 0, 0, 0, 0, -339, 462, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 546, 0, -498, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 298, 0, + 0, 377, 0, 0, 387, 390, 306, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 592, 0, 0, 0, + 0, -53, 0, -15, -67, 0, 0, 455, 0, 511, + 0, 959, 0, 1251, -293, -274, -64, 622, 0, 616, + 0, -38, 158, 0, 0, 56, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -262, 0, 1292, 0, 0, -279, 0, 0, + 0, 917, 0, -299, -134, 1077, 989, 0, 994, 0, + 1207, 1427, 1116, 0, 0, 820, 1724, 0, 0, 0, + 0, 1098, 0, 0, 0, 0, 0, -537, 1466, 0, + 0, 0, 0, 1705, 1085, 0, 0, 483, 821, 678, + 817, 1405, 1407, 1404, 1406, 1409, 0, 1411, 0, 0, + 0, 1035, 1267, -723, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -290, 0, 0, 0, 0, + -445, 0, 670, 0, 582, 0, 666, 0, 0, 0, + 726, -526, -16, -305, -7, 0, 1660, 0, 42, 0, + 51, 53, 60, 76, 89, 104, 108, 110, 122, 134, + 0, -664, 0, -28, 0, 0, 860, 0, 786, 0, + 0, 0, 766, -325, 830, -820, 0, 876, -457, 0, + 0, 0, 0, 0, 0, 780, 0, 0, 784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -269, 0, 132, 0, 0, - -320, 0, 0, 0, 1076, 0, -298, -134, 1229, 1159, - 0, 1151, 0, 1361, 1580, 1269, 0, 0, 968, 1882, - 0, 0, 0, 0, 1247, 0, 0, 0, 0, 0, - -515, 1624, 0, 0, 0, 0, 1865, 489, 0, 0, - 474, 922, 905, 918, 1564, 1565, 1566, 1572, 1563, 0, - 1571, 0, 0, 0, 1218, 1427, -708, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -287, 0, - 0, 0, 0, -446, 0, 819, 0, 741, 0, 825, - 0, 0, 0, 890, -526, -16, -307, 12, 0, 1818, - 0, 68, 0, 86, 101, 105, 114, 117, 122, 147, - 148, 149, 150, 0, -667, 0, -25, 0, 0, 1020, - 0, -575, 0, 0, 0, 923, 0, 1077, 0, 1030, - -457, 0, 0, 0, 0, 0, 0, 941, 0, 0, - 937, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 949, 0, 0, 0, 0, 0, 0, 0, - 0, -26, 0, 1469, 0, 0, 0, 1103, 0, 0, - 0, 0, 0, -169, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1574, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 761, 0, 0, 0, 0, - 0, 0, 0, 0, 862, 0, 0, 0, 0, 0, - 0, -14, 1173, 0, 0, 0, 1175, + 791, 0, 0, 0, 0, 0, 0, 0, 0, -40, + 0, 1307, 0, 0, 0, 947, 0, 0, 0, 0, + 0, -170, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1415, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 608, 0, 0, 0, 0, 0, 0, + 0, 0, 709, 0, 0, 0, 0, 0, 0, 39, + 1042, 0, 0, 0, 1031, }; protected static readonly short [] yyTable = { 110, - 157, 18, 724, 111, 197, 510, 44, 191, 513, 236, - 446, 428, 570, 194, 486, 352, 729, 675, 316, 471, - 427, 260, 764, 506, 403, 697, 494, 552, 158, 540, - 529, 569, 770, 232, 262, 874, 1115, 855, 856, 1148, - 1149, 933, 996, 466, 6, 254, 360, 774, 368, 535, - 892, 308, 1042, 359, 14, 367, 302, 658, 375, 192, - 302, 595, 1215, 668, 1043, 1235, 309, 1027, 311, 794, - 869, 1353, 197, 197, 1029, 442, 1043, 327, 336, 761, - 885, 1242, 887, 659, 162, 1174, 862, 771, 531, 793, - 408, 1313, 291, 197, 677, 1309, 357, 20, 1, 563, - 292, 349, 163, 200, 1124, 1215, 564, 1246, 1322, 1254, - 332, 95, 358, 1239, 331, 660, 332, 164, 565, 16, - 1278, 165, 677, 333, 350, 315, 1339, 48, 818, 772, - 166, 677, 628, 167, 471, 200, 1109, 1246, 168, 1254, - 762, 110, 157, 409, 595, 111, 702, 863, 236, 595, - 410, 595, 595, 595, 595, 595, 595, 595, 595, 595, - 595, 595, 345, 169, 170, 171, 172, 352, 43, 646, - 158, 48, 375, 595, 375, 595, 375, 595, 1439, 595, - 595, 595, 742, 48, 870, 349, 197, 197, 871, 793, - 1196, 199, 445, 264, 795, 595, 1354, 288, 289, 290, - 2, 294, 295, 446, 718, 570, 306, 307, 350, 352, - 346, 437, 722, 312, 857, 314, 15, 318, 1044, 661, - 375, 193, 329, 330, 569, 669, 162, 361, 570, 1028, - 1044, 443, 470, 411, 595, 466, 1030, 474, 412, 347, - 413, 552, 293, 793, 163, 366, 414, 415, 197, 260, - 528, 552, 1421, 1314, 533, 332, 333, 260, 537, 164, - 322, 327, 482, 165, 575, 536, 3, 4, 5, 6, - 703, 348, 166, 485, 197, 167, 489, 491, 1326, 1445, - 168, 355, 234, 1462, 197, 1055, 869, 349, 527, 516, - 197, 1455, 538, 1456, 524, 48, 526, 1440, 933, 525, - 489, 6, 1039, 234, 933, 169, 170, 171, 172, 570, - 350, 542, 543, 865, 1066, 554, 651, 1383, 551, 557, - 953, 651, 683, 416, 351, 651, 1143, 384, 302, 819, - 742, 1173, 1410, 576, 197, 789, 462, 197, 1417, 2, - 651, 252, 643, 577, 1463, 1095, 553, 470, 586, 1189, - 410, 463, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 385, 502, 1488, 989, 651, 197, 197, - 1465, 1327, 555, 798, 435, 436, 676, 352, 20, 373, - 983, 636, 637, 1341, 626, 236, 651, 1035, 312, 349, - 253, 366, 790, 462, 967, 647, 197, 197, 971, 1485, - 1258, 352, 1288, 202, 871, 848, 800, 684, 463, 1144, - 1371, 1372, 350, 1374, 197, 1053, 933, 1447, 1448, 1121, - 644, 645, 933, 641, 1393, 670, 656, 1400, 197, 507, - 234, 866, 329, 411, 570, 234, 476, 662, 412, 494, - 413, 523, 1416, 386, 387, 234, 414, 415, 471, 480, - 1305, 1151, 1152, 569, 1306, 248, 45, 696, 1154, 249, - 1083, 638, 484, 228, 692, 229, 1438, 113, 955, 1034, - 349, 671, 1051, 1479, 1052, 503, 95, 504, 515, 252, - 1286, 1452, 48, 361, 779, 1489, 781, 720, 782, 586, - 373, 727, 373, 350, 373, 373, 234, 373, 638, 373, - 638, 570, 481, 349, 49, 733, 735, 743, 670, 250, - 113, 671, 694, 751, 113, 672, 741, 887, 887, 951, - 753, 55, 561, 426, 886, 886, 350, 203, 253, 1287, - 197, 505, 551, 1453, 115, 519, 670, 400, 325, 325, - 973, 373, 551, 373, 766, 946, 373, 651, 597, 401, - 811, 982, 736, 197, 671, 638, 608, 609, 450, 325, - 553, 903, 1216, 965, 784, 784, 361, 718, 695, 451, - 553, 1289, 432, 694, 747, 810, 673, 115, 347, 697, - 347, 115, 671, 867, 631, 633, 337, 338, 339, 340, - 341, 342, 343, 344, 361, 978, 764, 887, 361, 651, - 361, 361, 361, 361, 886, 1216, 347, 1247, 361, 113, - 693, 797, 677, 585, 513, 816, 861, 803, 1067, 450, - 1290, 352, 467, 747, 467, 368, 349, 234, 349, 695, - 451, 597, 832, 247, 197, 649, 597, 1247, 597, 597, - 597, 597, 597, 597, 597, 597, 597, 597, 597, 350, - 734, 350, 325, 325, 349, 197, 833, 817, 357, 649, - 597, 470, 597, 351, 597, 351, 597, 597, 597, 251, - 260, 368, 831, 651, 533, 489, 115, 350, 651, 467, - 578, 339, 651, 834, 853, 722, 649, 315, 350, 727, - 579, 351, 1217, 263, 720, 499, 585, 651, 265, 500, - 1015, 585, 778, 585, 585, 585, 585, 585, 585, 585, - 585, 585, 585, 585, 325, 315, 410, 95, 197, 95, - 1218, 597, 878, 252, 651, 585, 1328, 585, 650, 585, - 339, 585, 585, 585, 888, 1217, 889, 1248, 113, 197, - 325, 585, 585, 651, 891, 766, 585, 585, 1198, 1214, - 325, 895, 650, 1219, 95, 197, 325, 585, 585, 197, - 328, 347, 350, 1218, 113, 1249, 1088, 1248, 1198, 586, - 585, 518, 253, 647, 586, 905, 780, 727, 95, 650, - 356, 430, 946, 552, 519, 113, 585, 1172, 921, 922, - 643, 349, 1214, 677, 1245, 1249, 1219, 707, 1250, 411, - 325, 520, 1118, 325, 412, 115, 413, 349, 197, 349, - 812, 673, 414, 415, 350, 552, 541, 662, 349, 943, - 673, 485, 813, 1220, 1245, 369, 197, 197, 1250, 935, - 350, 115, 350, 489, 325, 325, 969, 1065, 1015, 396, - 1150, 350, 593, 972, 351, 552, 351, 835, 879, 1077, - 397, 675, 115, 980, 836, 727, 283, 541, 672, 610, - 611, 1078, 325, 325, 398, 283, 1220, 672, 1251, 605, - 606, 607, 1221, 1404, 541, 541, 541, 541, 541, 541, + 157, 236, 18, 111, 197, 191, 513, 510, 724, 158, + 486, 428, 446, 570, 471, 729, 194, 44, 675, 427, + 316, 260, 764, 506, 403, 697, 569, 529, 540, 552, + 1116, 262, 770, 494, 995, 892, 874, 308, 466, 352, + 855, 856, 1041, 1042, 774, 254, 347, 410, 360, 535, + 368, 921, 1146, 1147, 1042, 1234, 302, 331, 162, 359, + 302, 367, 781, 658, 794, 14, 309, 163, 311, 164, + 1, 1241, 197, 197, 361, 442, 165, 1341, 336, 322, + 327, 410, 192, 885, 668, 887, 232, 20, 1025, 659, + 998, 702, 166, 197, 683, 1173, 636, 637, 252, 1027, + 355, 291, 1141, 1300, 48, 167, 761, 200, 671, 292, + 646, 502, 672, 554, 1440, 261, 48, 865, 1125, 771, + 168, 660, 95, 357, 169, 818, 170, 1238, 16, 471, + 411, 1265, 628, 1272, 6, 412, 2, 413, 171, 200, + 236, 110, 157, 414, 415, 111, 1275, 253, 1427, 261, + 172, 158, 315, 261, 261, 261, 261, 261, 261, 261, + 261, 772, 781, 49, 411, 869, 1441, 762, 43, 412, + 555, 413, 2, 673, 115, 1476, 638, 414, 415, 684, + 1195, 199, 1273, 742, 445, 1142, 197, 197, 361, 795, + 361, 352, 361, 435, 436, 1276, 1371, 1043, 332, 333, + 162, 531, 1342, 718, 656, 446, 570, 234, 1043, 163, + 538, 164, 998, 857, 722, 703, 781, 115, 165, 569, + 416, 115, 503, 234, 504, 661, 252, 15, 48, 570, + 466, 1409, 470, 352, 166, 866, 361, 474, 3, 4, + 5, 6, 443, 552, 193, 798, 669, 167, 197, 260, + 1026, 293, 528, 552, 426, 476, 533, 260, 1433, 482, + 537, 1028, 168, 1110, 437, 1301, 169, 1428, 170, 1054, + 1443, 536, 1444, 485, 197, 253, 489, 491, 505, 870, + 171, 484, 1398, 871, 197, 527, 95, 656, 575, 516, + 197, 576, 172, 234, 524, 1477, 526, 515, 349, 525, + 489, 577, 347, 354, 1038, 557, 862, 349, 921, 234, + 570, 542, 543, 800, 1065, 656, 115, 952, 551, 1405, + 20, 350, 1435, 1436, 819, 1313, 400, 553, 302, 1096, + 350, 742, 248, 733, 197, 345, 249, 197, 401, 832, + 869, 561, 349, 261, 988, 55, 1450, 470, 586, 354, + 202, 261, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 833, 657, 350, 643, 863, 197, 197, + 1453, 680, 921, 436, 1172, 608, 609, 236, 1467, 982, + 247, 1274, 733, 346, 626, 347, 250, 647, 875, 875, + 834, 6, 874, 874, 966, 234, 197, 197, 681, 1473, + 676, 352, 848, 631, 633, 1231, 637, 1451, 437, 789, + 349, 637, 347, 347, 197, 637, 203, 347, 1314, 347, + 347, 347, 347, 1122, 261, 352, 641, 347, 197, 384, + 637, 313, 680, 350, 436, 570, 261, 261, 261, 359, + 662, 261, 261, 471, 348, 115, 494, 657, 569, 1050, + 408, 1051, 970, 347, 696, 1149, 1150, 637, 871, 681, + 349, 624, 1152, 624, 692, 385, 790, 1032, 875, 437, + 480, 115, 874, 644, 645, 657, 637, 448, 251, 656, + 410, 48, 1291, 350, 921, 677, 1292, 720, 332, 586, + 921, 727, 115, 1214, 1215, 95, 234, 351, 1329, 252, + 332, 349, 570, 409, 332, 733, 735, 743, 779, 835, + 781, 1319, 782, 751, 950, 449, 836, 332, 624, 741, + 753, 315, 263, 481, 350, 347, 1359, 1360, 637, 1362, + 197, 347, 551, 453, 448, 453, 1214, 1215, 351, 325, + 1381, 553, 551, 1388, 766, 386, 387, 945, 253, 332, + 359, 553, 359, 197, 359, 359, 903, 359, 1404, 359, + 964, 347, 1216, 411, 784, 784, 718, 635, 412, 861, + 413, 48, 449, 349, 811, 560, 414, 415, 697, 349, + 637, 972, 1426, 867, 25, 1217, 26, 1218, 325, 27, + 453, 635, 981, 677, 28, 977, 350, 764, 29, 1066, + 265, 359, 350, 359, 1219, 1216, 359, 31, 1220, 349, + 351, 797, 513, 315, 33, 636, 351, 803, 635, 34, + 816, 707, 252, 35, 361, 349, 1221, 45, 1217, 261, + 1218, 349, 350, 95, 197, 37, 1033, 38, 113, 636, + 115, 39, 28, 362, 363, 352, 351, 1219, 350, 40, + 41, 1220, 350, 42, 350, 197, 319, 578, 228, 879, + 229, 470, 817, 364, 1033, 28, 636, 579, 351, 1221, + 260, 253, 954, 337, 365, 489, 533, 337, 28, 332, + 115, 113, 115, 28, 853, 113, 722, 115, 28, 727, + 28, 28, 28, 28, 720, 1014, 28, 357, 28, 328, + 234, 349, 28, 637, 563, 228, 115, 231, 637, 325, + 325, 564, 637, 358, 28, 1296, 115, 28, 197, 28, + 95, 337, 878, 565, 350, 877, 315, 637, 1309, 1315, + 325, 519, 1197, 1213, 888, 663, 889, 354, 351, 197, + 296, 332, 297, 28, 891, 766, 890, 1327, 736, 28, + 28, 895, 1197, 332, 637, 197, 600, 332, 600, 197, + 349, 1089, 897, 663, 261, 647, 388, 389, 350, 586, + 332, 430, 663, 637, 586, 905, 1213, 727, 1197, 350, + 113, 349, 778, 350, 581, 945, 552, 369, 921, 922, + 879, 337, 994, 780, 792, 337, 905, 332, 337, 1119, + 337, 905, 332, 905, 350, 337, 905, 905, 197, 905, + 905, 356, 357, 812, 643, 277, 518, 277, 552, 942, + 662, 485, 277, 325, 325, 813, 197, 197, 432, 519, + 396, 905, 1014, 489, 953, 1064, 968, 1148, 675, 337, + 935, 315, 936, 971, 399, 552, 520, 563, 397, 841, + 95, 593, 318, 979, 564, 727, 390, 391, 318, 1171, + 1392, 1078, 115, 115, 398, 319, 565, 581, 610, 611, + 392, 393, 581, 1079, 581, 581, 581, 581, 581, 581, + 581, 581, 581, 581, 581, 325, 905, 402, 332, 332, + 197, 332, 332, 57, 1262, 999, 581, 1001, 581, 1003, + 581, 1262, 581, 581, 581, 115, 659, 115, 405, 113, + 446, 325, 197, 1013, 268, 659, 357, 432, 581, 811, + 810, 325, 1445, 268, 662, 658, 908, 325, 1067, 1133, + 1068, 908, 881, 908, 658, 113, 908, 908, 297, 908, + 908, 352, 447, 727, 332, 315, 432, 332, 1019, 1247, + 1020, 332, 1021, 394, 395, 411, 113, 581, 1464, 513, + 412, 908, 413, 332, 433, 448, 332, 332, 414, 415, + 741, 325, 741, 499, 325, 1482, 1483, 500, 449, 766, + 332, 434, 1057, 451, 1059, 761, 1060, 761, 452, 761, + 453, 454, 455, 456, 228, 65, 65, 438, 457, 65, + 678, 197, 458, 441, 679, 325, 325, 750, 1072, 750, + 941, 750, 941, 1069, 459, 899, 908, 460, 325, 461, + 899, 325, 899, 710, 485, 899, 899, 711, 899, 899, + 467, 719, 783, 325, 325, 500, 679, 1097, 727, 766, + 167, 901, 167, 462, 167, 1104, 901, 468, 901, 66, + 1013, 901, 901, 66, 901, 901, 1109, 331, 236, 485, + 475, 179, 485, 179, 479, 179, 895, 614, 615, 616, + 617, 895, 487, 895, 945, 551, 895, 895, 358, 895, + 895, 1129, 236, 509, 553, 1158, 494, 488, 1132, 332, + 514, 332, 494, 381, 382, 383, 197, 918, 919, 1295, + 485, 155, 517, 155, 113, 899, 752, 551, 752, 556, + 332, 332, 1154, 1060, 545, 162, 553, 162, 163, 852, + 163, 852, 68, 574, 68, 1158, 115, 534, 1196, 1212, + 332, 901, 657, 347, 551, 1101, 1102, 347, 332, 332, + 347, 332, 347, 553, 325, 680, 197, 347, 1196, 350, + 438, 1183, 495, 874, 874, 411, 895, 411, 495, 185, + 539, 185, 197, 156, 580, 156, 1228, 325, 350, 1192, + 113, 120, 1212, 120, 1196, 634, 411, 411, 354, 282, + 113, 282, 337, 338, 339, 340, 341, 342, 343, 344, + 325, 127, 289, 127, 289, 642, 411, 1454, 1455, 518, + 518, 637, 637, 682, 411, 1114, 1115, 411, 612, 613, + 618, 619, 485, 1307, 694, 704, 705, 197, 197, 706, + 708, 583, 709, 1267, 1192, 197, 731, 1307, 732, 747, + 748, 749, 750, 752, 197, 197, 754, 197, 755, 756, + 757, 1270, 1271, 1287, 1337, 115, 1338, 765, 773, 115, + 775, 776, 787, 788, 792, 1287, 799, 197, 793, 801, + 197, 808, 820, 802, 1299, 821, 827, 1302, 1287, 823, + 824, 325, 357, 370, 844, 1316, 839, 115, 115, 850, + 845, 115, 846, 847, 115, 852, 851, 1287, 854, 868, + 872, 199, 325, 1372, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 583, 873, 882, 875, 115, 583, + 1399, 583, 583, 583, 583, 583, 583, 583, 583, 583, + 583, 583, 883, 1411, 1413, 884, 113, 113, 893, 900, + 898, 909, 914, 583, 916, 583, 727, 583, 1267, 583, + 583, 583, 920, 923, 924, 930, 933, 931, 485, 934, + 1399, 1399, 43, 264, 938, 325, 940, 288, 289, 290, + 958, 294, 295, 946, 959, 1421, 306, 307, 960, 113, + 967, 113, 961, 312, 969, 314, 325, 318, 976, 332, + 503, 985, 329, 330, 983, 332, 991, 987, 989, 992, + 996, 997, 325, 1007, 583, 1016, 325, 1017, 727, 1022, + 1029, 1023, 1030, 1031, 1037, 366, 1399, 1036, 1049, 1039, + 1055, 879, 541, 1058, 1056, 1063, 1077, 1081, 1080, 1082, + 1083, 332, 1090, 1095, 1100, 1105, 1103, 1111, 1112, 1117, + 1121, 1123, 1125, 1128, 727, 1153, 1156, 1163, 1142, 1135, + 1170, 1182, 1230, 1162, 1469, 1469, 1171, 1174, 1176, 1179, + 1178, 1478, 1478, 541, 1187, 1180, 586, 586, 1181, 1226, + 1232, 1229, 1245, 325, 325, 605, 606, 607, 1248, 1233, 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, - 197, 388, 389, 346, 1275, 1000, 811, 1002, 1251, 1004, - 447, 1275, 349, 357, 399, 346, 877, 446, 614, 346, - 614, 1232, 197, 1014, 228, 1221, 231, 1252, 352, 432, - 197, 662, 346, 448, 292, 350, 292, 890, 1132, 357, - 678, 292, 315, 113, 679, 1457, 449, 402, 1021, 351, - 1022, 451, 1023, 897, 727, 881, 452, 1252, 453, 454, - 455, 456, 911, 296, 346, 297, 457, 911, 315, 911, - 458, 1222, 911, 911, 1294, 911, 911, 346, 297, 350, - 346, 1476, 459, 325, 513, 460, 879, 461, 432, 917, - 766, 1494, 1495, 1058, 917, 1060, 917, 1061, 405, 917, - 917, 541, 917, 917, 394, 395, 325, 390, 391, 113, - 115, 462, 433, 773, 1222, 773, 1253, 773, 995, 113, - 792, 392, 393, 1070, 917, 954, 563, 920, 841, 325, - 918, 919, 920, 564, 920, 485, 339, 920, 920, 339, - 920, 920, 434, 65, 65, 565, 1253, 65, 1096, 727, - 766, 762, 911, 762, 228, 762, 1103, 438, 346, 710, - 719, 1014, 920, 711, 500, 1100, 1101, 1295, 485, 1108, - 346, 485, 777, 441, 346, 236, 115, 1135, 913, 917, - 381, 382, 383, 913, 551, 913, 115, 346, 913, 913, - 1128, 913, 913, 907, 946, 467, 261, 1131, 907, 236, - 907, 350, 438, 907, 907, 197, 907, 907, 508, 485, - 325, 346, 553, 346, 508, 468, 551, 920, 1019, 346, - 331, 1156, 1061, 346, 346, 475, 346, 346, 57, 1135, - 261, 325, 346, 346, 261, 261, 261, 261, 261, 261, - 261, 261, 487, 1068, 553, 1069, 551, 1197, 1213, 182, - 479, 182, 346, 182, 194, 509, 194, 197, 194, 371, - 346, 488, 1185, 346, 358, 113, 113, 1197, 913, 755, - 346, 755, 783, 197, 553, 252, 679, 361, 1230, 953, - 485, 953, 346, 907, 66, 346, 346, 170, 66, 170, - 764, 1213, 764, 1197, 325, 509, 362, 363, 425, 346, - 425, 509, 759, 177, 411, 177, 759, 514, 113, 412, - 113, 413, 178, 1320, 178, 325, 364, 414, 415, 425, - 425, 1466, 1467, 1197, 253, 517, 1320, 365, 197, 197, - 534, 325, 115, 115, 1280, 325, 197, 539, 864, 425, - 864, 574, 351, 1349, 545, 1350, 351, 425, 346, 130, - 425, 130, 68, 923, 68, 556, 130, 197, 197, 200, - 197, 200, 350, 171, 351, 171, 1301, 680, 351, 580, - 346, 351, 135, 351, 135, 115, 634, 115, 351, 1301, - 354, 197, 361, 297, 197, 297, 361, 657, 346, 361, - 351, 361, 1301, 142, 642, 142, 361, 886, 886, 1329, - 204, 682, 325, 325, 614, 615, 616, 617, 694, 304, - 1301, 304, 351, 532, 532, 651, 651, 1113, 1114, 612, - 613, 618, 619, 1384, 261, 704, 705, 706, 708, 731, - 709, 732, 261, 747, 748, 749, 923, 750, 752, 754, - 1411, 923, 205, 923, 923, 923, 923, 923, 923, 923, - 923, 923, 923, 1423, 1425, 755, 756, 757, 727, 765, - 1280, 1193, 773, 775, 541, 923, 325, 923, 776, 923, - 485, 923, 923, 923, 787, 788, 792, 808, 820, 793, - 1411, 1411, 799, 821, 801, 823, 802, 1433, 824, 827, - 43, 844, 206, 207, 208, 209, 325, 210, 211, 212, - 213, 214, 215, 216, 217, 261, 839, 218, 219, 220, - 221, 222, 223, 224, 225, 371, 1193, 261, 261, 261, - 727, 371, 261, 261, 845, 846, 923, 847, 851, 850, - 113, 513, 852, 854, 872, 868, 1411, 199, 873, 875, - 882, 883, 898, 884, 900, 1284, 1285, 893, 909, 914, - 916, 920, 923, 371, 930, 924, 727, 371, 931, 370, - 933, 934, 939, 936, 941, 947, 1481, 1481, 959, 1312, - 960, 961, 1315, 1490, 1490, 968, 962, 970, 586, 586, - 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 977, 503, 992, 984, 986, 993, 1031, 115, 371, 988, - 990, 997, 998, 371, 1008, 371, 371, 371, 371, 371, - 371, 371, 371, 371, 371, 371, 1017, 1025, 1024, 1033, - 1032, 1038, 1050, 1037, 1040, 879, 371, 371, 1056, 371, - 371, 371, 1057, 371, 371, 371, 1059, 371, 371, 1064, - 1072, 371, 371, 371, 371, 1076, 1079, 113, 371, 371, - 1080, 113, 1081, 371, 371, 371, 371, 371, 371, 371, - 371, 1089, 1082, 1094, 1099, 1104, 1102, 1124, 1116, 1111, - 1155, 325, 371, 1120, 1122, 371, 1134, 371, 1158, 113, - 113, 1127, 1144, 113, 1160, 1164, 113, 1162, 371, 560, - 1163, 1172, 1171, 1176, 1179, 1180, 1181, 1182, 25, 840, - 26, 1184, 1188, 27, 1228, 1259, 1233, 1231, 28, 1236, - 261, 1234, 29, 113, 115, 1243, 1291, 1261, 115, 1282, - 1304, 31, 1336, 325, 1318, 1307, 1321, 1308, 33, 1324, - 1333, 1342, 1335, 34, 1347, 1338, 1317, 35, 1325, 325, - 1340, 1327, 1346, 1344, 1352, 1360, 115, 115, 1363, 37, - 115, 38, 1364, 115, 1365, 39, 1357, 1367, 1375, 1376, - 48, 1379, 48, 40, 41, 1389, 1394, 42, 1406, 1396, - 319, 1408, 1405, 1409, 1415, 1418, 1419, 1429, 1430, 1432, - 115, 1435, 1437, 48, 1434, 1449, 1450, 513, 1454, 1443, - 1458, 1459, 513, 513, 325, 325, 48, 1461, 1468, 1453, - 1452, 48, 325, 1474, 1496, 1475, 48, 1497, 48, 48, - 48, 48, 1498, 9, 48, 513, 48, 949, 545, 838, - 48, 740, 32, 325, 325, 513, 325, 503, 513, 513, - 615, 941, 48, 513, 504, 48, 513, 48, 513, 808, - 513, 513, 513, 513, 462, 261, 616, 325, 513, 684, - 325, 354, 513, 30, 22, 812, 513, 502, 30, 324, - 528, 48, 758, 31, 513, 221, 783, 513, 96, 513, - 513, 766, 813, 31, 846, 513, 767, 513, 513, 513, - 513, 513, 513, 513, 513, 513, 513, 513, 758, 787, - 815, 788, 817, 513, 672, 672, 328, 694, 513, 513, - 353, 513, 513, 513, 513, 513, 513, 513, 346, 513, - 513, 651, 513, 513, 513, 513, 513, 513, 513, 513, - 513, 513, 138, 513, 513, 513, 513, 513, 513, 513, - 513, 513, 513, 513, 513, 513, 513, 513, 513, 513, - 513, 513, 513, 513, 513, 120, 300, 513, 145, 513, - 139, 513, 121, 301, 513, 840, 840, 146, 651, 233, - 513, 237, 54, 840, 840, 840, 840, 840, 21, 840, - 840, 1009, 840, 840, 840, 840, 840, 840, 840, 840, - 929, 1237, 1283, 1420, 840, 1451, 840, 840, 840, 840, - 840, 840, 1106, 1107, 840, 346, 1460, 829, 840, 840, - 1407, 840, 840, 840, 1436, 1402, 1298, 1310, 956, 842, - 957, 958, 952, 840, 1492, 840, 1244, 840, 840, 1484, - 1331, 840, 1241, 840, 840, 840, 840, 840, 840, 840, - 840, 840, 840, 840, 840, 1431, 840, 1426, 1424, 840, - 840, 1351, 1177, 840, 840, 1483, 1302, 925, 744, 1178, - 860, 976, 904, 786, 581, 902, 1041, 838, 840, 840, - 840, 840, 840, 299, 544, 858, 840, 840, 334, 620, - 840, 621, 624, 622, 1166, 840, 840, 840, 840, 840, - 623, 625, 760, 840, 1262, 840, 404, 1169, 1026, 1097, - 1123, 840, 840, 1036, 1092, 1085, 1090, 999, 991, 737, - 1260, 1157, 899, 640, 927, 926, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 840, 840, 840, 840, - 0, 840, 783, 783, 0, 0, 0, 0, 840, 0, - 783, 783, 783, 783, 783, 0, 783, 783, 0, 783, - 783, 783, 783, 783, 783, 783, 0, 0, 748, 0, - 0, 783, 0, 783, 783, 783, 783, 783, 783, 0, - 0, 783, 0, 0, 0, 783, 783, 0, 783, 783, - 783, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 783, 0, 783, 0, 783, 783, 0, 0, 783, 0, - 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 0, 783, 0, 0, 783, 783, 0, 0, - 783, 783, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 783, 783, 783, 783, 783, - 0, 0, 0, 783, 783, 0, 0, 783, 0, 0, - 0, 0, 783, 783, 783, 783, 783, 0, 0, 0, - 783, 346, 783, 0, 0, 0, 346, 346, 783, 783, + 541, 541, 541, 541, 541, 541, 911, 1235, 1242, 1269, + 1277, 332, 1290, 1321, 332, 1305, 332, 332, 1294, 1295, + 1308, 332, 332, 1311, 1323, 332, 332, 332, 332, 332, + 332, 332, 332, 332, 1324, 332, 332, 332, 332, 332, + 332, 332, 332, 332, 332, 1304, 1326, 325, 357, 1312, + 1314, 499, 1330, 1328, 357, 332, 332, 1332, 1334, 1335, + 1340, 1345, 1348, 332, 1355, 1351, 332, 1352, 312, 1353, + 1367, 366, 332, 1363, 1364, 1382, 1377, 1384, 1393, 1406, + 1394, 1396, 1397, 1403, 1407, 1417, 357, 1418, 1420, 911, + 357, 1423, 1422, 1425, 911, 1431, 911, 911, 911, 911, + 911, 911, 911, 911, 911, 911, 1437, 541, 1438, 507, + 113, 1442, 1446, 1449, 1447, 1456, 1441, 1440, 911, 1462, + 911, 523, 911, 1463, 911, 911, 911, 1484, 1485, 1486, + 9, 357, 937, 531, 826, 726, 357, 32, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 489, + 601, 929, 796, 490, 448, 602, 670, 30, 325, 357, + 357, 22, 357, 357, 357, 800, 357, 357, 357, 514, + 357, 357, 488, 30, 357, 357, 357, 357, 777, 911, + 31, 357, 357, 744, 754, 206, 357, 357, 357, 357, + 357, 357, 357, 357, 801, 96, 31, 834, 745, 310, + 755, 746, 775, 803, 738, 357, 776, 805, 357, 658, + 357, 680, 658, 25, 314, 26, 339, 332, 27, 828, + 637, 357, 637, 28, 123, 233, 105, 29, 285, 113, + 237, 130, 124, 113, 106, 286, 31, 131, 54, 21, + 1008, 929, 1107, 33, 1108, 1244, 1236, 1439, 34, 1408, + 48, 1448, 35, 325, 1395, 1424, 1284, 1390, 1297, 951, + 1480, 113, 113, 829, 37, 113, 38, 842, 113, 955, + 39, 1318, 956, 48, 1243, 1419, 1240, 1472, 40, 41, + 957, 1414, 42, 1412, 1471, 739, 48, 1188, 1339, 1288, + 693, 48, 113, 744, 925, 902, 48, 1177, 48, 48, + 48, 48, 975, 325, 48, 904, 48, 499, 860, 786, + 48, 581, 499, 499, 838, 299, 544, 1040, 334, 325, + 620, 622, 48, 621, 623, 48, 858, 48, 624, 899, + 734, 625, 760, 1165, 1249, 499, 1168, 1124, 404, 1052, + 1084, 1098, 1035, 1024, 1091, 499, 1086, 737, 499, 499, + 1093, 48, 990, 499, 640, 1246, 499, 296, 499, 1155, + 499, 499, 499, 499, 0, 0, 740, 0, 499, 0, + 0, 926, 499, 0, 325, 325, 499, 0, 0, 0, + 0, 0, 325, 927, 499, 0, 771, 499, 0, 499, + 499, 325, 325, 0, 325, 499, 0, 499, 499, 499, + 499, 499, 499, 499, 499, 499, 499, 499, 0, 0, + 0, 0, 0, 499, 325, 0, 0, 325, 499, 499, + 0, 499, 499, 499, 499, 499, 499, 499, 0, 499, + 499, 0, 499, 499, 499, 499, 499, 499, 499, 499, + 499, 499, 0, 499, 499, 499, 499, 499, 499, 499, + 499, 499, 499, 499, 499, 499, 499, 499, 499, 499, + 499, 499, 499, 499, 499, 0, 0, 499, 0, 499, + 541, 499, 0, 0, 499, 828, 828, 0, 0, 0, + 499, 0, 0, 828, 828, 828, 828, 828, 0, 828, + 828, 0, 828, 828, 828, 828, 828, 828, 828, 828, + 0, 0, 0, 0, 828, 0, 828, 828, 828, 828, + 828, 828, 0, 0, 828, 332, 0, 0, 828, 828, + 0, 828, 828, 828, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 828, 0, 828, 0, 828, 828, 0, + 0, 828, 0, 828, 828, 828, 828, 828, 828, 828, + 828, 828, 828, 828, 828, 0, 828, 0, 0, 828, + 828, 0, 0, 828, 828, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 828, 828, + 828, 828, 828, 0, 0, 0, 828, 828, 0, 0, + 828, 0, 0, 0, 0, 828, 828, 828, 828, 828, + 0, 0, 0, 828, 0, 828, 0, 0, 0, 0, + 0, 828, 828, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 339, 346, - 0, 0, 0, 783, 783, 783, 783, 0, 783, 346, - 0, 0, 346, 346, 0, 783, 0, 346, 0, 0, - 346, 0, 346, 0, 346, 346, 346, 346, 0, 0, - 0, 0, 346, 0, 0, 0, 346, 0, 0, 0, - 346, 0, 0, 0, 0, 0, 0, 0, 346, 0, - 0, 346, 0, 346, 346, 0, 0, 0, 0, 346, - 0, 346, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 346, 346, 0, 0, 0, 0, 346, 0, 0, - 0, 0, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 346, 0, 346, 346, 0, 0, 346, 346, 346, - 346, 346, 0, 0, 346, 346, 0, 0, 0, 346, - 346, 346, 346, 346, 346, 346, 346, 0, 0, 0, - 0, 0, 0, 0, 748, 0, 0, 0, 346, 748, - 748, 346, 0, 346, 0, 346, 0, 0, 346, 0, - 0, 0, 0, 0, 346, 376, 0, 0, 0, 0, - 0, 0, 748, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 748, 0, 0, 748, 748, 0, 0, 0, - 748, 0, 0, 748, 0, 748, 0, 748, 748, 748, - 748, 0, 0, 0, 0, 748, 0, 0, 0, 748, - 0, 0, 0, 748, 0, 0, 0, 0, 0, 0, - 0, 748, 0, 0, 748, 0, 748, 748, 0, 0, - 0, 0, 748, 0, 748, 748, 748, 748, 748, 748, - 748, 748, 748, 748, 748, 0, 0, 0, 0, 0, - 748, 0, 0, 0, 0, 748, 748, 748, 748, 748, - 748, 0, 748, 748, 748, 0, 748, 748, 0, 0, - 748, 748, 748, 748, 339, 0, 0, 748, 748, 339, - 339, 0, 748, 748, 748, 748, 748, 748, 748, 748, - 346, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 748, 339, 0, 748, 0, 748, 0, 748, 0, - 0, 748, 339, 0, 0, 339, 339, 748, 0, 0, - 339, 0, 0, 339, 0, 339, 0, 339, 339, 339, - 339, 0, 0, 0, 0, 339, 0, 0, 0, 339, - 0, 0, 0, 339, 0, 0, 0, 0, 0, 0, - 0, 339, 0, 0, 339, 0, 339, 339, 0, 0, - 0, 0, 339, 0, 339, 339, 339, 339, 339, 339, - 339, 339, 339, 339, 339, 0, 0, 0, 0, 0, - 339, 0, 0, 0, 0, 339, 339, 339, 339, 339, - 339, 0, 339, 339, 339, 0, 339, 339, 0, 0, - 339, 339, 339, 339, 0, 0, 0, 339, 339, 0, - 0, 0, 339, 339, 339, 339, 339, 339, 339, 339, - 0, 376, 0, 0, 0, 0, 376, 376, 0, 0, - 0, 339, 0, 0, 339, 0, 339, 0, 339, 0, - 0, 339, 0, 0, 0, 0, 0, 339, 0, 376, - 0, 0, 0, 0, 0, 49, 0, 0, 0, 376, - 0, 0, 376, 376, 0, 0, 0, 376, 0, 0, - 376, 0, 376, 0, 376, 376, 376, 376, 0, 0, - 0, 0, 376, 0, 0, 0, 376, 0, 0, 0, - 376, 0, 0, 0, 0, 0, 0, 0, 376, 0, - 0, 376, 0, 376, 376, 0, 0, 0, 0, 376, - 0, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 0, 0, 0, 0, 0, 376, 0, 0, - 0, 0, 376, 376, 0, 376, 376, 376, 0, 376, - 376, 376, 0, 376, 376, 0, 346, 376, 376, 376, - 376, 0, 346, 0, 376, 376, 0, 0, 0, 376, - 376, 376, 376, 376, 376, 376, 376, 0, 28, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 376, 0, - 0, 376, 0, 376, 346, 0, 0, 0, 346, 0, - 0, 0, 0, 0, 376, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 828, 828, 828, 828, + 0, 828, 771, 771, 0, 0, 0, 0, 828, 0, + 771, 771, 771, 771, 771, 0, 771, 771, 0, 771, + 771, 771, 771, 771, 771, 771, 0, 0, 734, 0, + 0, 771, 0, 771, 771, 771, 771, 771, 771, 0, + 0, 771, 0, 0, 0, 771, 771, 0, 771, 771, + 771, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 771, 0, 771, 0, 771, 771, 0, 0, 771, 0, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 0, 771, 0, 0, 771, 771, 0, 0, + 771, 771, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 771, 771, 771, 771, 771, + 0, 0, 0, 771, 771, 0, 0, 771, 0, 0, + 0, 0, 771, 771, 771, 771, 771, 0, 0, 0, + 771, 332, 771, 0, 0, 0, 332, 332, 771, 771, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 325, 332, + 0, 0, 0, 771, 771, 771, 771, 0, 771, 332, + 0, 0, 332, 332, 0, 771, 0, 332, 0, 0, + 332, 0, 332, 0, 332, 332, 332, 332, 0, 0, + 0, 0, 332, 0, 0, 0, 332, 0, 0, 0, + 332, 0, 0, 0, 0, 0, 0, 0, 332, 0, + 0, 332, 0, 332, 332, 0, 0, 0, 0, 332, + 0, 332, 332, 332, 332, 332, 332, 332, 332, 332, + 332, 332, 332, 0, 0, 0, 0, 332, 0, 0, + 0, 0, 332, 332, 332, 332, 332, 332, 332, 332, + 332, 332, 0, 332, 332, 0, 0, 332, 332, 332, + 332, 332, 0, 0, 332, 332, 0, 0, 0, 332, + 332, 332, 332, 332, 332, 332, 332, 0, 0, 0, + 0, 0, 0, 0, 734, 0, 0, 0, 332, 734, + 734, 332, 0, 332, 0, 332, 0, 0, 332, 0, + 0, 0, 0, 0, 332, 362, 0, 0, 0, 0, + 0, 0, 734, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 734, 0, 0, 734, 734, 0, 0, 0, + 734, 0, 0, 734, 0, 734, 0, 734, 734, 734, + 734, 0, 0, 0, 0, 734, 0, 0, 0, 734, + 0, 0, 0, 734, 0, 0, 0, 0, 0, 0, + 0, 734, 0, 0, 734, 0, 734, 734, 0, 0, + 0, 0, 734, 0, 734, 734, 734, 734, 734, 734, + 734, 734, 734, 734, 734, 0, 0, 0, 0, 0, + 734, 0, 0, 0, 0, 734, 734, 734, 734, 734, + 734, 0, 734, 734, 734, 0, 734, 734, 0, 0, + 734, 734, 734, 734, 325, 0, 0, 734, 734, 325, + 325, 0, 734, 734, 734, 734, 734, 734, 734, 734, + 332, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 734, 325, 0, 734, 0, 734, 0, 734, 0, + 0, 734, 325, 0, 0, 325, 325, 734, 0, 0, + 325, 0, 0, 325, 0, 325, 0, 325, 325, 325, + 325, 0, 0, 0, 0, 325, 0, 0, 0, 325, + 0, 0, 0, 325, 0, 0, 0, 0, 0, 0, + 0, 325, 0, 0, 325, 0, 325, 325, 0, 0, + 0, 0, 325, 0, 325, 325, 325, 325, 325, 325, + 325, 325, 325, 325, 325, 0, 0, 0, 0, 0, + 325, 0, 0, 0, 0, 325, 325, 325, 325, 325, + 325, 0, 325, 325, 325, 0, 325, 325, 0, 0, + 325, 325, 325, 325, 0, 0, 0, 325, 325, 0, + 0, 0, 325, 325, 325, 325, 325, 325, 325, 325, + 0, 362, 0, 0, 0, 0, 362, 362, 0, 0, + 0, 325, 0, 0, 325, 0, 325, 0, 325, 0, + 0, 325, 0, 0, 0, 0, 0, 325, 0, 362, + 0, 0, 0, 0, 0, 49, 0, 0, 0, 362, + 0, 0, 362, 362, 0, 0, 0, 362, 0, 0, + 362, 0, 362, 0, 362, 362, 362, 362, 0, 0, + 0, 0, 362, 0, 0, 0, 362, 0, 0, 0, + 362, 0, 0, 0, 0, 0, 0, 0, 362, 0, + 0, 362, 0, 362, 362, 0, 0, 0, 0, 362, + 0, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 0, 0, 0, 0, 0, 362, 0, 0, + 0, 0, 362, 362, 0, 362, 362, 362, 0, 362, + 362, 362, 0, 362, 362, 0, 332, 362, 362, 362, + 362, 0, 332, 0, 362, 362, 0, 0, 0, 362, + 362, 362, 362, 362, 362, 362, 362, 0, 28, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 362, 0, + 0, 362, 0, 362, 332, 0, 0, 0, 332, 0, + 0, 0, 0, 0, 362, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 346, - 0, 36, 0, 0, 346, 0, 346, 346, 346, 346, - 346, 346, 346, 346, 346, 346, 346, 346, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 346, 346, 346, - 346, 346, 346, 346, 346, 346, 346, 0, 346, 346, - 0, 0, 346, 346, 346, 346, 346, 0, 0, 346, - 346, 0, 0, 0, 346, 346, 346, 346, 346, 346, - 346, 346, 0, 0, 0, 0, 0, 0, 0, 0, - 35, 0, 0, 346, 0, 0, 346, 0, 346, 0, - 346, 0, 49, 346, 0, 0, 49, 0, 49, 346, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 332, + 0, 36, 0, 0, 332, 0, 332, 332, 332, 332, + 332, 332, 332, 332, 332, 332, 332, 332, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 332, 332, 332, + 332, 332, 332, 332, 332, 332, 332, 0, 332, 332, + 0, 0, 332, 332, 332, 332, 332, 0, 0, 332, + 332, 0, 0, 0, 332, 332, 332, 332, 332, 332, + 332, 332, 0, 0, 0, 0, 0, 0, 0, 0, + 35, 0, 0, 332, 0, 0, 332, 0, 332, 0, + 332, 0, 49, 332, 0, 0, 49, 0, 49, 332, 49, 0, 49, 0, 0, 49, 0, 49, 49, 0, 49, 0, 49, 0, 49, 0, 49, 49, 49, 49, 0, 0, 49, 49, 0, 0, 0, 34, 49, 49, @@ -9709,7 +9835,7 @@ void case_956() 0, 28, 28, 36, 28, 28, 28, 0, 36, 0, 28, 0, 36, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 36, 0, - 28, 0, 36, 36, 0, 0, 28, 28, 36, 931, + 28, 0, 36, 36, 0, 0, 28, 28, 36, 919, 36, 36, 36, 36, 0, 28, 0, 0, 36, 0, 0, 0, 36, 0, 36, 0, 0, 35, 0, 0, 0, 35, 0, 0, 36, 0, 36, 36, 0, 36, @@ -9724,7 +9850,7 @@ void case_956() 0, 0, 0, 0, 34, 0, 34, 34, 34, 34, 0, 0, 35, 0, 34, 0, 0, 28, 34, 35, 34, 28, 0, 0, 0, 0, 0, 0, 0, 0, - 34, 0, 28, 34, 0, 34, 0, 28, 932, 34, + 34, 0, 28, 34, 0, 34, 0, 28, 920, 34, 0, 28, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 28, 0, 34, 33, 28, 28, 0, 33, 34, 34, 28, 0, 28, @@ -9735,7 +9861,7 @@ void case_956() 33, 0, 33, 33, 33, 33, 0, 0, 48, 0, 33, 0, 28, 48, 33, 0, 33, 48, 28, 28, 48, 0, 0, 0, 0, 0, 33, 0, 0, 33, - 0, 33, 48, 48, 0, 33, 931, 48, 48, 0, + 0, 33, 48, 48, 0, 33, 919, 48, 48, 0, 48, 0, 0, 48, 0, 48, 48, 48, 48, 0, 0, 48, 0, 48, 0, 33, 48, 48, 0, 48, 48, 0, 33, 48, 0, 0, 0, 0, 0, 48, @@ -9750,7 +9876,7 @@ void case_956() 0, 0, 0, 0, 0, 48, 0, 0, 48, 0, 48, 49, 49, 0, 48, 0, 49, 49, 0, 0, 0, 0, 49, 0, 49, 49, 49, 49, 0, 0, - 0, 0, 49, 0, 48, 932, 49, 0, 49, 48, + 0, 0, 49, 0, 48, 920, 49, 0, 49, 48, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0, 48, 49, 0, 49, 0, 48, 0, 49, 0, 48, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, @@ -9767,552 +9893,539 @@ void case_956() 0, 74, 0, 37, 0, 38, 75, 0, 0, 39, 0, 76, 77, 78, 79, 80, 81, 40, 41, 82, 83, 42, 84, 0, 85, 0, 0, 86, 87, 0, - 346, 88, 89, 0, 0, 0, 346, 0, 0, 0, + 332, 88, 89, 0, 0, 0, 332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 91, 92, 93, 94, 0, 0, 0, 95, 0, 0, 0, 96, 0, 0, 0, 0, 97, 98, 99, 100, 101, 0, 0, - 0, 102, 346, 103, 0, 0, 0, 0, 0, 104, + 0, 102, 332, 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 346, 0, 0, 0, - 0, 0, 346, 0, 106, 107, 108, 109, 0, 0, - 0, 0, 0, 346, 0, 0, 199, 0, 346, 0, - 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 346, 0, 0, 0, 0, 0, 0, 346, 0, - 0, 0, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 0, 346, 346, 0, 346, 346, 346, 346, 346, - 346, 346, 346, 346, 346, 0, 346, 346, 346, 346, - 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 346, 346, 346, 346, 346, 346, 346, 0, 515, - 0, 0, 346, 0, 346, 515, 0, 346, 0, 0, - 0, 0, 0, 346, 0, 0, 0, 0, 346, 0, - 0, 346, 0, 346, 346, 0, 0, 0, 346, 346, - 0, 0, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 515, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 346, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 346, 346, 0, 0, 0, 0, 0, 0, - 346, 346, 0, 346, 0, 0, 0, 0, 0, 346, - 0, 0, 515, 0, 0, 0, 0, 515, 0, 515, - 515, 515, 515, 515, 515, 515, 515, 515, 515, 515, - 0, 0, 0, 0, 0, 0, 0, 346, 0, 0, - 515, 515, 515, 515, 515, 515, 515, 515, 515, 515, - 0, 515, 515, 0, 515, 515, 515, 515, 515, 515, - 515, 515, 515, 515, 0, 515, 515, 515, 515, 515, - 515, 515, 515, 515, 515, 515, 515, 515, 515, 515, - 515, 515, 515, 515, 515, 515, 515, 0, 511, 0, - 0, 0, 0, 515, 511, 0, 346, 0, 0, 0, - 0, 0, 515, 0, 0, 0, 0, 0, 346, 0, - 346, 0, 346, 0, 0, 346, 0, 346, 346, 0, - 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - 511, 346, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 346, 346, 0, 0, 0, 0, 346, 0, 346, - 403, 0, 346, 0, 0, 0, 0, 0, 346, 0, - 0, 511, 0, 0, 0, 0, 511, 0, 511, 511, - 511, 511, 511, 511, 511, 511, 511, 511, 511, 0, - 0, 0, 0, 0, 0, 0, 403, 0, 0, 511, - 511, 0, 511, 511, 511, 511, 511, 511, 511, 0, - 511, 511, 0, 511, 511, 511, 511, 511, 511, 511, - 511, 511, 511, 0, 511, 511, 511, 511, 511, 511, - 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, - 511, 511, 511, 511, 511, 511, 0, 519, 0, 0, - 0, 0, 511, 519, 0, 511, 0, 0, 0, 0, - 0, 511, 0, 0, 0, 0, 0, 339, 0, 403, - 403, 403, 403, 0, 403, 0, 403, 403, 0, 403, - 403, 403, 403, 403, 0, 403, 403, 403, 403, 519, - 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, - 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, - 403, 403, 0, 0, 0, 0, 339, 0, 403, 346, - 0, 403, 0, 0, 0, 0, 0, 403, 0, 0, - 519, 0, 0, 0, 0, 519, 0, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 0, 0, - 0, 0, 0, 0, 0, 346, 0, 0, 0, 519, - 0, 519, 519, 519, 519, 519, 519, 519, 0, 519, - 519, 0, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 0, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, - 519, 519, 519, 519, 519, 0, 346, 0, 0, 0, - 0, 519, 346, 0, 519, 0, 0, 0, 0, 0, - 519, 0, 0, 0, 0, 0, 0, 346, 346, 346, - 346, 346, 0, 0, 0, 346, 346, 0, 346, 346, - 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 0, 0, 0, 0, 0, 0, 346, 0, 0, - 346, 0, 0, 0, 0, 0, 346, 0, 0, 346, - 0, 0, 0, 0, 346, 0, 346, 346, 346, 346, - 346, 346, 346, 346, 346, 346, 346, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 346, 0, - 346, 346, 346, 346, 346, 346, 346, 0, 346, 346, - 0, 346, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 0, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 346, 346, 346, 0, 446, 738, 0, 0, 0, - 346, 446, 0, 346, 0, 25, 0, 26, 0, 346, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 389, 0, 106, 107, 108, 109, 0, 0, + 0, 0, 0, 332, 0, 0, 199, 0, 332, 0, + 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + 332, 332, 0, 0, 0, 0, 0, 0, 389, 0, + 0, 0, 332, 332, 332, 332, 332, 332, 332, 332, + 332, 0, 332, 332, 0, 332, 332, 332, 332, 332, + 332, 332, 332, 332, 332, 0, 332, 332, 332, 332, + 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + 332, 332, 332, 332, 332, 332, 332, 332, 0, 501, + 0, 0, 332, 0, 332, 501, 0, 332, 0, 0, + 0, 0, 0, 332, 0, 0, 0, 0, 0, 325, + 0, 389, 389, 389, 389, 0, 389, 0, 389, 389, + 0, 389, 389, 389, 389, 389, 0, 389, 389, 389, + 389, 501, 389, 389, 389, 389, 389, 389, 389, 389, + 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, + 389, 389, 389, 389, 0, 0, 0, 0, 325, 0, + 389, 332, 0, 389, 0, 0, 0, 0, 0, 389, + 0, 0, 501, 0, 0, 0, 0, 501, 0, 501, + 501, 501, 501, 501, 501, 501, 501, 501, 501, 501, + 0, 0, 0, 0, 0, 0, 0, 332, 0, 0, + 501, 501, 501, 501, 501, 501, 501, 501, 501, 501, + 0, 501, 501, 0, 501, 501, 501, 501, 501, 501, + 501, 501, 501, 501, 0, 501, 501, 501, 501, 501, + 501, 501, 501, 501, 501, 501, 501, 501, 501, 501, + 501, 501, 501, 501, 501, 501, 501, 0, 497, 0, + 0, 0, 0, 501, 497, 0, 332, 0, 0, 0, + 0, 0, 501, 0, 0, 0, 0, 0, 332, 0, + 332, 0, 332, 0, 0, 332, 0, 332, 332, 0, + 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + 497, 332, 332, 332, 332, 332, 332, 332, 332, 332, + 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + 332, 332, 332, 0, 0, 0, 0, 332, 0, 332, + 332, 0, 332, 0, 0, 0, 0, 0, 332, 0, + 0, 497, 0, 0, 0, 0, 497, 0, 497, 497, + 497, 497, 497, 497, 497, 497, 497, 497, 497, 0, + 0, 0, 0, 0, 0, 0, 332, 0, 0, 497, + 497, 0, 497, 497, 497, 497, 497, 497, 497, 0, + 497, 497, 0, 497, 497, 497, 497, 497, 497, 497, + 497, 497, 497, 0, 497, 497, 497, 497, 497, 497, + 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, + 497, 497, 497, 497, 497, 497, 0, 505, 0, 0, + 0, 0, 497, 505, 0, 497, 0, 0, 0, 0, + 0, 497, 0, 0, 0, 0, 0, 0, 332, 332, + 332, 332, 332, 0, 0, 0, 332, 332, 0, 332, + 332, 332, 332, 332, 332, 332, 332, 332, 332, 505, + 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + 332, 332, 0, 0, 0, 0, 0, 0, 332, 0, + 0, 332, 0, 0, 0, 0, 0, 332, 0, 0, + 505, 0, 0, 0, 0, 505, 0, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 505, + 0, 505, 505, 505, 505, 505, 505, 505, 0, 505, + 505, 0, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 0, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 505, 505, 505, 505, 505, 0, 332, 876, 0, 0, + 0, 505, 332, 0, 505, 0, 25, 0, 26, 0, + 505, 27, 0, 0, 0, 0, 28, 0, 0, 0, + 29, 0, 0, 0, 0, 0, 0, 0, 0, 31, + 0, 0, 0, 0, 0, 0, 33, 0, 332, 0, + 0, 34, 0, 0, 0, 35, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 37, 0, 38, + 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, + 0, 40, 41, 0, 0, 42, 0, 0, 319, 332, + 0, 0, 0, 0, 332, 0, 332, 332, 332, 332, + 332, 332, 332, 332, 332, 332, 332, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 332, 0, + 332, 332, 332, 332, 332, 332, 332, 0, 332, 332, + 0, 332, 332, 332, 332, 332, 332, 332, 332, 332, + 332, 0, 332, 332, 332, 332, 332, 332, 332, 332, + 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + 332, 332, 332, 332, 0, 432, 1071, 0, 0, 354, + 332, 432, 0, 332, 0, 25, 0, 26, 0, 332, 27, 0, 0, 0, 0, 28, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, - 0, 0, 0, 0, 0, 33, 0, 446, 0, 0, + 0, 0, 0, 0, 0, 33, 0, 432, 0, 0, 34, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 38, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, - 40, 41, 0, 0, 42, 0, 0, 739, 446, 0, - 0, 0, 0, 446, 0, 446, 446, 446, 446, 446, - 446, 446, 446, 446, 446, 446, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 446, 0, 446, - 446, 446, 446, 446, 446, 446, 0, 446, 446, 0, - 446, 446, 446, 446, 446, 446, 446, 446, 446, 446, - 0, 446, 446, 446, 446, 446, 446, 446, 446, 446, - 446, 446, 446, 446, 446, 446, 446, 446, 446, 446, - 446, 446, 446, 0, 406, 876, 0, 0, 740, 446, - 406, 0, 446, 0, 25, 0, 26, 0, 446, 27, + 40, 41, 0, 0, 42, 0, 0, 319, 432, 0, + 0, 0, 0, 432, 0, 432, 432, 432, 432, 432, + 432, 432, 432, 432, 432, 432, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 432, 0, 432, + 432, 432, 432, 432, 432, 432, 0, 432, 432, 0, + 432, 432, 432, 432, 432, 432, 432, 432, 432, 432, + 0, 432, 432, 432, 432, 432, 432, 432, 432, 432, + 432, 432, 432, 432, 432, 432, 432, 432, 432, 432, + 432, 432, 432, 0, 392, 1137, 0, 0, 354, 432, + 392, 0, 432, 0, 25, 0, 26, 0, 432, 27, 0, 0, 0, 0, 28, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, - 0, 0, 0, 0, 33, 0, 406, 0, 0, 34, + 0, 0, 0, 0, 33, 0, 392, 0, 0, 34, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 38, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 0, 40, - 41, 0, 0, 42, 0, 0, 319, 406, 0, 0, - 0, 0, 406, 0, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 406, 0, 406, 406, - 406, 406, 406, 406, 406, 0, 406, 0, 0, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 0, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 0, 550, 0, 492, 0, 354, 406, 550, - 0, 406, 0, 57, 25, 0, 26, 406, 0, 27, + 41, 0, 0, 42, 0, 0, 319, 392, 0, 0, + 0, 0, 392, 0, 392, 392, 392, 392, 392, 392, + 392, 392, 392, 392, 392, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 392, 0, 392, 392, + 392, 392, 392, 392, 392, 0, 392, 0, 0, 392, + 392, 392, 392, 392, 392, 392, 392, 392, 392, 0, + 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, + 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, + 392, 392, 0, 536, 0, 492, 0, 354, 392, 536, + 0, 392, 0, 57, 25, 0, 26, 392, 0, 27, 256, 0, 0, 0, 28, 62, 63, 0, 29, 0, 0, 0, 0, 0, 65, 0, 0, 31, 0, 0, - 0, 0, 0, 0, 33, 550, 0, 0, 0, 34, + 0, 0, 0, 0, 33, 536, 0, 0, 0, 34, 0, 72, 73, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 38, 75, 0, 0, 39, 0, 0, 77, 0, 79, 0, 81, 40, - 41, 257, 0, 42, 0, 0, 550, 0, 0, 0, - 0, 550, 0, 550, 550, 550, 550, 550, 550, 550, - 550, 550, 550, 550, 0, 0, 0, 0, 90, 91, - 92, 258, 0, 0, 0, 550, 0, 550, 0, 550, - 96, 550, 550, 550, 0, 550, 550, 0, 550, 550, - 550, 550, 550, 550, 550, 550, 550, 550, 368, 0, - 0, 550, 550, 550, 550, 550, 550, 550, 550, 550, - 550, 550, 550, 550, 550, 550, 550, 550, 550, 564, - 550, 368, 0, 0, 0, 564, 106, 493, 0, 0, - 0, 0, 0, 0, 368, 0, 550, 0, 0, 368, - 0, 0, 245, 0, 368, 0, 368, 368, 368, 368, - 0, 0, 0, 0, 368, 0, 0, 0, 368, 0, - 0, 564, 368, 0, 0, 0, 0, 0, 0, 0, - 368, 0, 0, 368, 0, 368, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 568, 0, 0, - 0, 0, 0, 568, 0, 0, 0, 0, 0, 368, - 0, 0, 564, 0, 0, 0, 0, 564, 0, 564, - 564, 564, 564, 564, 564, 564, 564, 564, 564, 564, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 568, - 0, 564, 0, 564, 0, 564, 0, 564, 564, 564, - 0, 564, 564, 0, 0, 564, 564, 564, 564, 564, - 564, 564, 564, 564, 0, 368, 0, 564, 564, 564, - 564, 564, 564, 564, 564, 0, 0, 0, 0, 0, - 568, 0, 0, 0, 0, 568, 564, 568, 568, 568, - 568, 568, 568, 568, 568, 568, 568, 568, 0, 0, - 0, 571, 564, 0, 0, 0, 0, 571, 0, 568, - 0, 568, 0, 568, 0, 568, 568, 568, 0, 568, - 568, 0, 0, 568, 568, 568, 568, 0, 0, 0, - 568, 568, 0, 0, 0, 568, 568, 568, 568, 568, - 568, 568, 568, 571, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 568, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 569, - 568, 0, 0, 0, 0, 569, 0, 0, 0, 0, - 0, 0, 0, 0, 571, 0, 0, 0, 0, 571, - 0, 571, 571, 571, 571, 571, 571, 571, 571, 571, - 571, 571, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 569, 0, 571, 0, 571, 0, 571, 0, 571, - 571, 571, 0, 571, 571, 0, 0, 571, 571, 571, - 571, 0, 0, 0, 571, 571, 0, 0, 0, 571, - 571, 571, 571, 571, 571, 571, 571, 0, 0, 0, - 0, 0, 569, 0, 0, 0, 0, 569, 571, 569, - 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, - 0, 0, 0, 570, 571, 0, 0, 0, 0, 570, - 0, 569, 0, 569, 0, 569, 0, 569, 569, 569, - 0, 569, 569, 0, 0, 569, 569, 569, 569, 0, - 0, 0, 569, 569, 0, 0, 0, 569, 569, 569, - 569, 569, 569, 569, 569, 570, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 569, 0, 0, 0, + 41, 257, 0, 42, 0, 0, 536, 0, 0, 0, + 0, 536, 0, 536, 536, 536, 536, 536, 536, 536, + 536, 536, 536, 536, 0, 0, 0, 0, 90, 91, + 92, 258, 0, 0, 0, 536, 0, 536, 0, 536, + 96, 536, 536, 536, 0, 536, 536, 0, 536, 536, + 536, 536, 536, 536, 536, 536, 536, 536, 354, 0, + 0, 536, 536, 536, 536, 536, 536, 536, 536, 536, + 536, 536, 536, 536, 536, 536, 536, 536, 536, 550, + 536, 354, 0, 0, 0, 550, 106, 493, 0, 0, + 0, 0, 0, 0, 354, 0, 536, 0, 0, 354, + 0, 0, 230, 0, 354, 0, 354, 354, 354, 354, + 0, 0, 0, 0, 354, 0, 0, 0, 354, 0, + 0, 550, 354, 0, 0, 0, 0, 0, 0, 0, + 354, 0, 0, 354, 0, 354, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 554, 0, 0, + 0, 0, 0, 554, 0, 0, 0, 0, 0, 354, + 0, 0, 550, 0, 0, 0, 0, 550, 0, 550, + 550, 550, 550, 550, 550, 550, 550, 550, 550, 550, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 554, + 0, 550, 0, 550, 0, 550, 0, 550, 550, 550, + 0, 550, 550, 0, 0, 550, 550, 550, 550, 550, + 550, 550, 550, 550, 0, 354, 0, 550, 550, 550, + 550, 550, 550, 550, 550, 0, 0, 0, 0, 0, + 554, 0, 0, 0, 0, 554, 550, 554, 554, 554, + 554, 554, 554, 554, 554, 554, 554, 554, 0, 0, + 0, 557, 550, 0, 0, 0, 0, 557, 0, 554, + 0, 554, 0, 554, 0, 554, 554, 554, 0, 554, + 554, 0, 0, 554, 554, 554, 554, 0, 0, 0, + 554, 554, 0, 0, 0, 554, 554, 554, 554, 554, + 554, 554, 554, 557, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 554, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 555, + 554, 0, 0, 0, 0, 555, 0, 0, 0, 0, + 0, 0, 0, 0, 557, 0, 0, 0, 0, 557, + 0, 557, 557, 557, 557, 557, 557, 557, 557, 557, + 557, 557, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 555, 0, 557, 0, 557, 0, 557, 0, 557, + 557, 557, 0, 557, 557, 0, 0, 557, 557, 557, + 557, 0, 0, 0, 557, 557, 204, 0, 0, 557, + 557, 557, 557, 557, 557, 557, 557, 0, 0, 0, + 0, 0, 555, 0, 0, 0, 0, 555, 557, 555, + 555, 555, 555, 555, 555, 555, 555, 555, 555, 555, + 0, 0, 0, 556, 557, 0, 0, 0, 205, 556, + 0, 555, 0, 555, 0, 555, 0, 555, 555, 555, + 0, 555, 555, 0, 0, 555, 555, 555, 555, 0, + 0, 0, 555, 555, 0, 0, 0, 555, 555, 555, + 555, 555, 555, 555, 555, 556, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 555, 0, 206, 207, + 208, 209, 0, 210, 211, 212, 213, 214, 215, 216, + 217, 560, 555, 218, 219, 220, 221, 222, 223, 224, + 225, 0, 0, 0, 0, 0, 556, 0, 0, 0, + 0, 556, 0, 556, 556, 556, 556, 556, 556, 556, + 556, 556, 556, 556, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 556, 0, 556, 0, 556, + 0, 556, 556, 556, 0, 556, 556, 0, 0, 556, + 556, 556, 556, 0, 0, 0, 556, 556, 0, 561, + 0, 556, 556, 556, 556, 556, 556, 556, 556, 0, + 0, 0, 0, 0, 560, 0, 0, 0, 0, 560, + 556, 560, 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 0, 0, 0, 0, 556, 0, 0, 0, + 0, 0, 0, 560, 0, 560, 0, 560, 0, 560, + 560, 560, 0, 0, 0, 0, 0, 560, 560, 560, + 560, 0, 0, 0, 560, 560, 0, 562, 0, 560, + 560, 560, 560, 560, 560, 560, 560, 0, 0, 0, + 0, 0, 561, 0, 0, 0, 0, 561, 560, 561, + 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, + 0, 0, 0, 0, 560, 0, 0, 0, 0, 0, + 0, 561, 0, 561, 0, 561, 0, 561, 561, 561, + 0, 0, 0, 0, 0, 561, 561, 561, 561, 0, + 0, 0, 561, 561, 0, 563, 0, 561, 561, 561, + 561, 561, 561, 561, 561, 0, 0, 0, 0, 0, + 562, 0, 0, 0, 0, 562, 561, 562, 562, 562, + 562, 562, 562, 562, 562, 562, 562, 562, 0, 0, + 0, 0, 561, 0, 0, 0, 0, 0, 0, 562, + 0, 562, 0, 562, 0, 562, 562, 562, 0, 0, + 0, 0, 0, 562, 562, 562, 562, 0, 0, 0, + 562, 562, 0, 564, 0, 562, 562, 562, 562, 562, + 562, 562, 562, 0, 0, 0, 0, 0, 563, 0, + 0, 0, 0, 563, 562, 563, 563, 563, 563, 563, + 563, 563, 563, 563, 563, 563, 0, 0, 0, 0, + 562, 0, 0, 0, 0, 0, 0, 563, 0, 563, + 0, 563, 0, 563, 563, 563, 0, 0, 0, 0, + 0, 563, 563, 563, 563, 0, 0, 0, 563, 563, + 0, 565, 0, 0, 0, 563, 563, 563, 563, 563, + 563, 0, 0, 0, 0, 0, 564, 0, 0, 0, + 0, 564, 563, 564, 564, 564, 564, 564, 564, 564, + 564, 564, 564, 564, 0, 0, 0, 0, 563, 0, + 0, 0, 0, 0, 0, 564, 0, 564, 0, 564, + 0, 564, 564, 564, 0, 0, 0, 0, 0, 564, + 564, 564, 564, 0, 0, 0, 564, 564, 0, 566, + 0, 0, 0, 564, 564, 564, 564, 564, 564, 0, + 0, 0, 0, 0, 565, 0, 0, 0, 0, 565, + 564, 565, 565, 565, 565, 565, 565, 565, 565, 565, + 565, 565, 0, 0, 0, 0, 564, 0, 0, 0, + 0, 0, 0, 565, 0, 565, 0, 565, 0, 565, + 565, 565, 0, 0, 0, 0, 0, 565, 565, 565, + 565, 0, 0, 0, 565, 565, 0, 567, 0, 0, + 0, 565, 565, 565, 565, 565, 565, 0, 0, 0, + 0, 0, 566, 0, 0, 0, 0, 566, 565, 566, + 566, 566, 566, 566, 566, 566, 566, 566, 566, 566, + 0, 0, 0, 0, 565, 0, 0, 0, 0, 0, + 0, 566, 0, 566, 0, 566, 0, 566, 566, 566, + 0, 0, 0, 0, 0, 566, 566, 566, 566, 0, + 0, 0, 566, 566, 0, 568, 0, 0, 0, 566, + 566, 566, 566, 566, 566, 0, 0, 0, 0, 0, + 567, 0, 0, 0, 0, 567, 566, 567, 567, 567, + 567, 567, 567, 567, 567, 567, 567, 567, 0, 0, + 0, 0, 566, 0, 0, 0, 0, 0, 0, 567, + 0, 567, 0, 567, 0, 567, 567, 567, 0, 0, + 0, 0, 0, 567, 567, 567, 567, 0, 0, 0, + 567, 567, 0, 569, 0, 0, 0, 567, 567, 567, + 567, 567, 567, 0, 0, 0, 0, 0, 568, 0, + 0, 0, 0, 568, 567, 568, 568, 568, 568, 568, + 568, 568, 568, 568, 568, 568, 0, 0, 0, 0, + 567, 0, 0, 0, 0, 0, 0, 568, 0, 568, + 0, 568, 0, 568, 568, 568, 0, 0, 0, 0, + 0, 0, 0, 568, 568, 0, 0, 0, 568, 568, + 0, 570, 0, 0, 0, 0, 0, 568, 568, 568, + 568, 0, 0, 0, 0, 0, 569, 0, 0, 0, + 0, 569, 568, 569, 569, 569, 569, 569, 569, 569, + 569, 569, 569, 569, 0, 0, 0, 0, 568, 0, + 0, 0, 0, 0, 0, 569, 0, 569, 0, 569, + 0, 569, 569, 569, 0, 0, 0, 0, 0, 0, + 0, 569, 569, 0, 0, 0, 569, 569, 0, 571, + 0, 0, 0, 0, 0, 569, 569, 569, 569, 0, + 0, 0, 0, 0, 570, 0, 0, 0, 0, 570, + 569, 570, 570, 570, 570, 570, 570, 570, 570, 570, + 570, 570, 0, 0, 0, 0, 569, 0, 0, 0, + 0, 0, 0, 570, 0, 570, 0, 570, 0, 570, + 570, 570, 0, 0, 0, 0, 0, 0, 0, 570, + 570, 0, 0, 0, 570, 570, 0, 572, 0, 0, + 0, 0, 0, 570, 570, 570, 570, 0, 0, 0, + 0, 0, 571, 0, 0, 0, 0, 571, 570, 571, + 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, + 0, 0, 0, 0, 570, 0, 0, 0, 0, 0, + 0, 571, 0, 571, 0, 571, 0, 571, 571, 571, + 0, 0, 0, 0, 0, 0, 0, 571, 571, 0, + 0, 0, 571, 571, 0, 573, 0, 0, 0, 0, + 0, 0, 0, 571, 571, 0, 0, 0, 0, 0, + 572, 0, 0, 0, 0, 572, 571, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 572, 572, 0, 0, + 0, 0, 571, 0, 0, 0, 0, 0, 0, 572, + 0, 572, 0, 572, 0, 572, 572, 572, 0, 0, + 0, 0, 0, 0, 0, 572, 572, 0, 0, 0, + 572, 572, 0, 574, 0, 0, 0, 0, 0, 0, + 0, 572, 572, 0, 0, 0, 0, 0, 573, 0, + 0, 0, 0, 573, 572, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 573, 573, 0, 0, 0, 0, + 572, 0, 0, 0, 0, 0, 0, 573, 0, 573, + 0, 573, 0, 573, 573, 573, 0, 0, 0, 0, + 0, 0, 0, 0, 573, 0, 0, 0, 573, 573, + 0, 575, 0, 0, 0, 0, 0, 0, 0, 573, + 573, 0, 0, 0, 0, 0, 574, 0, 0, 0, + 0, 574, 573, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 0, 0, 0, 0, 573, 0, + 0, 0, 0, 0, 0, 574, 0, 574, 0, 574, + 0, 574, 574, 574, 0, 0, 0, 0, 0, 0, + 0, 0, 574, 0, 0, 0, 574, 574, 0, 576, + 0, 0, 0, 0, 0, 0, 0, 574, 574, 0, + 0, 0, 0, 0, 575, 0, 0, 0, 0, 575, + 574, 575, 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 0, 0, 0, 0, 574, 0, 0, 0, + 0, 0, 0, 575, 0, 575, 0, 575, 0, 575, + 575, 575, 0, 0, 0, 0, 0, 0, 0, 0, + 575, 0, 0, 0, 0, 575, 0, 577, 0, 0, + 0, 0, 0, 0, 0, 575, 575, 0, 0, 0, + 0, 0, 576, 0, 0, 0, 0, 576, 575, 576, + 576, 576, 576, 576, 576, 576, 576, 576, 576, 576, + 0, 0, 0, 0, 575, 0, 0, 0, 0, 0, + 0, 576, 0, 576, 0, 576, 0, 576, 576, 576, + 0, 0, 0, 0, 0, 0, 0, 0, 576, 0, + 0, 0, 0, 576, 0, 578, 0, 0, 0, 0, + 0, 0, 0, 576, 576, 0, 0, 0, 0, 0, + 577, 0, 0, 0, 0, 577, 576, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, 0, 0, + 0, 0, 576, 0, 0, 0, 0, 0, 0, 577, + 0, 577, 0, 577, 0, 577, 577, 577, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 574, 569, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 570, 0, 0, 0, - 0, 570, 0, 570, 570, 570, 570, 570, 570, 570, - 570, 570, 570, 570, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 570, 0, 570, 0, 570, - 0, 570, 570, 570, 0, 570, 570, 0, 0, 570, - 570, 570, 570, 0, 0, 0, 570, 570, 0, 575, - 0, 570, 570, 570, 570, 570, 570, 570, 570, 0, - 0, 0, 0, 0, 574, 0, 0, 0, 0, 574, - 570, 574, 574, 574, 574, 574, 574, 574, 574, 574, - 574, 574, 0, 0, 0, 0, 570, 0, 0, 0, - 0, 0, 0, 574, 0, 574, 0, 574, 0, 574, - 574, 574, 0, 0, 0, 0, 0, 574, 574, 574, - 574, 0, 0, 0, 574, 574, 0, 576, 0, 574, - 574, 574, 574, 574, 574, 574, 574, 0, 0, 0, - 0, 0, 575, 0, 0, 0, 0, 575, 574, 575, - 575, 575, 575, 575, 575, 575, 575, 575, 575, 575, - 0, 0, 0, 0, 574, 0, 0, 0, 0, 0, - 0, 575, 0, 575, 0, 575, 0, 575, 575, 575, - 0, 0, 0, 0, 0, 575, 575, 575, 575, 0, - 0, 0, 575, 575, 0, 577, 0, 575, 575, 575, - 575, 575, 575, 575, 575, 0, 0, 0, 0, 0, - 576, 0, 0, 0, 0, 576, 575, 576, 576, 576, - 576, 576, 576, 576, 576, 576, 576, 576, 0, 0, - 0, 0, 575, 0, 0, 0, 0, 0, 0, 576, - 0, 576, 0, 576, 0, 576, 576, 576, 0, 0, - 0, 0, 0, 576, 576, 576, 576, 0, 0, 0, - 576, 576, 0, 578, 0, 576, 576, 576, 576, 576, - 576, 576, 576, 0, 0, 0, 0, 0, 577, 0, - 0, 0, 0, 577, 576, 577, 577, 577, 577, 577, - 577, 577, 577, 577, 577, 577, 0, 0, 0, 0, - 576, 0, 0, 0, 0, 0, 0, 577, 0, 577, - 0, 577, 0, 577, 577, 577, 0, 0, 0, 0, - 0, 577, 577, 577, 577, 0, 0, 0, 577, 577, - 0, 579, 0, 0, 0, 577, 577, 577, 577, 577, - 577, 0, 0, 0, 0, 0, 578, 0, 0, 0, - 0, 578, 577, 578, 578, 578, 578, 578, 578, 578, - 578, 578, 578, 578, 0, 0, 0, 0, 577, 0, - 0, 0, 0, 0, 0, 578, 0, 578, 0, 578, - 0, 578, 578, 578, 0, 0, 0, 0, 0, 578, - 578, 578, 578, 0, 0, 0, 578, 578, 0, 580, - 0, 0, 0, 578, 578, 578, 578, 578, 578, 0, - 0, 0, 0, 0, 579, 0, 0, 0, 0, 579, - 578, 579, 579, 579, 579, 579, 579, 579, 579, 579, - 579, 579, 0, 0, 0, 0, 578, 0, 0, 0, - 0, 0, 0, 579, 0, 579, 0, 579, 0, 579, - 579, 579, 0, 0, 0, 0, 0, 579, 579, 579, - 579, 0, 0, 0, 579, 579, 0, 581, 0, 0, - 0, 579, 579, 579, 579, 579, 579, 0, 0, 0, + 0, 577, 0, 579, 0, 0, 0, 0, 0, 0, + 0, 577, 577, 0, 0, 0, 0, 0, 578, 0, + 0, 0, 0, 578, 577, 578, 578, 578, 578, 578, + 578, 578, 578, 578, 578, 578, 0, 0, 0, 0, + 577, 0, 0, 0, 0, 0, 0, 578, 0, 578, + 0, 578, 0, 578, 578, 578, 0, 0, 0, 580, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 578, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 578, + 578, 0, 0, 0, 0, 0, 579, 0, 0, 0, + 0, 579, 578, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 0, 0, 0, 0, 578, 0, + 0, 0, 0, 0, 0, 579, 0, 579, 0, 579, + 0, 579, 579, 579, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 579, 0, 0, 0, 0, 580, 0, 0, 0, 0, 580, 579, 580, 580, 580, 580, 580, 580, 580, 580, 580, 580, 580, - 0, 0, 0, 0, 579, 0, 0, 0, 0, 0, - 0, 580, 0, 580, 0, 580, 0, 580, 580, 580, - 0, 0, 0, 0, 0, 580, 580, 580, 580, 0, - 0, 0, 580, 580, 0, 582, 0, 0, 0, 580, - 580, 580, 580, 580, 580, 0, 0, 0, 0, 0, - 581, 0, 0, 0, 0, 581, 580, 581, 581, 581, - 581, 581, 581, 581, 581, 581, 581, 581, 0, 0, - 0, 0, 580, 0, 0, 0, 0, 0, 0, 581, - 0, 581, 0, 581, 0, 581, 581, 581, 0, 0, - 0, 0, 0, 581, 581, 581, 581, 0, 0, 0, - 581, 581, 0, 583, 0, 0, 0, 581, 581, 581, - 581, 581, 581, 0, 0, 0, 0, 0, 582, 0, - 0, 0, 0, 582, 581, 582, 582, 582, 582, 582, - 582, 582, 582, 582, 582, 582, 0, 0, 0, 0, - 581, 0, 0, 0, 0, 0, 0, 582, 0, 582, - 0, 582, 0, 582, 582, 582, 0, 0, 0, 0, - 0, 0, 0, 582, 582, 0, 0, 0, 582, 582, - 0, 584, 0, 0, 0, 0, 0, 582, 582, 582, - 582, 0, 0, 0, 0, 0, 583, 0, 0, 0, - 0, 583, 582, 583, 583, 583, 583, 583, 583, 583, - 583, 583, 583, 583, 0, 0, 0, 0, 582, 0, - 0, 0, 0, 0, 0, 583, 0, 583, 0, 583, - 0, 583, 583, 583, 0, 0, 0, 0, 0, 0, - 0, 583, 583, 0, 0, 0, 583, 583, 0, 586, - 0, 0, 0, 0, 0, 583, 583, 583, 583, 0, - 0, 0, 0, 0, 584, 0, 0, 0, 0, 584, - 583, 584, 584, 584, 584, 584, 584, 584, 584, 584, - 584, 584, 0, 0, 0, 0, 583, 0, 0, 0, - 0, 0, 0, 584, 0, 584, 0, 584, 0, 584, - 584, 584, 0, 0, 0, 0, 0, 0, 0, 584, - 584, 0, 0, 0, 584, 584, 0, 587, 0, 0, - 0, 0, 0, 584, 584, 584, 584, 0, 0, 0, - 0, 0, 586, 0, 0, 0, 0, 586, 584, 586, - 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, - 0, 0, 0, 0, 584, 0, 0, 0, 0, 0, - 0, 586, 0, 586, 0, 586, 0, 586, 586, 586, - 0, 0, 0, 0, 0, 0, 0, 586, 586, 0, - 0, 0, 586, 586, 0, 588, 0, 0, 0, 0, - 0, 0, 0, 586, 586, 0, 0, 0, 0, 0, - 587, 0, 0, 0, 0, 587, 586, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 587, 587, 0, 0, - 0, 0, 586, 0, 0, 0, 0, 0, 0, 587, - 0, 587, 0, 587, 0, 587, 587, 587, 0, 0, - 0, 0, 0, 0, 0, 0, 587, 0, 0, 0, - 587, 587, 0, 589, 0, 0, 0, 0, 0, 0, - 0, 587, 587, 0, 0, 0, 0, 0, 588, 0, - 0, 0, 0, 588, 587, 588, 588, 588, 588, 588, - 588, 588, 588, 588, 588, 588, 0, 0, 0, 0, - 587, 0, 0, 0, 0, 0, 0, 588, 0, 588, - 0, 588, 0, 588, 588, 588, 0, 0, 0, 0, - 0, 0, 0, 0, 588, 0, 0, 0, 588, 588, - 0, 590, 0, 0, 0, 0, 0, 0, 0, 588, - 588, 0, 0, 0, 0, 0, 589, 0, 0, 0, - 0, 589, 588, 589, 589, 589, 589, 589, 589, 589, - 589, 589, 589, 589, 0, 0, 0, 0, 588, 0, - 0, 0, 0, 0, 0, 589, 0, 589, 0, 589, - 0, 589, 589, 589, 0, 0, 0, 0, 0, 0, - 0, 0, 589, 0, 0, 0, 0, 589, 0, 591, - 0, 0, 0, 0, 0, 0, 0, 589, 589, 0, - 0, 0, 0, 0, 590, 0, 0, 0, 0, 590, - 589, 590, 590, 590, 590, 590, 590, 590, 590, 590, - 590, 590, 0, 0, 0, 0, 589, 0, 0, 0, - 0, 0, 0, 590, 0, 590, 0, 590, 0, 590, - 590, 590, 0, 0, 0, 0, 0, 0, 0, 0, - 590, 0, 0, 0, 0, 590, 0, 592, 0, 0, - 0, 0, 0, 0, 0, 590, 590, 0, 0, 0, - 0, 0, 591, 0, 0, 0, 0, 591, 590, 591, - 591, 591, 591, 591, 591, 591, 591, 591, 591, 591, - 0, 0, 0, 0, 590, 0, 0, 0, 0, 0, - 0, 591, 0, 591, 0, 591, 0, 591, 591, 591, + 579, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 580, 0, 580, 0, 580, 579, 580, 580, 580, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 591, 0, 593, 0, 0, 0, 0, - 0, 0, 0, 591, 591, 0, 0, 0, 0, 0, - 592, 0, 0, 0, 0, 592, 591, 592, 592, 592, - 592, 592, 592, 592, 592, 592, 592, 592, 0, 0, - 0, 0, 591, 0, 0, 0, 0, 0, 0, 592, - 0, 592, 0, 592, 0, 592, 592, 592, 0, 0, - 0, 594, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 592, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 592, 592, 0, 0, 0, 0, 0, 593, 0, - 0, 0, 0, 593, 592, 593, 593, 593, 593, 593, - 593, 593, 593, 593, 593, 593, 0, 0, 0, 0, - 592, 0, 0, 0, 0, 0, 0, 593, 0, 593, - 0, 593, 0, 593, 593, 593, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 593, - 0, 0, 0, 0, 594, 0, 0, 0, 0, 594, - 593, 594, 594, 594, 594, 594, 594, 594, 594, 594, - 594, 594, 593, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 594, 0, 594, 0, 594, 593, 594, - 594, 594, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 56, 0, 594, 0, 0, 0, 0, - 0, 57, 25, 58, 26, 0, 594, 27, 59, 0, - 60, 61, 28, 62, 63, 64, 29, 0, 594, 0, - 0, 0, 65, 0, 66, 31, 67, 68, 69, 70, - 0, 0, 33, 0, 594, 0, 71, 34, 0, 72, - 73, 35, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 74, 0, 37, 0, 38, 75, 0, 0, 39, - 0, 76, 77, 78, 79, 80, 81, 40, 41, 82, - 83, 42, 84, 0, 85, 0, 0, 86, 87, 0, - 0, 88, 89, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 90, 91, 92, 93, - 94, 0, 0, 0, 95, 0, 0, 0, 96, 0, - 0, 0, 0, 97, 98, 99, 100, 101, 0, 0, - 0, 102, 0, 103, 0, 0, 0, 0, 0, 104, - 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 56, 0, 580, 0, 0, 0, 0, 0, 57, + 25, 58, 26, 0, 580, 27, 59, 0, 60, 61, + 28, 62, 63, 64, 29, 0, 580, 0, 0, 0, + 65, 0, 66, 31, 67, 68, 69, 70, 0, 0, + 33, 0, 580, 0, 71, 34, 0, 72, 73, 35, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, + 0, 37, 0, 38, 75, 0, 0, 39, 0, 76, + 77, 78, 79, 80, 81, 40, 41, 82, 83, 42, + 84, 0, 85, 0, 0, 86, 87, 0, 0, 88, + 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 90, 91, 92, 93, 94, 0, + 0, 0, 95, 0, 0, 0, 96, 0, 0, 0, + 0, 97, 98, 99, 100, 101, 0, 0, 0, 102, + 0, 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 268, 0, 0, 0, 106, 107, 108, 109, 57, 25, - 58, 26, 0, 0, 27, 59, 0, 60, 61, 28, - 62, 63, 64, 29, 0, 0, 0, 0, 0, 65, - 0, 66, 31, 67, 68, 69, 70, 0, 0, 33, - 0, 0, 0, 71, 34, 0, 72, 73, 35, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 74, 0, - 37, 0, 38, 75, 0, 0, 39, 0, 76, 77, - 78, 79, 80, 81, 40, 41, 82, 83, 42, 84, - 0, 85, 0, 0, 86, 87, 0, 0, 88, 89, + 0, 0, 0, 0, 0, 0, 0, 0, 268, 0, + 0, 0, 106, 107, 108, 109, 57, 25, 58, 26, + 0, 0, 27, 59, 0, 60, 61, 28, 62, 63, + 64, 29, 0, 0, 0, 0, 0, 65, 0, 66, + 31, 67, 68, 69, 70, 0, 0, 33, 0, 0, + 0, 71, 34, 0, 72, 73, 35, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 74, 0, 37, 0, + 38, 75, 0, 0, 39, 0, 76, 77, 78, 79, + 80, 81, 40, 41, 82, 83, 42, 84, 0, 85, + 0, 0, 86, 87, 0, 0, 88, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 90, 91, 92, 93, 94, 0, 0, - 0, 95, 0, 0, 0, 96, 0, 0, 0, 0, - 97, 98, 99, 100, 101, 0, 0, 0, 102, 0, - 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, + 0, 90, 91, 92, 93, 94, 0, 0, 0, 95, + 0, 0, 0, 96, 0, 0, 0, 0, 97, 98, + 99, 100, 101, 0, 0, 0, 102, 0, 103, 0, + 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 547, 0, 0, 0, 106, + 107, 108, 109, 57, 25, 58, 26, 0, 0, 27, + 59, 0, 60, 61, 28, 62, 63, 64, 29, 0, + 0, 0, 0, 0, 65, 0, 66, 31, 67, 68, + 69, 70, 0, 0, 33, 0, 0, 0, 71, 34, + 0, 72, 73, 35, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 74, 0, 37, 0, 38, 75, 0, + 0, 39, 0, 76, 77, 78, 79, 80, 81, 40, + 41, 82, 83, 42, 84, 0, 85, 0, 0, 86, + 87, 0, 0, 88, 89, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 90, 91, + 92, 93, 94, 0, 0, 0, 95, 0, 0, 0, + 96, 0, 0, 0, 0, 97, 98, 99, 100, 101, + 0, 0, 0, 102, 0, 103, 0, 0, 0, 0, + 0, 104, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 547, 0, 0, - 0, 106, 107, 108, 109, 57, 25, 58, 26, 0, - 0, 27, 59, 0, 60, 61, 28, 62, 63, 64, - 29, 0, 0, 0, 0, 0, 65, 0, 66, 31, - 67, 68, 69, 70, 0, 0, 33, 0, 0, 0, - 71, 34, 0, 72, 73, 35, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 74, 0, 37, 0, 38, - 75, 0, 0, 39, 0, 76, 77, 78, 79, 80, - 81, 40, 41, 82, 83, 42, 84, 0, 85, 0, - 0, 86, 87, 0, 0, 88, 89, 0, 0, 0, + 0, 0, 916, 0, 0, 0, 106, 107, 108, 109, + 916, 916, 916, 916, 0, 0, 916, 916, 0, 916, + 916, 916, 916, 916, 916, 916, 0, 0, 0, 0, + 0, 916, 0, 916, 916, 916, 916, 916, 916, 0, + 0, 916, 0, 0, 0, 916, 916, 0, 916, 916, + 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 916, 0, 916, 0, 916, 916, 0, 0, 916, 0, + 916, 916, 916, 916, 916, 916, 916, 916, 916, 916, + 916, 916, 0, 916, 0, 0, 916, 916, 0, 0, + 916, 916, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 916, 916, 916, 916, 916, + 0, 0, 0, 916, 0, 0, 0, 916, 0, 0, + 0, 0, 916, 916, 916, 916, 916, 0, 0, 0, + 916, 0, 916, 0, 0, 0, 0, 0, 916, 916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 90, 91, 92, 93, 94, 0, 0, 0, 95, 0, - 0, 0, 96, 0, 0, 0, 0, 97, 98, 99, - 100, 101, 0, 0, 0, 102, 0, 103, 0, 0, - 0, 0, 0, 104, 105, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 780, + 0, 0, 0, 916, 916, 916, 916, 780, 780, 780, + 780, 0, 0, 780, 780, 0, 780, 780, 780, 780, + 780, 780, 780, 0, 0, 0, 0, 0, 780, 0, + 780, 780, 780, 780, 780, 780, 0, 0, 780, 0, + 0, 0, 780, 780, 0, 780, 780, 780, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 780, 0, 780, + 0, 780, 780, 0, 0, 780, 0, 780, 780, 780, + 780, 780, 780, 780, 780, 780, 780, 780, 780, 0, + 780, 0, 0, 780, 780, 0, 0, 780, 780, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 780, 780, 780, 780, 780, 0, 0, 0, + 780, 0, 0, 0, 780, 0, 0, 0, 0, 780, + 780, 780, 780, 780, 0, 0, 0, 780, 0, 780, + 0, 0, 0, 0, 0, 780, 780, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 725, 0, 0, 0, + 780, 780, 780, 780, 57, 25, 0, 26, 0, 0, + 27, 256, 0, 0, 0, 28, 62, 63, 0, 29, + 0, 0, 172, 0, 172, 65, 0, 172, 31, 0, + 0, 0, 172, 0, 0, 33, 172, 0, 0, 0, + 34, 0, 72, 73, 35, 172, 0, 0, 0, 0, + 0, 0, 172, 0, 0, 0, 37, 172, 38, 75, + 0, 172, 39, 0, 0, 77, 0, 79, 0, 81, + 40, 41, 257, 172, 42, 172, 0, 0, 0, 172, + 0, 87, 0, 0, 88, 89, 0, 172, 172, 0, + 0, 172, 0, 0, 172, 0, 0, 0, 0, 90, + 91, 92, 93, 94, 0, 0, 0, 509, 726, 0, + 0, 96, 0, 0, 0, 0, 0, 98, 99, 100, + 101, 0, 0, 0, 102, 0, 103, 0, 0, 940, + 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 928, 0, 0, 0, 106, 107, - 108, 109, 928, 928, 928, 928, 0, 0, 928, 928, - 0, 928, 928, 928, 928, 928, 928, 928, 0, 0, - 0, 0, 0, 928, 0, 928, 928, 928, 928, 928, - 928, 0, 0, 928, 0, 0, 0, 928, 928, 0, - 928, 928, 928, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 928, 0, 928, 0, 928, 928, 0, 0, - 928, 0, 928, 928, 928, 928, 928, 928, 928, 928, - 928, 928, 928, 928, 0, 928, 0, 0, 928, 928, - 0, 0, 928, 928, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 928, 928, 928, - 928, 928, 0, 0, 0, 928, 0, 0, 0, 928, - 0, 0, 0, 0, 928, 928, 928, 928, 928, 0, - 0, 0, 928, 0, 928, 0, 0, 0, 0, 0, - 928, 928, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 725, 0, 0, 0, 106, 301, 108, + 109, 57, 25, 0, 26, 0, 0, 27, 256, 0, + 0, 0, 28, 62, 63, 172, 29, 0, 0, 172, + 0, 172, 65, 0, 172, 31, 0, 0, 0, 172, + 0, 0, 33, 172, 0, 0, 0, 34, 0, 72, + 73, 35, 172, 0, 0, 0, 0, 0, 0, 172, + 0, 0, 0, 37, 172, 38, 75, 906, 172, 39, + 0, 0, 77, 0, 79, 0, 81, 40, 41, 257, + 172, 42, 172, 0, 0, 0, 172, 0, 87, 0, + 0, 88, 89, 0, 172, 172, 0, 0, 172, 0, + 0, 172, 0, 0, 0, 0, 90, 91, 92, 93, + 94, 0, 0, 0, 509, 0, 0, 0, 96, 0, + 0, 0, 0, 0, 98, 99, 100, 101, 0, 0, + 0, 102, 0, 103, 940, 0, 0, 0, 0, 104, + 105, 0, 0, 0, 0, 0, 0, 57, 25, 0, + 26, 0, 0, 27, 256, 0, 0, 0, 28, 62, + 63, 0, 29, 0, 106, 301, 108, 109, 65, 0, + 0, 31, 0, 0, 0, 0, 0, 0, 33, 0, + 0, 0, 172, 34, 0, 72, 73, 35, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, + 0, 38, 75, 0, 0, 39, 0, 0, 77, 0, + 79, 0, 81, 40, 41, 257, 0, 42, 0, 0, + 0, 0, 0, 0, 87, 0, 0, 88, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 792, 0, 0, 0, 928, 928, 928, 928, 792, - 792, 792, 792, 0, 0, 792, 792, 0, 792, 792, - 792, 792, 792, 792, 792, 0, 0, 0, 0, 0, - 792, 0, 792, 792, 792, 792, 792, 792, 0, 0, - 792, 0, 0, 0, 792, 792, 0, 792, 792, 792, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 792, - 0, 792, 0, 792, 792, 0, 0, 792, 0, 792, - 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - 792, 0, 792, 0, 0, 792, 792, 0, 0, 792, - 792, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 792, 792, 792, 792, 792, 0, - 0, 0, 792, 0, 0, 0, 792, 0, 0, 0, - 0, 792, 792, 792, 792, 792, 0, 0, 0, 792, - 0, 792, 0, 0, 0, 0, 0, 792, 792, 0, + 0, 0, 90, 91, 92, 93, 94, 0, 0, 0, + 712, 974, 0, 0, 96, 0, 0, 0, 0, 0, + 98, 99, 100, 101, 0, 0, 0, 102, 0, 103, + 0, 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 725, 0, - 0, 0, 792, 792, 792, 792, 57, 25, 0, 26, - 0, 0, 27, 256, 0, 1018, 0, 28, 62, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 695, 0, + 106, 713, 108, 109, 0, 0, 57, 25, 0, 26, + 0, 714, 27, 256, 0, 0, 0, 28, 62, 63, 0, 29, 0, 0, 25, 0, 26, 65, 0, 27, 31, 0, 0, 0, 28, 0, 0, 33, 29, 0, 0, 0, 34, 0, 72, 73, 35, 31, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 37, 34, 38, 75, 0, 35, 39, 0, 0, 77, 0, 79, - 0, 81, 40, 41, 257, 37, 42, 38, 0, 0, + 0, 81, 40, 41, 257, 37, 42, 38, 0, 85, 0, 39, 0, 87, 0, 0, 88, 89, 0, 40, 41, 0, 0, 42, 0, 0, 319, 0, 0, 0, - 0, 90, 91, 92, 93, 94, 0, 0, 0, 509, - 726, 0, 0, 96, 0, 0, 0, 0, 0, 98, + 0, 90, 91, 92, 93, 94, 0, 0, 0, 0, + 0, 0, 0, 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, 0, 0, 0, 102, 0, 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, + 0, 0, 57, 25, 0, 26, 0, 0, 27, 256, + 0, 0, 0, 28, 62, 63, 0, 29, 0, 106, + 301, 108, 109, 65, 0, 0, 31, 0, 0, 0, + 0, 0, 0, 33, 0, 0, 0, 320, 34, 0, + 72, 73, 35, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 37, 0, 38, 75, 0, 0, + 39, 0, 0, 77, 0, 79, 0, 81, 40, 41, + 257, 0, 42, 0, 0, 0, 0, 0, 0, 87, + 0, 0, 88, 89, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 90, 91, 92, + 93, 94, 0, 0, 0, 712, 0, 0, 0, 96, + 0, 0, 0, 0, 0, 98, 99, 100, 101, 0, + 0, 0, 102, 0, 103, 0, 0, 0, 0, 0, + 104, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 725, 0, 0, 0, 106, - 301, 108, 109, 57, 25, 0, 26, 0, 0, 27, - 256, 0, 1139, 0, 28, 62, 63, 354, 29, 0, - 0, 25, 0, 26, 65, 0, 27, 31, 0, 0, - 0, 28, 0, 0, 33, 29, 0, 0, 0, 34, - 0, 72, 73, 35, 31, 0, 0, 0, 0, 0, - 0, 33, 0, 0, 0, 37, 34, 38, 75, 906, - 35, 39, 0, 0, 77, 0, 79, 0, 81, 40, - 41, 257, 37, 42, 38, 0, 0, 0, 39, 0, - 87, 0, 0, 88, 89, 0, 40, 41, 0, 0, - 42, 0, 0, 319, 0, 0, 0, 0, 90, 91, - 92, 93, 94, 0, 0, 0, 509, 0, 0, 0, - 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, - 0, 0, 0, 102, 0, 103, 0, 0, 0, 0, - 0, 104, 105, 0, 0, 0, 0, 0, 0, 57, - 25, 0, 26, 0, 0, 27, 256, 0, 0, 0, - 28, 62, 63, 0, 29, 0, 106, 301, 108, 109, - 65, 0, 0, 31, 0, 0, 0, 0, 0, 0, - 33, 0, 0, 0, 354, 34, 0, 72, 73, 35, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 37, 0, 38, 75, 0, 0, 39, 0, 0, - 77, 0, 79, 0, 81, 40, 41, 257, 0, 42, - 0, 0, 0, 0, 0, 0, 87, 0, 0, 88, - 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 90, 91, 92, 93, 94, 0, - 0, 0, 712, 975, 0, 0, 96, 0, 0, 0, - 0, 0, 98, 99, 100, 101, 0, 0, 0, 102, - 0, 103, 0, 0, 0, 0, 0, 104, 105, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 725, 0, 106, 713, 108, 109, 0, + 0, 57, 25, 0, 26, 0, 714, 27, 256, 0, + 0, 0, 28, 62, 63, 0, 29, 0, 0, 25, + 0, 26, 65, 0, 27, 31, 0, 0, 0, 28, + 0, 0, 33, 29, 0, 0, 0, 34, 0, 72, + 73, 35, 31, 0, 0, 0, 0, 0, 0, 33, + 0, 0, 0, 37, 34, 38, 75, 0, 35, 39, + 0, 0, 77, 0, 79, 0, 81, 40, 41, 257, + 37, 42, 38, 0, 0, 0, 39, 0, 87, 0, + 0, 88, 89, 0, 40, 41, 0, 0, 42, 0, + 0, 319, 0, 0, 0, 0, 90, 91, 92, 93, + 94, 0, 0, 0, 509, 0, 0, 0, 96, 0, + 0, 0, 0, 0, 98, 99, 100, 101, 0, 0, + 0, 102, 0, 103, 0, 0, 0, 0, 0, 104, + 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 695, 0, 106, 713, 108, 109, 0, 0, 57, 25, - 0, 26, 0, 714, 27, 256, 0, 0, 0, 28, - 62, 63, 0, 29, 0, 0, 187, 0, 187, 65, - 0, 187, 31, 0, 0, 0, 187, 0, 0, 33, - 187, 0, 0, 0, 34, 0, 72, 73, 35, 187, - 0, 0, 0, 0, 0, 0, 187, 0, 0, 0, - 37, 187, 38, 75, 0, 187, 39, 0, 0, 77, - 0, 79, 0, 81, 40, 41, 257, 187, 42, 187, - 0, 85, 0, 187, 0, 87, 0, 0, 88, 89, - 0, 187, 187, 0, 0, 187, 0, 0, 187, 0, + 894, 0, 0, 0, 106, 301, 108, 109, 57, 25, + 0, 26, 0, 0, 27, 256, 0, 0, 0, 28, + 62, 63, 326, 29, 0, 0, 25, 0, 26, 65, + 0, 27, 31, 0, 0, 0, 28, 0, 0, 33, + 29, 0, 0, 0, 34, 0, 72, 73, 35, 31, + 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, + 37, 34, 38, 75, 0, 35, 39, 0, 0, 77, + 0, 79, 0, 81, 40, 41, 257, 37, 42, 38, + 0, 0, 0, 39, 0, 87, 0, 0, 88, 89, + 0, 40, 41, 0, 0, 42, 0, 0, 319, 0, 0, 0, 0, 90, 91, 92, 93, 94, 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, 0, 0, 0, 102, 0, - 103, 0, 0, 952, 0, 0, 104, 105, 0, 0, - 0, 0, 0, 0, 57, 25, 0, 26, 0, 0, - 27, 256, 0, 0, 0, 28, 62, 63, 0, 29, - 0, 106, 301, 108, 109, 65, 0, 0, 31, 0, - 0, 0, 0, 0, 0, 33, 0, 0, 0, 187, - 34, 0, 72, 73, 35, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 37, 0, 38, 75, - 0, 0, 39, 0, 0, 77, 0, 79, 0, 81, - 40, 41, 257, 0, 42, 0, 0, 0, 0, 0, - 0, 87, 0, 0, 88, 89, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, - 91, 92, 93, 94, 0, 0, 0, 712, 0, 0, - 0, 96, 0, 0, 0, 0, 0, 98, 99, 100, - 101, 0, 0, 0, 102, 0, 103, 0, 0, 0, - 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 725, 0, 106, 713, 108, - 109, 0, 0, 57, 25, 0, 26, 0, 714, 27, - 256, 0, 0, 0, 28, 62, 63, 0, 29, 0, - 0, 187, 0, 187, 65, 0, 187, 31, 0, 0, - 0, 187, 0, 0, 33, 187, 0, 0, 0, 34, - 0, 72, 73, 35, 187, 0, 0, 0, 0, 0, - 0, 187, 0, 0, 0, 37, 187, 38, 75, 0, - 187, 39, 0, 0, 77, 0, 79, 0, 81, 40, - 41, 257, 187, 42, 187, 0, 0, 0, 187, 0, - 87, 0, 0, 88, 89, 0, 187, 187, 0, 0, - 187, 0, 0, 187, 0, 0, 0, 0, 90, 91, - 92, 93, 94, 0, 0, 0, 509, 0, 0, 0, - 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, - 0, 0, 0, 102, 0, 103, 952, 0, 0, 0, - 0, 104, 105, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 894, 0, 0, 0, 106, 301, 108, 109, - 57, 25, 0, 26, 0, 0, 27, 256, 0, 0, - 0, 28, 62, 63, 187, 29, 0, 0, 25, 0, - 26, 65, 0, 27, 31, 0, 0, 0, 28, 0, - 0, 33, 29, 0, 0, 0, 34, 0, 72, 73, - 35, 31, 0, 0, 0, 0, 0, 0, 33, 0, - 0, 0, 37, 34, 38, 75, 0, 35, 39, 0, - 0, 77, 0, 79, 0, 81, 40, 41, 257, 37, - 42, 38, 0, 0, 0, 39, 0, 87, 0, 0, - 88, 89, 0, 40, 41, 0, 0, 42, 0, 0, - 319, 0, 0, 0, 0, 90, 91, 92, 93, 94, - 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, - 0, 0, 0, 98, 99, 100, 101, 0, 0, 0, - 102, 0, 103, 0, 0, 0, 0, 0, 104, 105, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 619, - 0, 0, 0, 106, 301, 108, 109, 619, 619, 0, - 619, 0, 0, 619, 619, 0, 0, 0, 619, 619, - 619, 320, 619, 0, 0, 0, 0, 0, 619, 0, - 0, 619, 0, 0, 0, 0, 0, 0, 619, 0, - 0, 0, 0, 619, 0, 619, 619, 619, 0, 0, - 0, 0, 0, 0, 0, 346, 0, 0, 0, 619, - 0, 619, 619, 0, 0, 619, 0, 0, 619, 0, - 619, 0, 619, 619, 619, 619, 0, 619, 0, 0, - 0, 0, 0, 0, 619, 0, 0, 619, 619, 0, - 0, 346, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 619, 619, 619, 619, 619, 0, 0, 0, - 0, 0, 0, 0, 619, 0, 0, 0, 0, 0, - 619, 619, 619, 619, 0, 0, 0, 619, 0, 619, - 0, 0, 0, 0, 0, 619, 619, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 619, 619, 619, 619, 346, 346, 346, 346, 0, 0, - 0, 346, 346, 0, 0, 346, 346, 346, 346, 346, - 346, 346, 346, 346, 0, 346, 346, 346, 346, 346, - 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - 346, 346, 346, 346, 346, 346, 346, 0, 48, 0, - 0, 0, 48, 346, 48, 0, 346, 48, 0, 48, - 48, 0, 48, 0, 48, 0, 48, 0, 48, 48, - 48, 48, 0, 0, 48, 48, 0, 0, 0, 0, - 48, 0, 48, 48, 48, 0, 0, 48, 0, 48, - 0, 48, 0, 0, 48, 0, 48, 48, 48, 48, - 0, 0, 0, 48, 48, 48, 0, 0, 48, 48, - 48, 0, 0, 0, 0, 0, 0, 48, 48, 0, - 48, 48, 0, 48, 48, 48, 0, 0, 0, 48, + 0, 0, 0, 0, 0, 0, 0, 605, 0, 0, + 0, 106, 301, 108, 109, 605, 605, 0, 605, 0, + 0, 605, 605, 0, 0, 0, 605, 605, 605, 354, + 605, 0, 0, 0, 0, 0, 605, 0, 0, 605, + 0, 0, 0, 0, 0, 0, 605, 0, 0, 0, + 0, 605, 0, 605, 605, 605, 0, 0, 0, 0, + 0, 0, 0, 332, 0, 0, 0, 605, 0, 605, + 605, 0, 0, 605, 0, 0, 605, 0, 605, 0, + 605, 605, 605, 605, 0, 605, 0, 0, 0, 0, + 0, 0, 605, 0, 0, 605, 605, 0, 0, 332, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 48, 0, 48, - 0, 48, 0, 48, 0, 81, 48, 0, 48, 48, - 0, 48, 0, 48, 48, 48, 0, 48, 48, 48, - 48, 0, 0, 48, 48, 0, 0, 0, 0, 48, - 0, 48, 48, 48, 0, 0, 48, 0, 48, 0, - 48, 0, 0, 48, 0, 48, 48, 48, 48, 0, - 0, 0, 48, 48, 48, 48, 0, 48, 48, 48, - 0, 0, 0, 0, 0, 0, 48, 48, 0, 48, - 48, 0, 48, 48, 48, 0, 0, 0, 48, 0, + 605, 605, 605, 605, 605, 0, 0, 0, 0, 0, + 0, 0, 605, 0, 0, 0, 0, 0, 605, 605, + 605, 605, 0, 0, 0, 605, 0, 605, 0, 0, + 0, 0, 0, 605, 605, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 48, 0, 48, 0, - 48, 0, 48, 0, 82, 48, 0, 48, 48, 0, - 48, 0, 48, 48, 48, 0, 48, 48, 48, 48, + 0, 0, 0, 0, 0, 0, 0, 0, 605, 605, + 605, 605, 332, 332, 332, 332, 0, 0, 0, 332, + 332, 0, 0, 332, 332, 332, 332, 332, 332, 332, + 332, 332, 0, 332, 332, 332, 332, 332, 332, 332, + 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + 332, 332, 332, 332, 332, 0, 48, 0, 0, 0, + 48, 332, 48, 0, 332, 48, 0, 48, 48, 0, + 48, 0, 48, 0, 48, 0, 48, 48, 48, 48, 0, 0, 48, 48, 0, 0, 0, 0, 48, 0, 48, 48, 48, 0, 0, 48, 0, 48, 0, 48, 0, 0, 48, 0, 48, 48, 48, 48, 0, 0, - 0, 48, 48, 48, 48, 0, 48, 48, 48, 0, + 0, 48, 48, 48, 0, 0, 48, 48, 48, 0, 0, 0, 0, 0, 0, 48, 48, 0, 48, 48, 0, 48, 48, 48, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 48, 0, 48, - 0, 48, 0, 104, 48, 0, 48, 48, 0, 48, + 0, 48, 0, 81, 48, 0, 48, 48, 0, 48, 0, 48, 48, 48, 0, 48, 48, 48, 48, 0, 0, 48, 48, 0, 0, 0, 0, 48, 0, 48, 48, 48, 0, 0, 48, 0, 48, 0, 48, 0, @@ -10322,7 +10435,7 @@ void case_956() 48, 48, 48, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 48, 0, 48, 0, - 48, 0, 105, 48, 0, 48, 48, 0, 48, 0, + 48, 0, 82, 48, 0, 48, 48, 0, 48, 0, 48, 48, 48, 0, 48, 48, 48, 48, 0, 0, 48, 48, 0, 0, 0, 0, 48, 0, 48, 48, 48, 0, 0, 48, 0, 48, 0, 48, 0, 0, @@ -10332,35 +10445,51 @@ void case_956() 48, 48, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, 48, 0, 48, 48, 0, 48, 0, 48, - 48, 227, 48, 0, 48, 0, 48, 0, 48, 48, + 48, 212, 48, 0, 48, 0, 48, 0, 48, 48, 48, 48, 0, 0, 48, 48, 0, 0, 0, 0, 48, 0, 48, 48, 48, 0, 0, 48, 0, 48, - 346, 48, 0, 0, 48, 0, 48, 48, 48, 48, + 332, 48, 0, 0, 48, 0, 48, 48, 48, 48, 0, 0, 0, 48, 48, 48, 0, 0, 48, 48, - 48, 48, 0, 346, 0, 0, 0, 48, 48, 0, - 48, 48, 447, 48, 48, 48, 346, 0, 0, 48, - 0, 346, 0, 0, 346, 0, 346, 0, 346, 346, - 346, 346, 0, 0, 0, 448, 346, 0, 0, 48, - 346, 0, 0, 0, 346, 228, 0, 0, 449, 0, - 367, 0, 346, 451, 0, 346, 0, 346, 452, 0, + 48, 48, 0, 332, 0, 0, 0, 48, 48, 0, + 48, 48, 447, 48, 48, 48, 332, 0, 0, 48, + 0, 332, 0, 0, 332, 0, 332, 0, 332, 332, + 332, 332, 0, 0, 0, 448, 332, 0, 0, 48, + 332, 0, 0, 0, 332, 213, 0, 0, 449, 0, + 353, 0, 332, 451, 0, 332, 0, 332, 452, 0, 453, 454, 455, 456, 0, 0, 0, 0, 457, 0, - 0, 0, 458, 367, 0, 0, 346, 0, 0, 0, - 0, 346, 0, 0, 459, 0, 367, 460, 346, 461, - 278, 367, 346, 0, 244, 48, 367, 0, 367, 367, - 367, 367, 0, 0, 0, 346, 367, 0, 0, 0, - 367, 0, 0, 462, 367, 0, 0, 0, 0, 0, - 0, 0, 367, 57, 25, 367, 26, 367, 0, 27, - 256, 0, 0, 0, 28, 62, 63, 346, 29, 0, - 0, 0, 0, 0, 65, 0, 0, 31, 0, 0, - 0, 367, 0, 0, 33, 0, 0, 0, 0, 34, - 0, 72, 73, 35, 0, 582, 0, 0, 0, 1308, + 0, 0, 458, 353, 0, 0, 332, 0, 0, 0, + 447, 332, 0, 0, 459, 0, 353, 460, 332, 461, + 263, 353, 332, 0, 229, 48, 353, 0, 353, 353, + 353, 353, 0, 448, 0, 332, 353, 0, 0, 0, + 353, 0, 0, 462, 353, 0, 449, 0, 0, 0, + 0, 451, 353, 0, 0, 353, 452, 353, 453, 454, + 455, 456, 0, 0, 0, 0, 457, 332, 0, 0, + 458, 0, 0, 0, 1280, 0, 0, 57, 25, 0, + 26, 353, 459, 27, 256, 460, 0, 461, 28, 62, + 63, 0, 29, 0, 0, 0, 0, 0, 65, 0, + 0, 31, 0, 0, 0, 0, 0, 0, 33, 0, + 0, 462, 0, 34, 0, 72, 73, 35, 0, 582, + 0, 0, 0, 0, 0, 0, 583, 0, 0, 37, + 0, 38, 75, 0, 0, 39, 0, 353, 77, 0, + 79, 0, 81, 40, 41, 257, 0, 42, 0, 0, + 0, 0, 0, 0, 584, 0, 0, 88, 89, 0, + 0, 0, 0, 0, 0, 0, 0, 1281, 0, 0, + 0, 0, 90, 91, 92, 93, 94, 0, 0, 0, + 0, 0, 0, 0, 96, 901, 0, 585, 0, 0, + 98, 99, 100, 101, 0, 0, 0, 102, 0, 103, + 0, 0, 0, 0, 0, 104, 105, 0, 0, 0, + 0, 0, 0, 57, 25, 0, 26, 0, 0, 27, + 256, 0, 0, 0, 28, 62, 63, 0, 29, 0, + 106, 469, 108, 109, 65, 0, 0, 31, 0, 0, + 0, 0, 0, 0, 33, 0, 0, 0, 0, 34, + 0, 72, 73, 35, 0, 582, 0, 0, 0, 0, 0, 0, 583, 0, 0, 37, 0, 38, 75, 0, 0, 39, 0, 0, 77, 0, 79, 0, 81, 40, 41, 257, 0, 42, 0, 0, 0, 0, 0, 0, - 584, 0, 0, 88, 89, 0, 0, 367, 0, 0, + 584, 0, 0, 88, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 91, 92, 93, 94, 0, 0, 0, 0, 0, 0, 0, - 96, 901, 0, 585, 0, 0, 98, 99, 100, 101, + 96, 0, 0, 585, 0, 0, 98, 99, 100, 101, 0, 0, 0, 102, 0, 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, 57, 25, 0, 26, 0, 0, 27, 256, 0, 0, 0, @@ -10373,34 +10502,34 @@ void case_956() 0, 0, 0, 0, 0, 0, 584, 0, 0, 88, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 91, 92, 93, 94, 0, - 0, 0, 0, 0, 0, 0, 96, 0, 0, 585, + 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, 0, 0, 0, 102, 0, 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, 57, 25, 0, 26, 0, 0, 27, 256, 0, 0, 0, 28, 62, 63, 0, 29, 0, 106, 469, 108, 109, 65, 0, 0, 31, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, - 0, 34, 0, 72, 73, 35, 0, 582, 0, 0, - 0, 0, 0, 0, 583, 0, 0, 37, 0, 38, + 0, 34, 0, 72, 73, 35, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 37, 0, 38, 75, 0, 0, 39, 0, 0, 77, 0, 79, 0, - 81, 40, 41, 257, 0, 42, 0, 0, 0, 0, - 0, 0, 584, 0, 0, 88, 89, 0, 0, 0, + 81, 40, 41, 257, 0, 42, 0, 0, 85, 0, + 0, 0, 87, 0, 0, 88, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 91, 92, 93, 94, 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, 0, 0, 0, 102, 0, 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, 57, 25, 0, 26, 0, 0, 27, 256, 0, - 0, 0, 28, 62, 63, 0, 29, 0, 106, 469, + 0, 0, 28, 62, 63, 0, 29, 0, 106, 301, 108, 109, 65, 0, 0, 31, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 34, 0, 72, 73, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 38, 75, 0, 0, 39, 0, 0, 77, 0, 79, 0, 81, 40, 41, 257, - 0, 42, 0, 0, 85, 0, 0, 0, 87, 0, + 0, 42, 0, 0, 0, 0, 0, 0, 87, 0, 0, 88, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 91, 92, 93, - 94, 0, 0, 0, 0, 0, 0, 0, 96, 0, + 94, 0, 0, 0, 0, 859, 0, 0, 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, 0, 0, 0, 102, 0, 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, 57, 25, 0, @@ -10414,7 +10543,7 @@ void case_956() 0, 0, 0, 0, 87, 0, 0, 88, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 91, 92, 93, 94, 0, 0, 0, - 0, 859, 0, 0, 96, 0, 0, 0, 0, 0, + 509, 0, 0, 0, 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, 0, 0, 0, 102, 0, 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, 57, 25, 0, 26, 0, 0, 27, @@ -10427,7 +10556,7 @@ void case_956() 41, 257, 0, 42, 0, 0, 0, 0, 0, 0, 87, 0, 0, 88, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 91, - 92, 93, 94, 0, 0, 0, 509, 0, 0, 0, + 92, 93, 94, 0, 0, 0, 503, 0, 0, 0, 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, 0, 0, 0, 102, 0, 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, 57, @@ -10441,7 +10570,7 @@ void case_956() 0, 0, 0, 0, 0, 0, 87, 0, 0, 88, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 91, 92, 93, 94, 0, - 0, 0, 503, 0, 0, 0, 96, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, 0, 0, 0, 102, 0, 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, 57, 25, 0, 26, 0, @@ -10459,7 +10588,7 @@ void case_956() 100, 101, 0, 0, 0, 102, 0, 103, 0, 0, 0, 0, 0, 104, 105, 0, 0, 0, 0, 0, 0, 57, 25, 0, 26, 0, 0, 27, 256, 0, - 0, 0, 28, 62, 63, 0, 29, 0, 106, 301, + 0, 0, 28, 62, 63, 0, 29, 0, 106, 469, 108, 109, 65, 0, 0, 31, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 34, 0, 72, 73, 35, 0, 0, 0, 0, 0, 0, 0, 0, @@ -10470,427 +10599,411 @@ void case_956() 0, 0, 0, 0, 0, 0, 90, 91, 92, 93, 94, 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, 0, 0, - 0, 102, 0, 103, 0, 0, 0, 0, 0, 104, - 105, 0, 0, 0, 0, 0, 0, 57, 25, 0, - 26, 0, 0, 27, 256, 0, 0, 0, 28, 62, - 63, 0, 29, 0, 106, 469, 108, 109, 65, 0, - 0, 31, 0, 0, 0, 0, 0, 0, 33, 0, - 0, 0, 0, 34, 0, 72, 73, 35, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, - 0, 38, 75, 0, 0, 39, 0, 0, 77, 0, - 79, 0, 81, 40, 41, 257, 0, 42, 0, 0, - 0, 0, 0, 0, 87, 0, 0, 88, 89, 0, + 0, 102, 0, 103, 0, 0, 0, 0, 0, 104, + 105, 0, 0, 0, 0, 0, 0, 78, 78, 0, + 78, 0, 0, 78, 78, 0, 0, 0, 78, 78, + 78, 0, 78, 0, 106, 1009, 108, 109, 78, 0, + 0, 78, 0, 0, 0, 0, 0, 0, 78, 0, + 0, 0, 0, 78, 0, 78, 78, 78, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, + 0, 78, 78, 0, 0, 78, 0, 0, 78, 0, + 78, 0, 78, 78, 78, 78, 0, 78, 0, 0, + 0, 0, 0, 0, 78, 0, 0, 78, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 90, 91, 92, 93, 94, 0, 0, 0, - 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, - 98, 99, 100, 101, 0, 0, 0, 102, 0, 103, - 0, 0, 0, 0, 0, 104, 105, 0, 0, 0, - 0, 0, 0, 78, 78, 0, 78, 0, 0, 78, - 78, 0, 0, 0, 78, 78, 78, 0, 78, 0, - 106, 1010, 108, 109, 78, 0, 0, 78, 0, 0, - 0, 0, 0, 0, 78, 0, 0, 0, 0, 78, - 0, 78, 78, 78, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 78, 0, 78, 78, 0, - 0, 78, 0, 0, 78, 0, 78, 0, 78, 78, - 78, 78, 0, 78, 0, 0, 0, 0, 0, 0, - 78, 0, 0, 78, 78, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 78, 78, - 78, 78, 78, 0, 0, 0, 0, 0, 0, 0, - 78, 0, 0, 0, 0, 0, 78, 78, 78, 78, - 0, 0, 0, 78, 0, 78, 0, 0, 0, 0, - 0, 78, 78, 0, 0, 0, 0, 0, 0, 150, - 150, 0, 150, 0, 0, 150, 150, 0, 0, 0, - 150, 150, 150, 0, 150, 0, 78, 78, 78, 78, - 150, 0, 0, 150, 0, 0, 0, 0, 0, 0, - 150, 0, 0, 0, 0, 150, 0, 150, 150, 150, + 0, 0, 78, 78, 78, 78, 78, 0, 0, 0, + 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, + 78, 78, 78, 78, 0, 0, 0, 78, 0, 78, + 0, 0, 0, 0, 0, 78, 78, 0, 0, 0, + 0, 0, 0, 135, 135, 0, 135, 0, 0, 135, + 135, 0, 0, 0, 135, 135, 135, 0, 135, 0, + 78, 78, 78, 78, 135, 0, 0, 135, 0, 0, + 0, 0, 0, 0, 135, 0, 0, 0, 0, 135, + 0, 135, 135, 135, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 135, 0, 135, 135, 0, + 0, 135, 0, 0, 135, 0, 135, 0, 135, 135, + 135, 135, 0, 135, 0, 0, 0, 0, 0, 0, + 135, 0, 0, 135, 135, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 135, 135, + 135, 135, 135, 0, 0, 0, 0, 0, 0, 0, + 135, 0, 0, 0, 0, 0, 135, 135, 135, 135, + 0, 0, 0, 135, 0, 135, 0, 0, 0, 0, + 0, 135, 135, 0, 0, 0, 0, 0, 0, 57, + 25, 0, 26, 0, 0, 27, 256, 0, 0, 0, + 28, 62, 63, 0, 29, 0, 135, 135, 135, 135, + 65, 0, 0, 31, 0, 0, 0, 0, 0, 0, + 33, 0, 28, 0, 28, 34, 0, 72, 73, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 150, 0, 150, 150, 0, 0, 150, 0, 0, - 150, 0, 150, 0, 150, 150, 150, 150, 0, 150, - 0, 0, 0, 0, 0, 0, 150, 0, 0, 150, - 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 150, 150, 150, 150, 150, 0, - 0, 0, 0, 0, 0, 0, 150, 0, 0, 0, - 0, 0, 150, 150, 150, 150, 0, 0, 0, 150, - 0, 150, 0, 0, 0, 0, 0, 150, 150, 0, - 0, 0, 0, 0, 0, 57, 25, 0, 26, 0, - 0, 27, 256, 0, 0, 0, 28, 62, 63, 0, - 29, 0, 150, 150, 150, 150, 65, 0, 0, 31, - 0, 0, 0, 0, 0, 0, 33, 0, 28, 0, - 0, 34, 0, 72, 73, 35, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 37, 0, 38, - 75, 28, 0, 39, 0, 0, 77, 0, 79, 0, - 81, 40, 41, 257, 28, 42, 0, 0, 0, 28, - 0, 0, 0, 0, 28, 0, 28, 28, 28, 28, - 0, 0, 28, 0, 28, 0, 0, 0, 28, 0, - 90, 91, 92, 258, 94, 0, 0, 0, 0, 0, - 28, 0, 96, 28, 0, 28, 0, 0, 98, 99, - 100, 101, 0, 0, 0, 102, 0, 103, 0, 57, - 25, 0, 26, 104, 105, 27, 256, 0, 0, 28, - 28, 62, 63, 0, 29, 28, 28, 0, 0, 0, - 65, 0, 0, 31, 0, 0, 0, 48, 106, 259, - 33, 109, 0, 0, 0, 34, 0, 72, 73, 35, + 0, 37, 0, 38, 75, 28, 0, 39, 0, 0, + 77, 0, 79, 0, 81, 40, 41, 257, 28, 42, + 0, 0, 0, 28, 0, 0, 0, 0, 28, 0, + 28, 28, 28, 28, 0, 0, 0, 0, 28, 0, + 0, 0, 28, 0, 90, 91, 92, 258, 94, 0, + 0, 0, 0, 0, 28, 0, 96, 28, 0, 28, + 0, 0, 98, 99, 100, 101, 0, 0, 0, 102, + 0, 103, 0, 57, 25, 0, 26, 104, 105, 27, + 256, 0, 0, 28, 28, 62, 63, 0, 29, 28, + 28, 0, 0, 0, 65, 0, 0, 31, 0, 0, + 0, 0, 106, 259, 33, 109, 0, 0, 0, 34, + 0, 72, 73, 35, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 37, 0, 38, 75, 0, + 0, 39, 0, 0, 77, 0, 79, 0, 81, 40, + 41, 257, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 48, 37, 0, 38, 75, 0, 0, 39, 0, 0, - 77, 0, 79, 48, 81, 40, 41, 257, 48, 42, - 0, 0, 0, 48, 0, 48, 48, 48, 48, 0, - 0, 48, 0, 48, 0, 0, 0, 48, 0, 0, - 0, 0, 0, 0, 90, 91, 92, 258, 94, 48, - 0, 0, 48, 0, 48, 0, 96, 652, 0, 652, - 0, 652, 98, 0, 652, 101, 652, 652, 0, 652, - 0, 652, 0, 652, 0, 652, 652, 652, 48, 0, - 0, 652, 652, 0, 311, 0, 0, 652, 0, 652, - 652, 0, 0, 0, 652, 0, 0, 0, 652, 0, - 0, 0, 106, 259, 0, 109, 0, 0, 0, 652, - 652, 0, 652, 0, 0, 0, 652, 652, 0, 0, - 0, 0, 0, 0, 652, 652, 57, 25, 652, 26, - 0, 652, 27, 256, 0, 0, 652, 28, 62, 63, - 0, 29, 0, 0, 0, 0, 0, 65, 0, 0, - 31, 0, 0, 0, 0, 0, 0, 33, 652, 652, - 0, 0, 34, 0, 72, 73, 35, 0, 0, 0, - 0, 652, 0, 0, 0, 0, 0, 0, 37, 0, - 38, 75, 0, 0, 39, 0, 0, 77, 0, 79, - 0, 81, 40, 41, 257, 0, 42, 0, 0, 85, - 0, 0, 0, 0, 0, 0, 25, 0, 26, 0, - 0, 27, 652, 1190, 0, 0, 28, 0, 0, 0, - 29, 90, 91, 92, 258, 0, 0, 0, 0, 31, - 651, 0, 651, 96, 0, 651, 33, 651, 651, 0, - 651, 34, 651, 1191, 651, 35, 651, 651, 651, 0, - 0, 0, 651, 651, 0, 0, 0, 37, 651, 38, - 651, 651, 0, 39, 1192, 651, 0, 0, 0, 651, - 0, 40, 41, 0, 0, 42, 0, 0, 319, 106, - 259, 651, 0, 651, 0, 0, 0, 651, 651, 0, - 0, 0, 0, 0, 0, 651, 651, 0, 651, 651, - 651, 0, 651, 651, 0, 651, 651, 651, 651, 0, - 651, 0, 651, 0, 651, 651, 651, 0, 0, 0, - 651, 651, 0, 0, 0, 0, 651, 0, 651, 651, - 0, 0, 0, 651, 0, 0, 0, 651, 0, 0, - 0, 0, 651, 0, 0, 0, 0, 0, 0, 651, - 0, 651, 0, 0, 0, 651, 651, 0, 0, 354, - 0, 0, 0, 651, 651, 0, 0, 651, 0, 0, - 651, 0, 25, 0, 26, 651, 0, 27, 0, 0, - 1263, 0, 28, 651, 671, 0, 29, 0, 672, 1264, - 1265, 0, 0, 0, 1266, 31, 0, 0, 0, 0, - 1267, 0, 33, 0, 25, 0, 26, 34, 0, 27, - 0, 35, 1263, 0, 28, 0, 671, 0, 29, 0, - 672, 1264, 1265, 37, 0, 38, 1266, 31, 0, 39, - 0, 0, 1267, 0, 33, 0, 0, 40, 41, 34, - 0, 42, 0, 35, 1268, 0, 0, 0, 48, 1269, - 48, 651, 0, 48, 0, 37, 0, 38, 48, 0, - 0, 39, 48, 0, 0, 0, 0, 0, 0, 40, - 41, 48, 0, 42, 0, 0, 1268, 0, 48, 0, - 48, 1269, 48, 48, 1270, 48, 0, 48, 0, 48, - 48, 48, 0, 0, 48, 0, 48, 0, 0, 48, - 0, 48, 0, 48, 0, 48, 0, 0, 48, 0, - 48, 0, 0, 48, 48, 48, 0, 48, 0, 48, - 48, 48, 0, 48, 48, 1271, 48, 0, 48, 48, - 0, 48, 0, 48, 48, 0, 0, 48, 48, 0, - 48, 0, 0, 0, 0, 48, 48, 48, 0, 48, - 0, 0, 48, 0, 48, 168, 25, 1271, 26, 48, - 0, 27, 0, 48, 0, 48, 28, 48, 0, 0, - 29, 0, 48, 0, 0, 48, 0, 48, 0, 31, - 0, 48, 0, 0, 48, 168, 33, 0, 0, 48, - 48, 34, 0, 48, 0, 35, 48, 563, 0, 0, - 0, 48, 0, 0, 564, 0, 0, 37, 0, 38, - 0, 0, 0, 39, 0, 0, 565, 0, 0, 0, - 0, 40, 41, 0, 0, 42, 0, 25, 566, 26, - 0, 0, 27, 48, 0, 0, 0, 28, 0, 0, - 0, 29, 0, 0, 0, 30, 25, 0, 26, 0, - 31, 27, 0, 0, 0, 32, 28, 33, 0, 0, - 29, 0, 34, 0, 0, 0, 35, 36, 0, 31, - 0, 0, 0, 0, 0, 0, 33, 48, 37, 0, - 38, 34, 0, 0, 39, 35, 0, 0, 0, 0, - 0, 0, 40, 41, 0, 0, 42, 37, 0, 38, - 25, 0, 26, 39, 0, 27, 0, 0, 0, 567, - 28, 40, 41, 0, 29, 42, 0, 25, 319, 26, - 0, 0, 27, 31, 0, 0, 0, 28, 0, 0, - 33, 29, 0, 0, 0, 34, 0, 0, 0, 35, - 31, 0, 0, 0, 0, 0, 0, 33, 0, 0, - 0, 37, 34, 38, 0, 0, 35, 39, 0, 0, - 0, 0, 0, 0, 0, 40, 41, 0, 37, 42, - 38, 25, 319, 26, 39, 0, 27, 0, 0, 0, - 43, 28, 40, 41, 0, 29, 42, 0, 0, 511, - 0, 0, 0, 0, 31, 25, 0, 26, 0, 326, - 27, 33, 0, 0, 0, 28, 34, 0, 0, 29, - 35, 0, 0, 0, 0, 0, 0, 0, 31, 0, - 0, 0, 37, 0, 38, 33, 0, 0, 39, 0, - 34, 0, 0, 0, 35, 0, 40, 41, 0, 0, - 42, 0, 0, 319, 0, 25, 37, 26, 38, 0, - 27, 0, 39, 354, 0, 28, 0, 0, 0, 29, - 40, 41, 0, 0, 42, 0, 0, 319, 31, 25, - 354, 26, 0, 0, 27, 33, 0, 0, 0, 28, + 0, 0, 0, 0, 0, 0, 0, 0, 90, 91, + 92, 258, 94, 0, 0, 0, 0, 0, 0, 0, + 96, 638, 0, 638, 0, 638, 98, 0, 638, 101, + 638, 638, 0, 638, 0, 638, 0, 638, 0, 638, + 638, 638, 0, 0, 0, 638, 638, 0, 0, 0, + 0, 638, 0, 638, 638, 0, 0, 0, 638, 0, + 0, 0, 638, 0, 0, 0, 106, 259, 0, 109, + 0, 0, 0, 638, 638, 0, 638, 0, 0, 0, + 638, 638, 0, 0, 0, 0, 0, 0, 638, 638, + 57, 25, 638, 26, 0, 638, 27, 256, 0, 0, + 638, 28, 62, 63, 0, 29, 0, 0, 0, 0, + 0, 65, 0, 0, 31, 0, 0, 0, 0, 0, + 0, 33, 638, 638, 0, 0, 34, 0, 72, 73, + 35, 0, 0, 0, 0, 638, 0, 0, 0, 0, + 0, 0, 37, 0, 38, 75, 0, 0, 39, 0, + 0, 77, 0, 79, 0, 81, 40, 41, 257, 0, + 42, 0, 0, 85, 0, 0, 0, 0, 0, 0, + 25, 0, 26, 0, 0, 27, 638, 1189, 0, 0, + 28, 0, 0, 0, 29, 90, 91, 92, 258, 0, + 0, 0, 0, 31, 637, 0, 637, 96, 0, 637, + 33, 637, 637, 0, 637, 34, 637, 1190, 637, 35, + 637, 637, 637, 0, 0, 0, 637, 637, 0, 0, + 0, 37, 637, 38, 637, 637, 0, 39, 1191, 637, + 0, 0, 0, 637, 0, 40, 41, 0, 0, 42, + 0, 0, 319, 106, 259, 637, 0, 637, 0, 0, + 0, 637, 637, 0, 0, 0, 0, 0, 0, 637, + 637, 0, 637, 637, 637, 0, 637, 637, 0, 637, + 637, 637, 637, 0, 637, 0, 637, 0, 637, 637, + 637, 0, 0, 0, 637, 637, 0, 0, 0, 0, + 637, 0, 637, 637, 0, 0, 0, 637, 0, 0, + 0, 637, 0, 0, 0, 0, 637, 0, 0, 0, + 0, 0, 0, 637, 0, 637, 0, 0, 0, 637, + 637, 0, 0, 354, 0, 0, 0, 637, 637, 0, + 0, 637, 0, 0, 637, 0, 25, 0, 26, 637, + 0, 27, 0, 0, 1250, 0, 28, 637, 671, 0, + 29, 0, 672, 1251, 1252, 0, 0, 0, 1253, 31, + 0, 0, 0, 0, 1254, 0, 33, 0, 25, 0, + 26, 34, 0, 27, 0, 35, 1250, 0, 28, 0, + 671, 0, 29, 0, 672, 1251, 1252, 37, 0, 38, + 1253, 31, 0, 39, 0, 0, 1254, 0, 33, 0, + 0, 40, 41, 34, 0, 42, 0, 35, 1255, 0, + 0, 0, 48, 1256, 48, 637, 0, 48, 0, 37, + 0, 38, 48, 0, 0, 39, 48, 0, 0, 0, + 0, 0, 0, 40, 41, 48, 0, 42, 0, 0, + 1255, 0, 48, 0, 48, 1256, 48, 48, 1257, 48, + 0, 48, 0, 48, 48, 48, 0, 0, 48, 0, + 48, 0, 0, 48, 0, 48, 0, 48, 0, 48, + 0, 0, 48, 0, 48, 0, 0, 48, 48, 48, + 0, 48, 0, 48, 48, 48, 0, 48, 48, 1258, + 48, 0, 48, 48, 0, 48, 0, 48, 48, 0, + 0, 48, 48, 0, 48, 0, 0, 0, 0, 48, + 48, 48, 0, 48, 0, 0, 48, 0, 48, 153, + 25, 1258, 26, 48, 0, 27, 0, 48, 0, 48, + 28, 48, 0, 0, 29, 0, 48, 0, 0, 48, + 0, 48, 0, 31, 0, 48, 0, 0, 48, 153, + 33, 0, 0, 48, 48, 34, 0, 48, 0, 35, + 48, 563, 0, 0, 0, 48, 0, 0, 564, 0, + 0, 37, 0, 38, 0, 0, 0, 39, 0, 0, + 565, 0, 0, 0, 0, 40, 41, 0, 0, 42, + 0, 25, 566, 26, 0, 0, 27, 48, 0, 0, + 0, 28, 0, 0, 0, 29, 0, 0, 0, 30, + 25, 0, 26, 0, 31, 27, 0, 0, 0, 32, + 28, 33, 0, 0, 29, 0, 34, 0, 0, 0, + 35, 36, 0, 31, 0, 0, 0, 0, 0, 0, + 33, 48, 37, 0, 38, 34, 0, 0, 39, 35, + 0, 0, 0, 0, 0, 0, 40, 41, 0, 0, + 42, 37, 0, 38, 25, 0, 26, 39, 0, 27, + 0, 0, 0, 567, 28, 40, 41, 0, 29, 42, + 0, 25, 511, 26, 0, 0, 27, 31, 0, 0, + 0, 28, 0, 0, 33, 29, 0, 0, 0, 34, + 0, 0, 0, 35, 31, 0, 0, 0, 0, 0, + 0, 33, 0, 0, 0, 37, 34, 38, 0, 0, + 35, 39, 0, 0, 0, 0, 0, 0, 0, 40, + 41, 0, 37, 42, 38, 25, 319, 26, 39, 0, + 27, 0, 0, 0, 43, 28, 40, 41, 0, 29, + 42, 0, 0, 319, 0, 0, 0, 0, 31, 25, + 0, 26, 0, 354, 27, 33, 0, 0, 0, 28, 34, 0, 0, 29, 35, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 37, 0, 38, 33, 0, 0, 39, 0, 34, 0, 0, 0, 35, 0, - 40, 41, 0, 0, 42, 0, 0, 566, 0, 0, - 37, 0, 38, 498, 630, 498, 39, 0, 498, 0, - 0, 0, 0, 498, 40, 41, 0, 498, 42, 0, - 188, 739, 188, 0, 0, 188, 498, 0, 632, 0, - 188, 0, 0, 498, 188, 0, 0, 0, 498, 0, - 0, 0, 498, 188, 0, 0, 0, 0, 0, 0, - 188, 0, 0, 0, 498, 188, 498, 0, 0, 188, - 498, 0, 0, 0, 0, 0, 0, 0, 498, 498, - 0, 188, 498, 188, 187, 498, 187, 188, 354, 187, - 0, 0, 0, 0, 187, 188, 188, 0, 187, 188, - 0, 0, 188, 0, 0, 0, 0, 187, 197, 0, - 197, 0, 354, 197, 187, 0, 0, 0, 197, 187, - 0, 0, 197, 187, 0, 0, 0, 0, 0, 0, - 0, 197, 0, 0, 0, 187, 0, 187, 197, 0, - 0, 187, 0, 197, 0, 0, 0, 197, 0, 187, - 187, 0, 35, 187, 0, 0, 187, 0, 0, 197, - 0, 197, 0, 35, 0, 197, 498, 0, 35, 0, - 0, 0, 35, 197, 197, 35, 0, 197, 0, 0, - 197, 0, 0, 188, 0, 0, 0, 35, 35, 0, - 0, 0, 35, 35, 0, 33, 0, 0, 35, 0, - 35, 35, 35, 35, 0, 0, 33, 0, 35, 0, - 0, 33, 35, 0, 35, 33, 0, 0, 33, 0, - 0, 0, 0, 0, 35, 0, 35, 35, 0, 35, - 33, 33, 0, 35, 0, 33, 33, 187, 0, 0, - 0, 33, 0, 33, 33, 33, 33, 0, 0, 0, - 0, 33, 0, 35, 0, 33, 0, 33, 0, 35, - 35, 197, 0, 28, 0, 28, 0, 33, 0, 0, - 33, 0, 33, 0, 0, 0, 33, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 33, 0, 0, 28, - 0, 0, 33, 33, 28, 0, 48, 0, 0, 28, - 0, 28, 28, 28, 28, 0, 0, 48, 0, 28, - 0, 0, 48, 28, 0, 0, 48, 0, 0, 48, - 0, 0, 0, 0, 0, 28, 0, 0, 28, 0, - 28, 48, 48, 0, 0, 0, 48, 48, 0, 48, + 40, 41, 0, 0, 42, 0, 0, 566, 0, 484, + 37, 484, 38, 0, 484, 0, 39, 630, 0, 484, + 0, 0, 0, 484, 40, 41, 0, 0, 42, 0, + 0, 739, 484, 173, 632, 173, 0, 0, 173, 484, + 0, 0, 0, 173, 484, 0, 0, 173, 484, 0, + 0, 0, 0, 0, 0, 0, 173, 0, 0, 0, + 484, 0, 484, 173, 0, 0, 484, 0, 173, 0, + 0, 0, 173, 0, 484, 484, 0, 0, 484, 0, + 0, 484, 0, 0, 173, 0, 173, 172, 354, 172, + 173, 0, 172, 0, 0, 0, 0, 172, 173, 173, + 0, 172, 173, 0, 182, 173, 182, 0, 0, 182, + 172, 0, 354, 0, 182, 0, 0, 172, 182, 0, + 0, 0, 172, 0, 0, 0, 172, 182, 0, 0, + 0, 35, 0, 0, 182, 0, 0, 0, 172, 182, + 172, 0, 35, 182, 172, 0, 0, 35, 0, 0, + 0, 35, 172, 172, 35, 182, 172, 182, 0, 172, + 0, 182, 484, 0, 0, 0, 35, 35, 0, 182, + 182, 35, 35, 182, 33, 0, 182, 35, 0, 35, + 35, 35, 35, 0, 0, 33, 173, 35, 0, 0, + 33, 35, 0, 35, 33, 0, 0, 33, 0, 0, + 0, 0, 0, 35, 0, 35, 35, 0, 35, 33, + 33, 0, 35, 0, 33, 33, 0, 0, 0, 0, + 33, 0, 33, 33, 33, 33, 0, 0, 0, 0, + 33, 0, 35, 0, 33, 0, 33, 0, 35, 35, + 172, 0, 0, 48, 0, 0, 33, 0, 0, 33, + 0, 33, 0, 0, 48, 33, 0, 182, 0, 48, + 0, 0, 0, 48, 0, 0, 48, 0, 0, 0, + 0, 0, 0, 0, 0, 33, 0, 0, 48, 48, + 0, 33, 33, 48, 48, 0, 48, 0, 0, 48, + 0, 48, 48, 48, 48, 0, 0, 48, 0, 48, + 0, 0, 48, 48, 0, 48, 48, 0, 0, 48, + 0, 0, 0, 0, 0, 48, 0, 0, 48, 0, + 48, 48, 48, 0, 48, 0, 48, 48, 48, 0, 0, 0, 48, 0, 48, 48, 48, 48, 0, 0, - 48, 0, 48, 0, 28, 48, 48, 0, 48, 48, - 28, 28, 48, 0, 0, 0, 0, 0, 48, 0, - 0, 48, 0, 48, 48, 48, 0, 48, 0, 48, - 48, 48, 0, 0, 0, 48, 0, 48, 48, 48, - 48, 0, 0, 0, 0, 48, 0, 48, 0, 48, - 0, 48, 0, 37, 48, 0, 0, 0, 0, 0, - 0, 48, 0, 0, 48, 0, 48, 48, 0, 48, - 48, 0, 48, 0, 0, 0, 0, 48, 0, 48, - 48, 48, 48, 0, 0, 0, 0, 48, 0, 0, - 48, 48, 48, 0, 0, 0, 38, 0, 0, 0, - 0, 0, 0, 48, 0, 48, 48, 48, 48, 48, - 48, 0, 0, 0, 0, 48, 0, 48, 48, 48, - 48, 0, 0, 0, 0, 48, 0, 0, 0, 48, - 48, 0, 48, 0, 48, 48, 0, 0, 209, 0, - 0, 48, 0, 48, 48, 48, 48, 0, 48, 0, - 0, 0, 0, 48, 0, 48, 48, 48, 48, 0, - 0, 0, 0, 48, 0, 0, 0, 48, 48, 0, - 48, 0, 48, 48, 0, 447, 211, 0, 0, 48, - 0, 48, 48, 0, 48, 0, 48, 0, 0, 0, - 0, 48, 0, 48, 48, 48, 48, 0, 448, 0, - 0, 48, 0, 0, 0, 48, 0, 0, 48, 0, - 0, 449, 0, 0, 312, 450, 451, 48, 447, 0, - 48, 452, 48, 453, 454, 455, 456, 0, 0, 0, - 0, 457, 0, 0, 0, 458, 0, 0, 0, 0, - 0, 448, 0, 0, 0, 0, 48, 459, 48, 48, - 460, 0, 461, 0, 449, 0, 0, 0, 0, 451, - 0, 0, 0, 0, 452, 0, 453, 454, 455, 456, - 0, 0, 0, 0, 457, 0, 462, 0, 458, 0, + 0, 0, 48, 0, 48, 0, 48, 0, 48, 0, + 37, 48, 0, 0, 0, 0, 0, 0, 48, 0, + 0, 48, 0, 48, 48, 0, 48, 48, 0, 48, + 0, 0, 0, 0, 48, 0, 48, 48, 48, 48, + 0, 0, 0, 0, 48, 0, 0, 48, 48, 48, + 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, + 48, 0, 48, 48, 48, 48, 48, 48, 0, 0, + 0, 0, 48, 0, 48, 48, 48, 48, 0, 0, + 0, 0, 48, 0, 0, 0, 48, 48, 0, 48, + 0, 48, 48, 0, 0, 194, 0, 0, 48, 0, + 48, 48, 48, 48, 0, 48, 0, 0, 0, 0, + 48, 0, 48, 48, 48, 48, 0, 0, 0, 0, + 48, 0, 0, 0, 48, 48, 0, 48, 0, 48, + 48, 0, 48, 196, 48, 0, 48, 0, 48, 48, + 0, 48, 0, 48, 0, 0, 0, 0, 48, 0, + 48, 48, 48, 48, 0, 48, 0, 0, 48, 0, + 0, 0, 48, 0, 0, 48, 0, 0, 48, 0, + 0, 297, 447, 48, 48, 0, 0, 48, 48, 48, + 48, 48, 48, 48, 0, 0, 48, 0, 48, 0, + 0, 0, 48, 0, 0, 448, 0, 0, 0, 0, + 0, 0, 0, 48, 48, 48, 48, 48, 449, 48, + 0, 0, 450, 451, 0, 0, 0, 0, 452, 0, + 453, 454, 455, 456, 0, 0, 0, 0, 457, 0, + 0, 0, 458, 48, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 459, 0, 0, 460, 0, 461, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 459, 0, 0, 460, 0, 461, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 462, + 0, 0, 0, 462, }; protected static readonly short [] yyCheck = { 17, - 17, 4, 507, 17, 20, 299, 6, 18, 300, 52, - 235, 191, 353, 20, 291, 107, 509, 464, 85, 250, - 190, 60, 549, 298, 159, 483, 296, 335, 17, 328, - 318, 353, 559, 48, 60, 730, 1076, 705, 706, 1113, - 1114, 0, 906, 237, 0, 59, 113, 569, 115, 324, - 759, 78, 256, 113, 256, 115, 74, 256, 256, 256, - 78, 256, 1181, 256, 268, 1197, 80, 256, 82, 256, - 256, 256, 88, 89, 256, 325, 268, 368, 96, 368, - 748, 1213, 750, 282, 17, 1159, 368, 374, 294, 268, - 376, 256, 268, 109, 339, 1285, 357, 335, 256, 306, - 276, 391, 17, 21, 367, 1224, 313, 1226, 1298, 1226, - 368, 367, 373, 376, 277, 314, 374, 17, 325, 257, - 376, 17, 367, 381, 414, 386, 1316, 418, 650, 416, - 17, 376, 407, 17, 365, 53, 1071, 1256, 17, 1256, - 429, 159, 159, 429, 339, 159, 294, 429, 191, 344, - 256, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 266, 17, 17, 17, 17, 259, 418, 256, - 159, 294, 370, 368, 372, 370, 374, 372, 256, 374, - 375, 376, 523, 306, 370, 391, 202, 203, 374, 368, - 256, 429, 235, 62, 381, 390, 381, 66, 67, 68, - 358, 70, 71, 428, 503, 546, 75, 76, 414, 301, - 314, 226, 506, 82, 707, 84, 418, 86, 422, 418, - 418, 418, 91, 92, 546, 418, 159, 0, 569, 418, - 422, 231, 250, 339, 429, 429, 418, 255, 344, 343, - 346, 549, 418, 422, 159, 114, 352, 353, 264, 288, - 317, 559, 1384, 418, 321, 418, 419, 296, 325, 159, - 88, 89, 288, 159, 356, 325, 424, 425, 426, 427, - 418, 375, 159, 291, 290, 159, 294, 295, 325, 1411, - 159, 109, 369, 264, 300, 994, 256, 391, 314, 307, - 306, 1423, 294, 1425, 312, 418, 314, 375, 257, 313, - 318, 257, 970, 369, 256, 159, 159, 159, 159, 650, - 414, 329, 330, 256, 1009, 372, 272, 256, 335, 346, - 842, 277, 256, 429, 428, 281, 256, 262, 346, 651, - 671, 1158, 256, 418, 350, 372, 372, 353, 1378, 358, - 296, 371, 434, 428, 325, 1054, 335, 365, 366, 1176, - 256, 372, 370, 371, 372, 373, 374, 375, 376, 377, - 378, 379, 380, 298, 256, 256, 882, 323, 384, 385, - 1444, 418, 429, 294, 202, 203, 468, 469, 335, 256, - 873, 349, 350, 1318, 402, 428, 342, 963, 257, 391, - 420, 260, 429, 429, 852, 438, 412, 413, 368, 1473, - 1227, 493, 1266, 305, 374, 693, 294, 341, 429, 339, - 1345, 1346, 414, 1348, 430, 991, 368, 1413, 1414, 1087, - 435, 436, 374, 430, 1359, 256, 441, 1362, 444, 298, - 369, 374, 368, 339, 775, 369, 264, 444, 344, 709, - 346, 310, 1377, 378, 379, 369, 352, 353, 679, 376, - 1277, 1119, 1120, 775, 1281, 369, 6, 483, 1126, 373, - 1036, 429, 290, 371, 478, 373, 1401, 17, 341, 962, - 391, 256, 988, 1469, 990, 367, 367, 369, 306, 371, - 256, 263, 418, 256, 576, 376, 578, 505, 580, 507, - 367, 509, 369, 414, 371, 372, 369, 374, 372, 376, - 374, 842, 429, 391, 257, 519, 520, 523, 339, 423, - 60, 277, 368, 531, 64, 281, 523, 349, 350, 841, - 538, 418, 350, 429, 349, 350, 414, 305, 420, 305, - 546, 423, 549, 315, 17, 269, 367, 401, 88, 89, - 861, 418, 559, 420, 558, 839, 423, 263, 256, 413, - 642, 872, 286, 569, 339, 429, 384, 385, 368, 109, - 549, 792, 1181, 851, 582, 583, 339, 866, 368, 368, - 559, 256, 373, 429, 369, 376, 342, 60, 343, 1037, - 343, 64, 367, 718, 412, 413, 98, 99, 100, 101, - 102, 103, 104, 105, 367, 870, 1123, 429, 371, 315, - 373, 374, 375, 376, 429, 1224, 343, 1226, 381, 159, - 479, 629, 375, 256, 906, 374, 381, 635, 381, 429, - 305, 713, 372, 418, 374, 372, 391, 369, 391, 429, - 429, 339, 272, 376, 650, 272, 344, 1256, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 414, - 519, 414, 202, 203, 391, 671, 296, 416, 357, 296, - 368, 679, 370, 428, 372, 428, 374, 375, 376, 376, - 709, 418, 672, 272, 741, 693, 159, 414, 277, 429, - 418, 369, 281, 323, 702, 979, 323, 386, 414, 707, - 428, 428, 1181, 376, 712, 370, 339, 296, 371, 374, - 931, 344, 428, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, 264, 386, 256, 367, 734, 367, - 1181, 429, 736, 371, 323, 368, 376, 370, 272, 372, - 418, 374, 375, 376, 752, 1224, 754, 1226, 288, 755, - 290, 384, 385, 342, 758, 759, 389, 390, 1180, 1181, - 300, 769, 296, 1181, 367, 771, 306, 400, 401, 775, - 371, 343, 414, 1224, 314, 1226, 1043, 1256, 1200, 787, - 413, 256, 420, 816, 792, 793, 428, 795, 367, 323, - 418, 381, 1076, 1091, 269, 335, 429, 376, 806, 807, - 882, 391, 1224, 375, 1226, 1256, 1224, 381, 1226, 339, - 350, 286, 1079, 353, 344, 288, 346, 391, 824, 391, - 294, 367, 352, 353, 414, 1123, 328, 824, 391, 837, - 376, 839, 306, 1181, 1256, 379, 842, 843, 1256, 829, - 414, 314, 414, 851, 384, 385, 854, 1007, 1069, 384, - 1117, 414, 369, 861, 428, 1153, 428, 306, 421, 369, - 389, 1298, 335, 871, 313, 873, 367, 369, 367, 386, - 387, 381, 412, 413, 385, 376, 1224, 376, 1226, 381, - 382, 383, 1181, 1366, 386, 387, 388, 389, 390, 391, - 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, - 906, 394, 395, 357, 1235, 913, 988, 915, 1256, 917, - 261, 1242, 391, 357, 400, 369, 734, 1132, 372, 373, - 374, 1188, 928, 931, 371, 1224, 373, 1226, 1010, 373, - 936, 928, 386, 284, 374, 414, 376, 755, 1108, 357, - 370, 381, 386, 483, 374, 1428, 297, 390, 938, 428, - 940, 302, 942, 771, 962, 373, 307, 1256, 309, 310, - 311, 312, 339, 367, 418, 369, 317, 344, 386, 346, - 321, 1181, 349, 350, 325, 352, 353, 373, 369, 414, - 376, 1464, 333, 523, 1266, 336, 421, 338, 373, 339, - 994, 1486, 1487, 1001, 344, 1003, 346, 1005, 418, 349, - 350, 503, 352, 353, 398, 399, 546, 382, 383, 549, - 483, 362, 376, 372, 1224, 374, 1226, 376, 372, 559, - 374, 396, 397, 1016, 374, 843, 306, 339, 308, 569, - 354, 355, 344, 313, 346, 1043, 369, 349, 350, 372, - 352, 353, 418, 370, 371, 325, 1256, 374, 1056, 1057, - 1054, 372, 429, 374, 371, 376, 1064, 415, 357, 370, - 370, 1069, 374, 374, 374, 354, 355, 418, 1076, 1070, - 369, 1079, 574, 418, 373, 1108, 549, 1110, 339, 429, - 386, 387, 388, 344, 1091, 346, 559, 386, 349, 350, - 1098, 352, 353, 339, 1378, 256, 60, 1105, 344, 1132, - 346, 414, 415, 349, 350, 1111, 352, 353, 368, 1117, - 650, 371, 1091, 373, 374, 418, 1123, 429, 936, 418, - 277, 1129, 1130, 370, 371, 418, 373, 374, 375, 1162, - 94, 671, 392, 393, 98, 99, 100, 101, 102, 103, - 104, 105, 376, 372, 1123, 374, 1153, 1180, 1181, 370, - 340, 372, 412, 374, 370, 367, 372, 1163, 374, 0, - 420, 376, 1170, 423, 373, 705, 706, 1200, 429, 374, - 357, 376, 370, 1179, 1153, 371, 374, 373, 1186, 370, - 1188, 372, 369, 429, 370, 372, 373, 370, 374, 372, - 374, 1224, 376, 1226, 734, 368, 392, 393, 371, 386, - 373, 374, 372, 370, 339, 372, 376, 376, 748, 344, - 750, 346, 370, 1295, 372, 755, 412, 352, 353, 392, - 393, 364, 365, 1256, 420, 376, 1308, 423, 1234, 1235, - 418, 771, 705, 706, 1238, 775, 1242, 418, 372, 412, - 374, 372, 367, 1325, 343, 1327, 371, 420, 373, 374, - 423, 376, 372, 256, 374, 376, 381, 1263, 1264, 370, - 1266, 372, 414, 370, 367, 372, 1272, 372, 371, 418, - 373, 374, 374, 376, 376, 748, 418, 750, 381, 1285, - 418, 1287, 367, 374, 1290, 376, 371, 369, 373, 374, - 415, 376, 1298, 374, 418, 376, 381, 349, 350, 1303, - 285, 372, 842, 843, 390, 391, 392, 393, 418, 374, - 1316, 376, 415, 372, 373, 364, 365, 1074, 1075, 388, - 389, 394, 395, 1356, 288, 376, 372, 372, 368, 372, - 374, 372, 296, 372, 372, 418, 339, 372, 294, 294, - 1373, 344, 327, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 1386, 1387, 374, 372, 372, 1366, 376, - 1364, 1179, 418, 374, 866, 368, 906, 370, 372, 372, - 1378, 374, 375, 376, 371, 256, 374, 356, 372, 375, - 1413, 1414, 418, 374, 418, 375, 381, 1395, 374, 373, - 418, 372, 377, 378, 379, 380, 936, 382, 383, 384, - 385, 386, 387, 388, 389, 369, 381, 392, 393, 394, - 395, 396, 397, 398, 399, 256, 1234, 381, 382, 383, - 1428, 262, 386, 387, 374, 374, 429, 374, 376, 418, - 970, 0, 374, 294, 372, 423, 1469, 429, 374, 367, - 418, 372, 418, 373, 343, 1263, 1264, 372, 374, 294, - 294, 374, 418, 294, 370, 418, 1464, 298, 371, 381, - 418, 367, 256, 375, 256, 374, 1470, 1471, 256, 1287, - 256, 372, 1290, 1477, 1478, 372, 381, 280, 1486, 1487, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 256, 367, 372, 368, 418, 343, 374, 970, 339, 418, - 418, 418, 376, 344, 370, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 371, 376, 418, 376, - 374, 372, 372, 376, 370, 421, 367, 368, 423, 370, - 371, 372, 381, 374, 375, 376, 347, 378, 379, 351, - 367, 382, 383, 384, 385, 381, 381, 1087, 389, 390, - 256, 1091, 256, 394, 395, 396, 397, 398, 399, 400, - 401, 368, 372, 372, 347, 370, 374, 367, 370, 375, - 348, 1111, 413, 372, 375, 416, 372, 418, 368, 1119, - 1120, 370, 339, 1123, 418, 418, 1126, 374, 429, 256, - 374, 376, 348, 368, 375, 367, 367, 367, 265, 0, - 267, 368, 381, 270, 356, 418, 371, 376, 275, 368, - 574, 374, 279, 1153, 1087, 368, 337, 372, 1091, 368, - 305, 288, 376, 1163, 371, 418, 371, 418, 295, 369, - 367, 381, 371, 300, 367, 371, 418, 304, 418, 1179, - 371, 418, 371, 373, 371, 369, 1119, 1120, 371, 316, - 1123, 318, 372, 1126, 372, 322, 381, 374, 373, 373, - 261, 374, 263, 330, 331, 374, 256, 334, 376, 374, - 337, 372, 418, 372, 370, 418, 376, 418, 376, 372, - 1153, 376, 372, 284, 418, 367, 372, 256, 368, 381, - 381, 370, 261, 262, 1234, 1235, 297, 372, 368, 315, - 263, 302, 1242, 371, 368, 371, 307, 372, 309, 310, - 311, 312, 372, 0, 315, 284, 317, 0, 367, 376, - 321, 418, 376, 1263, 1264, 294, 1266, 368, 297, 298, - 372, 0, 333, 302, 368, 336, 305, 338, 307, 376, - 309, 310, 311, 312, 372, 709, 372, 1287, 317, 418, - 1290, 418, 321, 370, 367, 376, 325, 368, 368, 367, - 372, 362, 376, 370, 333, 418, 0, 336, 418, 338, - 339, 376, 376, 368, 372, 344, 376, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 372, 368, - 372, 368, 372, 362, 367, 376, 368, 368, 367, 368, - 367, 370, 371, 372, 373, 374, 375, 376, 373, 378, - 379, 315, 381, 382, 383, 384, 385, 386, 387, 388, - 389, 390, 376, 392, 393, 394, 395, 396, 397, 398, + 17, 52, 4, 17, 20, 18, 300, 299, 507, 17, + 291, 191, 235, 353, 250, 509, 20, 6, 464, 190, + 85, 60, 549, 298, 159, 483, 353, 318, 328, 335, + 1077, 60, 559, 296, 906, 759, 730, 78, 237, 107, + 705, 706, 256, 268, 569, 59, 0, 256, 113, 324, + 115, 0, 1114, 1115, 268, 1196, 74, 277, 17, 113, + 78, 115, 268, 256, 256, 256, 80, 17, 82, 17, + 256, 1212, 88, 89, 256, 325, 17, 256, 96, 88, + 89, 256, 256, 748, 256, 750, 48, 335, 256, 282, + 911, 294, 17, 109, 256, 1157, 349, 350, 371, 256, + 109, 268, 256, 256, 294, 17, 368, 21, 277, 276, + 256, 256, 281, 372, 263, 60, 306, 256, 367, 374, + 17, 314, 367, 357, 17, 650, 17, 376, 257, 365, + 339, 376, 407, 256, 0, 344, 358, 346, 17, 53, + 191, 159, 159, 352, 353, 159, 256, 420, 256, 94, + 17, 159, 386, 98, 99, 100, 101, 102, 103, 104, + 105, 416, 368, 257, 339, 256, 315, 429, 418, 344, + 429, 346, 358, 342, 17, 256, 429, 352, 353, 341, + 256, 429, 305, 523, 235, 339, 202, 203, 370, 381, + 372, 259, 374, 202, 203, 305, 256, 422, 418, 419, + 159, 294, 381, 503, 256, 428, 546, 369, 422, 159, + 294, 159, 1033, 707, 506, 418, 422, 60, 159, 546, + 429, 64, 367, 369, 369, 418, 371, 418, 418, 569, + 429, 1372, 250, 301, 159, 374, 418, 255, 424, 425, + 426, 427, 231, 549, 418, 294, 418, 159, 264, 288, + 418, 418, 317, 559, 429, 264, 321, 296, 1399, 288, + 325, 418, 159, 1070, 226, 418, 159, 375, 159, 993, + 1411, 325, 1413, 291, 290, 420, 294, 295, 423, 370, + 159, 290, 256, 374, 300, 314, 367, 339, 356, 307, + 306, 418, 159, 369, 312, 376, 314, 306, 391, 313, + 318, 428, 256, 372, 969, 346, 368, 391, 257, 369, + 650, 329, 330, 294, 1008, 367, 159, 842, 335, 1366, + 335, 414, 1401, 1402, 651, 325, 401, 335, 346, 1053, + 414, 671, 369, 369, 350, 266, 373, 353, 413, 272, + 256, 350, 391, 288, 882, 418, 264, 365, 366, 418, + 305, 296, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 296, 256, 414, 434, 429, 384, 385, + 1432, 368, 256, 368, 1156, 384, 385, 428, 1457, 873, + 376, 1253, 418, 314, 402, 339, 423, 438, 349, 350, + 323, 257, 349, 350, 852, 369, 412, 413, 368, 1461, + 468, 469, 693, 412, 413, 1187, 272, 325, 368, 372, + 391, 277, 343, 367, 430, 281, 305, 371, 418, 373, + 374, 375, 376, 1088, 369, 493, 430, 381, 444, 262, + 296, 368, 429, 414, 429, 775, 381, 382, 383, 256, + 444, 386, 387, 679, 375, 288, 709, 339, 775, 987, + 376, 989, 368, 343, 483, 1120, 1121, 323, 374, 429, + 391, 372, 1127, 374, 478, 298, 429, 961, 429, 429, + 376, 314, 429, 435, 436, 367, 342, 372, 376, 441, + 256, 418, 1264, 414, 368, 375, 1268, 505, 357, 507, + 374, 509, 335, 1180, 1180, 367, 369, 428, 1305, 371, + 369, 391, 842, 429, 373, 519, 520, 523, 576, 306, + 578, 1293, 580, 531, 841, 372, 313, 386, 429, 523, + 538, 368, 376, 429, 414, 343, 1333, 1334, 263, 1336, + 546, 343, 549, 372, 429, 374, 1223, 1223, 428, 369, + 1347, 549, 559, 1350, 558, 378, 379, 839, 420, 418, + 367, 559, 369, 569, 371, 372, 792, 374, 1365, 376, + 851, 343, 1180, 339, 582, 583, 866, 272, 344, 381, + 346, 418, 429, 391, 642, 256, 352, 353, 1036, 391, + 315, 861, 1389, 718, 265, 1180, 267, 1180, 418, 270, + 429, 296, 872, 375, 275, 870, 414, 1124, 279, 381, + 371, 418, 414, 420, 1180, 1223, 423, 288, 1180, 391, + 428, 629, 906, 386, 295, 272, 428, 635, 323, 300, + 374, 381, 371, 304, 373, 391, 1180, 6, 1223, 574, + 1223, 391, 414, 367, 650, 316, 962, 318, 17, 296, + 483, 322, 261, 392, 393, 713, 428, 1223, 414, 330, + 331, 1223, 414, 334, 414, 671, 337, 418, 371, 421, + 373, 679, 416, 412, 990, 284, 323, 428, 428, 1223, + 709, 420, 341, 367, 423, 693, 741, 371, 297, 373, + 374, 60, 376, 302, 702, 64, 978, 381, 307, 707, + 309, 310, 311, 312, 712, 931, 315, 357, 317, 371, + 369, 391, 321, 272, 306, 371, 549, 373, 277, 88, + 89, 313, 281, 373, 333, 1271, 559, 336, 734, 338, + 367, 415, 736, 325, 414, 734, 386, 296, 1284, 376, + 109, 269, 1179, 1180, 752, 339, 754, 418, 428, 755, + 367, 357, 369, 362, 758, 759, 755, 1303, 286, 368, + 369, 769, 1199, 369, 323, 771, 372, 373, 374, 775, + 391, 1042, 771, 367, 709, 816, 394, 395, 414, 787, + 386, 381, 376, 342, 792, 793, 1223, 795, 1225, 414, + 159, 391, 428, 414, 256, 1077, 1092, 379, 806, 807, + 421, 367, 372, 428, 374, 371, 339, 373, 374, 1080, + 376, 344, 418, 346, 414, 381, 349, 350, 824, 352, + 353, 418, 357, 294, 882, 374, 256, 376, 1124, 837, + 824, 839, 381, 202, 203, 306, 842, 843, 373, 269, + 384, 374, 1068, 851, 843, 1006, 854, 1118, 1284, 415, + 829, 386, 831, 861, 400, 1151, 286, 306, 389, 308, + 367, 369, 368, 871, 313, 873, 382, 383, 374, 376, + 1354, 369, 705, 706, 385, 381, 325, 339, 386, 387, + 396, 397, 344, 381, 346, 347, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 264, 429, 390, 370, 371, + 906, 373, 374, 375, 1234, 913, 368, 915, 370, 917, + 372, 1241, 374, 375, 376, 748, 367, 750, 418, 288, + 1133, 290, 928, 931, 367, 376, 357, 373, 390, 987, + 376, 300, 1416, 376, 928, 367, 339, 306, 372, 1109, + 374, 344, 373, 346, 376, 314, 349, 350, 369, 352, + 353, 1009, 261, 961, 373, 386, 373, 376, 937, 1230, + 939, 357, 941, 398, 399, 339, 335, 429, 1452, 1253, + 344, 374, 346, 369, 376, 284, 372, 373, 352, 353, + 374, 350, 376, 370, 353, 1474, 1475, 374, 297, 993, + 386, 418, 1000, 302, 1002, 372, 1004, 374, 307, 376, + 309, 310, 311, 312, 371, 370, 371, 415, 317, 374, + 370, 1017, 321, 418, 374, 384, 385, 372, 1017, 374, + 370, 376, 372, 1015, 333, 339, 429, 336, 369, 338, + 344, 372, 346, 370, 1042, 349, 350, 374, 352, 353, + 256, 370, 370, 412, 413, 374, 374, 1055, 1056, 1053, + 370, 339, 372, 362, 374, 1063, 344, 418, 346, 370, + 1068, 349, 350, 374, 352, 353, 1069, 277, 1109, 1077, + 418, 370, 1080, 372, 340, 374, 339, 390, 391, 392, + 393, 344, 376, 346, 1366, 1092, 349, 350, 373, 352, + 353, 1099, 1133, 367, 1092, 1136, 368, 376, 1106, 371, + 376, 373, 374, 386, 387, 388, 1112, 354, 355, 418, + 1118, 370, 376, 372, 483, 429, 374, 1124, 376, 376, + 392, 393, 1130, 1131, 343, 370, 1124, 372, 370, 372, + 372, 374, 372, 372, 374, 1176, 969, 418, 1179, 1180, + 412, 429, 369, 367, 1151, 354, 355, 371, 420, 373, + 374, 423, 376, 1151, 523, 372, 1162, 381, 1199, 414, + 415, 1169, 368, 349, 350, 371, 429, 373, 374, 370, + 418, 372, 1178, 370, 418, 372, 1184, 546, 414, 1178, + 549, 374, 1223, 376, 1225, 418, 392, 393, 418, 374, + 559, 376, 98, 99, 100, 101, 102, 103, 104, 105, + 569, 374, 374, 376, 376, 418, 412, 364, 365, 372, + 373, 364, 365, 372, 420, 1075, 1076, 423, 388, 389, + 394, 395, 1230, 1281, 418, 376, 372, 1233, 1234, 372, + 368, 256, 374, 1237, 1233, 1241, 372, 1295, 372, 372, + 372, 418, 372, 294, 1250, 1251, 294, 1253, 374, 372, + 372, 1250, 1251, 1259, 1312, 1088, 1314, 376, 418, 1092, + 374, 372, 371, 256, 374, 1271, 418, 1273, 375, 418, + 1276, 356, 372, 381, 1273, 374, 373, 1276, 1284, 375, + 374, 650, 0, 381, 372, 1289, 381, 1120, 1121, 418, + 374, 1124, 374, 374, 1127, 374, 376, 1303, 294, 423, + 372, 429, 671, 1344, 402, 403, 404, 405, 406, 407, + 408, 409, 410, 411, 339, 374, 418, 367, 1151, 344, + 1361, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 372, 1374, 1375, 373, 705, 706, 372, 343, + 418, 374, 294, 368, 294, 370, 1354, 372, 1352, 374, + 375, 376, 374, 418, 418, 370, 418, 371, 1366, 367, + 1401, 1402, 418, 62, 256, 734, 256, 66, 67, 68, + 256, 70, 71, 374, 256, 1383, 75, 76, 372, 748, + 372, 750, 381, 82, 280, 84, 755, 86, 256, 256, + 367, 418, 91, 92, 368, 262, 372, 418, 418, 343, + 418, 376, 771, 370, 429, 371, 775, 375, 1416, 418, + 374, 376, 374, 376, 372, 114, 1457, 376, 372, 370, + 423, 421, 328, 347, 381, 351, 381, 256, 381, 256, + 372, 298, 368, 372, 347, 370, 374, 367, 375, 370, + 372, 375, 367, 370, 1452, 348, 368, 418, 339, 372, + 348, 368, 381, 374, 1458, 1459, 376, 418, 374, 367, + 375, 1465, 1466, 369, 368, 367, 1474, 1475, 367, 356, + 371, 376, 418, 842, 843, 381, 382, 383, 372, 374, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 399, 400, 401, 256, 368, 368, 368, + 337, 368, 305, 367, 371, 371, 373, 374, 418, 418, + 371, 378, 379, 369, 371, 382, 383, 384, 385, 386, + 387, 388, 389, 390, 376, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 401, 418, 371, 906, 256, 418, + 418, 0, 381, 371, 262, 412, 413, 373, 371, 367, + 371, 381, 369, 420, 374, 371, 423, 372, 257, 372, + 374, 260, 429, 373, 373, 256, 374, 374, 418, 418, + 376, 372, 372, 370, 376, 418, 294, 376, 372, 339, + 298, 376, 418, 372, 344, 381, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 367, 503, 372, 298, + 969, 368, 381, 372, 370, 368, 315, 263, 368, 371, + 370, 310, 372, 371, 374, 375, 376, 368, 372, 372, + 0, 339, 0, 367, 376, 418, 344, 376, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 368, + 372, 0, 376, 368, 372, 372, 418, 370, 1017, 367, + 368, 367, 370, 371, 372, 376, 374, 375, 376, 372, + 378, 379, 368, 368, 382, 383, 384, 385, 574, 429, + 370, 389, 390, 376, 376, 418, 394, 395, 396, 397, + 398, 399, 400, 401, 376, 418, 368, 372, 376, 367, + 376, 372, 368, 372, 256, 413, 368, 372, 416, 367, + 418, 368, 376, 265, 368, 267, 367, 373, 270, 0, + 315, 429, 263, 275, 376, 51, 376, 279, 376, 1088, + 52, 376, 376, 1092, 376, 376, 288, 376, 12, 5, + 928, 824, 1068, 295, 1068, 1225, 1199, 1406, 300, 1369, + 261, 1422, 304, 1112, 1357, 1386, 1259, 1352, 1271, 841, + 1466, 1120, 1121, 671, 316, 1124, 318, 685, 1127, 845, + 322, 1290, 845, 284, 1223, 1379, 1211, 1460, 330, 331, + 845, 1375, 334, 1374, 1459, 337, 297, 1176, 1314, 1259, + 479, 302, 1151, 523, 816, 787, 307, 1162, 309, 310, + 311, 312, 866, 1162, 315, 792, 317, 256, 712, 583, + 321, 365, 261, 262, 679, 72, 331, 978, 94, 1178, + 396, 398, 333, 397, 399, 336, 709, 338, 400, 775, + 519, 401, 546, 1144, 1233, 284, 1151, 1092, 159, 990, + 1035, 1056, 963, 948, 1045, 294, 1036, 521, 297, 298, + 1047, 362, 886, 302, 420, 1228, 305, 368, 307, 1131, + 309, 310, 311, 312, -1, -1, 418, -1, 317, -1, + -1, 821, 321, -1, 1233, 1234, 325, -1, -1, -1, + -1, -1, 1241, 822, 333, -1, 0, 336, -1, 338, + 339, 1250, 1251, -1, 1253, 344, -1, 346, 347, 348, + 349, 350, 351, 352, 353, 354, 355, 356, -1, -1, + -1, -1, -1, 362, 1273, -1, -1, 1276, 367, 368, + -1, 370, 371, 372, 373, 374, 375, 376, -1, 378, + 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, -1, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 376, 376, 416, 376, 418, - 376, 420, 376, 376, 423, 256, 257, 376, 263, 51, - 429, 52, 12, 264, 265, 266, 267, 268, 5, 270, - 271, 928, 273, 274, 275, 276, 277, 278, 279, 280, - 824, 1200, 1256, 1381, 285, 1418, 287, 288, 289, 290, - 291, 292, 1069, 1069, 295, 0, 1434, 671, 299, 300, - 1369, 302, 303, 304, 1398, 1364, 1272, 1285, 845, 685, - 845, 845, 841, 314, 1478, 316, 1224, 318, 319, 1472, - 1304, 322, 1212, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 1391, 337, 1387, 1386, 340, - 341, 1327, 1162, 344, 345, 1471, 1272, 816, 523, 1163, - 712, 866, 792, 583, 365, 787, 979, 679, 359, 360, - 361, 362, 363, 72, 331, 709, 367, 368, 94, 396, - 371, 397, 400, 398, 1146, 376, 377, 378, 379, 380, - 399, 401, 546, 384, 1234, 386, 159, 1153, 949, 1057, - 1091, 392, 393, 964, 1048, 1037, 1046, 911, 886, 521, - 1230, 1130, 775, 420, 822, 821, -1, -1, -1, -1, + 409, 410, 411, 412, 413, -1, -1, 416, -1, 418, + 866, 420, -1, -1, 423, 256, 257, -1, -1, -1, + 429, -1, -1, 264, 265, 266, 267, 268, -1, 270, + 271, -1, 273, 274, 275, 276, 277, 278, 279, 280, + -1, -1, -1, -1, 285, -1, 287, 288, 289, 290, + 291, 292, -1, -1, 295, 0, -1, -1, 299, 300, + -1, 302, 303, 304, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 314, -1, 316, -1, 318, 319, -1, + -1, 322, -1, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, -1, 337, -1, -1, 340, + 341, -1, -1, 344, 345, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, + 361, 362, 363, -1, -1, -1, 367, 368, -1, -1, + 371, -1, -1, -1, -1, 376, 377, 378, 379, 380, + -1, -1, -1, 384, -1, 386, -1, -1, -1, -1, + -1, 392, 393, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 417, 418, 419, 420, -1, 422, 256, 257, -1, -1, -1, -1, 429, -1, 264, 265, 266, 267, 268, -1, 270, 271, -1, 273, @@ -11063,7 +11176,7 @@ void case_956() -1, -1, -1, 376, 377, 378, 379, 380, -1, -1, -1, 384, 298, 386, -1, -1, -1, -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 256, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 262, -1, 417, 418, 419, 420, -1, -1, -1, -1, -1, 339, -1, -1, 429, -1, 344, -1, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, @@ -11074,12 +11187,12 @@ void case_956() 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 256, -1, -1, 418, -1, 420, 262, -1, 423, -1, -1, - -1, -1, -1, 429, -1, -1, -1, -1, 368, -1, - -1, 371, -1, 373, 374, -1, -1, -1, 378, 379, - -1, -1, 382, 383, 384, 385, 386, 387, 388, 389, + -1, -1, -1, 429, -1, -1, -1, -1, -1, 369, + -1, 371, 372, 373, 374, -1, 376, -1, 378, 379, + -1, 381, 382, 383, 384, 385, -1, 387, 388, 389, 390, 298, 392, 393, 394, 395, 396, 397, 398, 399, - 400, 401, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 412, 413, -1, -1, -1, -1, -1, -1, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, -1, -1, -1, -1, 418, -1, 420, 262, -1, 423, -1, -1, -1, -1, -1, 429, -1, -1, 339, -1, -1, -1, -1, 344, -1, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, @@ -11106,29 +11219,29 @@ void case_956() 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, -1, 256, -1, -1, -1, -1, 420, 262, -1, 423, -1, -1, -1, -1, - -1, 429, -1, -1, -1, -1, -1, 369, -1, 371, - 372, 373, 374, -1, 376, -1, 378, 379, -1, 381, - 382, 383, 384, 385, -1, 387, 388, 389, 390, 298, + -1, 429, -1, -1, -1, -1, -1, -1, 370, 371, + 372, 373, 374, -1, -1, -1, 378, 379, -1, 381, + 382, 383, 384, 385, 386, 387, 388, 389, 390, 298, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, -1, -1, -1, -1, 418, -1, 420, 262, + 412, 413, -1, -1, -1, -1, -1, -1, 420, -1, -1, 423, -1, -1, -1, -1, -1, 429, -1, -1, 339, -1, -1, -1, -1, 344, -1, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, -1, -1, - -1, -1, -1, -1, -1, 298, -1, -1, -1, 368, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 368, -1, 370, 371, 372, 373, 374, 375, 376, -1, 378, 379, -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, -1, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, -1, 256, -1, -1, -1, - -1, 420, 262, -1, 423, -1, -1, -1, -1, -1, - 429, -1, -1, -1, -1, -1, -1, 370, 371, 372, - 373, 374, -1, -1, -1, 378, 379, -1, 381, 382, - 383, 384, 385, 386, 387, 388, 389, 390, 298, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, - 413, -1, -1, -1, -1, -1, -1, 420, -1, -1, - 423, -1, -1, -1, -1, -1, 429, -1, -1, 339, + 409, 410, 411, 412, 413, -1, 256, 256, -1, -1, + -1, 420, 262, -1, 423, -1, 265, -1, 267, -1, + 429, 270, -1, -1, -1, -1, 275, -1, -1, -1, + 279, -1, -1, -1, -1, -1, -1, -1, -1, 288, + -1, -1, -1, -1, -1, -1, 295, -1, 298, -1, + -1, 300, -1, -1, -1, 304, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 316, -1, 318, + -1, -1, -1, 322, -1, -1, -1, -1, -1, -1, + -1, 330, 331, -1, -1, 334, -1, -1, 337, 339, -1, -1, -1, -1, 344, -1, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 368, -1, @@ -11136,7 +11249,7 @@ void case_956() -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, -1, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, -1, 256, 256, -1, -1, -1, + 410, 411, 412, 413, -1, 256, 256, -1, -1, 418, 420, 262, -1, 423, -1, 265, -1, 267, -1, 429, 270, -1, -1, -1, -1, 275, -1, -1, -1, 279, -1, -1, -1, -1, -1, -1, -1, -1, 288, -1, @@ -11214,19 +11327,19 @@ void case_956() 355, 356, -1, -1, -1, -1, -1, -1, -1, -1, -1, 298, -1, 368, -1, 370, -1, 372, -1, 374, 375, 376, -1, 378, 379, -1, -1, 382, 383, 384, - 385, -1, -1, -1, 389, 390, -1, -1, -1, 394, + 385, -1, -1, -1, 389, 390, 285, -1, -1, 394, 395, 396, 397, 398, 399, 400, 401, -1, -1, -1, -1, -1, 339, -1, -1, -1, -1, 344, 413, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - -1, -1, -1, 256, 429, -1, -1, -1, -1, 262, + -1, -1, -1, 256, 429, -1, -1, -1, 327, 262, -1, 368, -1, 370, -1, 372, -1, 374, 375, 376, -1, 378, 379, -1, -1, 382, 383, 384, 385, -1, -1, -1, 389, 390, -1, -1, -1, 394, 395, 396, 397, 398, 399, 400, 401, 298, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 413, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 256, 429, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 339, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 413, -1, 377, 378, + 379, 380, -1, 382, 383, 384, 385, 386, 387, 388, + 389, 256, 429, 392, 393, 394, 395, 396, 397, 398, + 399, -1, -1, -1, -1, -1, 339, -1, -1, -1, -1, 344, -1, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 368, -1, 370, -1, 372, @@ -11319,7 +11432,7 @@ void case_956() 349, 350, 351, 352, 353, 354, 355, 356, -1, -1, -1, -1, 429, -1, -1, -1, -1, -1, -1, 368, -1, 370, -1, 372, -1, 374, 375, 376, -1, -1, - -1, -1, -1, -1, -1, -1, 385, -1, -1, -1, + -1, -1, -1, -1, -1, 384, 385, -1, -1, -1, 389, 390, -1, 256, -1, -1, -1, -1, -1, -1, -1, 400, 401, -1, -1, -1, -1, -1, 339, -1, -1, -1, -1, 344, 413, 346, 347, 348, 349, 350, @@ -11333,7 +11446,7 @@ void case_956() 353, 354, 355, 356, -1, -1, -1, -1, 429, -1, -1, -1, -1, -1, -1, 368, -1, 370, -1, 372, -1, 374, 375, 376, -1, -1, -1, -1, -1, -1, - -1, -1, 385, -1, -1, -1, -1, 390, -1, 256, + -1, -1, 385, -1, -1, -1, 389, 390, -1, 256, -1, -1, -1, -1, -1, -1, -1, 400, 401, -1, -1, -1, -1, -1, 339, -1, -1, -1, -1, 344, 413, 346, 347, 348, 349, 350, 351, 352, 353, 354, @@ -11346,94 +11459,38 @@ void case_956() 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, -1, -1, -1, -1, 429, -1, -1, -1, -1, -1, -1, 368, -1, 370, -1, 372, -1, 374, 375, 376, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 385, -1, -1, -1, -1, 390, -1, 256, -1, -1, -1, -1, -1, -1, -1, 400, 401, -1, -1, -1, -1, -1, 339, -1, -1, -1, -1, 344, 413, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, -1, -1, -1, -1, 429, -1, -1, -1, -1, -1, -1, 368, -1, 370, -1, 372, -1, 374, 375, 376, -1, -1, - -1, 256, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 390, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 390, -1, 256, -1, -1, -1, -1, -1, -1, -1, 400, 401, -1, -1, -1, -1, -1, 339, -1, -1, -1, -1, 344, 413, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, -1, -1, -1, -1, 429, -1, -1, -1, -1, -1, -1, 368, -1, 370, - -1, 372, -1, 374, 375, 376, -1, -1, -1, -1, + -1, 372, -1, 374, 375, 376, -1, -1, -1, 256, -1, -1, -1, -1, -1, -1, -1, -1, -1, 390, - -1, -1, -1, -1, 339, -1, -1, -1, -1, 344, - 401, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 413, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 368, -1, 370, -1, 372, 429, 374, - 375, 376, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 256, -1, 390, -1, -1, -1, -1, - -1, 264, 265, 266, 267, -1, 401, 270, 271, -1, - 273, 274, 275, 276, 277, 278, 279, -1, 413, -1, - -1, -1, 285, -1, 287, 288, 289, 290, 291, 292, - -1, -1, 295, -1, 429, -1, 299, 300, -1, 302, - 303, 304, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 314, -1, 316, -1, 318, 319, -1, -1, 322, - -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, -1, 337, -1, -1, 340, 341, -1, - -1, 344, 345, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 359, 360, 361, 362, - 363, -1, -1, -1, 367, -1, -1, -1, 371, -1, - -1, -1, -1, 376, 377, 378, 379, 380, -1, -1, - -1, 384, -1, 386, -1, -1, -1, -1, -1, 392, - 393, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 256, -1, -1, -1, 417, 418, 419, 420, 264, 265, - 266, 267, -1, -1, 270, 271, -1, 273, 274, 275, - 276, 277, 278, 279, -1, -1, -1, -1, -1, 285, - -1, 287, 288, 289, 290, 291, 292, -1, -1, 295, - -1, -1, -1, 299, 300, -1, 302, 303, 304, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 314, -1, - 316, -1, 318, 319, -1, -1, 322, -1, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - -1, 337, -1, -1, 340, 341, -1, -1, 344, 345, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, - -1, 367, -1, -1, -1, 371, -1, -1, -1, -1, - 376, 377, 378, 379, 380, -1, -1, -1, 384, -1, - 386, -1, -1, -1, -1, -1, 392, 393, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 256, -1, -1, - -1, 417, 418, 419, 420, 264, 265, 266, 267, -1, - -1, 270, 271, -1, 273, 274, 275, 276, 277, 278, - 279, -1, -1, -1, -1, -1, 285, -1, 287, 288, - 289, 290, 291, 292, -1, -1, 295, -1, -1, -1, - 299, 300, -1, 302, 303, 304, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 314, -1, 316, -1, 318, - 319, -1, -1, 322, -1, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, -1, 337, -1, - -1, 340, 341, -1, -1, 344, 345, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 359, 360, 361, 362, 363, -1, -1, -1, 367, -1, - -1, -1, 371, -1, -1, -1, -1, 376, 377, 378, - 379, 380, -1, -1, -1, 384, -1, 386, -1, -1, - -1, -1, -1, 392, 393, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 256, -1, -1, -1, 417, 418, - 419, 420, 264, 265, 266, 267, -1, -1, 270, 271, - -1, 273, 274, 275, 276, 277, 278, 279, -1, -1, - -1, -1, -1, 285, -1, 287, 288, 289, 290, 291, - 292, -1, -1, 295, -1, -1, -1, 299, 300, -1, - 302, 303, 304, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 314, -1, 316, -1, 318, 319, -1, -1, - 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, - 332, 333, 334, 335, -1, 337, -1, -1, 340, 341, - -1, -1, 344, 345, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 359, 360, 361, - 362, 363, -1, -1, -1, 367, -1, -1, -1, 371, - -1, -1, -1, -1, 376, 377, 378, 379, 380, -1, - -1, -1, 384, -1, 386, -1, -1, -1, -1, -1, - 392, 393, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 400, + 401, -1, -1, -1, -1, -1, 339, -1, -1, -1, + -1, 344, 413, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, -1, -1, -1, -1, 429, -1, + -1, -1, -1, -1, -1, 368, -1, 370, -1, 372, + -1, 374, 375, 376, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 390, -1, -1, + -1, -1, 339, -1, -1, -1, -1, 344, 401, 346, + 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 413, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 368, -1, 370, -1, 372, 429, 374, 375, 376, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 256, -1, -1, -1, 417, 418, 419, 420, 264, - 265, 266, 267, -1, -1, 270, 271, -1, 273, 274, - 275, 276, 277, 278, 279, -1, -1, -1, -1, -1, + -1, 256, -1, 390, -1, -1, -1, -1, -1, 264, + 265, 266, 267, -1, 401, 270, 271, -1, 273, 274, + 275, 276, 277, 278, 279, -1, 413, -1, -1, -1, 285, -1, 287, 288, 289, 290, 291, 292, -1, -1, - 295, -1, -1, -1, 299, 300, -1, 302, 303, 304, + 295, -1, 429, -1, 299, 300, -1, 302, 303, 304, -1, -1, -1, -1, -1, -1, -1, -1, -1, 314, -1, 316, -1, 318, 319, -1, -1, 322, -1, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, @@ -11445,159 +11502,202 @@ void case_956() -1, 386, -1, -1, -1, -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, -1, - -1, -1, 417, 418, 419, 420, 264, 265, -1, 267, - -1, -1, 270, 271, -1, 256, -1, 275, 276, 277, - -1, 279, -1, -1, 265, -1, 267, 285, -1, 270, - 288, -1, -1, -1, 275, -1, -1, 295, 279, -1, - -1, -1, 300, -1, 302, 303, 304, 288, -1, -1, - -1, -1, -1, -1, 295, -1, -1, -1, 316, 300, - 318, 319, -1, 304, 322, -1, -1, 325, -1, 327, - -1, 329, 330, 331, 332, 316, 334, 318, -1, -1, - -1, 322, -1, 341, -1, -1, 344, 345, -1, 330, - 331, -1, -1, 334, -1, -1, 337, -1, -1, -1, + -1, -1, 417, 418, 419, 420, 264, 265, 266, 267, + -1, -1, 270, 271, -1, 273, 274, 275, 276, 277, + 278, 279, -1, -1, -1, -1, -1, 285, -1, 287, + 288, 289, 290, 291, 292, -1, -1, 295, -1, -1, + -1, 299, 300, -1, 302, 303, 304, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 314, -1, 316, -1, + 318, 319, -1, -1, 322, -1, 324, 325, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, -1, 337, + -1, -1, 340, 341, -1, -1, 344, 345, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, -1, 367, - 368, -1, -1, 371, -1, -1, -1, -1, -1, 377, + -1, -1, -1, 371, -1, -1, -1, -1, 376, 377, 378, 379, 380, -1, -1, -1, 384, -1, 386, -1, -1, -1, -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, -1, -1, -1, 417, - 418, 419, 420, 264, 265, -1, 267, -1, -1, 270, - 271, -1, 256, -1, 275, 276, 277, 418, 279, -1, - -1, 265, -1, 267, 285, -1, 270, 288, -1, -1, - -1, 275, -1, -1, 295, 279, -1, -1, -1, 300, - -1, 302, 303, 304, 288, -1, -1, -1, -1, -1, - -1, 295, -1, -1, -1, 316, 300, 318, 319, 320, - 304, 322, -1, -1, 325, -1, 327, -1, 329, 330, - 331, 332, 316, 334, 318, -1, -1, -1, 322, -1, - 341, -1, -1, 344, 345, -1, 330, 331, -1, -1, - 334, -1, -1, 337, -1, -1, -1, -1, 359, 360, + 418, 419, 420, 264, 265, 266, 267, -1, -1, 270, + 271, -1, 273, 274, 275, 276, 277, 278, 279, -1, + -1, -1, -1, -1, 285, -1, 287, 288, 289, 290, + 291, 292, -1, -1, 295, -1, -1, -1, 299, 300, + -1, 302, 303, 304, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 314, -1, 316, -1, 318, 319, -1, + -1, 322, -1, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, -1, 337, -1, -1, 340, + 341, -1, -1, 344, 345, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, -1, 367, -1, -1, -1, - 371, -1, -1, -1, -1, -1, 377, 378, 379, 380, + 371, -1, -1, -1, -1, 376, 377, 378, 379, 380, -1, -1, -1, 384, -1, 386, -1, -1, -1, -1, - -1, 392, 393, -1, -1, -1, -1, -1, -1, 264, - 265, -1, 267, -1, -1, 270, 271, -1, -1, -1, - 275, 276, 277, -1, 279, -1, 417, 418, 419, 420, - 285, -1, -1, 288, -1, -1, -1, -1, -1, -1, - 295, -1, -1, -1, 418, 300, -1, 302, 303, 304, + -1, 392, 393, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 316, -1, 318, 319, -1, -1, 322, -1, -1, - 325, -1, 327, -1, 329, 330, 331, 332, -1, 334, - -1, -1, -1, -1, -1, -1, 341, -1, -1, 344, - 345, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, - -1, -1, 367, 368, -1, -1, 371, -1, -1, -1, - -1, -1, 377, 378, 379, 380, -1, -1, -1, 384, - -1, 386, -1, -1, -1, -1, -1, 392, 393, -1, + -1, -1, 256, -1, -1, -1, 417, 418, 419, 420, + 264, 265, 266, 267, -1, -1, 270, 271, -1, 273, + 274, 275, 276, 277, 278, 279, -1, -1, -1, -1, + -1, 285, -1, 287, 288, 289, 290, 291, 292, -1, + -1, 295, -1, -1, -1, 299, 300, -1, 302, 303, + 304, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 314, -1, 316, -1, 318, 319, -1, -1, 322, -1, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, -1, 337, -1, -1, 340, 341, -1, -1, + 344, 345, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 359, 360, 361, 362, 363, + -1, -1, -1, 367, -1, -1, -1, 371, -1, -1, + -1, -1, 376, 377, 378, 379, 380, -1, -1, -1, + 384, -1, 386, -1, -1, -1, -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, + -1, -1, -1, 417, 418, 419, 420, 264, 265, 266, + 267, -1, -1, 270, 271, -1, 273, 274, 275, 276, + 277, 278, 279, -1, -1, -1, -1, -1, 285, -1, + 287, 288, 289, 290, 291, 292, -1, -1, 295, -1, + -1, -1, 299, 300, -1, 302, 303, 304, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 314, -1, 316, + -1, 318, 319, -1, -1, 322, -1, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, -1, + 337, -1, -1, 340, 341, -1, -1, 344, 345, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 256, -1, 417, 418, 419, 420, -1, -1, 264, 265, - -1, 267, -1, 428, 270, 271, -1, -1, -1, 275, - 276, 277, -1, 279, -1, -1, 265, -1, 267, 285, - -1, 270, 288, -1, -1, -1, 275, -1, -1, 295, - 279, -1, -1, -1, 300, -1, 302, 303, 304, 288, - -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, - 316, 300, 318, 319, -1, 304, 322, -1, -1, 325, - -1, 327, -1, 329, 330, 331, 332, 316, 334, 318, - -1, 337, -1, 322, -1, 341, -1, -1, 344, 345, - -1, 330, 331, -1, -1, 334, -1, -1, 337, -1, - -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, - -1, -1, -1, -1, -1, 371, -1, -1, -1, -1, - -1, 377, 378, 379, 380, -1, -1, -1, 384, -1, - 386, -1, -1, 372, -1, -1, 392, 393, -1, -1, - -1, -1, -1, -1, 264, 265, -1, 267, -1, -1, + -1, -1, 359, 360, 361, 362, 363, -1, -1, -1, + 367, -1, -1, -1, 371, -1, -1, -1, -1, 376, + 377, 378, 379, 380, -1, -1, -1, 384, -1, 386, + -1, -1, -1, -1, -1, 392, 393, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 256, -1, -1, -1, + 417, 418, 419, 420, 264, 265, -1, 267, -1, -1, 270, 271, -1, -1, -1, 275, 276, 277, -1, 279, - -1, 417, 418, 419, 420, 285, -1, -1, 288, -1, - -1, -1, -1, -1, -1, 295, -1, -1, -1, 418, - 300, -1, 302, 303, 304, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 316, -1, 318, 319, - -1, -1, 322, -1, -1, 325, -1, 327, -1, 329, - 330, 331, 332, -1, 334, -1, -1, -1, -1, -1, - -1, 341, -1, -1, 344, 345, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 359, - 360, 361, 362, 363, -1, -1, -1, 367, -1, -1, + -1, -1, 265, -1, 267, 285, -1, 270, 288, -1, + -1, -1, 275, -1, -1, 295, 279, -1, -1, -1, + 300, -1, 302, 303, 304, 288, -1, -1, -1, -1, + -1, -1, 295, -1, -1, -1, 316, 300, 318, 319, + -1, 304, 322, -1, -1, 325, -1, 327, -1, 329, + 330, 331, 332, 316, 334, 318, -1, -1, -1, 322, + -1, 341, -1, -1, 344, 345, -1, 330, 331, -1, + -1, 334, -1, -1, 337, -1, -1, -1, -1, 359, + 360, 361, 362, 363, -1, -1, -1, 367, 368, -1, -1, 371, -1, -1, -1, -1, -1, 377, 378, 379, - 380, -1, -1, -1, 384, -1, 386, -1, -1, -1, + 380, -1, -1, -1, 384, -1, 386, -1, -1, 372, -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 256, -1, 417, 418, 419, - 420, -1, -1, 264, 265, -1, 267, -1, 428, 270, - 271, -1, -1, -1, 275, 276, 277, -1, 279, -1, - -1, 265, -1, 267, 285, -1, 270, 288, -1, -1, - -1, 275, -1, -1, 295, 279, -1, -1, -1, 300, - -1, 302, 303, 304, 288, -1, -1, -1, -1, -1, - -1, 295, -1, -1, -1, 316, 300, 318, 319, -1, - 304, 322, -1, -1, 325, -1, 327, -1, 329, 330, - 331, 332, 316, 334, 318, -1, -1, -1, 322, -1, - 341, -1, -1, 344, 345, -1, 330, 331, -1, -1, - 334, -1, -1, 337, -1, -1, -1, -1, 359, 360, - 361, 362, 363, -1, -1, -1, 367, -1, -1, -1, - 371, -1, -1, -1, -1, -1, 377, 378, 379, 380, - -1, -1, -1, 384, -1, 386, 370, -1, -1, -1, - -1, 392, 393, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 256, -1, -1, -1, 417, 418, 419, 420, - 264, 265, -1, 267, -1, -1, 270, 271, -1, -1, - -1, 275, 276, 277, 418, 279, -1, -1, 265, -1, - 267, 285, -1, 270, 288, -1, -1, -1, 275, -1, - -1, 295, 279, -1, -1, -1, 300, -1, 302, 303, - 304, 288, -1, -1, -1, -1, -1, -1, 295, -1, - -1, -1, 316, 300, 318, 319, -1, 304, 322, -1, - -1, 325, -1, 327, -1, 329, 330, 331, 332, 316, - 334, 318, -1, -1, -1, 322, -1, 341, -1, -1, - 344, 345, -1, 330, 331, -1, -1, 334, -1, -1, - 337, -1, -1, -1, -1, 359, 360, 361, 362, 363, - -1, -1, -1, -1, -1, -1, -1, 371, -1, -1, - -1, -1, -1, 377, 378, 379, 380, -1, -1, -1, - 384, -1, 386, -1, -1, -1, -1, -1, 392, 393, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 256, - -1, -1, -1, 417, 418, 419, 420, 264, 265, -1, + -1, -1, -1, 256, -1, -1, -1, 417, 418, 419, + 420, 264, 265, -1, 267, -1, -1, 270, 271, -1, + -1, -1, 275, 276, 277, 418, 279, -1, -1, 265, + -1, 267, 285, -1, 270, 288, -1, -1, -1, 275, + -1, -1, 295, 279, -1, -1, -1, 300, -1, 302, + 303, 304, 288, -1, -1, -1, -1, -1, -1, 295, + -1, -1, -1, 316, 300, 318, 319, 320, 304, 322, + -1, -1, 325, -1, 327, -1, 329, 330, 331, 332, + 316, 334, 318, -1, -1, -1, 322, -1, 341, -1, + -1, 344, 345, -1, 330, 331, -1, -1, 334, -1, + -1, 337, -1, -1, -1, -1, 359, 360, 361, 362, + 363, -1, -1, -1, 367, -1, -1, -1, 371, -1, + -1, -1, -1, -1, 377, 378, 379, 380, -1, -1, + -1, 384, -1, 386, 370, -1, -1, -1, -1, 392, + 393, -1, -1, -1, -1, -1, -1, 264, 265, -1, 267, -1, -1, 270, 271, -1, -1, -1, 275, 276, - 277, 418, 279, -1, -1, -1, -1, -1, 285, -1, + 277, -1, 279, -1, 417, 418, 419, 420, 285, -1, -1, 288, -1, -1, -1, -1, -1, -1, 295, -1, - -1, -1, -1, 300, -1, 302, 303, 304, -1, -1, - -1, -1, -1, -1, -1, 262, -1, -1, -1, 316, + -1, -1, 418, 300, -1, 302, 303, 304, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 316, -1, 318, 319, -1, -1, 322, -1, -1, 325, -1, 327, -1, 329, 330, 331, 332, -1, 334, -1, -1, -1, -1, -1, -1, 341, -1, -1, 344, 345, -1, - -1, 298, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, -1, - -1, -1, -1, -1, 371, -1, -1, -1, -1, -1, + 367, 368, -1, -1, 371, -1, -1, -1, -1, -1, 377, 378, 379, 380, -1, -1, -1, 384, -1, 386, -1, -1, -1, -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 256, -1, + 417, 418, 419, 420, -1, -1, 264, 265, -1, 267, + -1, 428, 270, 271, -1, -1, -1, 275, 276, 277, + -1, 279, -1, -1, 265, -1, 267, 285, -1, 270, + 288, -1, -1, -1, 275, -1, -1, 295, 279, -1, + -1, -1, 300, -1, 302, 303, 304, 288, -1, -1, + -1, -1, -1, -1, 295, -1, -1, -1, 316, 300, + 318, 319, -1, 304, 322, -1, -1, 325, -1, 327, + -1, 329, 330, 331, 332, 316, 334, 318, -1, 337, + -1, 322, -1, 341, -1, -1, 344, 345, -1, 330, + 331, -1, -1, 334, -1, -1, 337, -1, -1, -1, + -1, 359, 360, 361, 362, 363, -1, -1, -1, -1, + -1, -1, -1, 371, -1, -1, -1, -1, -1, 377, + 378, 379, 380, -1, -1, -1, 384, -1, 386, -1, + -1, -1, -1, -1, 392, 393, -1, -1, -1, -1, + -1, -1, 264, 265, -1, 267, -1, -1, 270, 271, + -1, -1, -1, 275, 276, 277, -1, 279, -1, 417, + 418, 419, 420, 285, -1, -1, 288, -1, -1, -1, + -1, -1, -1, 295, -1, -1, -1, 418, 300, -1, + 302, 303, 304, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 316, -1, 318, 319, -1, -1, + 322, -1, -1, 325, -1, 327, -1, 329, 330, 331, + 332, -1, 334, -1, -1, -1, -1, -1, -1, 341, + -1, -1, 344, 345, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 359, 360, 361, + 362, 363, -1, -1, -1, 367, -1, -1, -1, 371, + -1, -1, -1, -1, -1, 377, 378, 379, 380, -1, + -1, -1, 384, -1, 386, -1, -1, -1, -1, -1, + 392, 393, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 256, -1, 417, 418, 419, 420, -1, + -1, 264, 265, -1, 267, -1, 428, 270, 271, -1, + -1, -1, 275, 276, 277, -1, 279, -1, -1, 265, + -1, 267, 285, -1, 270, 288, -1, -1, -1, 275, + -1, -1, 295, 279, -1, -1, -1, 300, -1, 302, + 303, 304, 288, -1, -1, -1, -1, -1, -1, 295, + -1, -1, -1, 316, 300, 318, 319, -1, 304, 322, + -1, -1, 325, -1, 327, -1, 329, 330, 331, 332, + 316, 334, 318, -1, -1, -1, 322, -1, 341, -1, + -1, 344, 345, -1, 330, 331, -1, -1, 334, -1, + -1, 337, -1, -1, -1, -1, 359, 360, 361, 362, + 363, -1, -1, -1, 367, -1, -1, -1, 371, -1, + -1, -1, -1, -1, 377, 378, 379, 380, -1, -1, + -1, 384, -1, 386, -1, -1, -1, -1, -1, 392, + 393, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 417, 418, 419, 420, 371, 372, 373, 374, -1, -1, - -1, 378, 379, -1, -1, 382, 383, 384, 385, 386, - 387, 388, 389, 390, -1, 392, 393, 394, 395, 396, - 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, -1, 261, -1, - -1, -1, 265, 420, 267, -1, 423, 270, -1, 272, - 273, -1, 275, -1, 277, -1, 279, -1, 281, 282, - 283, 284, -1, -1, 287, 288, -1, -1, -1, -1, - 293, -1, 295, 296, 297, -1, -1, 300, -1, 302, - -1, 304, -1, -1, 307, -1, 309, 310, 311, 312, - -1, -1, -1, 316, 317, 318, -1, -1, 321, 322, - 323, -1, -1, -1, -1, -1, -1, 330, 331, -1, - 333, 334, -1, 336, 337, 338, -1, -1, -1, 342, + 256, -1, -1, -1, 417, 418, 419, 420, 264, 265, + -1, 267, -1, -1, 270, 271, -1, -1, -1, 275, + 276, 277, 418, 279, -1, -1, 265, -1, 267, 285, + -1, 270, 288, -1, -1, -1, 275, -1, -1, 295, + 279, -1, -1, -1, 300, -1, 302, 303, 304, 288, + -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, + 316, 300, 318, 319, -1, 304, 322, -1, -1, 325, + -1, 327, -1, 329, 330, 331, 332, 316, 334, 318, + -1, -1, -1, 322, -1, 341, -1, -1, 344, 345, + -1, 330, 331, -1, -1, 334, -1, -1, 337, -1, + -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, + -1, -1, -1, -1, -1, 371, -1, -1, -1, -1, + -1, 377, 378, 379, 380, -1, -1, -1, 384, -1, + 386, -1, -1, -1, -1, -1, 392, 393, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 256, -1, -1, + -1, 417, 418, 419, 420, 264, 265, -1, 267, -1, + -1, 270, 271, -1, -1, -1, 275, 276, 277, 418, + 279, -1, -1, -1, -1, -1, 285, -1, -1, 288, + -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, + -1, 300, -1, 302, 303, 304, -1, -1, -1, -1, + -1, -1, -1, 262, -1, -1, -1, 316, -1, 318, + 319, -1, -1, 322, -1, -1, 325, -1, 327, -1, + 329, 330, 331, 332, -1, 334, -1, -1, -1, -1, + -1, -1, 341, -1, -1, 344, 345, -1, -1, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 261, -1, 362, - -1, 265, -1, 267, -1, 368, 270, -1, 272, 273, - -1, 275, -1, 277, 377, 279, -1, 281, 282, 283, - 284, -1, -1, 287, 288, -1, -1, -1, -1, 293, - -1, 295, 296, 297, -1, -1, 300, -1, 302, -1, - 304, -1, -1, 307, -1, 309, 310, 311, 312, -1, - -1, -1, 316, 317, 318, 418, -1, 321, 322, 323, - -1, -1, -1, -1, -1, -1, 330, 331, -1, 333, - 334, -1, 336, 337, 338, -1, -1, -1, 342, -1, + 359, 360, 361, 362, 363, -1, -1, -1, -1, -1, + -1, -1, 371, -1, -1, -1, -1, -1, 377, 378, + 379, 380, -1, -1, -1, 384, -1, 386, -1, -1, + -1, -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 261, -1, 362, -1, - 265, -1, 267, -1, 368, 270, -1, 272, 273, -1, - 275, -1, 277, 377, 279, -1, 281, 282, 283, 284, + -1, -1, -1, -1, -1, -1, -1, -1, 417, 418, + 419, 420, 371, 372, 373, 374, -1, -1, -1, 378, + 379, -1, -1, 382, 383, 384, 385, 386, 387, 388, + 389, 390, -1, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, -1, 261, -1, -1, -1, + 265, 420, 267, -1, 423, 270, -1, 272, 273, -1, + 275, -1, 277, -1, 279, -1, 281, 282, 283, 284, -1, -1, 287, 288, -1, -1, -1, -1, 293, -1, 295, 296, 297, -1, -1, 300, -1, 302, -1, 304, -1, -1, 307, -1, 309, 310, 311, 312, -1, -1, - -1, 316, 317, 318, 418, -1, 321, 322, 323, -1, + -1, 316, 317, 318, -1, -1, 321, 322, 323, -1, -1, -1, -1, -1, -1, 330, 331, -1, 333, 334, -1, 336, 337, 338, -1, -1, -1, 342, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -11635,22 +11735,38 @@ void case_956() 261, -1, 333, 302, -1, 336, -1, 338, 307, -1, 309, 310, 311, 312, -1, -1, -1, -1, 317, -1, -1, -1, 321, 284, -1, -1, 357, -1, -1, -1, - -1, 362, -1, -1, 333, -1, 297, 336, 369, 338, + 261, 362, -1, -1, 333, -1, 297, 336, 369, 338, 371, 302, 373, -1, 305, 418, 307, -1, 309, 310, - 311, 312, -1, -1, -1, 386, 317, -1, -1, -1, - 321, -1, -1, 362, 325, -1, -1, -1, -1, -1, - -1, -1, 333, 264, 265, 336, 267, 338, -1, 270, - 271, -1, -1, -1, 275, 276, 277, 418, 279, -1, - -1, -1, -1, -1, 285, -1, -1, 288, -1, -1, - -1, 362, -1, -1, 295, -1, -1, -1, -1, 300, - -1, 302, 303, 304, -1, 306, -1, -1, -1, 418, + 311, 312, -1, 284, -1, 386, 317, -1, -1, -1, + 321, -1, -1, 362, 325, -1, 297, -1, -1, -1, + -1, 302, 333, -1, -1, 336, 307, 338, 309, 310, + 311, 312, -1, -1, -1, -1, 317, 418, -1, -1, + 321, -1, -1, -1, 325, -1, -1, 264, 265, -1, + 267, 362, 333, 270, 271, 336, -1, 338, 275, 276, + 277, -1, 279, -1, -1, -1, -1, -1, 285, -1, + -1, 288, -1, -1, -1, -1, -1, -1, 295, -1, + -1, 362, -1, 300, -1, 302, 303, 304, -1, 306, + -1, -1, -1, -1, -1, -1, 313, -1, -1, 316, + -1, 318, 319, -1, -1, 322, -1, 418, 325, -1, + 327, -1, 329, 330, 331, 332, -1, 334, -1, -1, + -1, -1, -1, -1, 341, -1, -1, 344, 345, -1, + -1, -1, -1, -1, -1, -1, -1, 418, -1, -1, + -1, -1, 359, 360, 361, 362, 363, -1, -1, -1, + -1, -1, -1, -1, 371, 372, -1, 374, -1, -1, + 377, 378, 379, 380, -1, -1, -1, 384, -1, 386, + -1, -1, -1, -1, -1, 392, 393, -1, -1, -1, + -1, -1, -1, 264, 265, -1, 267, -1, -1, 270, + 271, -1, -1, -1, 275, 276, 277, -1, 279, -1, + 417, 418, 419, 420, 285, -1, -1, 288, -1, -1, + -1, -1, -1, -1, 295, -1, -1, -1, -1, 300, + -1, 302, 303, 304, -1, 306, -1, -1, -1, -1, -1, -1, 313, -1, -1, 316, -1, 318, 319, -1, -1, 322, -1, -1, 325, -1, 327, -1, 329, 330, 331, 332, -1, 334, -1, -1, -1, -1, -1, -1, - 341, -1, -1, 344, 345, -1, -1, 418, -1, -1, + 341, -1, -1, 344, 345, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, -1, - 371, 372, -1, 374, -1, -1, 377, 378, 379, 380, + 371, -1, -1, 374, -1, -1, 377, 378, 379, 380, -1, -1, -1, 384, -1, 386, -1, -1, -1, -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, 264, 265, -1, 267, -1, -1, 270, 271, -1, -1, -1, @@ -11663,17 +11779,17 @@ void case_956() -1, -1, -1, -1, -1, -1, 341, -1, -1, 344, 345, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, - -1, -1, -1, -1, -1, -1, 371, -1, -1, 374, + -1, -1, -1, -1, -1, -1, 371, -1, -1, -1, -1, -1, 377, 378, 379, 380, -1, -1, -1, 384, -1, 386, -1, -1, -1, -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, 264, 265, -1, 267, -1, -1, 270, 271, -1, -1, -1, 275, 276, 277, -1, 279, -1, 417, 418, 419, 420, 285, -1, -1, 288, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, - -1, 300, -1, 302, 303, 304, -1, 306, -1, -1, - -1, -1, -1, -1, 313, -1, -1, 316, -1, 318, + -1, 300, -1, 302, 303, 304, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 316, -1, 318, 319, -1, -1, 322, -1, -1, 325, -1, 327, -1, - 329, 330, 331, 332, -1, 334, -1, -1, -1, -1, + 329, 330, 331, 332, -1, 334, -1, -1, 337, -1, -1, -1, 341, -1, -1, 344, 345, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, -1, -1, -1, @@ -11687,10 +11803,10 @@ void case_956() 303, 304, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 316, -1, 318, 319, -1, -1, 322, -1, -1, 325, -1, 327, -1, 329, 330, 331, 332, - -1, 334, -1, -1, 337, -1, -1, -1, 341, -1, + -1, 334, -1, -1, -1, -1, -1, -1, 341, -1, -1, 344, 345, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, 361, 362, - 363, -1, -1, -1, -1, -1, -1, -1, 371, -1, + 363, -1, -1, -1, -1, 368, -1, -1, 371, -1, -1, -1, -1, -1, 377, 378, 379, 380, -1, -1, -1, 384, -1, 386, -1, -1, -1, -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, 264, 265, -1, @@ -11704,7 +11820,7 @@ void case_956() -1, -1, -1, -1, 341, -1, -1, 344, 345, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, -1, - -1, 368, -1, -1, 371, -1, -1, -1, -1, -1, + 367, -1, -1, -1, 371, -1, -1, -1, -1, -1, 377, 378, 379, 380, -1, -1, -1, 384, -1, 386, -1, -1, -1, -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, 264, 265, -1, 267, -1, -1, 270, @@ -11731,7 +11847,7 @@ void case_956() -1, -1, -1, -1, -1, -1, 341, -1, -1, 344, 345, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, - -1, -1, 367, -1, -1, -1, 371, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 371, -1, -1, -1, -1, -1, 377, 378, 379, 380, -1, -1, -1, 384, -1, 386, -1, -1, -1, -1, -1, 392, 393, -1, -1, -1, -1, -1, -1, 264, 265, -1, 267, -1, @@ -11792,196 +11908,169 @@ void case_956() 265, -1, 267, -1, -1, 270, 271, -1, -1, -1, 275, 276, 277, -1, 279, -1, 417, 418, 419, 420, 285, -1, -1, 288, -1, -1, -1, -1, -1, -1, - 295, -1, -1, -1, -1, 300, -1, 302, 303, 304, + 295, -1, 261, -1, 263, 300, -1, 302, 303, 304, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 316, -1, 318, 319, -1, -1, 322, -1, -1, - 325, -1, 327, -1, 329, 330, 331, 332, -1, 334, - -1, -1, -1, -1, -1, -1, 341, -1, -1, 344, - 345, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, - -1, -1, -1, -1, -1, -1, 371, -1, -1, -1, + -1, 316, -1, 318, 319, 284, -1, 322, -1, -1, + 325, -1, 327, -1, 329, 330, 331, 332, 297, 334, + -1, -1, -1, 302, -1, -1, -1, -1, 307, -1, + 309, 310, 311, 312, -1, -1, -1, -1, 317, -1, + -1, -1, 321, -1, 359, 360, 361, 362, 363, -1, + -1, -1, -1, -1, 333, -1, 371, 336, -1, 338, -1, -1, 377, 378, 379, 380, -1, -1, -1, 384, - -1, 386, -1, -1, -1, -1, -1, 392, 393, -1, - -1, -1, -1, -1, -1, 264, 265, -1, 267, -1, - -1, 270, 271, -1, -1, -1, 275, 276, 277, -1, - 279, -1, 417, 418, 419, 420, 285, -1, -1, 288, - -1, -1, -1, -1, -1, -1, 295, -1, 261, -1, - -1, 300, -1, 302, 303, 304, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 316, -1, 318, - 319, 284, -1, 322, -1, -1, 325, -1, 327, -1, - 329, 330, 331, 332, 297, 334, -1, -1, -1, 302, - -1, -1, -1, -1, 307, -1, 309, 310, 311, 312, - -1, -1, 315, -1, 317, -1, -1, -1, 321, -1, - 359, 360, 361, 362, 363, -1, -1, -1, -1, -1, - 333, -1, 371, 336, -1, 338, -1, -1, 377, 378, - 379, 380, -1, -1, -1, 384, -1, 386, -1, 264, - 265, -1, 267, 392, 393, 270, 271, -1, -1, 362, - 275, 276, 277, -1, 279, 368, 369, -1, -1, -1, - 285, -1, -1, 288, -1, -1, -1, 261, 417, 418, - 295, 420, -1, -1, -1, 300, -1, 302, 303, 304, + -1, 386, -1, 264, 265, -1, 267, 392, 393, 270, + 271, -1, -1, 362, 275, 276, 277, -1, 279, 368, + 369, -1, -1, -1, 285, -1, -1, 288, -1, -1, + -1, -1, 417, 418, 295, 420, -1, -1, -1, 300, + -1, 302, 303, 304, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 316, -1, 318, 319, -1, + -1, 322, -1, -1, 325, -1, 327, -1, 329, 330, + 331, 332, -1, 334, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 284, 316, -1, 318, 319, -1, -1, 322, -1, -1, - 325, -1, 327, 297, 329, 330, 331, 332, 302, 334, - -1, -1, -1, 307, -1, 309, 310, 311, 312, -1, - -1, 315, -1, 317, -1, -1, -1, 321, -1, -1, - -1, -1, -1, -1, 359, 360, 361, 362, 363, 333, - -1, -1, 336, -1, 338, -1, 371, 263, -1, 265, - -1, 267, 377, -1, 270, 380, 272, 273, -1, 275, - -1, 277, -1, 279, -1, 281, 282, 283, 362, -1, - -1, 287, 288, -1, 368, -1, -1, 293, -1, 295, - 296, -1, -1, -1, 300, -1, -1, -1, 304, -1, - -1, -1, 417, 418, -1, 420, -1, -1, -1, 315, - 316, -1, 318, -1, -1, -1, 322, 323, -1, -1, - -1, -1, -1, -1, 330, 331, 264, 265, 334, 267, - -1, 337, 270, 271, -1, -1, 342, 275, 276, 277, - -1, 279, -1, -1, -1, -1, -1, 285, -1, -1, - 288, -1, -1, -1, -1, -1, -1, 295, 364, 365, - -1, -1, 300, -1, 302, 303, 304, -1, -1, -1, - -1, 377, -1, -1, -1, -1, -1, -1, 316, -1, - 318, 319, -1, -1, 322, -1, -1, 325, -1, 327, - -1, 329, 330, 331, 332, -1, 334, -1, -1, 337, - -1, -1, -1, -1, -1, -1, 265, -1, 267, -1, - -1, 270, 418, 272, -1, -1, 275, -1, -1, -1, - 279, 359, 360, 361, 362, -1, -1, -1, -1, 288, - 265, -1, 267, 371, -1, 270, 295, 272, 273, -1, - 275, 300, 277, 302, 279, 304, 281, 282, 283, -1, - -1, -1, 287, 288, -1, -1, -1, 316, 293, 318, - 295, 296, -1, 322, 323, 300, -1, -1, -1, 304, - -1, 330, 331, -1, -1, 334, -1, -1, 337, 417, - 418, 316, -1, 318, -1, -1, -1, 322, 323, -1, - -1, -1, -1, -1, -1, 330, 331, -1, 265, 334, - 267, -1, 337, 270, -1, 272, 273, 342, 275, -1, - 277, -1, 279, -1, 281, 282, 283, -1, -1, -1, - 287, 288, -1, -1, -1, -1, 293, -1, 295, 296, - -1, -1, -1, 300, -1, -1, -1, 304, -1, -1, - -1, -1, 377, -1, -1, -1, -1, -1, -1, 316, - -1, 318, -1, -1, -1, 322, 323, -1, -1, 418, - -1, -1, -1, 330, 331, -1, -1, 334, -1, -1, - 337, -1, 265, -1, 267, 342, -1, 270, -1, -1, - 273, -1, 275, 418, 277, -1, 279, -1, 281, 282, + -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, + 361, 362, 363, -1, -1, -1, -1, -1, -1, -1, + 371, 263, -1, 265, -1, 267, 377, -1, 270, 380, + 272, 273, -1, 275, -1, 277, -1, 279, -1, 281, + 282, 283, -1, -1, -1, 287, 288, -1, -1, -1, + -1, 293, -1, 295, 296, -1, -1, -1, 300, -1, + -1, -1, 304, -1, -1, -1, 417, 418, -1, 420, + -1, -1, -1, 315, 316, -1, 318, -1, -1, -1, + 322, 323, -1, -1, -1, -1, -1, -1, 330, 331, + 264, 265, 334, 267, -1, 337, 270, 271, -1, -1, + 342, 275, 276, 277, -1, 279, -1, -1, -1, -1, + -1, 285, -1, -1, 288, -1, -1, -1, -1, -1, + -1, 295, 364, 365, -1, -1, 300, -1, 302, 303, + 304, -1, -1, -1, -1, 377, -1, -1, -1, -1, + -1, -1, 316, -1, 318, 319, -1, -1, 322, -1, + -1, 325, -1, 327, -1, 329, 330, 331, 332, -1, + 334, -1, -1, 337, -1, -1, -1, -1, -1, -1, + 265, -1, 267, -1, -1, 270, 418, 272, -1, -1, + 275, -1, -1, -1, 279, 359, 360, 361, 362, -1, + -1, -1, -1, 288, 265, -1, 267, 371, -1, 270, + 295, 272, 273, -1, 275, 300, 277, 302, 279, 304, + 281, 282, 283, -1, -1, -1, 287, 288, -1, -1, + -1, 316, 293, 318, 295, 296, -1, 322, 323, 300, + -1, -1, -1, 304, -1, 330, 331, -1, -1, 334, + -1, -1, 337, 417, 418, 316, -1, 318, -1, -1, + -1, 322, 323, -1, -1, -1, -1, -1, -1, 330, + 331, -1, 265, 334, 267, -1, 337, 270, -1, 272, + 273, 342, 275, -1, 277, -1, 279, -1, 281, 282, 283, -1, -1, -1, 287, 288, -1, -1, -1, -1, - 293, -1, 295, -1, 265, -1, 267, 300, -1, 270, - -1, 304, 273, -1, 275, -1, 277, -1, 279, -1, - 281, 282, 283, 316, -1, 318, 287, 288, -1, 322, - -1, -1, 293, -1, 295, -1, -1, 330, 331, 300, - -1, 334, -1, 304, 337, -1, -1, -1, 265, 342, - 267, 418, -1, 270, -1, 316, -1, 318, 275, -1, - -1, 322, 279, -1, -1, -1, -1, -1, -1, 330, - 331, 288, -1, 334, -1, -1, 337, -1, 295, -1, - 265, 342, 267, 300, 377, 270, -1, 304, -1, 306, + 293, -1, 295, 296, -1, -1, -1, 300, -1, -1, + -1, 304, -1, -1, -1, -1, 377, -1, -1, -1, + -1, -1, -1, 316, -1, 318, -1, -1, -1, 322, + 323, -1, -1, 418, -1, -1, -1, 330, 331, -1, + -1, 334, -1, -1, 337, -1, 265, -1, 267, 342, + -1, 270, -1, -1, 273, -1, 275, 418, 277, -1, + 279, -1, 281, 282, 283, -1, -1, -1, 287, 288, + -1, -1, -1, -1, 293, -1, 295, -1, 265, -1, + 267, 300, -1, 270, -1, 304, 273, -1, 275, -1, + 277, -1, 279, -1, 281, 282, 283, 316, -1, 318, + 287, 288, -1, 322, -1, -1, 293, -1, 295, -1, + -1, 330, 331, 300, -1, 334, -1, 304, 337, -1, + -1, -1, 265, 342, 267, 418, -1, 270, -1, 316, + -1, 318, 275, -1, -1, 322, 279, -1, -1, -1, + -1, -1, -1, 330, 331, 288, -1, 334, -1, -1, + 337, -1, 295, -1, 265, 342, 267, 300, 377, 270, + -1, 304, -1, 306, 275, 308, -1, -1, 279, -1, + 313, -1, -1, 316, -1, 318, -1, 288, -1, 322, + -1, -1, 325, -1, 295, -1, -1, 330, 331, 300, + -1, 334, -1, 304, 337, 306, -1, 308, 265, 418, + 267, -1, 313, 270, -1, 316, -1, 318, 275, -1, + -1, 322, 279, -1, 325, -1, -1, -1, -1, 330, + 331, 288, -1, 334, -1, -1, 337, -1, 295, 372, + 265, 418, 267, 300, -1, 270, -1, 304, -1, 306, 275, 308, -1, -1, 279, -1, 313, -1, -1, 316, - -1, 318, -1, 288, -1, 322, -1, -1, 325, -1, + -1, 318, -1, 288, -1, 322, -1, -1, 325, 370, 295, -1, -1, 330, 331, 300, -1, 334, -1, 304, - 337, 306, -1, 308, 265, 418, 267, -1, 313, 270, - -1, 316, -1, 318, 275, -1, -1, 322, 279, -1, - 325, -1, -1, -1, -1, 330, 331, 288, -1, 334, - -1, -1, 337, -1, 295, 372, 265, 418, 267, 300, - -1, 270, -1, 304, -1, 306, 275, 308, -1, -1, - 279, -1, 313, -1, -1, 316, -1, 318, -1, 288, - -1, 322, -1, -1, 325, 370, 295, -1, -1, 330, - 331, 300, -1, 334, -1, 304, 337, 306, -1, -1, - -1, 418, -1, -1, 313, -1, -1, 316, -1, 318, - -1, -1, -1, 322, -1, -1, 325, -1, -1, -1, - -1, 330, 331, -1, -1, 334, -1, 265, 337, 267, - -1, -1, 270, 418, -1, -1, -1, 275, -1, -1, - -1, 279, -1, -1, -1, 283, 265, -1, 267, -1, - 288, 270, -1, -1, -1, 293, 275, 295, -1, -1, - 279, -1, 300, -1, -1, -1, 304, 305, -1, 288, - -1, -1, -1, -1, -1, -1, 295, 418, 316, -1, - 318, 300, -1, -1, 322, 304, -1, -1, -1, -1, - -1, -1, 330, 331, -1, -1, 334, 316, -1, 318, - 265, -1, 267, 322, -1, 270, -1, -1, -1, 418, - 275, 330, 331, -1, 279, 334, -1, 265, 337, 267, - -1, -1, 270, 288, -1, -1, -1, 275, -1, -1, - 295, 279, -1, -1, -1, 300, -1, -1, -1, 304, - 288, -1, -1, -1, -1, -1, -1, 295, -1, -1, - -1, 316, 300, 318, -1, -1, 304, 322, -1, -1, - -1, -1, -1, -1, -1, 330, 331, -1, 316, 334, - 318, 265, 337, 267, 322, -1, 270, -1, -1, -1, - 418, 275, 330, 331, -1, 279, 334, -1, -1, 337, - -1, -1, -1, -1, 288, 265, -1, 267, -1, 418, - 270, 295, -1, -1, -1, 275, 300, -1, -1, 279, - 304, -1, -1, -1, -1, -1, -1, -1, 288, -1, - -1, -1, 316, -1, 318, 295, -1, -1, 322, -1, - 300, -1, -1, -1, 304, -1, 330, 331, -1, -1, - 334, -1, -1, 337, -1, 265, 316, 267, 318, -1, - 270, -1, 322, 418, -1, 275, -1, -1, -1, 279, - 330, 331, -1, -1, 334, -1, -1, 337, 288, 265, - 418, 267, -1, -1, 270, 295, -1, -1, -1, 275, + 337, 306, -1, -1, -1, 418, -1, -1, 313, -1, + -1, 316, -1, 318, -1, -1, -1, 322, -1, -1, + 325, -1, -1, -1, -1, 330, 331, -1, -1, 334, + -1, 265, 337, 267, -1, -1, 270, 418, -1, -1, + -1, 275, -1, -1, -1, 279, -1, -1, -1, 283, + 265, -1, 267, -1, 288, 270, -1, -1, -1, 293, + 275, 295, -1, -1, 279, -1, 300, -1, -1, -1, + 304, 305, -1, 288, -1, -1, -1, -1, -1, -1, + 295, 418, 316, -1, 318, 300, -1, -1, 322, 304, + -1, -1, -1, -1, -1, -1, 330, 331, -1, -1, + 334, 316, -1, 318, 265, -1, 267, 322, -1, 270, + -1, -1, -1, 418, 275, 330, 331, -1, 279, 334, + -1, 265, 337, 267, -1, -1, 270, 288, -1, -1, + -1, 275, -1, -1, 295, 279, -1, -1, -1, 300, + -1, -1, -1, 304, 288, -1, -1, -1, -1, -1, + -1, 295, -1, -1, -1, 316, 300, 318, -1, -1, + 304, 322, -1, -1, -1, -1, -1, -1, -1, 330, + 331, -1, 316, 334, 318, 265, 337, 267, 322, -1, + 270, -1, -1, -1, 418, 275, 330, 331, -1, 279, + 334, -1, -1, 337, -1, -1, -1, -1, 288, 265, + -1, 267, -1, 418, 270, 295, -1, -1, -1, 275, 300, -1, -1, 279, 304, -1, -1, -1, -1, -1, -1, -1, 288, -1, -1, -1, 316, -1, 318, 295, -1, -1, 322, -1, 300, -1, -1, -1, 304, -1, - 330, 331, -1, -1, 334, -1, -1, 337, -1, -1, - 316, -1, 318, 265, 418, 267, 322, -1, 270, -1, - -1, -1, -1, 275, 330, 331, -1, 279, 334, -1, - 265, 337, 267, -1, -1, 270, 288, -1, 418, -1, - 275, -1, -1, 295, 279, -1, -1, -1, 300, -1, - -1, -1, 304, 288, -1, -1, -1, -1, -1, -1, - 295, -1, -1, -1, 316, 300, 318, -1, -1, 304, - 322, -1, -1, -1, -1, -1, -1, -1, 330, 331, - -1, 316, 334, 318, 265, 337, 267, 322, 418, 270, - -1, -1, -1, -1, 275, 330, 331, -1, 279, 334, - -1, -1, 337, -1, -1, -1, -1, 288, 265, -1, - 267, -1, 418, 270, 295, -1, -1, -1, 275, 300, - -1, -1, 279, 304, -1, -1, -1, -1, -1, -1, - -1, 288, -1, -1, -1, 316, -1, 318, 295, -1, - -1, 322, -1, 300, -1, -1, -1, 304, -1, 330, - 331, -1, 261, 334, -1, -1, 337, -1, -1, 316, - -1, 318, -1, 272, -1, 322, 418, -1, 277, -1, - -1, -1, 281, 330, 331, 284, -1, 334, -1, -1, - 337, -1, -1, 418, -1, -1, -1, 296, 297, -1, - -1, -1, 301, 302, -1, 261, -1, -1, 307, -1, - 309, 310, 311, 312, -1, -1, 272, -1, 317, -1, - -1, 277, 321, -1, 323, 281, -1, -1, 284, -1, - -1, -1, -1, -1, 333, -1, 335, 336, -1, 338, - 296, 297, -1, 342, -1, 301, 302, 418, -1, -1, - -1, 307, -1, 309, 310, 311, 312, -1, -1, -1, - -1, 317, -1, 362, -1, 321, -1, 323, -1, 368, - 369, 418, -1, 261, -1, 263, -1, 333, -1, -1, - 336, -1, 338, -1, -1, -1, 342, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 284, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 362, -1, -1, 297, - -1, -1, 368, 369, 302, -1, 261, -1, -1, 307, + 330, 331, -1, -1, 334, -1, -1, 337, -1, 265, + 316, 267, 318, -1, 270, -1, 322, 418, -1, 275, + -1, -1, -1, 279, 330, 331, -1, -1, 334, -1, + -1, 337, 288, 265, 418, 267, -1, -1, 270, 295, + -1, -1, -1, 275, 300, -1, -1, 279, 304, -1, + -1, -1, -1, -1, -1, -1, 288, -1, -1, -1, + 316, -1, 318, 295, -1, -1, 322, -1, 300, -1, + -1, -1, 304, -1, 330, 331, -1, -1, 334, -1, + -1, 337, -1, -1, 316, -1, 318, 265, 418, 267, + 322, -1, 270, -1, -1, -1, -1, 275, 330, 331, + -1, 279, 334, -1, 265, 337, 267, -1, -1, 270, + 288, -1, 418, -1, 275, -1, -1, 295, 279, -1, + -1, -1, 300, -1, -1, -1, 304, 288, -1, -1, + -1, 261, -1, -1, 295, -1, -1, -1, 316, 300, + 318, -1, 272, 304, 322, -1, -1, 277, -1, -1, + -1, 281, 330, 331, 284, 316, 334, 318, -1, 337, + -1, 322, 418, -1, -1, -1, 296, 297, -1, 330, + 331, 301, 302, 334, 261, -1, 337, 307, -1, 309, + 310, 311, 312, -1, -1, 272, 418, 317, -1, -1, + 277, 321, -1, 323, 281, -1, -1, 284, -1, -1, + -1, -1, -1, 333, -1, 335, 336, -1, 338, 296, + 297, -1, 342, -1, 301, 302, -1, -1, -1, -1, + 307, -1, 309, 310, 311, 312, -1, -1, -1, -1, + 317, -1, 362, -1, 321, -1, 323, -1, 368, 369, + 418, -1, -1, 261, -1, -1, 333, -1, -1, 336, + -1, 338, -1, -1, 272, 342, -1, 418, -1, 277, + -1, -1, -1, 281, -1, -1, 284, -1, -1, -1, + -1, -1, -1, -1, -1, 362, -1, -1, 296, 297, + -1, 368, 369, 301, 302, -1, 261, -1, -1, 307, -1, 309, 310, 311, 312, -1, -1, 272, -1, 317, - -1, -1, 277, 321, -1, -1, 281, -1, -1, 284, + -1, -1, 277, 321, -1, 323, 281, -1, -1, 284, -1, -1, -1, -1, -1, 333, -1, -1, 336, -1, - 338, 296, 297, -1, -1, -1, 301, 302, -1, 261, + 338, 296, 297, -1, 342, -1, 301, 302, 261, -1, -1, -1, 307, -1, 309, 310, 311, 312, -1, -1, - 272, -1, 317, -1, 362, 277, 321, -1, 323, 281, - 368, 369, 284, -1, -1, -1, -1, -1, 333, -1, - -1, 336, -1, 338, 296, 297, -1, 342, -1, 301, - 302, 261, -1, -1, -1, 307, -1, 309, 310, 311, - 312, -1, -1, -1, -1, 317, -1, 362, -1, 321, - -1, 323, -1, 368, 284, -1, -1, -1, -1, -1, - -1, 333, -1, -1, 336, -1, 338, 297, -1, 261, - 342, -1, 302, -1, -1, -1, -1, 307, -1, 309, - 310, 311, 312, -1, -1, -1, -1, 317, -1, -1, - 362, 321, 284, -1, -1, -1, 368, -1, -1, -1, - -1, -1, -1, 333, -1, 297, 336, 261, 338, 263, - 302, -1, -1, -1, -1, 307, -1, 309, 310, 311, - 312, -1, -1, -1, -1, 317, -1, -1, -1, 321, - 284, -1, 362, -1, 364, 365, -1, -1, 368, -1, - -1, 333, -1, 297, 336, 261, 338, -1, 302, -1, - -1, -1, -1, 307, -1, 309, 310, 311, 312, -1, - -1, -1, -1, 317, -1, -1, -1, 321, 284, -1, - 362, -1, 364, 365, -1, 261, 368, -1, -1, 333, - -1, 297, 336, -1, 338, -1, 302, -1, -1, -1, - -1, 307, -1, 309, 310, 311, 312, -1, 284, -1, - -1, 317, -1, -1, -1, 321, -1, -1, 362, -1, - -1, 297, -1, -1, 368, 301, 302, 333, 261, -1, - 336, 307, 338, 309, 310, 311, 312, -1, -1, -1, - -1, 317, -1, -1, -1, 321, -1, -1, -1, -1, - -1, 284, -1, -1, -1, -1, 362, 333, 364, 365, - 336, -1, 338, -1, 297, -1, -1, -1, -1, 302, + -1, -1, 317, -1, 362, -1, 321, -1, 323, -1, + 368, 284, -1, -1, -1, -1, -1, -1, 333, -1, + -1, 336, -1, 338, 297, -1, 261, 342, -1, 302, -1, -1, -1, -1, 307, -1, 309, 310, 311, 312, - -1, -1, -1, -1, 317, -1, 362, -1, 321, -1, + -1, -1, -1, -1, 317, -1, -1, 362, 321, 284, + -1, -1, -1, 368, -1, -1, -1, -1, -1, -1, + 333, -1, 297, 336, 261, 338, 263, 302, -1, -1, + -1, -1, 307, -1, 309, 310, 311, 312, -1, -1, + -1, -1, 317, -1, -1, -1, 321, 284, -1, 362, + -1, 364, 365, -1, -1, 368, -1, -1, 333, -1, + 297, 336, 261, 338, -1, 302, -1, -1, -1, -1, + 307, -1, 309, 310, 311, 312, -1, -1, -1, -1, + 317, -1, -1, -1, 321, 284, -1, 362, -1, 364, + 365, -1, 261, 368, 263, -1, 333, -1, 297, 336, + -1, 338, -1, 302, -1, -1, -1, -1, 307, -1, + 309, 310, 311, 312, -1, 284, -1, -1, 317, -1, + -1, -1, 321, -1, -1, 362, -1, -1, 297, -1, + -1, 368, 261, 302, 333, -1, -1, 336, 307, 338, + 309, 310, 311, 312, -1, -1, 315, -1, 317, -1, + -1, -1, 321, -1, -1, 284, -1, -1, -1, -1, + -1, -1, -1, 362, 333, 364, 365, 336, 297, 338, + -1, -1, 301, 302, -1, -1, -1, -1, 307, -1, + 309, 310, 311, 312, -1, -1, -1, -1, 317, -1, + -1, -1, 321, 362, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 333, -1, -1, 336, -1, 338, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 333, -1, -1, 336, -1, 338, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 362, + -1, -1, -1, 362, }; -#line 6274 "cs-parser.jay" +#line 6352 "cs-parser.jay" // // A class used to hold info about an operator declarator @@ -12040,6 +12129,11 @@ void Error_NamedArgumentExpected (NamedArgument a) report.Error (1738, a.Location, "Named arguments must appear after the positional arguments"); } +void Error_MissingInitializer (Location loc) +{ + report.Error (210, loc, "You must provide an initializer in a fixed or using statement declaration"); +} + void push_current_class (TypeContainer tc, object partial_token) { if (module.Evaluator != null && current_container is ModuleContainer){ @@ -12295,6 +12389,7 @@ void start_anonymous (bool isLambda, ParametersCompiled parameters, bool isAsync oob_stack.Push (current_anonymous_method); oob_stack.Push (current_local_parameters); oob_stack.Push (current_variable); + oob_stack.Push (lexer.async_block); current_local_parameters = parameters; if (isLambda) { @@ -12309,6 +12404,7 @@ void start_anonymous (bool isLambda, ParametersCompiled parameters, bool isAsync current_anonymous_method = new AnonymousMethodExpression (isAsync, loc); } + lexer.async_block = isAsync; // Force the next block to be created as a ToplevelBlock parsing_anonymous_method = true; } @@ -12324,6 +12420,7 @@ AnonymousMethodExpression end_anonymous (ParametersBlock anon_block) current_anonymous_method.Block = anon_block; retval = current_anonymous_method; + lexer.async_block = (bool) oob_stack.Pop (); current_variable = (BlockVariableDeclaration) oob_stack.Pop (); current_local_parameters = (ParametersCompiled) oob_stack.Pop (); current_anonymous_method = (AnonymousMethodExpression) oob_stack.Pop (); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.jay b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.jay index 48471ff2a8..09def5b046 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.jay +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-parser.jay @@ -2,14 +2,15 @@ // // cs-parser.jay: The Parser for the C# compiler // -// Authors: Miguel de Icaza (miguel@gnu.org) +// Authors: Miguel de Icaza (miguel@gnome.org) // Ravi Pratap (ravi@ximian.com) -// Marek Safar (marek.safar@gmail.com) +// Marek Safar (marek.safar@gmail.com) // // Dual Licensed under the terms of the GNU GPL and the MIT X11 license // // (C) 2001 Ximian, Inc (http://www.ximian.com) -// (C) 2004 Novell, Inc +// (C) 2004-2011 Novell, Inc +// Copyright 2011 Xamarin Inc. // // TODO: // (1) Figure out why error productions dont work. `type-declaration' is a @@ -143,9 +144,12 @@ namespace Mono.CSharp UsingsBag ubag; List> mod_locations; Location parameterModifierLocation, savedLocation, savedOpenLocation, savedCloseLocation; - Location savedAttrParenOpenLocation, savedAttrParenCloseLocation; + Location savedAttrParenOpenLocation, savedAttrParenCloseLocation, savedOperatorLocation; Stack> locationListStack = new Stack> (); // used for type parameters List attributeCommas = new List (); + List attributeArgumentCommas = new List (); + List parameterListCommas = new List (); + List enumCommas = new List (); object lastYYVal; @@ -542,16 +546,14 @@ namespace_declaration } opt_extern_alias_directives opt_using_directives opt_namespace_or_type_declarations CLOSE_BRACE opt_semicolon { - if ($11 != null) - lbag.AddLocation (current_namespace, GetLocation ($2), GetLocation ($5), GetLocation ($10), GetLocation ($11)); - else - lbag.AddLocation (current_namespace, GetLocation ($2), GetLocation ($5), GetLocation ($10)); - current_namespace = current_namespace.Parent; current_class = current_namespace.SlaveDeclSpace; current_container = current_class.PartialContainer; ubag.CloseNamespace (GetLocation ($10)); - ubag.EndNamespace (GetLocation ($10)); + if ($11 != null) + ubag.EndNamespace (GetLocation ($11)); + else + ubag.EndNamespace (); } ; @@ -564,7 +566,9 @@ qualified_identifier | qualified_identifier DOT IDENTIFIER { var lt = (Tokenizer.LocatedToken) $3; - $$ = new MemberName ((MemberName) $1, lt.Value, lt.Location); + $$ = new MemberName ((MemberName) $1, lt.Value, lt.Location) { + DotLocation = GetLocation ($2) + }; } | error { @@ -670,7 +674,8 @@ attribute_sections { var sect = (List) $1; $$ = new Attributes (sect); - lbag.AddLocation (sect, savedOpenLocation, savedCloseLocation); + if (locationListStack.Count > 0) + lbag.AddLocation (sect, locationListStack.Pop ()); if (attributeCommas.Count > 0) { lbag.AppendTo (sect, attributeCommas); attributeCommas.Clear (); @@ -680,6 +685,9 @@ attribute_sections { Attributes attrs = $1 as Attributes; var sect = (List) $2; + + if (locationListStack.Count > 0) + lbag.AddLocation (sect, locationListStack.Pop ()); if (attrs == null) attrs = new Attributes (sect); else @@ -719,12 +727,20 @@ attribute_section_cont current_attr_target = null; lexer.parsing_attribute_section = false; - savedCloseLocation = GetLocation ($6); + if ($5 != null) { + locationListStack.Push (new List(new [] { savedOpenLocation, savedCloseLocation, GetLocation ($2), GetLocation ($5), GetLocation ($6) })); + } else { + locationListStack.Push (new List(new [] { savedOpenLocation, savedCloseLocation, GetLocation ($2), GetLocation ($6) })); + } } | attribute_list opt_comma CLOSE_BRACKET { $$ = $1; - savedCloseLocation = GetLocation ($3); + if ($2 != null) { + locationListStack.Push (new List(new [] { savedOpenLocation, GetLocation ($2), GetLocation ($3) })); + } else { + locationListStack.Push (new List(new [] { savedOpenLocation, GetLocation ($3) })); + } } ; @@ -733,9 +749,10 @@ attribute_target { var lt = (Tokenizer.LocatedToken) $1; $$ = CheckAttributeTarget (lt.Value, lt.Location); + savedCloseLocation = GetLocation ($1); } - | EVENT { $$ = "event"; } - | RETURN { $$ = "return"; } + | EVENT { $$ = "event"; savedCloseLocation = GetLocation ($1); } + | RETURN { $$ = "return"; savedCloseLocation = GetLocation ($1); } | error { if (yyToken == Token.IDENTIFIER) { @@ -781,7 +798,10 @@ attribute ATypeNameExpression expr = mname.GetTypeExpression (); $$ = new Attribute (current_attr_target, expr, arguments, mname.Location, lexer.IsEscapedIdentifier (mname)); if (arguments != null) { - lbag.AddLocation ($$, savedAttrParenOpenLocation, savedAttrParenCloseLocation); + attributeArgumentCommas.Insert (0, savedAttrParenOpenLocation); + attributeArgumentCommas.Add (savedAttrParenCloseLocation); + lbag.AddLocation ($$, attributeArgumentCommas); + attributeArgumentCommas.Clear (); } } ; @@ -828,7 +848,7 @@ attribute_arguments Error_NamedArgumentExpected ((NamedArgument) args [args.Count - 1]); args.Add ((Argument) $3); - lbag.AppendTo (args, GetLocation ($2)); + attributeArgumentCommas.Add (GetLocation ($2)); } | attribute_arguments COMMA named_attribute_argument { @@ -838,7 +858,7 @@ attribute_arguments } ((Arguments) o [1]).Add ((Argument) $3); - lbag.AppendTo (o[1], GetLocation ($2)); + attributeArgumentCommas.Add (GetLocation ($2)); } ; @@ -875,6 +895,7 @@ named_argument var lt = (Tokenizer.LocatedToken) $1; $$ = new NamedArgument (lt.Value, lt.Location, (Expression) $4, arg_mod); + lbag.AddLocation ($$, GetLocation($2)); } ; @@ -897,8 +918,13 @@ opt_class_member_declarations class_member_declarations : class_member_declaration - | class_member_declarations - class_member_declaration + { + lexer.parsing_modifiers = true; + } + | class_member_declarations class_member_declaration + { + lexer.parsing_modifiers = true; + } ; class_member_declaration @@ -933,6 +959,7 @@ struct_declaration { MemberName name = MakeName ((MemberName) $6); push_current_class (new Struct (current_namespace, current_class, name, (Modifiers) $2, (Attributes) $1), $3); + lbag.AddMember (current_class, GetModifierLocations (), GetLocation ($4)); } opt_class_base opt_type_parameter_constraints_clauses @@ -944,17 +971,25 @@ struct_declaration if (doc_support) current_container.DocComment = Lexer.consume_doc_comment (); - lbag.AddMember (current_class, GetModifierLocations (), GetLocation ($4)); + + lexer.parsing_modifiers = true; } - struct_body + OPEN_BRACE { - --lexer.parsing_declaration; + if (doc_support) + Lexer.doc_state = XmlCommentState.Allowed; + } + opt_class_member_declarations CLOSE_BRACE + { + lbag.AppendToMember (current_class, GetLocation ($11), GetLocation ($13)); + --lexer.parsing_declaration; if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } opt_semicolon { - lbag.AppendToMember (current_class, GetLocation ($13)); + if ($15 != null) + current_class.OptionalSemicolon = GetLocation ($15); $$ = pop_current_class (); } | opt_attributes opt_modifiers opt_partial STRUCT error @@ -962,46 +997,6 @@ struct_declaration Error_SyntaxError (yyToken); } ; - -struct_body - : OPEN_BRACE - { - if (doc_support) - Lexer.doc_state = XmlCommentState.Allowed; - } - opt_struct_member_declarations CLOSE_BRACE - { - lbag.AppendToMember (current_class, GetLocation ($1), GetLocation ($4)); - } - ; - -opt_struct_member_declarations - : /* empty */ - | struct_member_declarations - ; - -struct_member_declarations - : struct_member_declaration - | struct_member_declarations struct_member_declaration - ; - -struct_member_declaration - : constant_declaration - | field_declaration - | method_declaration - | property_declaration - | event_declaration - | indexer_declaration - | operator_declaration - | constructor_declaration - | type_declaration - - /* - * This is only included so we can flag error 575: - * destructors only allowed on class types - */ - | destructor_declaration - ; constant_declaration : opt_attributes @@ -1257,15 +1252,19 @@ method_declaration if (doc_support) Lexer.doc_state = XmlCommentState.NotAllowed; - // Add it early in the case of body being eof for full aot - current_container.AddMethod ((Method) $1); + // Add it early in the case of body being eof for full ast + Method m = (Method) $1; + lexer.async_block = (m.ModFlags & Modifiers.ASYNC) != 0; + current_container.AddMethod (m); } method_body { Method method = (Method) $1; method.Block = (ToplevelBlock) $3; + lexer.async_block = false; if (method.Block == null) { + lbag.AppendToMember (method, savedLocation); // semicolon method.ParameterInfo.CheckParameters (method); if ((method.ModFlags & Modifiers.ASYNC) != 0) { @@ -1421,7 +1420,7 @@ method_header method_body : block - | SEMICOLON { $$ = null; } + | SEMICOLON { savedLocation = GetLocation ($1); $$ = null; } ; opt_formal_parameter_list @@ -1434,20 +1433,25 @@ formal_parameter_list { var pars_list = (List) $1; $$ = new ParametersCompiled (pars_list.ToArray ()); - lbag.AddLocation ($$, lbag.GetLocations (pars_list)); + lbag.AddLocation ($$, parameterListCommas); } | fixed_parameters COMMA parameter_array { var pars_list = (List) $1; pars_list.Add ((Parameter) $3); - + parameterListCommas.Add (GetLocation ($2)); + $$ = new ParametersCompiled (pars_list.ToArray ()); + lbag.AddLocation ($$, parameterListCommas); } | fixed_parameters COMMA arglist_modifier { var pars_list = (List) $1; pars_list.Add (new ArglistParameter (GetLocation ($3))); + parameterListCommas.Add (GetLocation ($2)); + $$ = new ParametersCompiled (pars_list.ToArray (), true); + lbag.AddLocation ($$, parameterListCommas); } | parameter_array COMMA error { @@ -1455,6 +1459,7 @@ formal_parameter_list report.Error (231, ((Parameter) $1).Location, "A params parameter must be the last parameter in a formal parameter list"); $$ = new ParametersCompiled (new Parameter[] { (Parameter) $1 } ); + lbag.AddLocation ($$, parameterListCommas); } | fixed_parameters COMMA parameter_array COMMA error { @@ -1463,14 +1468,18 @@ formal_parameter_list var pars_list = (List) $1; pars_list.Add (new ArglistParameter (GetLocation ($3))); - + parameterListCommas.Add (GetLocation ($2)); + parameterListCommas.Add (GetLocation ($4)); + $$ = new ParametersCompiled (pars_list.ToArray (), true); + lbag.AddLocation ($$, parameterListCommas); } | arglist_modifier COMMA error { report.Error (257, GetLocation ($1), "An __arglist parameter must be the last parameter in a formal parameter list"); $$ = new ParametersCompiled (new Parameter [] { new ArglistParameter (GetLocation ($1)) }, true); + lbag.AddLocation ($$, parameterListCommas); } | fixed_parameters COMMA ARGLIST COMMA error { @@ -1478,8 +1487,11 @@ formal_parameter_list var pars_list = (List) $1; pars_list.Add (new ArglistParameter (GetLocation ($3))); + parameterListCommas.Add (GetLocation ($2)); + parameterListCommas.Add (GetLocation ($4)); $$ = new ParametersCompiled (pars_list.ToArray (), true); + lbag.AddLocation ($$, parameterListCommas); } | parameter_array { @@ -1502,7 +1514,7 @@ fixed_parameters parameters_bucket.Clear (); Parameter p = (Parameter) $1; parameters_bucket.Add (p); - + parameterListCommas.Clear (); default_parameter_used = p.HasDefaultValue; $$ = parameters_bucket; } @@ -1519,7 +1531,7 @@ fixed_parameters default_parameter_used |= p.HasDefaultValue; pars.Add (p); - lbag.AppendTo (pars, GetLocation ($2)); + parameterListCommas.Add (GetLocation ($2)); } $$ = $1; @@ -1612,7 +1624,6 @@ parameter_modifiers : parameter_modifier { $$ = $1; - parameterModifierLocation = GetLocation ($1); } | parameter_modifiers parameter_modifier { @@ -1642,14 +1653,14 @@ parameter_modifier { if ((valid_param_mod & ParameterModifierType.Ref) == 0) Error_ParameterModifierNotValid ("ref", GetLocation ($1)); - + parameterModifierLocation = GetLocation ($1); $$ = Parameter.Modifier.REF; } | OUT { if ((valid_param_mod & ParameterModifierType.Out) == 0) Error_ParameterModifierNotValid ("out", GetLocation ($1)); - + parameterModifierLocation = GetLocation ($1); $$ = Parameter.Modifier.OUT; } | THIS @@ -1659,7 +1670,7 @@ parameter_modifier if (lang_version <= LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation ($1), "extension methods"); - + parameterModifierLocation = GetLocation ($1); $$ = Parameter.Modifier.This; } ; @@ -1669,6 +1680,7 @@ parameter_array { var lt = (Tokenizer.LocatedToken) $4; $$ = new ParamsParameter ((FullNamedExpression) $3, lt.Value, (Attributes) $1, lt.Location); + lbag.AddLocation ($$, savedLocation); } | opt_attributes params_modifier type IDENTIFIER ASSIGN constant_expression { @@ -1676,6 +1688,7 @@ parameter_array var lt = (Tokenizer.LocatedToken) $4; $$ = new ParamsParameter ((FullNamedExpression) $3, lt.Value, (Attributes) $1, lt.Location); + lbag.AddLocation ($$, savedLocation); } | opt_attributes params_modifier type error { @@ -1689,6 +1702,7 @@ params_modifier { if ((valid_param_mod & ParameterModifierType.Params) == 0) report.Error (1670, (GetLocation ($1)), "The `params' modifier is not allowed in current context"); + savedLocation = GetLocation ($1); } | PARAMS parameter_modifier { @@ -1698,6 +1712,7 @@ params_modifier } else { report.Error (1611, GetLocation ($1), "The params parameter cannot be declared as ref or out"); } + savedLocation = GetLocation ($1); } | PARAMS params_modifier { @@ -1838,7 +1853,6 @@ get_accessor_declaration } current_local_parameters = current_property.Get.ParameterInfo; - lbag.AddMember (current_property.Get, GetModifierLocations ()); lexer.PropertyParsing = false; } accessor_body @@ -1849,7 +1863,10 @@ get_accessor_declaration if (current_container.Kind == MemberKind.Interface) { report.Error (531, current_property.Get.Block.StartLocation, "`{0}': interface members cannot have a definition", current_property.Get.GetSignatureForError ()); - } + } + lbag.AddMember (current_property.Get, GetModifierLocations ()); + } else { + lbag.AddMember (current_property.Get, GetModifierLocations (), savedLocation); } current_local_parameters = null; @@ -1886,7 +1903,6 @@ set_accessor_declaration } current_local_parameters = current_property.Set.ParameterInfo; - lbag.AddMember (current_property.Set, GetModifierLocations ()); lexer.PropertyParsing = false; } accessor_body @@ -1898,6 +1914,9 @@ set_accessor_declaration report.Error (531, current_property.Set.Block.StartLocation, "`{0}': interface members cannot have a definition", current_property.Set.GetSignatureForError ()); } + lbag.AddMember (current_property.Set, GetModifierLocations ()); + } else { + lbag.AddMember (current_property.Set, GetModifierLocations (), savedLocation); } current_local_parameters = null; @@ -1913,7 +1932,7 @@ accessor_body : block | SEMICOLON { - lbag.AppendToMember (lbag.LastMember, GetLocation ($1)); + savedLocation = GetLocation ($1); $$ = null; } | error @@ -1948,6 +1967,8 @@ interface_declaration current_container.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } + + lexer.parsing_modifiers = true; } OPEN_BRACE opt_interface_member_declarations CLOSE_BRACE { @@ -1957,7 +1978,9 @@ interface_declaration } opt_semicolon { - lbag.AppendToMember (current_class, GetLocation ($11), GetLocation ($13)); + if ($15 != null) + current_class.OptionalSemicolon = GetLocation ($15); + lbag.AppendToMember (current_class, GetLocation ($11), GetLocation ($13)); $$ = pop_current_class (); } | opt_attributes opt_modifiers opt_partial INTERFACE error @@ -1973,7 +1996,13 @@ opt_interface_member_declarations interface_member_declarations : interface_member_declaration + { + lexer.parsing_modifiers = true; + } | interface_member_declarations interface_member_declaration + { + lexer.parsing_modifiers = true; + } ; interface_member_declaration @@ -2028,6 +2057,9 @@ operator_declaration current_container.AddOperator (op); lbag.AddMember (op, GetModifierLocations (), lbag.GetLocations (decl)); + if ($5 == null) { // Semicolon + lbag.AppendTo (op, savedLocation); + } } current_local_parameters = null; @@ -2036,7 +2068,7 @@ operator_declaration operator_body : block - | SEMICOLON { $$ = null; } + | SEMICOLON { savedLocation = GetLocation ($1); $$ = null; } ; operator_type @@ -2091,37 +2123,37 @@ operator_declarator } $$ = new OperatorDeclaration (op, (FullNamedExpression) $1, loc); - lbag.AddLocation ($$, GetLocation ($2), GetLocation ($3), GetLocation ($4), GetLocation ($7)); + lbag.AddLocation ($$, GetLocation ($2), savedOperatorLocation, GetLocation ($4), GetLocation ($7)); } | conversion_operator_declarator ; overloadable_operator // Unary operators: - : BANG { $$ = Operator.OpType.LogicalNot; } - | TILDE { $$ = Operator.OpType.OnesComplement; } - | OP_INC { $$ = Operator.OpType.Increment; } - | OP_DEC { $$ = Operator.OpType.Decrement; } - | TRUE { $$ = Operator.OpType.True; } - | FALSE { $$ = Operator.OpType.False; } + : BANG { $$ = Operator.OpType.LogicalNot; savedOperatorLocation = GetLocation ($1); } + | TILDE { $$ = Operator.OpType.OnesComplement; savedOperatorLocation = GetLocation ($1); } + | OP_INC { $$ = Operator.OpType.Increment; savedOperatorLocation = GetLocation ($1); } + | OP_DEC { $$ = Operator.OpType.Decrement; savedOperatorLocation = GetLocation ($1); } + | TRUE { $$ = Operator.OpType.True; savedOperatorLocation = GetLocation ($1); } + | FALSE { $$ = Operator.OpType.False; savedOperatorLocation = GetLocation ($1); } // Unary and binary: - | PLUS { $$ = Operator.OpType.Addition; } - | MINUS { $$ = Operator.OpType.Subtraction; } + | PLUS { $$ = Operator.OpType.Addition; savedOperatorLocation = GetLocation ($1); } + | MINUS { $$ = Operator.OpType.Subtraction; savedOperatorLocation = GetLocation ($1); } // Binary: - | STAR { $$ = Operator.OpType.Multiply; } - | DIV { $$ = Operator.OpType.Division; } - | PERCENT { $$ = Operator.OpType.Modulus; } - | BITWISE_AND { $$ = Operator.OpType.BitwiseAnd; } - | BITWISE_OR { $$ = Operator.OpType.BitwiseOr; } - | CARRET { $$ = Operator.OpType.ExclusiveOr; } - | OP_SHIFT_LEFT { $$ = Operator.OpType.LeftShift; } - | OP_SHIFT_RIGHT { $$ = Operator.OpType.RightShift; } - | OP_EQ { $$ = Operator.OpType.Equality; } - | OP_NE { $$ = Operator.OpType.Inequality; } - | OP_GT { $$ = Operator.OpType.GreaterThan; } - | OP_LT { $$ = Operator.OpType.LessThan; } - | OP_GE { $$ = Operator.OpType.GreaterThanOrEqual; } - | OP_LE { $$ = Operator.OpType.LessThanOrEqual; } + | STAR { $$ = Operator.OpType.Multiply; savedOperatorLocation = GetLocation ($1); } + | DIV { $$ = Operator.OpType.Division; savedOperatorLocation = GetLocation ($1); } + | PERCENT { $$ = Operator.OpType.Modulus; savedOperatorLocation = GetLocation ($1); } + | BITWISE_AND { $$ = Operator.OpType.BitwiseAnd; savedOperatorLocation = GetLocation ($1); } + | BITWISE_OR { $$ = Operator.OpType.BitwiseOr; savedOperatorLocation = GetLocation ($1); } + | CARRET { $$ = Operator.OpType.ExclusiveOr; savedOperatorLocation = GetLocation ($1); } + | OP_SHIFT_LEFT { $$ = Operator.OpType.LeftShift; savedOperatorLocation = GetLocation ($1); } + | OP_SHIFT_RIGHT { $$ = Operator.OpType.RightShift; savedOperatorLocation = GetLocation ($1); } + | OP_EQ { $$ = Operator.OpType.Equality; savedOperatorLocation = GetLocation ($1); } + | OP_NE { $$ = Operator.OpType.Inequality; savedOperatorLocation = GetLocation ($1); } + | OP_GT { $$ = Operator.OpType.GreaterThan; savedOperatorLocation = GetLocation ($1); } + | OP_LT { $$ = Operator.OpType.LessThan; savedOperatorLocation = GetLocation ($1); } + | OP_GE { $$ = Operator.OpType.GreaterThanOrEqual; savedOperatorLocation = GetLocation ($1); } + | OP_LE { $$ = Operator.OpType.LessThanOrEqual; savedOperatorLocation = GetLocation ($1); } ; conversion_operator_declarator @@ -2531,7 +2563,11 @@ event_accessor_block enum_declaration : opt_attributes opt_modifiers - ENUM type_declaration_name + ENUM + { + enumCommas.Add (GetLocation ($3)); + } + type_declaration_name opt_enum_base { if (doc_support) @@ -2541,13 +2577,14 @@ enum_declaration { if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; + enumCommas.Add (GetLocation ($8)); - MemberName name = (MemberName) $4; + MemberName name = (MemberName) $5; if (name.IsGeneric) { report.Error (1675, name.Location, "Enums cannot have type parameters"); } - push_current_class (new Enum (current_namespace, current_class, (TypeExpression) $5, (Modifiers) $2, MakeName (name), (Attributes) $1), null); + push_current_class (new Enum (current_namespace, current_class, (TypeExpression) $6, (Modifiers) $2, MakeName (name), (Attributes) $1), null); } opt_enum_member_declarations { @@ -2557,15 +2594,16 @@ enum_declaration } CLOSE_BRACE opt_semicolon { + enumCommas.Add (GetLocation ($12)); + if ($13 != null) + current_class.OptionalSemicolon = GetLocation ($13); if (doc_support) current_class.DocComment = enumTypeComment; --lexer.parsing_declaration; -// if (doc_support) -// em.DocComment = ev.DocComment; - - lbag.AddMember (current_class, GetModifierLocations (), GetLocation ($3), GetLocation ($7), GetLocation ($11)); + lbag.AddMember (current_class, GetModifierLocations (), enumCommas); + enumCommas.Clear (); $$ = pop_current_class (); } ; @@ -2579,6 +2617,7 @@ opt_enum_base Enum.Error_1008 (GetLocation ($2), report); $$ = null; } else { + enumCommas.Add (GetLocation ($1)); $$ = $2; } } @@ -2594,7 +2633,7 @@ opt_enum_member_declarations | enum_member_declarations | enum_member_declarations COMMA { - lbag.AddLocation ($1, GetLocation ($2)); + enumCommas.Add (GetLocation ($2)); } ; @@ -2602,7 +2641,7 @@ enum_member_declarations : enum_member_declaration | enum_member_declarations COMMA enum_member_declaration { - lbag.AddLocation ($1, GetLocation ($2)); + enumCommas.Add (GetLocation ($2)); $$ = $3; } ; @@ -2719,8 +2758,9 @@ member_name | namespace_or_type_name DOT IDENTIFIER opt_type_argument_list { var lt = (Tokenizer.LocatedToken) $3; - $$ = new MemberName ((MemberName) $1, lt.Value, (TypeArguments) $4, lt.Location); - lbag.AddLocation ($$, GetLocation ($2)); + $$ = new MemberName ((MemberName) $1, lt.Value, (TypeArguments) $4, lt.Location) { + DotLocation = GetLocation ($2) + }; } ; @@ -2817,7 +2857,7 @@ indexer_declaration_name | explicit_interface THIS { lexer.parsing_generic_declaration = false; - $$ = new MemberName ((MemberName) $1, TypeContainer.DefaultIndexerName, null, GetLocation ($1)); + $$ = new MemberName ((MemberName) $1, TypeContainer.DefaultIndexerName, null, GetLocation ($2)); } ; @@ -2852,7 +2892,7 @@ opt_type_parameter_list FeatureIsNotAvailable (GetLocation ($1), "generics"); $$ = $2; - lbag.AddLocation ($$, GetLocation ($1), GetLocation ($3)); + lbag.AppendTo ($$, GetLocation ($1), GetLocation ($3)); } ; @@ -2868,7 +2908,7 @@ type_parameters TypeArguments type_args = (TypeArguments) $1; type_args.Add ((FullNamedExpression)$3); $$ = type_args; - lbag.AddLocation ($3, GetLocation ($3)); + lbag.AppendTo (type_args, GetLocation ($2)); } ; @@ -2876,7 +2916,10 @@ type_parameter : opt_attributes opt_type_parameter_variance IDENTIFIER { var lt = (Tokenizer.LocatedToken)$3; - $$ = new TypeParameterName (lt.Value, (Attributes)$1, (Variance) $2, lt.Location); + var variance = (Variance) $2; + $$ = new TypeParameterName (lt.Value, (Attributes)$1, variance, lt.Location); + if (variance != Variance.None) + lbag.AddLocation ($$, savedLocation); } | error { @@ -3124,20 +3167,23 @@ member_access : primary_expression DOT IDENTIFIER opt_type_argument_list { var lt = (Tokenizer.LocatedToken) $3; - $$ = new MemberAccess ((Expression) $1, lt.Value, (TypeArguments) $4, lt.Location); - lbag.AddLocation ($$, GetLocation ($2)); + $$ = new MemberAccess ((Expression) $1, lt.Value, (TypeArguments) $4, lt.Location) { + DotLocation = GetLocation ($2) + }; } | builtin_types DOT IDENTIFIER opt_type_argument_list { var lt = (Tokenizer.LocatedToken) $3; - $$ = new MemberAccess ((Expression) $1, lt.Value, (TypeArguments) $4, lt.Location); - lbag.AddLocation ($$, GetLocation ($2)); + $$ = new MemberAccess ((Expression) $1, lt.Value, (TypeArguments) $4, lt.Location) { + DotLocation = GetLocation ($2) + }; } | BASE DOT IDENTIFIER opt_type_argument_list { var lt = (Tokenizer.LocatedToken) $3; - $$ = new MemberAccess (new BaseThis (GetLocation ($1)), lt.Value, (TypeArguments) $4, lt.Location); - lbag.AddLocation ($$, GetLocation ($2)); + $$ = new MemberAccess (new BaseThis (GetLocation ($1)), lt.Value, (TypeArguments) $4, lt.Location) { + DotLocation = GetLocation ($2) + }; } | qualified_alias_member IDENTIFIER opt_type_argument_list { @@ -3703,13 +3749,17 @@ unbound_type_name { var lt = (Tokenizer.LocatedToken) $3; - $$ = new MemberAccess ((Expression) $1, lt.Value, lt.Location); + $$ = new MemberAccess ((Expression) $1, lt.Value, lt.Location) { + DotLocation = GetLocation ($2) + }; } | unbound_type_name DOT IDENTIFIER generic_dimension { var lt = (Tokenizer.LocatedToken) $3; - $$ = new MemberAccess ((Expression) $1, lt.Value, (int) $4, lt.Location); + $$ = new MemberAccess ((Expression) $1, lt.Value, (int) $4, lt.Location) { + DotLocation = GetLocation ($2) + }; } | namespace_or_type_name DOT IDENTIFIER generic_dimension { @@ -3718,7 +3768,9 @@ unbound_type_name Error_TypeExpected (GetLocation ($4)); var lt = (Tokenizer.LocatedToken) $3; - $$ = new MemberAccess (te, lt.Value, (int) $4, lt.Location); + $$ = new MemberAccess (te, lt.Value, (int) $4, lt.Location) { + DotLocation = GetLocation ($2) + }; } ; @@ -3856,10 +3908,10 @@ cast_expression await_expression : AWAIT unary_expression - { + { current_block.ParametersBlock.IsAsync = true; $$ = new Await ((Expression) $2, GetLocation ($1)); - } + } ; // @@ -4118,7 +4170,7 @@ lambda_parameter_list { var pars = new List (4); pars.Add ((Parameter) $1); - + parameterListCommas.Clear (); $$ = pars; } | lambda_parameter_list COMMA lambda_parameter @@ -4130,7 +4182,7 @@ lambda_parameter_list } pars.Add (p); - lbag.AppendTo (pars, GetLocation ($2)); + parameterListCommas.Add (GetLocation ($2)); $$ = pars; } @@ -4161,6 +4213,7 @@ opt_lambda_parameter_list | lambda_parameter_list { var pars_list = (List) $1; $$ = new ParametersCompiled (pars_list.ToArray ()); + lbag.AddLocation ($$, parameterListCommas); } ; @@ -4306,8 +4359,9 @@ class_declaration if (((c.ModFlags & Modifiers.STATIC) != 0) && lang_version == LanguageVersion.ISO_1) { FeatureIsNotAvailable (c.Location, "static classes"); } - + push_current_class (c, $3); + lbag.AddMember (current_class, GetModifierLocations (), GetLocation ($4)); } opt_class_base opt_type_parameter_constraints_clauses @@ -4315,12 +4369,13 @@ class_declaration lexer.ConstraintsParsing = false; current_class.SetParameterInfo ((List) $9); - lbag.AddMember (current_class, GetModifierLocations (), GetLocation ($4)); if (doc_support) { current_container.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } + + lexer.parsing_modifiers = true; } OPEN_BRACE opt_class_member_declarations CLOSE_BRACE { @@ -4330,7 +4385,9 @@ class_declaration } opt_semicolon { - lbag.AppendToMember (current_class, GetLocation ($11), GetLocation ($13), GetLocation ($15)); + lbag.AppendToMember (current_class, GetLocation ($11), GetLocation ($13)); + if ($15 != null) + current_class.OptionalSemicolon = GetLocation ($15); $$ = pop_current_class (); } ; @@ -4347,8 +4404,12 @@ opt_modifiers { mod_locations = null; $$ = ModifierNone; + lexer.parsing_modifiers = false; } | modifiers + { + lexer.parsing_modifiers = false; + } ; modifiers @@ -4458,6 +4519,7 @@ opt_class_base : /* empty */ | COLON type_list { + lbag.AppendToMember (current_class, GetLocation ($1)); current_container.AddBasesForPart (current_class, (List) $2); } ; @@ -4505,6 +4567,7 @@ type_parameter_constraints_clause { var lt = (Tokenizer.LocatedToken) $2; $$ = new Constraints (new SimpleMemberName (lt.Value, lt.Location), (List) $4, GetLocation ($1)); + lbag.AddLocation ($$, GetLocation ($3)); } ; @@ -4536,6 +4599,7 @@ type_parameter_constraints } constraints.Add ((FullNamedExpression) $3); + lbag.AppendTo (constraints, GetLocation ($2)); $$ = constraints; } ; @@ -4581,10 +4645,12 @@ type_parameter_variance : OUT { $$ = Variance.Covariant; + savedLocation = GetLocation ($1); } | IN { $$ = Variance.Contravariant; + savedLocation = GetLocation ($1); } ; @@ -4754,7 +4820,7 @@ labeled_statement { var lt = (Tokenizer.LocatedToken) $1; LabeledStatement labeled = new LabeledStatement (lt.Value, current_block, lt.Location); - + lbag.AddLocation (labeled, GetLocation ($2)); current_block.AddLabel (labeled); current_block.AddStatement (labeled); } @@ -4914,6 +4980,17 @@ opt_variable_declarators | variable_declarators ; +opt_using_or_fixed_variable_declarators + : /* empty */ + | variable_declarators + { + foreach (var d in current_variable.Declarators) { + if (d.Initializer == null) + Error_MissingInitializer (d.Variable.Location); + } + } + ; + variable_declarators : variable_declarator | variable_declarators variable_declarator @@ -5524,7 +5601,7 @@ fixed_statement current_block.AddLocalName (li); current_variable = new Fixed.VariableDeclaration ((FullNamedExpression) $3, li); } - using_or_fixed_variable_initializer opt_variable_declarators CLOSE_PARENS + using_or_fixed_variable_initializer opt_using_or_fixed_variable_declarators CLOSE_PARENS { $$ = current_variable; current_variable = null; @@ -5552,7 +5629,7 @@ using_statement current_block.AddLocalName (li); current_variable = new Using.VariableDeclaration ((FullNamedExpression) $3, li); } - using_or_fixed_variable_initializer opt_variable_declarators CLOSE_PARENS + using_or_fixed_variable_initializer opt_using_or_fixed_variable_declarators CLOSE_PARENS { $$ = current_variable; current_variable = null; @@ -5581,11 +5658,12 @@ using_statement using_or_fixed_variable_initializer : /* empty */ { - report.Error (210, lexer.Location, "You must provide an initializer in a fixed or using statement declaration"); + Error_MissingInitializer (lexer.Location); } | ASSIGN variable_initializer { current_variable.Initializer = (Expression) $2; + lbag.AppendTo (current_variable, GetLocation ($1)); $$ = current_variable; } ; @@ -6329,6 +6407,11 @@ void Error_NamedArgumentExpected (NamedArgument a) report.Error (1738, a.Location, "Named arguments must appear after the positional arguments"); } +void Error_MissingInitializer (Location loc) +{ + report.Error (210, loc, "You must provide an initializer in a fixed or using statement declaration"); +} + void push_current_class (TypeContainer tc, object partial_token) { if (module.Evaluator != null && current_container is ModuleContainer){ @@ -6584,6 +6667,7 @@ void start_anonymous (bool isLambda, ParametersCompiled parameters, bool isAsync oob_stack.Push (current_anonymous_method); oob_stack.Push (current_local_parameters); oob_stack.Push (current_variable); + oob_stack.Push (lexer.async_block); current_local_parameters = parameters; if (isLambda) { @@ -6598,6 +6682,7 @@ void start_anonymous (bool isLambda, ParametersCompiled parameters, bool isAsync current_anonymous_method = new AnonymousMethodExpression (isAsync, loc); } + lexer.async_block = isAsync; // Force the next block to be created as a ToplevelBlock parsing_anonymous_method = true; } @@ -6613,6 +6698,7 @@ AnonymousMethodExpression end_anonymous (ParametersBlock anon_block) current_anonymous_method.Block = anon_block; retval = current_anonymous_method; + lexer.async_block = (bool) oob_stack.Pop (); current_variable = (BlockVariableDeclaration) oob_stack.Pop (); current_local_parameters = (ParametersCompiled) oob_stack.Pop (); current_anonymous_method = (AnonymousMethodExpression) oob_stack.Pop (); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-tokenizer.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-tokenizer.cs index 6054c44625..e87f7676a7 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-tokenizer.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/cs-tokenizer.cs @@ -3,13 +3,13 @@ // This also implements the preprocessor // // Author: Miguel de Icaza (miguel@gnu.org) -// Marek Safar (marek.safar@seznam.cz) +// Marek Safar (marek.safar@gmail.com) // // Dual licensed under the terms of the MIT X11 or GNU GPL // // Copyright 2001, 2002 Ximian, Inc (http://www.ximian.com) // Copyright 2004-2008 Novell, Inc -// +// Copyright 2011 Xamarin, Inc (http://www.xamarin.com) // using System; using System.Text; @@ -205,6 +205,10 @@ namespace Mono.CSharp public int parsing_declaration; public bool parsing_attribute_section; + public bool parsing_modifiers; + + public bool async_block; + // // The special characters to inject on streams to run the unit parser // in the special expression mode. Using private characters from @@ -787,18 +791,47 @@ namespace Mono.CSharp res = -1; break; - // TODO: async, it's modifiers context only case Token.ASYNC: - if (context.Settings.Version != LanguageVersion.Future) { + if (parsing_modifiers) { + // + // Skip attributes section or constructor called async + // + if (parsing_attribute_section || peek_token () == Token.OPEN_PARENS) { + res = -1; + } else { + // async is keyword + } + } else if (parsing_block > 0) { + switch (peek_token ()) { + case Token.DELEGATE: + case Token.OPEN_PARENS_LAMBDA: + // async is keyword + break; + case Token.IDENTIFIER: + PushPosition (); + xtoken (); + if (xtoken () != Token.ARROW) + res = -1; + + PopPosition (); + break; + default: + res = -1; + break; + } + } else { res = -1; } + + if (res == Token.ASYNC && context.Settings.Version <= LanguageVersion.V_4) { + Report.FeatureIsNotAvailable (context, Location, "asynchronous functions"); + } + break; - // TODO: async, it's async block context only case Token.AWAIT: - if (context.Settings.Version != LanguageVersion.Future) { + if (!async_block) res = -1; - } break; } @@ -1833,7 +1866,8 @@ namespace Mono.CSharp var cmd = GetPreprocessorDirective (id_builder, TokenizePreprocessorIdentifier (out c, out endLine, out endCol)); if ((cmd & PreprocessorDirective.CustomArgumentsParsing) != 0) { - sbag.AddPreProcessorDirective (startLine, startCol, line, col, cmd, null); + if (position_stack.Count == 0) + sbag.AddPreProcessorDirective (startLine, startCol, line, col, cmd, null); return cmd; } @@ -1899,7 +1933,8 @@ namespace Mono.CSharp // Eat any trailing whitespaces arg = arg.Trim (simple_whitespaces); } - sbag.AddPreProcessorDirective (startLine, startCol, endLine, endCol, cmd, arg); + if (position_stack.Count == 0) + sbag.AddPreProcessorDirective (startLine, startCol, endLine, endCol, cmd, arg); return cmd; } @@ -2196,14 +2231,16 @@ namespace Mono.CSharp { if (peek_char () != '/') Report.Warning (1696, 1, Location, "Single-line comment or end-of-line expected"); - sbag.StartComment (SpecialsBag.CommentType.Single, startsLine, line, col - 1); + if (position_stack.Count == 0) + sbag.StartComment (SpecialsBag.CommentType.Single, startsLine, line, col - 1); // Read everything till the end of the line or file int c; do { c = get_char (); - sbag.PushCommentChar (c); + if (position_stack.Count == 0) + sbag.PushCommentChar (c); var pc = peek_char (); - if (pc == '\n' || pc == -1) + if (pc == '\n' || pc == -1 && position_stack.Count == 0) sbag.EndComment (line, col + 1); } while (c != -1 && c != '\n'); } @@ -2541,6 +2578,7 @@ namespace Mono.CSharp ifstack.Push (flags | TAKING); return true; } + sbag.SkipIf (); ifstack.Push (flags); return false; @@ -3149,17 +3187,16 @@ namespace Mono.CSharp get_char (); return Token.OP_DIV_ASSIGN; } - // Handle double-slash comments. if (d == '/') { get_char (); if (doc_processing) { if (peek_char () == '/') { - sbag.StartComment (SpecialsBag.CommentType.Documentation, startsLine, line, col - 1); get_char (); // Don't allow ////. if ((d = peek_char ()) != '/') { - sbag.PushCommentChar (d); + if (position_stack.Count == 0) + sbag.PushCommentChar (d); if (doc_state == XmlCommentState.Allowed) handle_one_line_xml_comment (); else if (doc_state == XmlCommentState.NotAllowed) @@ -3171,39 +3208,41 @@ namespace Mono.CSharp } } else { bool isDoc = peek_char () == '/'; - sbag.StartComment (isDoc ? SpecialsBag.CommentType.Documentation : SpecialsBag.CommentType.Single, startsLine, line, col - 1); + if (position_stack.Count == 0) + sbag.StartComment (isDoc ? SpecialsBag.CommentType.Documentation : SpecialsBag.CommentType.Single, startsLine, line, col - 1); if (isDoc) get_char (); } d = peek_char (); - if (d == '\n' || d == '\r') - sbag.EndComment (line, col + 1); while ((d = get_char ()) != -1 && (d != '\n') && d != '\r') { - sbag.PushCommentChar (d); - var pc = peek_char (); - if (pc == -1 || pc == '\n' || pc == '\r') { - sbag.EndComment (line, col + 1); - } + if (position_stack.Count == 0) + sbag.PushCommentChar (d); } + if (position_stack.Count == 0) + sbag.EndComment (line, col + 1); any_token_seen |= tokens_seen; tokens_seen = false; comments_seen = false; continue; } else if (d == '*'){ - sbag.StartComment (SpecialsBag.CommentType.Multi, startsLine, line, col); + if (position_stack.Count == 0) + sbag.StartComment (SpecialsBag.CommentType.Multi, startsLine, line, col); get_char (); bool docAppend = false; if (doc_processing && peek_char () == '*') { int ch = get_char (); - sbag.PushCommentChar (ch); + if (position_stack.Count == 0) + sbag.PushCommentChar (ch); // But when it is /**/, just do nothing. if (peek_char () == '/') { ch = get_char (); - sbag.PushCommentChar (ch); - sbag.EndComment (line, col + 1); + if (position_stack.Count == 0) { + sbag.PushCommentChar (ch); + sbag.EndComment (line, col + 1); + } continue; } if (doc_state == XmlCommentState.Allowed) @@ -3220,11 +3259,14 @@ namespace Mono.CSharp } while ((d = get_char ()) != -1){ - sbag.PushCommentChar (d); + if (position_stack.Count == 0) + sbag.PushCommentChar (d); if (d == '*' && peek_char () == '/'){ - sbag.PushCommentChar ('/'); + if (position_stack.Count == 0) + sbag.PushCommentChar ('/'); get_char (); - sbag.EndComment (line, col + 1); + if (position_stack.Count == 0) + sbag.EndComment (line, col + 1); comments_seen = true; break; } @@ -3390,16 +3432,20 @@ namespace Mono.CSharp int TokenizeBackslash () { +#if FULL_AST + int read_start = reader.Position; +#endif + Location start_location = Location; int c = get_char (); tokens_seen = true; if (c == '\'') { - val = new CharLiteral (context.BuiltinTypes, (char) c, Location); - Report.Error (1011, Location, "Empty character literal"); + val = new CharLiteral (context.BuiltinTypes, (char) c, start_location); + Report.Error (1011, start_location, "Empty character literal"); return Token.LITERAL; } - if (c == '\n') { - Report.Error (1010, Location, "Newline in constant"); + if (c == '\r') { + Report.Error (1010, start_location, "Newline in constant"); return Token.ERROR; } @@ -3410,11 +3456,12 @@ namespace Mono.CSharp if (d != 0) throw new NotImplementedException (); - val = new CharLiteral (context.BuiltinTypes, (char) c, Location); + ILiteralConstant res = new CharLiteral (context.BuiltinTypes, (char) c, start_location); + val = res; c = get_char (); if (c != '\'') { - Report.Error (1012, Location, "Too many characters in character literal"); + Report.Error (1012, start_location, "Too many characters in character literal"); // Try to recover, read until newline or next "'" while ((c = get_char ()) != -1) { @@ -3423,6 +3470,10 @@ namespace Mono.CSharp } } +#if FULL_AST + res.ParsedValue = reader.ReadChars (read_start - 1, reader.Position); +#endif + return Token.LITERAL; } @@ -3480,11 +3531,13 @@ namespace Mono.CSharp { int c; while ((c = peek_char ()) == ' ') { - sbag.PushCommentChar (c); + if (position_stack.Count == 0) + sbag.PushCommentChar (c); get_char (); // skip heading whitespaces. } while ((c = peek_char ()) != -1 && c != '\n' && c != '\r') { - sbag.PushCommentChar (c); + if (position_stack.Count == 0) + sbag.PushCommentChar (c); xml_comment_buffer.Append ((char) get_char ()); } if (c == '\r' || c == '\n') diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/decl.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/decl.cs index 0ad375d282..32c8d071a4 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/decl.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/decl.cs @@ -27,6 +27,7 @@ using IKVM.Reflection.Emit; #else using System.Reflection; using System.Reflection.Emit; +//using Mono.Collections.Generic; #endif namespace Mono.CSharp { @@ -48,6 +49,12 @@ namespace Mono.CSharp { public bool IsDoubleColon { get { return is_double_colon; } } +#if FULL_AST + public Location DotLocation { + get; + set; + } +#endif private MemberName (MemberName left, string name, bool is_double_colon, Location loc) { @@ -153,7 +160,11 @@ namespace Mono.CSharp { } Expression lexpr = Left.GetTypeExpression (); - return new MemberAccess (lexpr, Name, TypeArguments, Location); + var result = new MemberAccess (lexpr, Name, TypeArguments, Location); +#if FULL_AST + result.DotLocation = DotLocation; +#endif + return result; } public MemberName Clone () @@ -693,9 +704,9 @@ namespace Mono.CSharp { return true; } - public virtual IList LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceContainer scope) + public virtual ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity) { - return Parent.LookupExtensionMethod (extensionType, name, arity, ref scope); + return Parent.LookupExtensionMethod (extensionType, name, arity); } public virtual FullNamedExpression LookupNamespaceAlias (string name) @@ -1440,6 +1451,21 @@ namespace Mono.CSharp { get; private set; } + + public bool HasOptionalSemicolon { + get; + private set; + } + Location optionalSemicolon; + public Location OptionalSemicolon { + get { + return optionalSemicolon; + } + set { + optionalSemicolon = value; + HasOptionalSemicolon = true; + } + } #endif public List Constraints { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/delegate.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/delegate.cs index 8752aebc19..cc381846ff 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/delegate.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/delegate.cs @@ -434,6 +434,11 @@ namespace Mono.CSharp { protected MethodSpec constructor_method; protected MethodGroupExpr method_group; + public override bool ContainsEmitWithAwait () + { + return false; + } + public static Arguments CreateDelegateMethodArguments (AParametersCollection pd, TypeSpec[] types, Location loc) { Arguments delegate_arguments = new Arguments (pd.Count); @@ -541,7 +546,7 @@ namespace Mono.CSharp { public override void Emit (EmitContext ec) { if (method_group.InstanceExpression == null) - ec.Emit (OpCodes.Ldnull); + ec.EmitNull (); else method_group.InstanceExpression.Emit (ec); @@ -717,6 +722,11 @@ namespace Mono.CSharp { this.arguments = args; this.loc = loc; } + + public override bool ContainsEmitWithAwait () + { + return InstanceExpr.ContainsEmitWithAwait () || (arguments != null && arguments.ContainsEmitWithAwait ()); + } public override Expression CreateExpressionTree (ResolveContext ec) { @@ -753,7 +763,9 @@ namespace Mono.CSharp { // Invocation on delegates call the virtual Invoke member // so we are always `instance' calls // - Invocation.EmitCall (ec, InstanceExpr, method, arguments, loc); + var call = new CallEmitter (); + call.InstanceExpression = InstanceExpr; + call.EmitPredefined (ec, method, arguments); } public override void EmitStatement (EmitContext ec) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/dynamic.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/dynamic.cs index c7df9f7c85..76447fad0c 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/dynamic.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/dynamic.cs @@ -6,6 +6,7 @@ // Dual licensed under the terms of the MIT X11 or GNU GPL // // Copyright 2009 Novell, Inc +// Copyright 2011 Xamarin Inc. // using System; @@ -95,9 +96,14 @@ namespace Mono.CSharp throw new NotImplementedException (); } + public override bool ContainsEmitWithAwait () + { + throw new NotSupportedException (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { - throw new NotImplementedException (); + throw new NotSupportedException (); } protected override Expression DoResolve (ResolveContext ec) @@ -122,7 +128,7 @@ namespace Mono.CSharp throw new NotImplementedException (); } - public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load) + public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound) { throw new NotImplementedException (); } @@ -262,6 +268,11 @@ namespace Mono.CSharp } } + public override bool ContainsEmitWithAwait () + { + return arguments.ContainsEmitWithAwait (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { ec.Report.Error (1963, loc, "An expression tree cannot contain a dynamic operation"); @@ -714,7 +725,7 @@ namespace Mono.CSharp class DynamicInvocation : DynamicExpressionStatement, IDynamicBinder { - ATypeNameExpression member; + readonly ATypeNameExpression member; public DynamicInvocation (ATypeNameExpression member, Arguments args, Location loc) : base (null, args, loc) @@ -897,7 +908,7 @@ namespace Mono.CSharp throw new NotImplementedException (); } - public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load) + public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound) { EmitCall (ec, setter, setter_args, !leave_copy); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/ecore.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/ecore.cs index 3be2ce0cda..d7e357c012 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/ecore.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/ecore.cs @@ -7,6 +7,7 @@ // // Copyright 2001, 2002, 2003 Ximian, Inc. // Copyright 2003-2008 Novell, Inc. +// Copyright 2011 Xamarin Inc. // // @@ -130,16 +131,14 @@ namespace Mono.CSharp { set { type = value; } } - public Location Location { - get { return loc; } + public virtual bool IsSideEffectFree { + get { + return false; + } } - public virtual string GetSignatureForError () - { - if (type == null) - return ""; - TypeSpec typeSpec = type.GetDefinition (); - return typeSpec != null ? typeSpec.GetSignatureForError () : ""; + public Location Location { + get { return loc; } } public virtual bool IsNull { @@ -148,6 +147,15 @@ namespace Mono.CSharp { } } + // + // Returns true when the expression during Emit phase breaks stack + // by using await expression + // + public virtual bool ContainsEmitWithAwait () + { + return false; + } + /// /// Performs semantic analysis on the Expression /// @@ -343,6 +351,11 @@ namespace Mono.CSharp { } } } + + public virtual string GetSignatureForError () + { + return type.GetDefinition ().GetSignatureForError (); + } /// /// Resolves an expression and performs semantic analysis on it. @@ -469,6 +482,107 @@ namespace Mono.CSharp { ec.Emit (OpCodes.Pop); } + // + // Emits the expression into temporary field variable. The method + // should be used for await expressions only + // + public virtual Expression EmitToField (EmitContext ec) + { + // + // This is the await prepare Emit method. When emitting code like + // a + b we emit code like + // + // a.Emit () + // b.Emit () + // Opcodes.Add + // + // For await a + await b we have to interfere the flow to keep the + // stack clean because await yields from the expression. The emit + // then changes to + // + // a = a.EmitToField () // a is changed to temporary field access + // b = b.EmitToField () + // a.Emit () + // b.Emit () + // Opcodes.Add + // + // + // The idea is to emit expression and leave the stack empty with + // result value still available. + // + // Expressions should override this default implementation when + // optimized version can be provided (e.g. FieldExpr) + // + // + // We can optimize for side-effect free expressions, they can be + // emitted out of order + // + if (IsSideEffectFree) + return this; + + bool needs_temporary = ContainsEmitWithAwait (); + if (!needs_temporary) + ec.EmitThis (); + + // Emit original code + EmitToFieldSource (ec); + + // + // Store the result to temporary field when we + // cannot load this directly + // + var field = ec.GetTemporaryField (type); + if (needs_temporary) { + // + // Create temporary local (we cannot load this before Emit) + // + var temp = ec.GetTemporaryLocal (type); + ec.Emit (OpCodes.Stloc, temp); + + ec.EmitThis (); + ec.Emit (OpCodes.Ldloc, temp); + field.EmitAssignFromStack (ec); + + ec.FreeTemporaryLocal (temp, type); + } else { + field.EmitAssignFromStack (ec); + } + + return field; + } + + protected virtual void EmitToFieldSource (EmitContext ec) + { + // + // Default implementation calls Emit method + // + Emit (ec); + } + + protected static void EmitExpressionsList (EmitContext ec, List expressions) + { + if (ec.HasSet (BuilderContext.Options.AsyncBody)) { + bool contains_await = false; + + for (int i = 1; i < expressions.Count; ++i) { + if (expressions[i].ContainsEmitWithAwait ()) { + contains_await = true; + break; + } + } + + if (contains_await) { + for (int i = 0; i < expressions.Count; ++i) { + expressions[i] = expressions[i].EmitToField (ec); + } + } + } + + for (int i = 0; i < expressions.Count; ++i) { + expressions[i].Emit (ec); + } + } + /// /// Protected constructor. Only derivate types should /// be able to be created @@ -498,7 +612,7 @@ namespace Mono.CSharp { return null; } - protected static MethodSpec ConstructorLookup (ResolveContext rc, TypeSpec type, ref Arguments args, Location loc) + public static MethodSpec ConstructorLookup (ResolveContext rc, TypeSpec type, ref Arguments args, Location loc) { var ctors = MemberCache.FindMembers (type, Constructor.ConstructorName, true); if (ctors == null) { @@ -961,6 +1075,11 @@ namespace Mono.CSharp { } } + public override bool ContainsEmitWithAwait () + { + return child.ContainsEmitWithAwait (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { Arguments args = new Arguments (2); @@ -1140,6 +1259,12 @@ namespace Mono.CSharp { get { return child.IsOneInteger; } } + public override bool IsSideEffectFree { + get { + return child.IsSideEffectFree; + } + } + public override bool IsZeroInteger { get { return child.IsZeroInteger; } } @@ -1277,6 +1402,12 @@ namespace Mono.CSharp { } } + public override bool IsSideEffectFree { + get { + return Child.IsSideEffectFree; + } + } + public override bool IsZeroInteger { get { return Child.IsZeroInteger; } } @@ -1731,6 +1862,17 @@ namespace Mono.CSharp { c = new ReducedConstantExpression (c, orig_expr); return c; } + + public override void EncodeAttributeValue (IMemberContext rc, AttributeEncoder enc, TypeSpec targetType) + { + // + // LAMESPEC: Reduced conditional expression is allowed as an attribute argument + // + if (orig_expr is Conditional) + child.EncodeAttributeValue (rc, enc, targetType); + else + base.EncodeAttributeValue (rc, enc, targetType); + } } sealed class ReducedExpressionStatement : ExpressionStatement @@ -1748,6 +1890,11 @@ namespace Mono.CSharp { this.loc = orig.Location; } + public override bool ContainsEmitWithAwait () + { + return stm.ContainsEmitWithAwait (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { return orig_expr.CreateExpressionTree (ec); @@ -1790,6 +1937,11 @@ namespace Mono.CSharp { #endregion + public override bool ContainsEmitWithAwait () + { + return expr.ContainsEmitWithAwait (); + } + // // Creates fully resolved expression switcher // @@ -1873,6 +2025,11 @@ namespace Mono.CSharp { this.loc = expr.Location; } + public override bool ContainsEmitWithAwait () + { + return expr.ContainsEmitWithAwait (); + } + public override Expression CreateExpressionTree (ResolveContext rc) { return expr.CreateExpressionTree (rc); @@ -1930,6 +2087,11 @@ namespace Mono.CSharp { target.expr = expr.Clone (clonectx); } + public override bool ContainsEmitWithAwait () + { + return expr.ContainsEmitWithAwait (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { throw new NotSupportedException ("ET"); @@ -2090,7 +2252,6 @@ namespace Mono.CSharp { } } - // MSAF var retval = ctx.LookupNamespaceOrType (Name, Arity, LookupMode.IgnoreAccessibility, loc); if (retval != null) { ctx.Module.Compiler.Report.SymbolRelatedToPreviousError (retval.Type); @@ -2379,6 +2540,11 @@ namespace Mono.CSharp { // resolved to different type } + public override bool ContainsEmitWithAwait () + { + return false; + } + public override Expression CreateExpressionTree (ResolveContext ec) { throw new NotSupportedException ("ET"); @@ -2626,6 +2792,11 @@ namespace Mono.CSharp { } } + public override bool ContainsEmitWithAwait () + { + return InstanceExpression != null && InstanceExpression.ContainsEmitWithAwait (); + } + static bool IsSameOrBaseQualifier (TypeSpec type, TypeSpec qtype) { do { @@ -2814,6 +2985,7 @@ namespace Mono.CSharp { InstanceExpression.Emit (ec); t.Store (ec); t.AddressOf (ec, AddressOp.Store); + t.Release (ec); } } else { InstanceExpression.Emit (ec); @@ -2830,18 +3002,57 @@ namespace Mono.CSharp { public abstract void SetTypeArguments (ResolveContext ec, TypeArguments ta); } + public class ExtensionMethodCandidates + { + NamespaceContainer container; + Namespace ns; + IList methods; + + public ExtensionMethodCandidates (IList methods, NamespaceContainer nsContainer) + : this (methods, nsContainer, null) + { + } + + public ExtensionMethodCandidates (IList methods, NamespaceContainer nsContainer, Namespace ns) + { + this.methods = methods; + this.container = nsContainer; + this.ns = ns; + } + + public NamespaceContainer Container { + get { + return container; + } + } + + public bool HasUninspectedMembers { get; set; } + + public Namespace Namespace { + get { + return ns; + } + } + + public IList Methods { + get { + return methods; + } + } + } + // // Represents a group of extension method candidates for whole namespace // class ExtensionMethodGroupExpr : MethodGroupExpr, OverloadResolver.IErrorHandler { - NamespaceContainer namespace_entry; + ExtensionMethodCandidates candidates; public readonly Expression ExtensionExpression; - public ExtensionMethodGroupExpr (IList list, NamespaceContainer n, Expression extensionExpr, Location l) - : base (list.Cast().ToList (), extensionExpr.Type, l) + public ExtensionMethodGroupExpr (ExtensionMethodCandidates candidates, Expression extensionExpr, Location loc) + : base (candidates.Methods.Cast().ToList (), extensionExpr.Type, loc) { - this.namespace_entry = n; + this.candidates = candidates; this.ExtensionExpression = extensionExpr; } @@ -2849,21 +3060,55 @@ namespace Mono.CSharp { get { return true; } } + // + // For extension methodgroup we are not looking for base members but parent + // namespace extension methods + // public override IList GetBaseMembers (TypeSpec baseType) { - if (namespace_entry == null) + // TODO: candidates are null only when doing error reporting, that's + // incorrect. We have to discover same extension methods in error mode + if (candidates == null) return null; + int arity = type_arguments == null ? 0 : type_arguments.Count; + // - // For extension methodgroup we are not looking for base members but parent - // namespace extension methods + // Here we try to resume the search for extension method at the point + // where the last bunch of candidates was found. It's more tricky than + // it seems as we have to check both namespace containers and namespace + // in correct order. // - int arity = type_arguments == null ? 0 : type_arguments.Count; - var found = namespace_entry.LookupExtensionMethod (DeclaringType, Name, arity, ref namespace_entry); - if (found == null) + // Consider: + // + // namespace A { + // using N1; + // namespace B.C.D { + // ().ToList (); + } + } + + var ns_container = candidates.HasUninspectedMembers ? candidates.Container : candidates.Container.Parent; + if (ns_container == null) + return null; + + candidates = ns_container.LookupExtensionMethod (ExtensionExpression.Type, Name, arity); + if (candidates == null) return null; - return found.Cast ().ToList (); + return candidates.Methods.Cast ().ToList (); } public override MethodGroupExpr LookupExtensionMethod (ResolveContext rc) @@ -3072,7 +3317,9 @@ namespace Mono.CSharp { public void EmitCall (EmitContext ec, Arguments arguments) { - Invocation.EmitCall (ec, InstanceExpression, best_candidate, arguments, loc); + var call = new CallEmitter (); + call.InstanceExpression = InstanceExpression; + call.Emit (ec, best_candidate, arguments, loc); } public override void Error_ValueCannotBeConverted (ResolveContext ec, Location loc, TypeSpec target, bool expl) @@ -3197,12 +3444,11 @@ namespace Mono.CSharp { return null; int arity = type_arguments == null ? 0 : type_arguments.Count; - NamespaceContainer methods_scope = null; - var methods = rc.LookupExtensionMethod (InstanceExpression.Type, Methods[0].Name, arity, ref methods_scope); + var methods = rc.LookupExtensionMethod (InstanceExpression.Type, Methods[0].Name, arity); if (methods == null) return null; - var emg = new ExtensionMethodGroupExpr (methods, methods_scope, InstanceExpression, loc); + var emg = new ExtensionMethodGroupExpr (methods, InstanceExpression, loc); emg.SetTypeArguments (rc, type_arguments); return emg; } @@ -3969,9 +4215,11 @@ namespace Mono.CSharp { // // Indentity, implicit reference or boxing conversion must exist for the extension parameter // + // LAMESPEC: or implicit type parameter conversion + // var at = a.Type; if (at == pt || TypeSpecComparer.IsEqual (at, pt) || - Convert.ImplicitReferenceConversionExists (at, pt) || + Convert.ImplicitReferenceConversionExists (at, pt, false) || Convert.ImplicitBoxingConversion (null, at, pt) != null) { score = 0; continue; @@ -4756,10 +5004,11 @@ namespace Mono.CSharp { } } - /// - /// Fully resolved expression that evaluates to a Field - /// - public class FieldExpr : MemberExpr, IDynamicAssign, IMemoryLocation, IVariableReference { + // + // Fully resolved expression that references a Field + // + public class FieldExpr : MemberExpr, IDynamicAssign, IMemoryLocation, IVariableReference + { protected FieldSpec spec; VariableInfo variable_info; @@ -4929,7 +5178,7 @@ namespace Mono.CSharp { } else if (var != null && var.IsHoisted) { AnonymousMethodExpression.Error_AddressOfCapturedVar (ec, var, loc); } - + return new FixedBufferPtr (this, fb.ElementType, loc).Resolve (ec); } @@ -5108,23 +5357,27 @@ namespace Mono.CSharp { } } - public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load) + public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound) { - var await_expr = source as Await; - if (await_expr != null) { - // - // Await is not ordinary expression (it contains jump), hence the usual flow cannot be used - // to emit instance load before expression - // - await_expr.EmitAssign (ec, this); - } else { - prepared = prepare_for_load && !(source is DynamicExpressionStatement); - if (IsInstance) - EmitInstance (ec, prepared); + bool has_await_source = ec.HasSet (BuilderContext.Options.AsyncBody) && source.ContainsEmitWithAwait (); + if (isCompound && !(source is DynamicExpressionStatement)) { + if (has_await_source) { + if (IsInstance) + InstanceExpression = InstanceExpression.EmitToField (ec); + } else { + prepared = true; + } + } - source.Emit (ec); + if (IsInstance) { + if (has_await_source) + source = source.EmitToField (ec); + + EmitInstance (ec, prepared); } + source.Emit (ec); + if (leave_copy) { ec.Emit (OpCodes.Dup); if (!IsStatic) { @@ -5150,6 +5403,18 @@ namespace Mono.CSharp { } } + // + // Emits store to field with prepared values on stack + // + public void EmitAssignFromStack (EmitContext ec) + { + if (IsStatic) { + ec.Emit (OpCodes.Stsfld, spec); + } else { + ec.Emit (OpCodes.Stfld, spec); + } + } + public override void Emit (EmitContext ec) { Emit (ec, false); @@ -5187,12 +5452,12 @@ namespace Mono.CSharp { } else need_copy = false; - if (need_copy){ - LocalBuilder local; + if (need_copy) { Emit (ec); - local = ec.DeclareLocal (type, false); - ec.Emit (OpCodes.Stloc, local); - ec.Emit (OpCodes.Ldloca, local); + var temp = ec.GetTemporaryLocal (type); + ec.Emit (OpCodes.Stloc, temp); + ec.Emit (OpCodes.Ldloca, temp); + ec.FreeTemporaryLocal (temp, type); return; } @@ -5229,14 +5494,13 @@ namespace Mono.CSharp { } - /// - /// Expression that evaluates to a Property. The Assign class - /// might set the `Value' expression if we are in an assignment. - /// - /// This is not an LValue because we need to re-write the expression, we - /// can not take data from the stack and store it. - /// - class PropertyExpr : PropertyOrIndexerExpr + // + // Expression that evaluates to a Property. + // + // This is not an LValue because we need to re-write the expression. We + // can not take data from the stack and store it. + // + sealed class PropertyExpr : PropertyOrIndexerExpr { public PropertyExpr (PropertySpec spec, Location l) : base (l) @@ -5247,6 +5511,14 @@ namespace Mono.CSharp { #region Properties + protected override Arguments Arguments { + get { + return null; + } + set { + } + } + protected override TypeSpec DeclaringType { get { return best_candidate.DeclaringType; @@ -5279,6 +5551,14 @@ namespace Mono.CSharp { #endregion + public static PropertyExpr CreatePredefined (PropertySpec spec, Location loc) + { + return new PropertyExpr (spec, loc) { + Getter = spec.Get, + Setter = spec.Set + }; + } + public override Expression CreateExpressionTree (ResolveContext ec) { Arguments args; @@ -5347,36 +5627,41 @@ namespace Mono.CSharp { // Special case: length of single dimension array property is turned into ldlen // if (IsSingleDimensionalArrayLength ()) { - if (!prepared) - EmitInstance (ec, false); + EmitInstance (ec, false); ec.Emit (OpCodes.Ldlen); ec.Emit (OpCodes.Conv_I4); return; } - Invocation.EmitCall (ec, InstanceExpression, Getter, null, loc, prepared, false); - - if (leave_copy) { - ec.Emit (OpCodes.Dup); - if (!IsStatic) { - temp = new LocalTemporary (this.Type); - temp.Store (ec); - } - } + base.Emit (ec, leave_copy); } - public override void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load) + public override void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound) { Arguments args; + LocalTemporary await_source_arg = null; - if (prepare_for_load && !(source is DynamicExpressionStatement)) { - args = new Arguments (0); - prepared = true; + if (isCompound && !(source is DynamicExpressionStatement)) { + emitting_compound_assignment = true; source.Emit (ec); - - if (leave_copy) { - ec.Emit (OpCodes.Dup); - if (!IsStatic) { + + if (has_await_arguments) { + await_source_arg = new LocalTemporary (Type); + await_source_arg.Store (ec); + + args = new Arguments (1); + args.Add (new Argument (await_source_arg)); + + if (leave_copy) { + temp = await_source_arg; + } + + has_await_arguments = false; + } else { + args = null; + + if (leave_copy) { + ec.Emit (OpCodes.Dup); temp = new LocalTemporary (this.Type); temp.Store (ec); } @@ -5394,12 +5679,23 @@ namespace Mono.CSharp { } } - Invocation.EmitCall (ec, InstanceExpression, Setter, args, loc, false, prepared); - + emitting_compound_assignment = false; + + var call = new CallEmitter (); + call.InstanceExpression = InstanceExpression; + if (args == null) + call.InstanceExpressionOnStack = true; + + call.Emit (ec, Setter, args, loc); + if (temp != null) { temp.Emit (ec); temp.Release (ec); } + + if (await_source_arg != null) { + await_source_arg.Release (ec); + } } protected override Expression OverloadResolve (ResolveContext rc, Expression right_side) @@ -5437,7 +5733,8 @@ namespace Mono.CSharp { protected T best_candidate; protected LocalTemporary temp; - protected bool prepared; + protected bool emitting_compound_assignment; + protected bool has_await_arguments; protected PropertyOrIndexerExpr (Location l) { @@ -5446,6 +5743,8 @@ namespace Mono.CSharp { #region Properties + protected abstract Arguments Arguments { get; set; } + public MethodSpec Getter { get { return getter; @@ -5520,14 +5819,43 @@ namespace Mono.CSharp { // // Implements the IAssignMethod interface for assignments // - public abstract void Emit (EmitContext ec, bool leave_copy); - public abstract void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load); + public virtual void Emit (EmitContext ec, bool leave_copy) + { + var call = new CallEmitter (); + call.InstanceExpression = InstanceExpression; + if (has_await_arguments) + call.HasAwaitArguments = true; + else + call.DuplicateArguments = emitting_compound_assignment; + + call.Emit (ec, Getter, Arguments, loc); + + if (call.HasAwaitArguments) { + InstanceExpression = call.InstanceExpression; + Arguments = call.EmittedArguments; + has_await_arguments = true; + } + + if (leave_copy) { + ec.Emit (OpCodes.Dup); + temp = new LocalTemporary (Type); + temp.Store (ec); + } + } + + public abstract void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound); public override void Emit (EmitContext ec) { Emit (ec, false); } + protected override void EmitToFieldSource (EmitContext ec) + { + has_await_arguments = true; + Emit (ec, false); + } + public abstract SLE.Expression MakeAssignExpression (BuilderContext ctx, Expression source); protected abstract Expression OverloadResolve (ResolveContext rc, Expression right_side); @@ -5716,14 +6044,17 @@ namespace Mono.CSharp { throw new NotImplementedException (); } - public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load) + public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound) { - if (leave_copy || !prepare_for_load) + if (leave_copy || !isCompound) throw new NotImplementedException ("EventExpr::EmitAssign"); Arguments args = new Arguments (1); args.Add (new Argument (source)); - Invocation.EmitCall (ec, InstanceExpression, op, args, loc); + + var call = new CallEmitter (); + call.InstanceExpression = InstanceExpression; + call.Emit (ec, op, args, loc); } #endregion @@ -5810,20 +6141,15 @@ namespace Mono.CSharp { return new TemporaryVariableReference (li, loc); } - public override Expression CreateExpressionTree (ResolveContext ec) - { - throw new NotSupportedException ("ET"); - } - protected override Expression DoResolve (ResolveContext ec) { eclass = ExprClass.Variable; // // Don't capture temporary variables except when using - // iterator redirection + // state machine redirection // - if (ec.CurrentAnonymousMethod != null && ec.CurrentAnonymousMethod.IsIterator && ec.IsVariableCapturingRequired) { + if (ec.CurrentAnonymousMethod != null && ec.CurrentAnonymousMethod is StateMachineInitializer && ec.IsVariableCapturingRequired) { AnonymousMethodStorey storey = li.Block.Explicit.CreateAnonymousMethodStorey (ec); storey.CaptureLocalVariable (ec, li); } @@ -5877,7 +6203,7 @@ namespace Mono.CSharp { } public override VariableInfo VariableInfo { - get { throw new NotImplementedException (); } + get { return null; } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/enum.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/enum.cs index ec23b5267a..fef5af717b 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/enum.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/enum.cs @@ -117,6 +117,11 @@ namespace Mono.CSharp { this.prev = prev; } + public override bool ContainsEmitWithAwait () + { + return false; + } + public override Expression CreateExpressionTree (ResolveContext ec) { throw new NotSupportedException ("Missing Resolve call"); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/eval.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/eval.cs index 03097dfd84..fdcff115e3 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/eval.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/eval.cs @@ -988,6 +988,13 @@ namespace Mono.CSharp } } + /// + /// Same as quit - useful in script scenerios + /// + static public void Quit () { + QuitRequested = true; + } + #if !NET_2_1 /// /// Describes an object or a type. diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/expression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/expression.cs index d27f6f88f2..e708b6c1c2 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/expression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/expression.cs @@ -7,6 +7,7 @@ // // Copyright 2001, 2002, 2003 Ximian, Inc. // Copyright 2003-2008 Novell, Inc. +// Copyright 2011 Xamarin Inc. // using System; @@ -46,6 +47,11 @@ namespace Mono.CSharp this.loc = loc; } + public override bool ContainsEmitWithAwait () + { + return arguments.ContainsEmitWithAwait (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { if (expr_tree != null) @@ -73,7 +79,8 @@ namespace Mono.CSharp public override void Emit (EmitContext ec) { - Invocation.EmitCall (ec, null, oper, arguments, loc); + var call = new CallEmitter (); + call.EmitPredefined (ec, oper, arguments); } public override SLE.Expression MakeExpression (BuilderContext ctx) @@ -336,6 +343,11 @@ namespace Mono.CSharp return EmptyCast.Create (this, type); } + public override bool ContainsEmitWithAwait () + { + return Expr.ContainsEmitWithAwait (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { return CreateExpressionTree (ec, null); @@ -498,7 +510,10 @@ namespace Mono.CSharp case Operator.UnaryNegation: if (ec.HasSet (EmitContext.Options.CheckedScope) && !IsFloat (type)) { - ec.Emit (OpCodes.Ldc_I4_0); + if (ec.HasSet (BuilderContext.Options.AsyncBody) && Expr.ContainsEmitWithAwait ()) + Expr = Expr.EmitToField (ec); + + ec.EmitInt (0); if (type.BuiltinType == BuiltinTypeSpec.Type.Long) ec.Emit (OpCodes.Conv_U8); Expr.Emit (ec); @@ -512,7 +527,7 @@ namespace Mono.CSharp case Operator.LogicalNot: Expr.Emit (ec); - ec.Emit (OpCodes.Ldc_I4_0); + ec.EmitInt (0); ec.Emit (OpCodes.Ceq); break; @@ -815,17 +830,26 @@ namespace Mono.CSharp loc = l; } - public override Expression CreateExpressionTree (ResolveContext ec) - { - Error_PointerInsideExpressionTree (ec); - return null; + public bool IsFixed { + get { return true; } } - + protected override void CloneTo (CloneContext clonectx, Expression t) { Indirection target = (Indirection) t; target.expr = expr.Clone (clonectx); - } + } + + public override bool ContainsEmitWithAwait () + { + throw new NotImplementedException (); + } + + public override Expression CreateExpressionTree (ResolveContext ec) + { + Error_PointerInsideExpressionTree (ec); + return null; + } public override void Emit (EmitContext ec) { @@ -845,13 +869,13 @@ namespace Mono.CSharp } } - public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load) + public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound) { - prepared = prepare_for_load; + prepared = isCompound; expr.Emit (ec); - if (prepare_for_load) + if (isCompound) ec.Emit (OpCodes.Dup); source.Emit (ec); @@ -906,15 +930,6 @@ namespace Mono.CSharp return this; } - public bool IsFixed { - get { return true; } - } - - public override string ToString () - { - return "*(" + expr + ")"; - } - public override object Accept (StructuralVisitor visitor) { return visitor.Visit (this); @@ -979,7 +994,7 @@ namespace Mono.CSharp // // Emits target assignment using unmodified source value // - public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load) + public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound) { // // Allocate temporary variable to keep original value before it's modified @@ -988,7 +1003,7 @@ namespace Mono.CSharp expr.Emit (ec); temp.Store (ec); - ((IAssignMethod) expr).EmitAssign (ec, source, false, prepare_for_load); + ((IAssignMethod) expr).EmitAssign (ec, source, false, isCompound); if (leave_copy) Emit (ec); @@ -1014,7 +1029,7 @@ namespace Mono.CSharp Mode mode; bool is_expr, recurse; - Expression expr; + protected Expression expr; // Holds the real operation Expression operation; @@ -1038,6 +1053,11 @@ namespace Mono.CSharp expr = e; } + public override bool ContainsEmitWithAwait () + { + return expr.ContainsEmitWithAwait (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { return new SimpleAssign (this, this).CreateExpressionTree (ec); @@ -1088,6 +1108,11 @@ namespace Mono.CSharp if (expr.Type.IsNullableType) return new Nullable.LiftedUnaryMutator (mode, expr, loc).Resolve (ec); + return DoResolveOperation (ec); + } + + protected Expression DoResolveOperation (ResolveContext ec) + { eclass = ExprClass.Value; type = expr.Type; @@ -1228,7 +1253,7 @@ namespace Mono.CSharp if (recurse) { ((IAssignMethod) expr).Emit (ec, is_expr && (mode == Mode.PostIncrement || mode == Mode.PostDecrement)); - operation.Emit (ec); + EmitOperation (ec); recurse = false; return; @@ -1237,6 +1262,11 @@ namespace Mono.CSharp EmitCode (ec, true); } + protected virtual void EmitOperation (EmitContext ec) + { + operation.Emit (ec); + } + public override void EmitStatement (EmitContext ec) { EmitCode (ec, false); @@ -1277,15 +1307,11 @@ namespace Mono.CSharp } - /// - /// Base class for the `Is' and `As' classes. - /// - /// - /// - /// FIXME: Split this in two, and we get to save the `Operator' Oper - /// size. - /// - public abstract class Probe : Expression { + // + // Base class for the `is' and `as' operators + // + public abstract class Probe : Expression + { public Expression ProbeType; protected Expression expr; protected TypeSpec probe_type_expr; @@ -1303,6 +1329,11 @@ namespace Mono.CSharp } } + public override bool ContainsEmitWithAwait () + { + return expr.ContainsEmitWithAwait (); + } + protected override Expression DoResolve (ResolveContext ec) { probe_type_expr = ProbeType.ResolveAsType (ec); @@ -1348,7 +1379,8 @@ namespace Mono.CSharp /// /// Implementation of the `is' operator. /// - public class Is : Probe { + public class Is : Probe + { Nullable.Unwrap expr_unwrap; public Is (Expression expr, Expression probe_type, Location l) @@ -1379,7 +1411,7 @@ namespace Mono.CSharp ec.Emit (OpCodes.Box, expr.Type); ec.Emit (OpCodes.Isinst, probe_type_expr); - ec.Emit (OpCodes.Ldnull); + ec.EmitNull (); ec.Emit (OpCodes.Cgt_Un); } @@ -1489,11 +1521,22 @@ namespace Mono.CSharp return CreateConstantResult (ec, true); } } else { - // if (InflatedTypeSpec.ContainsTypeParameter (d)) - // return this; + if (Convert.ImplicitReferenceConversionExists (d, t)) { + // + // Do not optimize for imported type + // + if (d.MemberDefinition.IsImported && d.BuiltinType != BuiltinTypeSpec.Type.None) + return this; + + // + // Turn is check into simple null check for implicitly convertible reference types + // + return ReducedExpression.Create ( + new Binary (Binary.Operator.Inequality, expr, new NullLiteral (loc), loc).Resolve (ec), + this).Resolve (ec); + } - if (Convert.ImplicitReferenceConversionExists (d, t) || - Convert.ExplicitReferenceConversionExists (d, t)) { + if (Convert.ExplicitReferenceConversionExists (d, t)) { return this; } } @@ -1741,6 +1784,17 @@ namespace Mono.CSharp this.loc = loc; } + public override bool IsSideEffectFree { + get { + return true; + } + } + + public override bool ContainsEmitWithAwait () + { + return false; + } + public override Expression CreateExpressionTree (ResolveContext ec) { Arguments args = new Arguments (2); @@ -1780,6 +1834,7 @@ namespace Mono.CSharp temp_storage.AddressOf(ec, AddressOp.LoadStore); ec.Emit(OpCodes.Initobj, type); temp_storage.Emit(ec); + temp_storage.Release (ec); } #if NET_4_0 && !STATIC @@ -2380,6 +2435,11 @@ namespace Mono.CSharp } } + public override bool ContainsEmitWithAwait () + { + return left.ContainsEmitWithAwait () || right.ContainsEmitWithAwait (); + } + public static void EmitOperatorOpcode (EmitContext ec, Operator oper, TypeSpec l) { OpCode opcode; @@ -2453,7 +2513,7 @@ namespace Mono.CSharp case Operator.Inequality: ec.Emit (OpCodes.Ceq); - ec.Emit (OpCodes.Ldc_I4_0); + ec.EmitInt (0); opcode = OpCodes.Ceq; break; @@ -2477,7 +2537,7 @@ namespace Mono.CSharp ec.Emit (OpCodes.Cgt_Un); else ec.Emit (OpCodes.Cgt); - ec.Emit (OpCodes.Ldc_I4_0); + ec.EmitInt (0); opcode = OpCodes.Ceq; break; @@ -2488,7 +2548,7 @@ namespace Mono.CSharp else ec.Emit (OpCodes.Clt); - ec.Emit (OpCodes.Ldc_I4_0); + ec.EmitInt (0); opcode = OpCodes.Ceq; break; @@ -3815,6 +3875,14 @@ namespace Mono.CSharp protected virtual void EmitOperator (EmitContext ec, TypeSpec l) { + if (ec.HasSet (BuilderContext.Options.AsyncBody) && right.ContainsEmitWithAwait ()) { + left = left.EmitToField (ec); + + if ((oper & Operator.LogicalMask) == 0) { + right = right.EmitToField (ec); + } + } + // // Handle short-circuit operators differently // than the rest @@ -3829,7 +3897,7 @@ namespace Mono.CSharp ec.Emit (OpCodes.Br_S, end); ec.MarkLabel (load_result); - ec.Emit (is_or ? OpCodes.Ldc_I4_1 : OpCodes.Ldc_I4_0); + ec.EmitInt (is_or ? 1 : 0); ec.MarkLabel (end); return; } @@ -4018,6 +4086,11 @@ namespace Mono.CSharp arguments = new Arguments (2); } + public override bool ContainsEmitWithAwait () + { + return arguments.ContainsEmitWithAwait (); + } + public static StringConcat Create (ResolveContext rc, Expression left, Expression right, Location loc) { if (left.eclass == ExprClass.Unresolved || right.eclass == ExprClass.Unresolved) @@ -4115,8 +4188,10 @@ namespace Mono.CSharp var members = GetConcatMethodCandidates (); var res = new OverloadResolver (members, OverloadResolver.Restrictions.NoBaseMembers, loc); var method = res.ResolveMember (new ResolveContext (ec.MemberContext), ref arguments); - if (method != null) - Invocation.EmitCall (ec, null, method, arguments, loc); + if (method != null) { + var call = new CallEmitter (); + call.EmitPredefined (ec, method, arguments); + } } public override SLE.Expression MakeExpression (BuilderContext ctx) @@ -4132,7 +4207,8 @@ namespace Mono.CSharp // // User-defined conditional logical operator // - public class ConditionalLogicalOperator : UserOperatorCall { + public class ConditionalLogicalOperator : UserOperatorCall + { readonly bool is_and; Expression oper_expr; @@ -4175,13 +4251,33 @@ namespace Mono.CSharp // // Emit and duplicate left argument // - arguments [0].Expr.Emit (ec); - ec.Emit (OpCodes.Dup); - arguments.RemoveAt (0); + bool right_contains_await = ec.HasSet (BuilderContext.Options.AsyncBody) && arguments[1].Expr.ContainsEmitWithAwait (); + if (right_contains_await) { + arguments[0] = arguments[0].EmitToField (ec); + arguments[0].Expr.Emit (ec); + } else { + arguments[0].Expr.Emit (ec); + ec.Emit (OpCodes.Dup); + arguments.RemoveAt (0); + } oper_expr.EmitBranchable (ec, end_target, true); + base.Emit (ec); - ec.MarkLabel (end_target); + + if (right_contains_await) { + // + // Special handling when right expression contains await and left argument + // could not be left on stack before logical branch + // + Label skip_left_load = ec.DefineLabel (); + ec.Emit (OpCodes.Br_S, skip_left_load); + ec.MarkLabel (end_target); + arguments[0].Expr.Emit (ec); + ec.MarkLabel (skip_left_load); + } else { + ec.MarkLabel (end_target); + } } } @@ -4201,6 +4297,11 @@ namespace Mono.CSharp this.op = op; } + public override bool ContainsEmitWithAwait () + { + throw new NotImplementedException (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { Error_PointerInsideExpressionTree (ec); @@ -4423,6 +4524,8 @@ namespace Mono.CSharp this.loc = loc; } + #region Properties + public Expression Expr { get { return expr; @@ -4440,7 +4543,14 @@ namespace Mono.CSharp return false_expr; } } - + + #endregion + + public override bool ContainsEmitWithAwait () + { + return Expr.ContainsEmitWithAwait () || true_expr.ContainsEmitWithAwait () || false_expr.ContainsEmitWithAwait (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { Arguments args = new Arguments (3); @@ -4453,8 +4563,32 @@ namespace Mono.CSharp protected override Expression DoResolve (ResolveContext ec) { expr = expr.Resolve (ec); - true_expr = true_expr.Resolve (ec); - false_expr = false_expr.Resolve (ec); + + // + // Unreachable code needs different resolve path. For instance for await + // expression to not generate unreachable resumable statement + // + Constant c = expr as Constant; + if (c != null && ec.CurrentBranching != null) { + bool unreachable = ec.CurrentBranching.CurrentUsageVector.IsUnreachable; + + if (c.IsDefaultValue) { + ec.CurrentBranching.CurrentUsageVector.IsUnreachable = true; + true_expr = true_expr.Resolve (ec); + ec.CurrentBranching.CurrentUsageVector.IsUnreachable = unreachable; + + false_expr = false_expr.Resolve (ec); + } else { + true_expr = true_expr.Resolve (ec); + + ec.CurrentBranching.CurrentUsageVector.IsUnreachable = true; + false_expr = false_expr.Resolve (ec); + ec.CurrentBranching.CurrentUsageVector.IsUnreachable = unreachable; + } + } else { + true_expr = true_expr.Resolve (ec); + false_expr = false_expr.Resolve (ec); + } if (true_expr == null || false_expr == null || expr == null) return null; @@ -4494,11 +4628,17 @@ namespace Mono.CSharp } } - // Dead code optimalization - Constant c = expr as Constant; - if (c != null){ + if (c != null) { bool is_false = c.IsDefaultValue; - ec.Report.Warning (429, 4, is_false ? true_expr.Location : false_expr.Location, "Unreachable expression code detected"); + + // + // Don't issue the warning for constant expressions + // + if (!(is_false ? true_expr is Constant : false_expr is Constant)) { + ec.Report.Warning (429, 4, is_false ? true_expr.Location : false_expr.Location, + "Unreachable expression code detected"); + } + return ReducedExpression.Create ( is_false ? false_expr : true_expr, this, false_expr is Constant && true_expr is Constant).Resolve (ec); @@ -4515,13 +4655,6 @@ namespace Mono.CSharp expr.EmitBranchable (ec, false_target, false); true_expr.Emit (ec); - if (type.IsInterface) { - LocalBuilder temp = ec.GetTemporaryLocal (type); - ec.Emit (OpCodes.Stloc, temp); - ec.Emit (OpCodes.Ldloc, temp); - ec.FreeTemporaryLocal (temp, type); - } - ec.Emit (OpCodes.Br, end_target); ec.MarkLabel (false_target); false_expr.Emit (ec); @@ -4543,7 +4676,8 @@ namespace Mono.CSharp } } - public abstract class VariableReference : Expression, IAssignMethod, IMemoryLocation, IVariableReference { + public abstract class VariableReference : Expression, IAssignMethod, IMemoryLocation, IVariableReference + { LocalTemporary temp; #region Abstract @@ -4578,6 +4712,22 @@ namespace Mono.CSharp Variable.EmitAddressOf (ec); } + public override bool ContainsEmitWithAwait () + { + return false; + } + + public override Expression CreateExpressionTree (ResolveContext ec) + { + HoistedVariable hv = GetHoistedVariable (ec); + if (hv != null) + return hv.CreateExpressionTree (); + + Arguments arg = new Arguments (1); + arg.Add (new Argument (this)); + return CreateExpressionFactoryCall (ec, "Constant", arg); + } + public override Expression DoResolveLValue (ResolveContext rc, Expression right_side) { if (IsLockedByStatement) { @@ -4683,6 +4833,15 @@ namespace Mono.CSharp } } + public override Expression EmitToField (EmitContext ec) + { + HoistedVariable hv = GetHoistedVariable (ec); + if (hv != null) { + return hv.EmitToField (ec); + } + + return base.EmitToField (ec); + } public HoistedVariable GetHoistedVariable (ResolveContext rc) { @@ -4767,17 +4926,6 @@ namespace Mono.CSharp local_info.AddressTaken = true; } - public override Expression CreateExpressionTree (ResolveContext ec) - { - HoistedVariable hv = GetHoistedVariable (ec); - if (hv != null) - return hv.CreateExpressionTree (); - - Arguments arg = new Arguments (1); - arg.Add (new Argument (this)); - return CreateExpressionFactoryCall (ec, "Constant", arg); - } - void DoResolveBase (ResolveContext ec) { VerifyAssigned (ec); @@ -5074,22 +5222,6 @@ namespace Mono.CSharp SetAssigned (ec); return base.DoResolveLValue (ec, right_side); } - - static public void EmitLdArg (EmitContext ec, int x) - { - switch (x) { - case 0: ec.Emit (OpCodes.Ldarg_0); break; - case 1: ec.Emit (OpCodes.Ldarg_1); break; - case 2: ec.Emit (OpCodes.Ldarg_2); break; - case 3: ec.Emit (OpCodes.Ldarg_3); break; - default: - if (x > byte.MaxValue) - ec.Emit (OpCodes.Ldarg, x); - else - ec.Emit (OpCodes.Ldarg_S, (byte) x); - break; - } - } } /// @@ -5137,6 +5269,13 @@ namespace Mono.CSharp target.expr = expr.Clone (clonectx); } + public override bool ContainsEmitWithAwait () + { + if (arguments != null && arguments.ContainsEmitWithAwait ()) + return true; + + return mg.ContainsEmitWithAwait (); + } public override Expression CreateExpressionTree (ResolveContext ec) { @@ -5333,168 +5472,6 @@ namespace Mono.CSharp return true; } - // - // Used to decide whether call or callvirt is needed - // - static bool IsVirtualCallRequired (Expression instance, MethodSpec method) - { - // - // There are 2 scenarious where we emit callvirt - // - // Case 1: A method is virtual and it's not used to call base - // Case 2: A method instance expression can be null. In this casen callvirt ensures - // correct NRE exception when the method is called - // - var decl_type = method.DeclaringType; - if (decl_type.IsStruct || decl_type.IsEnum) - return false; - - if (instance is BaseThis) - return false; - - // - // It's non-virtual and will never be null - // - if (!method.IsVirtual && (instance is This || instance is New || instance is ArrayCreation || instance is DelegateCreation)) - return false; - - return true; - } - - /// - /// is_base tells whether we want to force the use of the `call' - /// opcode instead of using callvirt. Call is required to call - /// a specific method, while callvirt will always use the most - /// recent method in the vtable. - /// - /// is_static tells whether this is an invocation on a static method - /// - /// instance_expr is an expression that represents the instance - /// it must be non-null if is_static is false. - /// - /// method is the method to invoke. - /// - /// Arguments is the list of arguments to pass to the method or constructor. - /// - public static void EmitCall (EmitContext ec, Expression instance_expr, - MethodSpec method, Arguments Arguments, Location loc) - { - EmitCall (ec, instance_expr, method, Arguments, loc, false, false); - } - - // `dup_args' leaves an extra copy of the arguments on the stack - // `omit_args' does not leave any arguments at all. - // So, basically, you could make one call with `dup_args' set to true, - // and then another with `omit_args' set to true, and the two calls - // would have the same set of arguments. However, each argument would - // only have been evaluated once. - public static void EmitCall (EmitContext ec, Expression instance_expr, - MethodSpec method, Arguments Arguments, Location loc, - bool dup_args, bool omit_args) - { - LocalTemporary this_arg = null; - - // Speed up the check by not doing it on not allowed targets - if (method.ReturnType.Kind == MemberKind.Void && method.IsConditionallyExcluded (ec.Module.Compiler, loc)) - return; - - OpCode call_op; - TypeSpec iexpr_type; - - if (method.IsStatic) { - iexpr_type = null; - call_op = OpCodes.Call; - } else { - iexpr_type = instance_expr.Type; - - if (IsVirtualCallRequired (instance_expr, method)) { - call_op = OpCodes.Callvirt; - } else { - call_op = OpCodes.Call; - } - - // - // If this is ourselves, push "this" - // - if (!omit_args) { - TypeSpec t = iexpr_type; - - // - // Push the instance expression - // - if ((iexpr_type.IsStruct && (call_op == OpCodes.Callvirt || (call_op == OpCodes.Call && method.DeclaringType == iexpr_type))) || - iexpr_type.IsGenericParameter || method.DeclaringType.IsNullableType) { - // - // If the expression implements IMemoryLocation, then - // we can optimize and use AddressOf on the - // return. - // - // If not we have to use some temporary storage for - // it. - var iml = instance_expr as IMemoryLocation; - if (iml != null) { - iml.AddressOf (ec, AddressOp.Load); - } else { - LocalTemporary temp = new LocalTemporary (iexpr_type); - instance_expr.Emit (ec); - temp.Store (ec); - temp.AddressOf (ec, AddressOp.Load); - } - - // avoid the overhead of doing this all the time. - if (dup_args) - t = ReferenceContainer.MakeType (ec.Module, iexpr_type); - } else if (iexpr_type.IsEnum || iexpr_type.IsStruct) { - instance_expr.Emit (ec); - ec.Emit (OpCodes.Box, iexpr_type); - t = iexpr_type = ec.BuiltinTypes.Object; - } else { - instance_expr.Emit (ec); - } - - if (dup_args) { - ec.Emit (OpCodes.Dup); - if (Arguments != null && Arguments.Count != 0) { - this_arg = new LocalTemporary (t); - this_arg.Store (ec); - } - } - } - } - - if (!omit_args && Arguments != null) { - var dup_arg_exprs = Arguments.Emit (ec, dup_args); - if (dup_args) { - this_arg.Emit (ec); - LocalTemporary lt; - foreach (var dup in dup_arg_exprs) { - dup.Emit (ec); - lt = dup as LocalTemporary; - if (lt != null) - lt.Release (ec); - } - } - } - - if (call_op == OpCodes.Callvirt && (iexpr_type.IsGenericParameter || iexpr_type.IsStruct)) { - ec.Emit (OpCodes.Constrained, iexpr_type); - } - - if (method.Parameters.HasArglist) { - var varargs_types = GetVarargsTypes (method, Arguments); - ec.Emit (call_op, method, varargs_types); - return; - } - - // - // If you have: - // this.DoFoo (); - // and DoFoo is not virtual, you can omit the callvirt, - // because you don't need the null checking behavior. - // - ec.Emit (call_op, method); - } - public override void Emit (EmitContext ec) { mg.EmitCall (ec, arguments); @@ -5621,6 +5598,11 @@ namespace Mono.CSharp return null; } + public override bool ContainsEmitWithAwait () + { + return arguments != null && arguments.ContainsEmitWithAwait (); + } + // // Checks whether the type is an interface that has the // [ComImport, CoClass] attributes and must be treated @@ -5776,6 +5758,7 @@ namespace Mono.CSharp temp.AddressOf (ec, AddressOp.Store); ec.Emit (OpCodes.Initobj, type); temp.Emit (ec); + temp.Release (ec); ec.Emit (OpCodes.Br_S, label_end); ec.MarkLabel (label_activator); @@ -5822,9 +5805,13 @@ namespace Mono.CSharp } else if (vr != null && vr.IsRef) { vr.EmitLoad (ec); } - - if (arguments != null) + + if (arguments != null) { + if (ec.HasSet (BuilderContext.Options.AsyncBody) && (arguments.Count > (this is NewInitialize ? 0 : 1)) && arguments.ContainsEmitWithAwait ()) + arguments = arguments.Emit (ec, false, true); + arguments.Emit (ec); + } if (is_value_type) { if (method == null) { @@ -5985,6 +5972,11 @@ namespace Mono.CSharp elements.Add (expr); } + public override bool ContainsEmitWithAwait () + { + throw new NotSupportedException (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { throw new NotSupportedException ("ET"); @@ -6003,7 +5995,7 @@ namespace Mono.CSharp { var current_field = rc.CurrentMemberDefinition as FieldBase; TypeExpression type; - if (current_field != null) { + if (current_field != null && rc.CurrentAnonymousMethod == null) { type = new TypeExpression (current_field.MemberType, current_field.Location); } else if (variable != null) { if (variable.TypeExpression is VarExpr) { @@ -6119,12 +6111,7 @@ namespace Mono.CSharp { } - protected override void Error_NegativeArrayIndex (ResolveContext ec, Location loc) - { - ec.Report.Error (248, loc, "Cannot create an array with a negative size"); - } - - bool CheckIndices (ResolveContext ec, ArrayInitializer probe, int idx, bool specified_dims, int child_bounds) + bool CheckIndices (ResolveContext ec, ArrayInitializer probe, int idx, bool specified_dims, int child_bounds) { if (initializers != null && bounds == null) { // @@ -6214,6 +6201,16 @@ namespace Mono.CSharp return true; } + public override bool ContainsEmitWithAwait () + { + foreach (var arg in arguments) { + if (arg.ContainsEmitWithAwait ()) + return true; + } + + return InitializersContainAwait (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { Arguments args; @@ -6262,6 +6259,24 @@ namespace Mono.CSharp } } + protected override void Error_NegativeArrayIndex (ResolveContext ec, Location loc) + { + ec.Report.Error (248, loc, "Cannot create an array with a negative size"); + } + + bool InitializersContainAwait () + { + if (array_data == null) + return false; + + foreach (var expr in array_data) { + if (expr.ContainsEmitWithAwait ()) + return true; + } + + return false; + } + protected virtual Expression ResolveArrayElement (ResolveContext ec, Expression element) { element = element.Resolve (ec); @@ -6508,7 +6523,7 @@ namespace Mono.CSharp // // Emits the initializers for the array // - void EmitStaticInitializers (EmitContext ec) + void EmitStaticInitializers (EmitContext ec, FieldExpr stackArray) { var m = ec.Module.PredefinedMembers.RuntimeHelpersInitializeArray.Resolve (loc); if (m == null) @@ -6520,7 +6535,12 @@ namespace Mono.CSharp byte [] data = MakeByteBlob (); var fb = ec.CurrentTypeDefinition.Module.MakeStaticData (data, loc); - ec.Emit (OpCodes.Dup); + if (stackArray == null) { + ec.Emit (OpCodes.Dup); + } else { + stackArray.Emit (ec); + } + ec.Emit (OpCodes.Ldtoken, fb); ec.Emit (OpCodes.Call, m); } @@ -6532,7 +6552,7 @@ namespace Mono.CSharp // // This always expect the top value on the stack to be the array // - void EmitDynamicInitializers (EmitContext ec, bool emitConstants) + void EmitDynamicInitializers (EmitContext ec, bool emitConstants, FieldExpr stackArray) { int dims = bounds.Count; var current_pos = new int [dims]; @@ -6544,9 +6564,18 @@ namespace Mono.CSharp // Constant can be initialized via StaticInitializer if (c == null || (c != null && emitConstants && !c.IsDefaultInitializer (array_element_type))) { - TypeSpec etype = e.Type; - ec.Emit (OpCodes.Dup); + var etype = e.Type; + + if (stackArray != null) { + if (e.ContainsEmitWithAwait ()) { + e = e.EmitToField (ec); + } + + stackArray.Emit (ec); + } else { + ec.Emit (OpCodes.Dup); + } for (int idx = 0; idx < dims; idx++) ec.EmitInt (current_pos [idx]); @@ -6600,31 +6629,47 @@ namespace Mono.CSharp first_emit_temp.Store (ec); } - foreach (Expression e in arguments) - e.Emit (ec); + FieldExpr await_stack_field; + if (ec.HasSet (BuilderContext.Options.AsyncBody) && InitializersContainAwait ()) { + await_stack_field = ec.GetTemporaryField (type); + ec.EmitThis (); + } else { + await_stack_field = null; + } + + EmitExpressionsList (ec, arguments); ec.EmitArrayNew ((ArrayContainer) type); if (initializers == null) return; + if (await_stack_field != null) + await_stack_field.EmitAssignFromStack (ec); + #if STATIC - // Emit static initializer for arrays which have contain more than 2 items and + // + // Emit static initializer for arrays which contain more than 2 items and // the static initializer will initialize at least 25% of array values or there // is more than 10 items to be initialized + // // NOTE: const_initializers_count does not contain default constant values. + // if (const_initializers_count > 2 && (array_data.Count > 10 || const_initializers_count * 4 > (array_data.Count)) && (BuiltinTypeSpec.IsPrimitiveType (array_element_type) || array_element_type.IsEnum)) { - EmitStaticInitializers (ec); + EmitStaticInitializers (ec, await_stack_field); if (!only_constant_initializers) - EmitDynamicInitializers (ec, false); + EmitDynamicInitializers (ec, false, await_stack_field); } else #endif { - EmitDynamicInitializers (ec, true); + EmitDynamicInitializers (ec, true, await_stack_field); } + if (await_stack_field != null) + await_stack_field.Emit (ec); + if (first_emit_temp != null) first_emit_temp.Release (ec); } @@ -6828,7 +6873,7 @@ namespace Mono.CSharp public void Emit (EmitContext ec) { - ec.Emit (OpCodes.Ldarg_0); + ec.EmitThis (); } public void EmitAssign (EmitContext ec) @@ -6838,7 +6883,7 @@ namespace Mono.CSharp public void EmitAddressOf (EmitContext ec) { - ec.Emit (OpCodes.Ldarg_0); + ec.EmitThis (); } } @@ -6867,6 +6912,12 @@ namespace Mono.CSharp get { return type.IsStruct; } } + public override bool IsSideEffectFree { + get { + return true; + } + } + protected override ILocalVariable Variable { get { return ThisVariable.Instance; } } @@ -6955,16 +7006,6 @@ namespace Mono.CSharp } } - public override Expression CreateExpressionTree (ResolveContext ec) - { - Arguments args = new Arguments (1); - args.Add (new Argument (this)); - - // Use typeless constant for ldarg.0 to save some - // space and avoid problems with anonymous stories - return CreateExpressionFactoryCall (ec, "Constant", args); - } - protected override Expression DoResolve (ResolveContext ec) { ResolveBase (ec); @@ -7035,6 +7076,16 @@ namespace Mono.CSharp this.loc = loc; } + protected override void CloneTo (CloneContext clonectx, Expression target) + { + // nothing. + } + + public override bool ContainsEmitWithAwait () + { + return false; + } + public override Expression CreateExpressionTree (ResolveContext ec) { throw new NotSupportedException ("ET"); @@ -7058,10 +7109,6 @@ namespace Mono.CSharp ec.Emit (OpCodes.Arglist); } - protected override void CloneTo (CloneContext clonectx, Expression target) - { - // nothing. - } public override object Accept (StructuralVisitor visitor) { return visitor.Visit (this); @@ -7098,6 +7145,11 @@ namespace Mono.CSharp return retval; } } + + public override bool ContainsEmitWithAwait () + { + throw new NotImplementedException (); + } public override Expression CreateExpressionTree (ResolveContext ec) { @@ -7151,6 +7203,11 @@ namespace Mono.CSharp this.loc = loc; } + public override bool ContainsEmitWithAwait () + { + return false; + } + protected override Expression DoResolve (ResolveContext rc) { expr = expr.Resolve (rc); @@ -7222,6 +7279,11 @@ namespace Mono.CSharp this.loc = loc; } + public override bool ContainsEmitWithAwait () + { + throw new NotImplementedException (); + } + protected override Expression DoResolve (ResolveContext rc) { expr = expr.ResolveLValue (rc, EmptyExpression.LValueMemberAccess); @@ -7265,6 +7327,13 @@ namespace Mono.CSharp } #region Properties + + public override bool IsSideEffectFree { + get { + return true; + } + } + public TypeSpec TypeArgument { get { return typearg; @@ -7279,6 +7348,19 @@ namespace Mono.CSharp #endregion + + protected override void CloneTo (CloneContext clonectx, Expression t) + { + TypeOf target = (TypeOf) t; + if (QueriedType != null) + target.QueriedType = (FullNamedExpression) QueriedType.Clone (clonectx); + } + + public override bool ContainsEmitWithAwait () + { + return false; + } + public override Expression CreateExpressionTree (ResolveContext ec) { Arguments args = new Arguments (2); @@ -7372,14 +7454,7 @@ namespace Mono.CSharp if (m != null) ec.Emit (OpCodes.Call, m); } - - protected override void CloneTo (CloneContext clonectx, Expression t) - { - TypeOf target = (TypeOf) t; - if (QueriedType != null) - target.QueriedType = (FullNamedExpression) QueriedType.Clone (clonectx); - } - + public override object Accept (StructuralVisitor visitor) { return visitor.Visit (this); @@ -7436,6 +7511,17 @@ namespace Mono.CSharp this.loc = loc; } + public override bool IsSideEffectFree { + get { + return true; + } + } + + public override bool ContainsEmitWithAwait () + { + return false; + } + public override Expression CreateExpressionTree (ResolveContext ec) { Arguments args = new Arguments (2); @@ -7516,6 +7602,17 @@ namespace Mono.CSharp loc = l; } + public override bool IsSideEffectFree { + get { + return true; + } + } + + public override bool ContainsEmitWithAwait () + { + return false; + } + public override Expression CreateExpressionTree (ResolveContext ec) { Error_PointerInsideExpressionTree (ec); @@ -7666,6 +7763,13 @@ namespace Mono.CSharp { protected Expression expr; +#if FULL_AST + public Location DotLocation { + get; + set; + } +#endif + public MemberAccess (Expression expr, string id) : base (id, expr.Location) { @@ -7739,7 +7843,7 @@ namespace Mono.CSharp const MemberKind dot_kinds = MemberKind.Class | MemberKind.Struct | MemberKind.Delegate | MemberKind.Enum | MemberKind.Interface | MemberKind.TypeParameter | MemberKind.ArrayType; - return (type.Kind & dot_kinds) != 0; + return (type.Kind & dot_kinds) != 0 || type.BuiltinType == BuiltinTypeSpec.Type.Dynamic; } public override Expression LookupNameExpression (ResolveContext rc, MemberLookupRestrictions restrictions) @@ -7817,10 +7921,9 @@ namespace Mono.CSharp // Try to look for extension method when member lookup failed // if (MethodGroupExpr.IsExtensionMethodArgument (expr)) { - NamespaceContainer scope = null; - var methods = rc.LookupExtensionMethod (expr_type, Name, lookup_arity, ref scope); + var methods = rc.LookupExtensionMethod (expr_type, Name, lookup_arity); if (methods != null) { - var emg = new ExtensionMethodGroupExpr (methods, scope, expr, loc); + var emg = new ExtensionMethodGroupExpr (methods, expr, loc); if (HasTypeArguments) { if (!targs.Resolve (rc)) return null; @@ -7971,8 +8074,14 @@ namespace Mono.CSharp if (nested.IsAccessible (rc)) break; - // Keep looking after inaccessible candidate - expr_type = nested.DeclaringType.BaseType; + // + // Keep looking after inaccessible candidate but only if + // we are not in same context as the definition itself + // + if (expr_type.MemberDefinition == rc.CurrentMemberDefinition) + break; + + expr_type = expr_type.BaseType; } TypeExpr texpr; @@ -8054,6 +8163,11 @@ namespace Mono.CSharp Expr = e; loc = l; } + + public override bool ContainsEmitWithAwait () + { + return Expr.ContainsEmitWithAwait (); + } public override Expression CreateExpressionTree (ResolveContext ec) { @@ -8079,19 +8193,19 @@ namespace Mono.CSharp public override void Emit (EmitContext ec) { - using (ec.With (EmitContext.Options.AllCheckStateFlags, true)) + using (ec.With (EmitContext.Options.CheckedScope, true)) Expr.Emit (ec); } public override void EmitBranchable (EmitContext ec, Label target, bool on_true) { - using (ec.With (EmitContext.Options.AllCheckStateFlags, true)) + using (ec.With (EmitContext.Options.CheckedScope, true)) Expr.EmitBranchable (ec, target, on_true); } public override SLE.Expression MakeExpression (BuilderContext ctx) { - using (ctx.With (BuilderContext.Options.AllCheckStateFlags, true)) { + using (ctx.With (BuilderContext.Options.CheckedScope, true)) { return Expr.MakeExpression (ctx); } } @@ -8120,6 +8234,11 @@ namespace Mono.CSharp Expr = e; loc = l; } + + public override bool ContainsEmitWithAwait () + { + return Expr.ContainsEmitWithAwait (); + } public override Expression CreateExpressionTree (ResolveContext ec) { @@ -8145,13 +8264,13 @@ namespace Mono.CSharp public override void Emit (EmitContext ec) { - using (ec.With (EmitContext.Options.AllCheckStateFlags, false)) + using (ec.With (EmitContext.Options.CheckedScope, false)) Expr.Emit (ec); } public override void EmitBranchable (EmitContext ec, Label target, bool on_true) { - using (ec.With (EmitContext.Options.AllCheckStateFlags, false)) + using (ec.With (EmitContext.Options.CheckedScope, false)) Expr.EmitBranchable (ec, target, on_true); } @@ -8173,7 +8292,8 @@ namespace Mono.CSharp /// During semantic analysis these are transformed into /// IndexerAccess, ArrayAccess or a PointerArithmetic. /// - public class ElementAccess : Expression { + public class ElementAccess : Expression + { public Arguments Arguments; public Expression Expr; @@ -8184,6 +8304,11 @@ namespace Mono.CSharp this.Arguments = args; } + public override bool ContainsEmitWithAwait () + { + return Expr.ContainsEmitWithAwait () || Arguments.ContainsEmitWithAwait (); + } + // // We perform some simple tests, and then to "split" the emit and store // code we create an instance of a different class, and return that. @@ -8306,9 +8431,9 @@ namespace Mono.CSharp // ElementAccess ea; - LocalTemporary temp, expr_copy; - Expression[] prepared_arguments; + LocalTemporary temp; bool prepared; + bool? has_await_args; public ArrayAccess (ElementAccess ea_data, Location l) { @@ -8316,11 +8441,28 @@ namespace Mono.CSharp loc = l; } + public void AddressOf (EmitContext ec, AddressOp mode) + { + var ac = (ArrayContainer) ea.Expr.Type; + + LoadInstanceAndArguments (ec, false, false); + + if (ac.Element.IsGenericParameter && mode == AddressOp.Load) + ec.Emit (OpCodes.Readonly); + + ec.EmitArrayAddress (ac); + } + public override Expression CreateExpressionTree (ResolveContext ec) { return ea.CreateExpressionTree (ec); } + public override bool ContainsEmitWithAwait () + { + return ea.ContainsEmitWithAwait (); + } + public override Expression DoResolveLValue (ResolveContext ec, Expression right_side) { return DoResolve (ec); @@ -8365,10 +8507,24 @@ namespace Mono.CSharp // // Load the array arguments into the stack. // - void LoadArrayAndArguments (EmitContext ec) + void LoadInstanceAndArguments (EmitContext ec, bool duplicateArguments, bool prepareAwait) { - ea.Expr.Emit (ec); - ea.Arguments.Emit (ec); + if (prepareAwait) { + ea.Expr = ea.Expr.EmitToField (ec); + } else if (duplicateArguments) { + ea.Expr.Emit (ec); + ec.Emit (OpCodes.Dup); + + var copy = new LocalTemporary (ea.Expr.Type); + copy.Store (ec); + ea.Expr = copy; + } else { + ea.Expr.Emit (ec); + } + + var dup_args = ea.Arguments.Emit (ec, duplicateArguments, prepareAwait); + if (dup_args != null) + ea.Arguments = dup_args; } public void Emit (EmitContext ec, bool leave_copy) @@ -8378,19 +8534,11 @@ namespace Mono.CSharp if (prepared) { ec.EmitLoadFromPtr (type); } else { - if (prepared_arguments == null) { - LoadArrayAndArguments (ec); - } else { - expr_copy.Emit (ec); - LocalTemporary lt; - foreach (var expr in prepared_arguments) { - expr.Emit (ec); - lt = expr as LocalTemporary; - if (lt != null) - lt.Release (ec); - } + if (!has_await_args.HasValue && ec.HasSet (BuilderContext.Options.AsyncBody) && ea.Arguments.ContainsEmitWithAwait ()) { + LoadInstanceAndArguments (ec, false, true); } + LoadInstanceAndArguments (ec, false, false); ec.EmitArrayLoad (ac); } @@ -8406,40 +8554,56 @@ namespace Mono.CSharp Emit (ec, false); } - public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load) + public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound) { var ac = (ArrayContainer) ea.Expr.Type; TypeSpec t = source.Type; + has_await_args = ec.HasSet (BuilderContext.Options.AsyncBody) && (ea.Arguments.ContainsEmitWithAwait () || source.ContainsEmitWithAwait ()); + // // When we are dealing with a struct, get the address of it to avoid value copy // Same cannot be done for reference type because array covariance and the // check in ldelema requires to specify the type of array element stored at the index // - if (t.IsStruct && ((prepare_for_load && !(source is DynamicExpressionStatement)) || !BuiltinTypeSpec.IsPrimitiveType (t))) { - LoadArrayAndArguments (ec); + if (t.IsStruct && ((isCompound && !(source is DynamicExpressionStatement)) || !BuiltinTypeSpec.IsPrimitiveType (t))) { + LoadInstanceAndArguments (ec, false, has_await_args.Value); + + if (has_await_args.Value) { + if (source.ContainsEmitWithAwait ()) { + source = source.EmitToField (ec); + isCompound = false; + prepared = true; + } + + LoadInstanceAndArguments (ec, isCompound, false); + } else { + prepared = true; + } + ec.EmitArrayAddress (ac); - if (prepare_for_load) { + if (isCompound) { ec.Emit (OpCodes.Dup); + prepared = true; } + } else { + LoadInstanceAndArguments (ec, isCompound, has_await_args.Value); - prepared = true; - } else if (prepare_for_load) { - ea.Expr.Emit (ec); - ec.Emit (OpCodes.Dup); + if (has_await_args.Value) { + if (source.ContainsEmitWithAwait ()) + source = source.EmitToField (ec); - expr_copy = new LocalTemporary (ea.Expr.Type); - expr_copy.Store (ec); - prepared_arguments = ea.Arguments.Emit (ec, true); - } else { - LoadArrayAndArguments (ec); + LoadInstanceAndArguments (ec, false, false); + } } source.Emit (ec); - if (expr_copy != null) { - expr_copy.Release (ec); + if (isCompound) { + var lt = ea.Expr as LocalTemporary; + if (lt != null) + lt.Release (ec); } if (leave_copy) { @@ -8460,28 +8624,19 @@ namespace Mono.CSharp } } - public void EmitNew (EmitContext ec, New source, bool leave_copy) - { - if (!source.Emit (ec, this)) { - if (leave_copy) - throw new NotImplementedException (); - - return; - } - - throw new NotImplementedException (); - } - - public void AddressOf (EmitContext ec, AddressOp mode) + public override Expression EmitToField (EmitContext ec) { - var ac = (ArrayContainer) ea.Expr.Type; - - LoadArrayAndArguments (ec); - - if (ac.Element.IsGenericParameter && mode == AddressOp.Load) - ec.Emit (OpCodes.Readonly); - - ec.EmitArrayAddress (ac); + // + // Have to be specialized for arrays to get access to + // underlying element. Instead of another result copy we + // need direct access to element + // + // Consider: + // + // CallRef (ref a[await Task.Factory.StartNew (() => 1)]); + // + ea.Expr = ea.Expr.EmitToField (ec); + return this; } public SLE.Expression MakeAssignExpression (BuilderContext ctx, Expression source) @@ -8500,7 +8655,7 @@ namespace Mono.CSharp SLE.Expression[] MakeExpressionArguments (BuilderContext ctx) { - using (ctx.With (BuilderContext.Options.AllCheckStateFlags, true)) { + using (ctx.With (BuilderContext.Options.CheckedScope, true)) { return Arguments.MakeExpression (ea.Arguments, ctx); } } @@ -8509,9 +8664,8 @@ namespace Mono.CSharp // // Indexer access expression // - class IndexerExpr : PropertyOrIndexerExpr, OverloadResolver.IBaseMembersProvider + sealed class IndexerExpr : PropertyOrIndexerExpr, OverloadResolver.IBaseMembersProvider { - LocalTemporary prepared_value; IList indexers; Arguments arguments; TypeSpec queried_type; @@ -8527,6 +8681,15 @@ namespace Mono.CSharp #region Properties + protected override Arguments Arguments { + get { + return arguments; + } + set { + arguments = value; + } + } + protected override TypeSpec DeclaringType { get { return best_candidate.DeclaringType; @@ -8553,6 +8716,11 @@ namespace Mono.CSharp #endregion + public override bool ContainsEmitWithAwait () + { + return base.ContainsEmitWithAwait () || arguments.ContainsEmitWithAwait (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { Arguments args = Arguments.CreateForExpressionTree (ec, arguments, @@ -8561,55 +8729,71 @@ namespace Mono.CSharp return CreateExpressionFactoryCall (ec, "Call", args); } - - public override void Emit (EmitContext ec, bool leave_copy) + + public override void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool isCompound) { - if (prepared) { - prepared_value.Emit (ec); - } else { - Invocation.EmitCall (ec, InstanceExpression, Getter, arguments, loc); - } + LocalTemporary await_source_arg = null; - if (leave_copy) { - ec.Emit (OpCodes.Dup); - temp = new LocalTemporary (Type); - temp.Store (ec); - } - } - - public override void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load) - { - prepared = prepare_for_load; - Expression value = source; + if (isCompound) { + emitting_compound_assignment = true; + if (source is DynamicExpressionStatement) { + Emit (ec, false); + } else { + source.Emit (ec); + } + emitting_compound_assignment = false; - if (prepared) { - Invocation.EmitCall (ec, InstanceExpression, Getter, arguments, loc, true, false); + if (has_await_arguments) { + await_source_arg = new LocalTemporary (Type); + await_source_arg.Store (ec); - prepared_value = new LocalTemporary (type); - prepared_value.Store (ec); - source.Emit (ec); - prepared_value.Release (ec); + arguments.Add (new Argument (await_source_arg)); + + if (leave_copy) { + temp = await_source_arg; + } + + has_await_arguments = false; + } else { + arguments = null; + if (leave_copy) { + ec.Emit (OpCodes.Dup); + temp = new LocalTemporary (Type); + temp.Store (ec); + } + } + } else { if (leave_copy) { - ec.Emit (OpCodes.Dup); - temp = new LocalTemporary (Type); - temp.Store (ec); + if (ec.HasSet (BuilderContext.Options.AsyncBody) && (arguments.ContainsEmitWithAwait () || source.ContainsEmitWithAwait ())) { + source = source.EmitToField (ec); + } else { + temp = new LocalTemporary (Type); + source.Emit (ec); + temp.Store (ec); + source = temp; + } } - } else if (leave_copy) { - temp = new LocalTemporary (Type); - source.Emit (ec); - temp.Store (ec); - value = temp; + + arguments.Add (new Argument (source)); } - - if (!prepared) - arguments.Add (new Argument (value)); - Invocation.EmitCall (ec, InstanceExpression, Setter, arguments, loc, false, prepared); - + var call = new CallEmitter (); + call.InstanceExpression = InstanceExpression; + if (arguments == null) + call.InstanceExpressionOnStack = true; + + call.Emit (ec, Setter, arguments, loc); + if (temp != null) { temp.Emit (ec); temp.Release (ec); + } else if (leave_copy) { + source.Emit (ec); + } + + if (await_source_arg != null) { + await_source_arg.Release (ec); } } @@ -8837,6 +9021,11 @@ namespace Mono.CSharp loc = Location.Null; } + public override bool ContainsEmitWithAwait () + { + return false; + } + public override Expression CreateExpressionTree (ResolveContext ec) { throw new NotSupportedException ("ET"); @@ -8862,6 +9051,19 @@ namespace Mono.CSharp } } + sealed class EmptyAwaitExpression : EmptyExpression + { + public EmptyAwaitExpression (TypeSpec type) + : base (type) + { + } + + public override bool ContainsEmitWithAwait () + { + return true; + } + } + // // Empty statement expression // @@ -8874,6 +9076,11 @@ namespace Mono.CSharp loc = Location.Null; } + public override bool ContainsEmitWithAwait () + { + return false; + } + public override Expression CreateExpressionTree (ResolveContext ec) { return null; @@ -8944,6 +9151,11 @@ namespace Mono.CSharp } } + public override bool ContainsEmitWithAwait () + { + return source.ContainsEmitWithAwait (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { Arguments args = new Arguments (3); @@ -9148,6 +9360,11 @@ namespace Mono.CSharp this.loc = l; } + public override bool ContainsEmitWithAwait () + { + throw new NotImplementedException (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { Error_PointerInsideExpressionTree (ec); @@ -9251,6 +9468,11 @@ namespace Mono.CSharp loc = l; } + public override bool ContainsEmitWithAwait () + { + return false; + } + public override Expression CreateExpressionTree (ResolveContext ec) { throw new NotSupportedException ("ET"); @@ -9542,6 +9764,16 @@ namespace Mono.CSharp t.initializers.Add (e.Clone (clonectx)); } + public override bool ContainsEmitWithAwait () + { + foreach (var e in initializers) { + if (e.ContainsEmitWithAwait ()) + return true; + } + + return false; + } + public override Expression CreateExpressionTree (ResolveContext ec) { var expr_initializers = new ArrayInitializer (initializers.Count, loc); @@ -9652,6 +9884,11 @@ namespace Mono.CSharp this.new_instance = newInstance; } + public override bool ContainsEmitWithAwait () + { + return false; + } + public override Expression CreateExpressionTree (ResolveContext ec) { // Should not be reached @@ -9674,6 +9911,11 @@ namespace Mono.CSharp e.Emit (ec); } + public override Expression EmitToField (EmitContext ec) + { + return (Expression) new_instance.instance; + } + #region IMemoryLocation Members public void AddressOf (EmitContext ec, AddressOp mode) @@ -9699,16 +9941,6 @@ namespace Mono.CSharp this.initializers = initializers; } - protected override IMemoryLocation EmitAddressOf (EmitContext ec, AddressOp Mode) - { - instance = base.EmitAddressOf (ec, Mode); - - if (!initializers.IsEmpty) - initializers.Emit (ec); - - return instance; - } - protected override void CloneTo (CloneContext clonectx, Expression t) { base.CloneTo (clonectx, t); @@ -9717,6 +9949,11 @@ namespace Mono.CSharp target.initializers = (CollectionOrObjectInitializers) initializers.Clone (clonectx); } + public override bool ContainsEmitWithAwait () + { + return base.ContainsEmitWithAwait () || initializers.ContainsEmitWithAwait (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { Arguments args = new Arguments (2); @@ -9749,11 +9986,14 @@ namespace Mono.CSharp if (initializers.IsEmpty) return left_on_stack; - LocalTemporary temp = target as LocalTemporary; - if (temp == null) { + LocalTemporary temp = null; + + instance = target as LocalTemporary; + + if (instance == null) { if (!left_on_stack) { VariableReference vr = target as VariableReference; - + // FIXME: This still does not work correctly for pre-set variables if (vr != null && vr.IsRef) target.AddressOf (ec, AddressOp.Load); @@ -9762,23 +10002,41 @@ namespace Mono.CSharp left_on_stack = true; } - temp = new LocalTemporary (type); + if (ec.HasSet (BuilderContext.Options.AsyncBody) && initializers.ContainsEmitWithAwait ()) { + instance = new EmptyAwaitExpression (Type).EmitToField (ec) as IMemoryLocation; + } else { + temp = new LocalTemporary (type); + instance = temp; + } } - instance = temp; - if (left_on_stack) + if (left_on_stack && temp != null) temp.Store (ec); initializers.Emit (ec); if (left_on_stack) { - temp.Emit (ec); - temp.Release (ec); + if (temp != null) { + temp.Emit (ec); + temp.Release (ec); + } else { + ((Expression) instance).Emit (ec); + } } return left_on_stack; } + protected override IMemoryLocation EmitAddressOf (EmitContext ec, AddressOp Mode) + { + instance = base.EmitAddressOf (ec, Mode); + + if (!initializers.IsEmpty) + initializers.Emit (ec); + + return instance; + } + public override object Accept (StructuralVisitor visitor) { return visitor.Visit (this); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/flowanalysis.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/flowanalysis.cs index d864dc875e..f54f6f1790 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/flowanalysis.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/flowanalysis.cs @@ -7,6 +7,7 @@ // // Copyright 2001, 2002, 2003 Ximian, Inc. // Copyright 2003-2008 Novell, Inc. +// Copyright 2011 Xamarin, Inc. // using System; @@ -250,7 +251,12 @@ namespace Mono.CSharp } public bool IsUnreachable { - get { return is_unreachable; } + get { + return is_unreachable; + } + set { + is_unreachable = value; + } } public void ResetBarrier () @@ -415,9 +421,9 @@ namespace Mono.CSharp return Parent.CheckRethrow (loc); } - public virtual bool AddResumePoint (ResumableStatement stmt, Location loc, out int pc) + public virtual bool AddResumePoint (ResumableStatement stmt, out int pc) { - return Parent.AddResumePoint (stmt, loc, out pc); + return Parent.AddResumePoint (stmt, out pc); } // returns true if we crossed an unwind-protected region (try/catch/finally, lock, using, ...) @@ -636,15 +642,15 @@ namespace Mono.CSharp public class FlowBranchingIterator : FlowBranchingBlock { - readonly StateMachineInitializer iterator; + readonly Iterator iterator; - public FlowBranchingIterator (FlowBranching parent, StateMachineInitializer iterator) + public FlowBranchingIterator (FlowBranching parent, Iterator iterator) : base (parent, BranchingType.Iterator, SiblingType.Block, iterator.Block, iterator.Location) { this.iterator = iterator; } - public override bool AddResumePoint (ResumableStatement stmt, Location loc, out int pc) + public override bool AddResumePoint (ResumableStatement stmt, out int pc) { pc = iterator.AddResumePoint (stmt); return false; @@ -666,7 +672,7 @@ namespace Mono.CSharp return false; } - public override bool AddResumePoint (ResumableStatement stmt, Location loc, out int pc) + public override bool AddResumePoint (ResumableStatement stmt, out int pc) { throw new InternalErrorException ("A yield in a non-iterator block"); } @@ -730,11 +736,12 @@ namespace Mono.CSharp public class FlowBranchingTryCatch : FlowBranchingBlock { - TryCatch stmt; + readonly TryCatch tc; + public FlowBranchingTryCatch (FlowBranching parent, TryCatch stmt) : base (parent, BranchingType.Block, SiblingType.Try, null, stmt.loc) { - this.stmt = stmt; + this.tc = stmt; } public override bool CheckRethrow (Location loc) @@ -742,37 +749,46 @@ namespace Mono.CSharp return CurrentUsageVector.Next != null || Parent.CheckRethrow (loc); } - public override bool AddResumePoint (ResumableStatement stmt, Location loc, out int pc) + public override bool AddResumePoint (ResumableStatement stmt, out int pc) { int errors = Report.Errors; - Parent.AddResumePoint (stmt, loc, out pc); + Parent.AddResumePoint (tc.IsTryCatchFinally ? stmt : tc, out pc); if (errors == Report.Errors) { - if (CurrentUsageVector.Next == null) - Report.Error (1626, loc, "Cannot yield a value in the body of a try block with a catch clause"); - else - Report.Error (1631, loc, "Cannot yield a value in the body of a catch clause"); + if (stmt is AwaitStatement) { + if (CurrentUsageVector.Next != null) { + Report.Error (1985, stmt.loc, "The `await' operator cannot be used in the body of a catch clause"); + } else { + this.tc.AddResumePoint (stmt, pc); + } + } else { + if (CurrentUsageVector.Next == null) + Report.Error (1626, stmt.loc, "Cannot yield a value in the body of a try block with a catch clause"); + else + Report.Error (1631, stmt.loc, "Cannot yield a value in the body of a catch clause"); + } } + return true; } public override bool AddBreakOrigin (UsageVector vector, Location loc) { Parent.AddBreakOrigin (vector, loc); - stmt.SomeCodeFollows (); + tc.SomeCodeFollows (); return true; } public override bool AddContinueOrigin (UsageVector vector, Location loc) { Parent.AddContinueOrigin (vector, loc); - stmt.SomeCodeFollows (); + tc.SomeCodeFollows (); return true; } public override bool AddReturnOrigin (UsageVector vector, ExitStatement exit_stmt) { Parent.AddReturnOrigin (vector, exit_stmt); - stmt.SomeCodeFollows (); + tc.SomeCodeFollows (); return true; } @@ -783,7 +799,53 @@ namespace Mono.CSharp } } - public class FlowBranchingException : FlowBranching + public class FlowBranchingAsync : FlowBranchingBlock + { + readonly AsyncInitializer async_init; + + public FlowBranchingAsync (FlowBranching parent, AsyncInitializer async_init) + : base (parent, BranchingType.Block, SiblingType.Try, null, async_init.Location) + { + this.async_init = async_init; + } +/* + public override bool CheckRethrow (Location loc) + { + return CurrentUsageVector.Next != null || Parent.CheckRethrow (loc); + } +*/ + public override bool AddResumePoint (ResumableStatement stmt, out int pc) + { + pc = async_init.AddResumePoint (stmt); + return true; + } + + public override bool AddBreakOrigin (UsageVector vector, Location loc) + { + Parent.AddBreakOrigin (vector, loc); + return true; + } + + public override bool AddContinueOrigin (UsageVector vector, Location loc) + { + Parent.AddContinueOrigin (vector, loc); + return true; + } + + public override bool AddReturnOrigin (UsageVector vector, ExitStatement exit_stmt) + { + Parent.AddReturnOrigin (vector, exit_stmt); + return true; + } + + public override bool AddGotoOrigin (UsageVector vector, Goto goto_stmt) + { + Parent.AddGotoOrigin (vector, goto_stmt); + return true; + } + } + + public class FlowBranchingTryFinally : FlowBranching { ExceptionStatement stmt; UsageVector current_vector; @@ -869,7 +931,7 @@ namespace Mono.CSharp SavedOrigin saved_origins; - public FlowBranchingException (FlowBranching parent, + public FlowBranchingTryFinally (FlowBranching parent, ExceptionStatement stmt) : base (parent, BranchingType.Exception, SiblingType.Try, null, stmt.loc) @@ -906,15 +968,20 @@ namespace Mono.CSharp return false; } - public override bool AddResumePoint (ResumableStatement stmt, Location loc, out int pc) + public override bool AddResumePoint (ResumableStatement stmt, out int pc) { int errors = Report.Errors; - Parent.AddResumePoint (this.stmt, loc, out pc); + Parent.AddResumePoint (this.stmt, out pc); if (errors == Report.Errors) { if (finally_vector == null) this.stmt.AddResumePoint (stmt, pc); - else - Report.Error (1625, loc, "Cannot yield in the body of a finally clause"); + else { + if (stmt is AwaitStatement) { + Report.Error (1984, stmt.loc, "The `await' operator cannot be used in the body of a finally clause"); + } else { + Report.Error (1625, stmt.loc, "Cannot yield in the body of a finally clause"); + } + } } return true; } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/generic.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/generic.cs index 1975704777..d955f868f7 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/generic.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/generic.cs @@ -9,7 +9,9 @@ // // Copyright 2001, 2002, 2003 Ximian, Inc (http://www.ximian.com) // Copyright 2004-2008 Novell, Inc +// Copyright 2011 Xamarin, Inc (http://www.xamarin.com) // + using System; using System.Collections.Generic; using System.Text; @@ -723,8 +725,8 @@ namespace Mono.CSharp { } } - if (ifaces_defined == null && ifaces != null) - ifaces_defined = ifaces.ToArray (); + if (ifaces_defined == null) + ifaces_defined = ifaces == null ? TypeSpec.EmptyTypes : ifaces.ToArray (); state |= StateFlags.InterfacesExpanded; } @@ -738,13 +740,19 @@ namespace Mono.CSharp { // public TypeSpec[] InterfacesDefined { get { - if (ifaces_defined == null && ifaces != null) + if (ifaces_defined == null) { + if (ifaces == null) + return null; + ifaces_defined = ifaces.ToArray (); + } - return ifaces_defined; + return ifaces_defined.Length == 0 ? null : ifaces_defined; } set { - ifaces = ifaces_defined = value; + ifaces_defined = value; + if (value != null && value.Length != 0) + ifaces = value; } } @@ -974,10 +982,13 @@ namespace Mono.CSharp { // Check interfaces implementation -> definition if (InterfacesDefined != null) { - foreach (var iface in InterfacesDefined) { + // + // Iterate over inflated interfaces + // + foreach (var iface in Interfaces) { found = false; if (other.InterfacesDefined != null) { - foreach (var oiface in other.InterfacesDefined) { + foreach (var oiface in other.Interfaces) { if (TypeSpecComparer.Override.IsEqual (iface, oiface)) { found = true; break; @@ -1007,9 +1018,12 @@ namespace Mono.CSharp { if (InterfacesDefined == null) return false; - foreach (var oiface in other.InterfacesDefined) { + // + // Iterate over inflated interfaces + // + foreach (var oiface in other.Interfaces) { found = false; - foreach (var iface in InterfacesDefined) { + foreach (var iface in Interfaces) { if (TypeSpecComparer.Override.IsEqual (iface, oiface)) { found = true; break; @@ -2789,7 +2803,7 @@ namespace Mono.CSharp { // Some types cannot be used as type arguments // if (bound.Type.Kind == MemberKind.Void || bound.Type.IsPointer || bound.Type.IsSpecialRuntimeType || - bound.Type == InternalType.MethodGroup) + bound.Type == InternalType.MethodGroup || bound.Type == InternalType.AnonymousMethod) return; var a = bounds [index]; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/import.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/import.cs index 137c5ccb38..595a6193e6 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/import.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/import.cs @@ -5,7 +5,8 @@ // // Dual licensed under the terms of the MIT X11 or GNU GPL // -// Copyright 2009, 2010 Novell, Inc +// Copyright 2009-2011 Novell, Inc +// Copyright 2011 Xamarin, Inc (http://www.xamarin.com) // using System; @@ -962,6 +963,15 @@ namespace Mono.CSharp if (spec.BaseType != null) { var bifaces = spec.BaseType.Interfaces; if (bifaces != null) { + // + // Before adding base class interfaces close defined interfaces + // on type parameter + // + var tp = spec as TypeParameterSpec; + if (tp != null && tp.InterfacesDefined == null) { + tp.InterfacesDefined = TypeSpec.EmptyTypes; + } + foreach (var iface in bifaces) spec.AddInterface (iface); } @@ -1894,6 +1904,15 @@ namespace Mono.CSharp } } + // + // Load base interfaces first to minic behaviour of compiled members + // + if (declaringType.IsInterface && declaringType.Interfaces != null) { + foreach (var iface in declaringType.Interfaces) { + cache.AddInterface (iface); + } + } + if (!onlyTypes) { // // The logic here requires methods to be returned first which seems to work for both Mono and .NET @@ -2024,12 +2043,6 @@ namespace Mono.CSharp cache.AddMemberImported (imported); } } - - if (declaringType.IsInterface && declaringType.Interfaces != null) { - foreach (var iface in declaringType.Interfaces) { - cache.AddInterface (iface); - } - } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/iterators.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/iterators.cs index 9a256de68c..04e468db4a 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/iterators.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/iterators.cs @@ -8,6 +8,7 @@ // Dual licensed under the terms of the MIT X11 or GNU GPL // Copyright 2003 Ximian, Inc. // Copyright 2003-2008 Novell, Inc. +// Copyright 2011 Xamarin Inc. // // TODO: @@ -28,7 +29,7 @@ namespace Mono.CSharp public abstract class YieldStatement : ResumableStatement where T : StateMachineInitializer { protected Expression expr; - bool unwind_protect; + protected bool unwind_protect; protected T machine_initializer; int resume_pc; @@ -62,7 +63,7 @@ namespace Mono.CSharp machine_initializer = bc.CurrentAnonymousMethod as T; if (!bc.CurrentBranching.CurrentUsageVector.IsUnreachable) - unwind_protect = bc.CurrentBranching.AddResumePoint (this, loc, out resume_pc); + unwind_protect = bc.CurrentBranching.AddResumePoint (this, out resume_pc); return true; } @@ -156,7 +157,6 @@ namespace Mono.CSharp Start = 0 } - Field disposing_field; Field pc_field; int local_name_idx; StateMachineMethod method; @@ -168,12 +168,6 @@ namespace Mono.CSharp #region Properties - public Field DisposingField { - get { - return disposing_field; - } - } - public StateMachineMethod StateMachineMethod { get { return method; @@ -200,14 +194,13 @@ namespace Mono.CSharp protected override bool DoDefineMembers () { pc_field = AddCompilerGeneratedField ("$PC", new TypeExpression (Compiler.BuiltinTypes.Int, Location)); - disposing_field = AddCompilerGeneratedField ("$disposing", new TypeExpression (Compiler.BuiltinTypes.Bool, Location)); return base.DoDefineMembers (); } protected override string GetVariableMangledName (LocalVariable local_info) { - return "<" + local_info.Name + ">__" + local_name_idx++.ToString (); + return "<" + local_info.Name + ">__" + local_name_idx++.ToString ("X"); } } @@ -280,7 +273,7 @@ namespace Mono.CSharp { Label label_init = ec.DefineLabel (); - ec.Emit (OpCodes.Ldarg_0); + ec.EmitThis (); ec.Emit (OpCodes.Ldflda, host.PC.Spec); ec.EmitInt ((int) State.Start); ec.EmitInt ((int) State.Uninitialized); @@ -292,7 +285,7 @@ namespace Mono.CSharp ec.EmitInt ((int) State.Uninitialized); ec.Emit (OpCodes.Bne_Un_S, label_init); - ec.Emit (OpCodes.Ldarg_0); + ec.EmitThis (); ec.Emit (OpCodes.Ret); ec.MarkLabel (label_init); @@ -396,6 +389,7 @@ namespace Mono.CSharp TypeExpr iterator_type_expr; Field current_field; + Field disposing_field; TypeExpr enumerator_type; TypeExpr enumerable_type; @@ -411,7 +405,15 @@ namespace Mono.CSharp } public Field CurrentField { - get { return current_field; } + get { + return current_field; + } + } + + public Field DisposingField { + get { + return disposing_field; + } } public IList HoistedParameters { @@ -457,6 +459,7 @@ namespace Mono.CSharp protected override bool DoDefineMembers () { current_field = AddCompilerGeneratedField ("$current", iterator_type_expr); + disposing_field = AddCompilerGeneratedField ("$disposing", new TypeExpression (Compiler.BuiltinTypes.Bool, Location)); if (hoisted_params != null) { // @@ -578,6 +581,10 @@ namespace Mono.CSharp { EmitContext ec = new EmitContext (this, ig, MemberType); ec.CurrentAnonymousMethod = expr; + + if (expr is AsyncInitializer) + ec.With (BuilderContext.Options.AsyncBody, true); + return ec; } } @@ -617,9 +624,11 @@ namespace Mono.CSharp // The state as we generate the machine // Label move_next_ok; + Label iterator_body_end; protected Label move_next_error; - protected LocalBuilder skip_finally, current_pc; - List resume_points; + LocalBuilder skip_finally; + protected LocalBuilder current_pc; + protected List resume_points; protected StateMachineInitializer (ParametersBlock block, TypeContainer host, TypeSpec returnType) : base (block, returnType, block.StartLocation) @@ -627,12 +636,35 @@ namespace Mono.CSharp this.Host = host; } + #region Properties + + public Label BodyEnd { + get { + return iterator_body_end; + } + } + + public LocalBuilder CurrentPC + { + get { + return current_pc; + } + } + + public LocalBuilder SkipFinally { + get { + return skip_finally; + } + } + public override AnonymousMethodStorey Storey { get { return storey; } } + #endregion + public int AddResumePoint (ResumableStatement stmt) { if (resume_points == null) @@ -660,7 +692,6 @@ namespace Mono.CSharp var ctx = CreateBlockContext (ec); - ctx.StartFlowBranching (this, ec.CurrentBranching); Block.Resolve (ctx); // @@ -690,70 +721,26 @@ namespace Mono.CSharp storey.Instance.Emit (ec); } - public void EmitDispose (EmitContext ec) - { - Label end = ec.DefineLabel (); - - Label[] labels = null; - int n_resume_points = resume_points == null ? 0 : resume_points.Count; - for (int i = 0; i < n_resume_points; ++i) { - ResumableStatement s = resume_points[i]; - Label ret = s.PrepareForDispose (ec, end); - if (ret.Equals (end) && labels == null) - continue; - if (labels == null) { - labels = new Label[resume_points.Count + 1]; - for (int j = 0; j <= i; ++j) - labels[j] = end; - } - - labels[i + 1] = ret; - } - - if (labels != null) { - current_pc = ec.GetTemporaryLocal (ec.BuiltinTypes.UInt); - ec.Emit (OpCodes.Ldarg_0); - ec.Emit (OpCodes.Ldfld, storey.PC.Spec); - ec.Emit (OpCodes.Stloc, current_pc); - } - - ec.Emit (OpCodes.Ldarg_0); - ec.EmitInt (1); - ec.Emit (OpCodes.Stfld, storey.DisposingField.Spec); - - ec.Emit (OpCodes.Ldarg_0); - ec.EmitInt ((int) IteratorStorey.State.After); - ec.Emit (OpCodes.Stfld, storey.PC.Spec); - - if (labels != null) { - //SymbolWriter.StartIteratorDispatcher (ec.ig); - ec.Emit (OpCodes.Ldloc, current_pc); - ec.Emit (OpCodes.Switch, labels); - //SymbolWriter.EndIteratorDispatcher (ec.ig); - - foreach (ResumableStatement s in resume_points) - s.EmitForDispose (ec, current_pc, end, true); - } - - ec.MarkLabel (end); - } - void EmitMoveNext_NoResumePoints (EmitContext ec, Block original_block) { - ec.Emit (OpCodes.Ldarg_0); + ec.EmitThis (); ec.Emit (OpCodes.Ldfld, storey.PC.Spec); - ec.Emit (OpCodes.Ldarg_0); + ec.EmitThis (); ec.EmitInt ((int) IteratorStorey.State.After); ec.Emit (OpCodes.Stfld, storey.PC.Spec); // We only care if the PC is zero (start executing) or non-zero (don't do anything) ec.Emit (OpCodes.Brtrue, move_next_error); + iterator_body_end = ec.DefineLabel (); + SymbolWriter.StartIteratorBody (ec); original_block.Emit (ec); SymbolWriter.EndIteratorBody (ec); + ec.MarkLabel (iterator_body_end); + EmitMoveNextEpilogue (ec); ec.MarkLabel (move_next_error); @@ -773,14 +760,14 @@ namespace Mono.CSharp EmitMoveNext_NoResumePoints (ec, block); return; } - + current_pc = ec.GetTemporaryLocal (ec.BuiltinTypes.UInt); - ec.Emit (OpCodes.Ldarg_0); + ec.EmitThis (); ec.Emit (OpCodes.Ldfld, storey.PC.Spec); ec.Emit (OpCodes.Stloc, current_pc); // We're actually in state 'running', but this is as good a PC value as any if there's an abnormal exit - ec.Emit (OpCodes.Ldarg_0); + ec.EmitThis (); ec.EmitInt ((int) IteratorStorey.State.After); ec.Emit (OpCodes.Stfld, storey.PC.Spec); @@ -796,33 +783,57 @@ namespace Mono.CSharp if (need_skip_finally) { skip_finally = ec.GetTemporaryLocal (ec.BuiltinTypes.Bool); - ec.Emit (OpCodes.Ldc_I4_0); + ec.EmitInt (0); ec.Emit (OpCodes.Stloc, skip_finally); } + var async_init = this as AsyncInitializer; + if (async_init != null) + ec.BeginExceptionBlock (); + SymbolWriter.StartIteratorDispatcher (ec); ec.Emit (OpCodes.Ldloc, current_pc); ec.Emit (OpCodes.Switch, labels); - ec.Emit (OpCodes.Br, move_next_error); + ec.Emit (async_init != null ? OpCodes.Leave : OpCodes.Br, move_next_error); SymbolWriter.EndIteratorDispatcher (ec); ec.MarkLabel (labels[0]); + iterator_body_end = ec.DefineLabel (); + SymbolWriter.StartIteratorBody (ec); block.Emit (ec); SymbolWriter.EndIteratorBody (ec); SymbolWriter.StartIteratorDispatcher (ec); - ec.Emit (OpCodes.Ldarg_0); + ec.MarkLabel (iterator_body_end); + + if (async_init != null) { + var catch_value = LocalVariable.CreateCompilerGenerated (ec.Module.Compiler.BuiltinTypes.Exception, block, Location); + + ec.BeginCatchBlock (catch_value.Type); + catch_value.EmitAssign (ec); + + ec.EmitThis (); + ec.EmitInt ((int) IteratorStorey.State.After); + ec.Emit (OpCodes.Stfld, storey.PC.Spec); + + ((AsyncTaskStorey) async_init.Storey).EmitSetException (ec, new LocalVariableReference (catch_value, Location)); + + ec.Emit (OpCodes.Leave, move_next_ok); + ec.EndExceptionBlock (); + } + + ec.EmitThis (); ec.EmitInt ((int) IteratorStorey.State.After); ec.Emit (OpCodes.Stfld, storey.PC.Spec); EmitMoveNextEpilogue (ec); ec.MarkLabel (move_next_error); - + if (ReturnType.Kind != MemberKind.Void) { ec.EmitInt (0); ec.Emit (OpCodes.Ret); @@ -842,6 +853,12 @@ namespace Mono.CSharp { } + public void EmitLeave (EmitContext ec, bool unwind_protect) + { + // Return ok + ec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, move_next_ok); + } + // // Called back from YieldStatement // @@ -851,28 +868,29 @@ namespace Mono.CSharp // Guard against being disposed meantime // Label disposed = ec.DefineLabel (); - ec.Emit (OpCodes.Ldarg_0); - ec.Emit (OpCodes.Ldfld, storey.DisposingField.Spec); - ec.Emit (OpCodes.Brtrue_S, disposed); + var iterator = storey as IteratorStorey; + if (iterator != null) { + ec.EmitThis (); + ec.Emit (OpCodes.Ldfld, iterator.DisposingField.Spec); + ec.Emit (OpCodes.Brtrue_S, disposed); + } // // store resume program-counter // - ec.Emit (OpCodes.Ldarg_0); + ec.EmitThis (); ec.EmitInt (resume_pc); ec.Emit (OpCodes.Stfld, storey.PC.Spec); - ec.MarkLabel (disposed); + + if (iterator != null) { + ec.MarkLabel (disposed); + } // mark finally blocks as disabled if (unwind_protect && skip_finally != null) { ec.EmitInt (1); ec.Emit (OpCodes.Stloc, skip_finally); } - - // Return ok - ec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, move_next_ok); - - ec.MarkLabel (resume_point); } } @@ -894,14 +912,6 @@ namespace Mono.CSharp this.type = method.ReturnType; } - public LocalBuilder SkipFinally { - get { return skip_finally; } - } - - public LocalBuilder CurrentPC { - get { return current_pc; } - } - public Block Container { get { return OriginalMethod.Block; } } @@ -951,6 +961,54 @@ namespace Mono.CSharp } } + public void EmitDispose (EmitContext ec) + { + Label end = ec.DefineLabel (); + + Label[] labels = null; + int n_resume_points = resume_points == null ? 0 : resume_points.Count; + for (int i = 0; i < n_resume_points; ++i) { + ResumableStatement s = resume_points[i]; + Label ret = s.PrepareForDispose (ec, end); + if (ret.Equals (end) && labels == null) + continue; + if (labels == null) { + labels = new Label[resume_points.Count + 1]; + for (int j = 0; j <= i; ++j) + labels[j] = end; + } + + labels[i + 1] = ret; + } + + if (labels != null) { + current_pc = ec.GetTemporaryLocal (ec.BuiltinTypes.UInt); + ec.EmitThis (); + ec.Emit (OpCodes.Ldfld, storey.PC.Spec); + ec.Emit (OpCodes.Stloc, current_pc); + } + + ec.EmitThis (); + ec.EmitInt (1); + ec.Emit (OpCodes.Stfld, ((IteratorStorey) storey).DisposingField.Spec); + + ec.EmitThis (); + ec.EmitInt ((int) IteratorStorey.State.After); + ec.Emit (OpCodes.Stfld, storey.PC.Spec); + + if (labels != null) { + //SymbolWriter.StartIteratorDispatcher (ec.ig); + ec.Emit (OpCodes.Ldloc, current_pc); + ec.Emit (OpCodes.Switch, labels); + //SymbolWriter.EndIteratorDispatcher (ec.ig); + + foreach (ResumableStatement s in resume_points) + s.EmitForDispose (ec, current_pc, end, true); + } + + ec.MarkLabel (end); + } + public override void EmitStatement (EmitContext ec) { throw new NotImplementedException (); @@ -964,6 +1022,17 @@ namespace Mono.CSharp fe.EmitAssign (ec, expr, false, false); base.InjectYield (ec, expr, resume_pc, unwind_protect, resume_point); + + EmitLeave (ec, unwind_protect); + + ec.MarkLabel (resume_point); + } + + protected override BlockContext CreateBlockContext (ResolveContext rc) + { + var bc = base.CreateBlockContext (rc); + bc.StartFlowBranching (this, rc.CurrentBranching); + return bc; } public static void CreateIterator (IMethodData method, TypeContainer parent, Modifiers modifiers) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/lambda.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/lambda.cs index 3cad50ce49..16f96a33de 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/lambda.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/lambda.cs @@ -199,7 +199,11 @@ namespace Mono.CSharp { { if (statement != null) { statement.EmitStatement (ec); - ec.Emit (OpCodes.Ret); + if (unwind_protect) + ec.Emit (OpCodes.Leave, ec.CreateReturnLabel ()); + else { + ec.Emit (OpCodes.Ret); + } return; } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/location.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/location.cs index fd3fe3aaa3..04907b3464 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/location.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/location.cs @@ -516,7 +516,9 @@ if (checkpoints.Length <= CheckpointIndex) throw new Exception (String.Format (" public readonly Tokenizer.PreprocessorDirective Cmd; public readonly string Arg; - + + public bool Take = true; + public PreProcessorDirective (int line, int col, int endLine, int endCol, Tokenizer.PreprocessorDirective cmd, string arg) { this.Line = line; @@ -574,6 +576,15 @@ if (checkpoints.Length <= CheckpointIndex) throw new Exception (String.Format (" { Specials.Add (new PreProcessorDirective (startLine, startCol, endLine, endColumn, cmd, arg)); } + + public void SkipIf () + { + if (Specials.Count > 0) { + var directive = Specials[Specials.Count - 1] as PreProcessorDirective; + if (directive != null) + directive.Take = false; + } + } } // @@ -897,6 +908,12 @@ if (checkpoints.Length <= CheckpointIndex) throw new Exception (String.Format (" curNamespace.Pop (); } + [Conditional ("FULL_AST")] + public void EndNamespace () + { + curNamespace.Pop (); + } + [Conditional ("FULL_AST")] public void OpenNamespace (Location bracketLocation) { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/method.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/method.cs index 75998515ac..c69c1d766f 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/method.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/method.cs @@ -613,7 +613,7 @@ namespace Mono.CSharp { MethodData = new MethodData ( this, ModFlags, flags, this, MethodBuilder, GenericMethod, base_method); - if (!MethodData.Define (Parent.PartialContainer, GetFullName (MemberName), Report)) + if (!MethodData.Define (Parent.PartialContainer, GetFullName (MemberName))) return false; MethodBuilder = MethodData.MethodBuilder; @@ -1151,7 +1151,7 @@ namespace Mono.CSharp { } if ((ModFlags & Modifiers.ASYNC) != 0) { - AsyncInitializer.Create (block, parameters, Parent.PartialContainer, ReturnType, Location); + AsyncInitializer.Create (this, block, parameters, Parent.PartialContainer, ReturnType, Location); } } @@ -1316,6 +1316,11 @@ namespace Mono.CSharp { } } + public override bool ContainsEmitWithAwait () + { + throw new NotSupportedException (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { throw new NotSupportedException ("ET"); @@ -1386,7 +1391,9 @@ namespace Mono.CSharp { ec.Mark (loc); - Invocation.EmitCall (ec, new CompilerGeneratedThis (type, loc), base_ctor, argument_list, loc); + var call = new CallEmitter (); + call.InstanceExpression = new CompilerGeneratedThis (type, loc); + call.EmitPredefined (ec, base_ctor, argument_list); } public override void EmitStatement (EmitContext ec) @@ -1633,11 +1640,6 @@ namespace Mono.CSharp { EmitContext ec = new EmitContext (this, ConstructorBuilder.GetILGenerator (), bc.ReturnType); ec.With (EmitContext.Options.ConstructorScope, true); - if (!ec.HasReturnLabel && bc.HasReturnLabel) { - ec.ReturnLabel = bc.ReturnLabel; - ec.HasReturnLabel = true; - } - block.Emit (ec); } } @@ -1817,32 +1819,34 @@ namespace Mono.CSharp { this.parent_method = parent_method; } - public bool Define (DeclSpace parent, string method_full_name, Report Report) + public bool Define (TypeContainer container, string method_full_name) { - TypeContainer container = parent.PartialContainer; - PendingImplementation pending = container.PendingImplementations; MethodSpec ambig_iface_method; + bool optional = false; + if (pending != null) { - implementing = pending.IsInterfaceMethod (method.MethodName, member.InterfaceType, this, out ambig_iface_method); + implementing = pending.IsInterfaceMethod (method.MethodName, member.InterfaceType, this, out ambig_iface_method, ref optional); if (member.InterfaceType != null) { if (implementing == null) { if (member is PropertyBase) { - Report.Error (550, method.Location, "`{0}' is an accessor not found in interface member `{1}{2}'", + container.Compiler.Report.Error (550, method.Location, + "`{0}' is an accessor not found in interface member `{1}{2}'", method.GetSignatureForError (), TypeManager.CSharpName (member.InterfaceType), member.GetSignatureForError ().Substring (member.GetSignatureForError ().LastIndexOf ('.'))); } else { - Report.Error (539, method.Location, + container.Compiler.Report.Error (539, method.Location, "`{0}.{1}' in explicit interface declaration is not a member of interface", TypeManager.CSharpName (member.InterfaceType), member.ShortName); } return false; } if (implementing.IsAccessor && !method.IsAccessor) { - Report.SymbolRelatedToPreviousError (implementing); - Report.Error (683, method.Location, "`{0}' explicit method implementation cannot implement `{1}' because it is an accessor", + container.Compiler.Report.SymbolRelatedToPreviousError (implementing); + container.Compiler.Report.Error (683, method.Location, + "`{0}' explicit method implementation cannot implement `{1}' because it is an accessor", member.GetSignatureForError (), TypeManager.CSharpSignature (implementing)); return false; } @@ -1850,20 +1854,23 @@ namespace Mono.CSharp { if (implementing != null) { if (!method.IsAccessor) { if (implementing.IsAccessor) { - Report.SymbolRelatedToPreviousError (implementing); - Report.Error (470, method.Location, "Method `{0}' cannot implement interface accessor `{1}'", + container.Compiler.Report.SymbolRelatedToPreviousError (implementing); + container.Compiler.Report.Error (470, method.Location, + "Method `{0}' cannot implement interface accessor `{1}'", method.GetSignatureForError (), TypeManager.CSharpSignature (implementing)); } } else if (implementing.DeclaringType.IsInterface) { if (!implementing.IsAccessor) { - Report.SymbolRelatedToPreviousError (implementing); - Report.Error (686, method.Location, "Accessor `{0}' cannot implement interface member `{1}' for type `{2}'. Use an explicit interface implementation", + container.Compiler.Report.SymbolRelatedToPreviousError (implementing); + container.Compiler.Report.Error (686, method.Location, + "Accessor `{0}' cannot implement interface member `{1}' for type `{2}'. Use an explicit interface implementation", method.GetSignatureForError (), TypeManager.CSharpSignature (implementing), container.GetSignatureForError ()); } else { PropertyBase.PropertyMethod pm = method as PropertyBase.PropertyMethod; if (pm != null && pm.HasCustomAccessModifier && (pm.ModFlags & Modifiers.PUBLIC) == 0) { - Report.SymbolRelatedToPreviousError (implementing); - Report.Error (277, method.Location, "Accessor `{0}' must be declared public to implement interface member `{1}'", + container.Compiler.Report.SymbolRelatedToPreviousError (implementing); + container.Compiler.Report.Error (277, method.Location, + "Accessor `{0}' must be declared public to implement interface member `{1}'", method.GetSignatureForError (), implementing.GetSignatureForError ()); } } @@ -1879,43 +1886,44 @@ namespace Mono.CSharp { // explicit implementations, make sure we are private. // if (implementing != null){ - // - // Setting null inside this block will trigger a more - // verbose error reporting for missing interface implementations - // - // The "candidate" function has been flagged already - // but it wont get cleared - // - if (member.IsExplicitImpl){ + if (member.IsExplicitImpl) { if (method.ParameterInfo.HasParams && !implementing.Parameters.HasParams) { - Report.SymbolRelatedToPreviousError (implementing); - Report.Error (466, method.Location, "`{0}': the explicit interface implementation cannot introduce the params modifier", + container.Compiler.Report.SymbolRelatedToPreviousError (implementing); + container.Compiler.Report.Error (466, method.Location, + "`{0}': the explicit interface implementation cannot introduce the params modifier", method.GetSignatureForError ()); } if (ambig_iface_method != null) { - Report.SymbolRelatedToPreviousError (ambig_iface_method); - Report.SymbolRelatedToPreviousError (implementing); - Report.Warning (473, 2, method.Location, + container.Compiler.Report.SymbolRelatedToPreviousError (ambig_iface_method); + container.Compiler.Report.SymbolRelatedToPreviousError (implementing); + container.Compiler.Report.Warning (473, 2, method.Location, "Explicit interface implementation `{0}' matches more than one interface member. Consider using a non-explicit implementation instead", method.GetSignatureForError ()); } - } else { + // + // Setting implementin to null inside this block will trigger a more + // verbose error reporting for missing interface implementations + // if (implementing.DeclaringType.IsInterface) { // // If this is an interface method implementation, // check for public accessibility // - if ((flags & MethodAttributes.MemberAccessMask) != MethodAttributes.Public) - { + if ((flags & MethodAttributes.MemberAccessMask) != MethodAttributes.Public) { + implementing = null; + } else if (optional && (container.Interfaces == null || Array.IndexOf (container.Interfaces, implementing.DeclaringType) < 0)) { + // + // We are not implementing interface when base class already implemented it + // implementing = null; } - } else if ((flags & MethodAttributes.MemberAccessMask) == MethodAttributes.Private){ + } else if ((flags & MethodAttributes.MemberAccessMask) == MethodAttributes.Private) { // We may never be private. implementing = null; - } else if ((modifiers & Modifiers.OVERRIDE) == 0){ + } else if ((modifiers & Modifiers.OVERRIDE) == 0) { // // We may be protected if we're overriding something. // @@ -1939,9 +1947,8 @@ namespace Mono.CSharp { // When implementing interface methods, set NewSlot // unless, we are overwriting a method. // - if (implementing.DeclaringType.IsInterface){ - if ((modifiers & Modifiers.OVERRIDE) == 0) - flags |= MethodAttributes.NewSlot; + if ((modifiers & Modifiers.OVERRIDE) == 0 && implementing.DeclaringType.IsInterface) { + flags |= MethodAttributes.NewSlot; } flags |= MethodAttributes.Virtual | MethodAttributes.HideBySig; @@ -1953,8 +1960,8 @@ namespace Mono.CSharp { // // clear the pending implementation flag (requires explicit methods to be defined first) // - parent.PartialContainer.PendingImplementations.ImplementMethod (method.MethodName, - member.InterfaceType, this, member.IsExplicitImpl, out ambig_iface_method); + pending.ImplementMethod (method.MethodName, + member.InterfaceType, this, member.IsExplicitImpl, out ambig_iface_method, ref optional); // // Update indexer accessor name to match implementing abstract accessor @@ -2036,10 +2043,6 @@ namespace Mono.CSharp { BlockContext bc = new BlockContext (mc, block, method.ReturnType); if (block.Resolve (null, bc, method)) { EmitContext ec = method.CreateEmitContext (MethodBuilder.GetILGenerator ()); - if (!ec.HasReturnLabel && bc.HasReturnLabel) { - ec.ReturnLabel = bc.ReturnLabel; - ec.HasReturnLabel = true; - } block.Emit (ec); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/namespace.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/namespace.cs index fdafbee39f..bd55dce6c2 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/namespace.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/namespace.cs @@ -370,9 +370,9 @@ namespace Mono.CSharp { return res; } - /// - /// Looks for extension method in this namespace - /// + // + // Looks for extension method in this namespace + // public List LookupExtensionMethod (IMemberContext invocationContext, TypeSpec extensionType, string name, int arity) { if (types == null) @@ -402,6 +402,26 @@ namespace Mono.CSharp { return found; } + // + // Extension methods look up for dotted namespace names + // + public IList LookupExtensionMethod (IMemberContext invocationContext, TypeSpec extensionType, string name, int arity, out Namespace scope) + { + // + // Inspect parent namespaces in namespace expression + // + scope = this; + do { + var candidates = scope.LookupExtensionMethod (invocationContext, extensionType, name, arity); + if (candidates != null) + return candidates; + + scope = scope.Parent; + } while (scope != null); + + return null; + } + public void AddType (ModuleContainer module, TypeSpec ts) { if (types == null) { @@ -797,7 +817,7 @@ namespace Mono.CSharp { // Does extension methods look up to find a method which matches name and extensionType. // Search starts from this namespace and continues hierarchically up to top level. // - public IList LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceContainer scope) + public ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity) { List candidates = null; foreach (Namespace n in GetUsingTable ()) { @@ -811,29 +831,21 @@ namespace Mono.CSharp { candidates.AddRange (a); } - scope = parent; if (candidates != null) - return candidates; + return new ExtensionMethodCandidates (candidates, this); if (parent == null) return null; - // - // Inspect parent namespaces in namespace expression - // - Namespace parent_ns = ns.Parent; - do { - candidates = parent_ns.LookupExtensionMethod (this, extensionType, name, arity); - if (candidates != null) - return candidates; - - parent_ns = parent_ns.Parent; - } while (parent_ns != null); + Namespace ns_scope; + var ns_candidates = ns.Parent.LookupExtensionMethod (this, extensionType, name, arity, out ns_scope); + if (ns_candidates != null) + return new ExtensionMethodCandidates (ns_candidates, this, ns_scope); // - // Continue in parent scope + // Continue in parent container // - return parent.LookupExtensionMethod (extensionType, name, arity, ref scope); + return parent.LookupExtensionMethod (extensionType, name, arity); } public FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc) diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/nullable.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/nullable.cs index f6b9abcca9..28cf683e4c 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/nullable.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/nullable.cs @@ -79,7 +79,7 @@ namespace Mono.CSharp.Nullable } } - public class Unwrap : Expression, IMemoryLocation, IAssignMethod + public class Unwrap : Expression, IMemoryLocation { Expression expr; @@ -96,6 +96,11 @@ namespace Mono.CSharp.Nullable eclass = expr.eclass; } + public override bool ContainsEmitWithAwait () + { + return expr.ContainsEmitWithAwait (); + } + public static Expression Create (Expression expr) { // @@ -132,16 +137,24 @@ namespace Mono.CSharp.Nullable public override void Emit (EmitContext ec) { Store (ec); + + var call = new CallEmitter (); + call.InstanceExpression = this; + if (useDefaultValue) - Invocation.EmitCall (ec, this, NullableInfo.GetGetValueOrDefault (expr.Type), null, loc); + call.EmitPredefined (ec, NullableInfo.GetGetValueOrDefault (expr.Type), null); else - Invocation.EmitCall (ec, this, NullableInfo.GetValue (expr.Type), null, loc); + call.EmitPredefined (ec, NullableInfo.GetValue (expr.Type), null); } public void EmitCheck (EmitContext ec) { Store (ec); - Invocation.EmitCall (ec, this, NullableInfo.GetHasValue (expr.Type), null, loc); + + var call = new CallEmitter (); + call.InstanceExpression = this; + + call.EmitPredefined (ec, NullableInfo.GetHasValue (expr.Type), null); } public override bool Equals (object obj) @@ -169,10 +182,10 @@ namespace Mono.CSharp.Nullable void Store (EmitContext ec) { - if (expr is VariableReference) + if (temp != null) return; - if (temp != null) + if (expr is VariableReference) return; expr.Emit (ec); @@ -211,51 +224,6 @@ namespace Mono.CSharp.Nullable return temp; } } - - public void Emit (EmitContext ec, bool leave_copy) - { - if (leave_copy) - Load (ec); - - Emit (ec); - } - - public void EmitAssign (EmitContext ec, Expression source, - bool leave_copy, bool prepare_for_load) - { - InternalWrap wrap = new InternalWrap (source, expr.Type, loc); - ((IAssignMethod) expr).EmitAssign (ec, wrap, leave_copy, false); - } - - class InternalWrap : Expression - { - public Expression expr; - - public InternalWrap (Expression expr, TypeSpec type, Location loc) - { - this.expr = expr; - this.loc = loc; - this.type = type; - - eclass = ExprClass.Value; - } - - public override Expression CreateExpressionTree (ResolveContext ec) - { - throw new NotSupportedException ("ET"); - } - - protected override Expression DoResolve (ResolveContext ec) - { - return this; - } - - public override void Emit (EmitContext ec) - { - expr.Emit (ec); - ec.Emit (OpCodes.Newobj, NullableInfo.GetConstructor (type)); - } - } } // @@ -280,7 +248,9 @@ namespace Mono.CSharp.Nullable public override void Emit (EmitContext ec) { - Invocation.EmitCall (ec, Child, NullableInfo.GetValue (Child.Type), null, loc); + var call = new CallEmitter (); + call.InstanceExpression = Child; + call.EmitPredefined (ec, NullableInfo.GetValue (Child.Type), null); } } @@ -354,6 +324,7 @@ namespace Mono.CSharp.Nullable value_target.AddressOf (ec, AddressOp.Store); ec.Emit (OpCodes.Initobj, type); value_target.Emit (ec); + value_target.Release (ec); } public void AddressOf (EmitContext ec, AddressOp Mode) @@ -386,6 +357,11 @@ namespace Mono.CSharp.Nullable : this (expr, unwrap as Unwrap, type) { } + + public override bool ContainsEmitWithAwait () + { + return unwrap.ContainsEmitWithAwait (); + } public override Expression CreateExpressionTree (ResolveContext ec) { @@ -677,7 +653,7 @@ namespace Mono.CSharp.Nullable } left_unwrap.Emit (ec); - ec.Emit (OpCodes.Brtrue_S, load_right); + ec.Emit (OpCodes.Brtrue, load_right); // value & null, value | null if (right_unwrap != null) { @@ -733,7 +709,7 @@ namespace Mono.CSharp.Nullable if (left_unwrap != null && (IsRightNullLifted || right.IsNull)) { left_unwrap.EmitCheck (ec); if (Oper == Binary.Operator.Equality) { - ec.Emit (OpCodes.Ldc_I4_0); + ec.EmitInt (0); ec.Emit (OpCodes.Ceq); } return; @@ -742,7 +718,7 @@ namespace Mono.CSharp.Nullable if (right_unwrap != null && (IsLeftNullLifted || left.IsNull)) { right_unwrap.EmitCheck (ec); if (Oper == Binary.Operator.Equality) { - ec.Emit (OpCodes.Ldc_I4_0); + ec.EmitInt (0); ec.Emit (OpCodes.Ceq); } return; @@ -755,6 +731,11 @@ namespace Mono.CSharp.Nullable user_operator.Emit (ec); ec.Emit (Oper == Operator.Equality ? OpCodes.Brfalse_S : OpCodes.Brtrue_S, dissimilar_label); } else { + if (ec.HasSet (BuilderContext.Options.AsyncBody) && right.ContainsEmitWithAwait ()) { + left = left.EmitToField (ec); + right = right.EmitToField (ec); + } + left.Emit (ec); right.Emit (ec); @@ -774,7 +755,7 @@ namespace Mono.CSharp.Nullable ec.Emit (OpCodes.Ceq); } else { if (Oper == Operator.Inequality) { - ec.Emit (OpCodes.Ldc_I4_0); + ec.EmitInt (0); ec.Emit (OpCodes.Ceq); } } @@ -783,9 +764,9 @@ namespace Mono.CSharp.Nullable ec.MarkLabel (dissimilar_label); if (Oper == Operator.Inequality) - ec.Emit (OpCodes.Ldc_I4_1); + ec.EmitInt (1); else - ec.Emit (OpCodes.Ldc_I4_0); + ec.EmitInt (0); ec.MarkLabel (end_label); } @@ -839,7 +820,7 @@ namespace Mono.CSharp.Nullable ec.MarkLabel (is_null_label); if ((Oper & Operator.ComparisonMask) != 0) { - ec.Emit (OpCodes.Ldc_I4_0); + ec.EmitInt (0); } else { LiftedNull.Create (type, loc).Emit (ec); } @@ -854,8 +835,14 @@ namespace Mono.CSharp.Nullable return; } - if (l.IsNullableType) - l = TypeManager.GetTypeArguments (l) [0]; + if (left.Type.IsNullableType) { + l = NullableInfo.GetUnderlyingType (left.Type); + left = EmptyCast.Create (left, l); + } + + if (right.Type.IsNullableType) { + right = EmptyCast.Create (right, NullableInfo.GetUnderlyingType (right.Type)); + } base.EmitOperator (ec, l); } @@ -1149,6 +1136,14 @@ namespace Mono.CSharp.Nullable return this; } + public override bool ContainsEmitWithAwait () + { + if (unwrap != null) + return unwrap.ContainsEmitWithAwait () || right.ContainsEmitWithAwait (); + + return left.ContainsEmitWithAwait () || right.ContainsEmitWithAwait (); + } + protected override Expression DoResolve (ResolveContext ec) { left = left.Resolve (ec); @@ -1217,75 +1212,58 @@ namespace Mono.CSharp.Nullable } } - public class LiftedUnaryMutator : ExpressionStatement + class LiftedUnaryMutator : UnaryMutator { - public readonly UnaryMutator.Mode Mode; - Expression expr; - UnaryMutator underlying; - Unwrap unwrap; - - public LiftedUnaryMutator (UnaryMutator.Mode mode, Expression expr, Location loc) + public LiftedUnaryMutator (Mode mode, Expression expr, Location loc) + : base (mode, expr, loc) { - this.expr = expr; - this.Mode = mode; - this.loc = loc; - } - - public override Expression CreateExpressionTree (ResolveContext ec) - { - return new SimpleAssign (this, this).CreateExpressionTree (ec); } protected override Expression DoResolve (ResolveContext ec) { - expr = expr.Resolve (ec); - if (expr == null) - return null; - - unwrap = Unwrap.Create (expr, false); - if (unwrap == null) - return null; + var orig_expr = expr; - underlying = (UnaryMutator) new UnaryMutator (Mode, unwrap, loc).Resolve (ec); - if (underlying == null) - return null; + expr = Unwrap.Create (expr); + var res = base.DoResolveOperation (ec); - eclass = ExprClass.Value; + expr = orig_expr; type = expr.Type; - return this; + + return res; } - void DoEmit (EmitContext ec, bool is_expr) + protected override void EmitOperation (EmitContext ec) { Label is_null_label = ec.DefineLabel (); Label end_label = ec.DefineLabel (); - unwrap.EmitCheck (ec); + LocalTemporary lt = new LocalTemporary (type); + + // Value is on the stack + lt.Store (ec); + + var call = new CallEmitter (); + call.InstanceExpression = lt; + call.EmitPredefined (ec, NullableInfo.GetHasValue (expr.Type), null); + ec.Emit (OpCodes.Brfalse, is_null_label); - if (is_expr) { - underlying.Emit (ec); - ec.Emit (OpCodes.Br_S, end_label); - } else { - underlying.EmitStatement (ec); - } + call = new CallEmitter (); + call.InstanceExpression = lt; + call.EmitPredefined (ec, NullableInfo.GetValue (expr.Type), null); - ec.MarkLabel (is_null_label); - if (is_expr) - LiftedNull.Create (type, loc).Emit (ec); + lt.Release (ec); - ec.MarkLabel (end_label); - } + base.EmitOperation (ec); - public override void Emit (EmitContext ec) - { - DoEmit (ec, true); - } + ec.Emit (OpCodes.Newobj, NullableInfo.GetConstructor (type)); + ec.Emit (OpCodes.Br_S, end_label); - public override void EmitStatement (EmitContext ec) - { - DoEmit (ec, false); + ec.MarkLabel (is_null_label); + LiftedNull.Create (type, loc).Emit (ec); + + ec.MarkLabel (end_label); } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/parameter.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/parameter.cs index c36699f93c..e9b9042cf2 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/parameter.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/parameter.cs @@ -616,40 +616,20 @@ namespace Mono.CSharp { public void Emit (EmitContext ec) { - int arg_idx = idx; - if (!ec.IsStatic) - arg_idx++; - - ParameterReference.EmitLdArg (ec, arg_idx); + ec.EmitArgumentLoad (idx); } public void EmitAssign (EmitContext ec) { - int arg_idx = idx; - if (!ec.IsStatic) - arg_idx++; - - if (arg_idx <= 255) - ec.Emit (OpCodes.Starg_S, (byte) arg_idx); - else - ec.Emit (OpCodes.Starg, arg_idx); + ec.EmitArgumentStore (idx); } public void EmitAddressOf (EmitContext ec) { - int arg_idx = idx; - - if (!ec.IsStatic) - arg_idx++; - - bool is_ref = (ModFlags & Modifier.ISBYREF) != 0; - if (is_ref) { - ParameterReference.EmitLdArg (ec, arg_idx); + if ((ModFlags & Modifier.ISBYREF) != 0) { + ec.EmitArgumentLoad (idx); } else { - if (arg_idx <= 255) - ec.Emit (OpCodes.Ldarga_S, (byte) arg_idx); - else - ec.Emit (OpCodes.Ldarga, arg_idx); + ec.EmitArgumentAddress (idx); } } @@ -1298,7 +1278,7 @@ namespace Mono.CSharp { type.GetSignatureForError (), parameter_type.GetSignatureForError ()); } - public virtual object Accept (StructuralVisitor visitor) + public override object Accept (StructuralVisitor visitor) { return visitor.Visit (this); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/pending.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/pending.cs index 696797aa01..0852b0f826 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/pending.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/pending.cs @@ -51,6 +51,78 @@ namespace Mono.CSharp { public MethodSpec [] need_proxy; } + struct ProxyMethodContext : IMemberContext + { + readonly TypeContainer container; + + public ProxyMethodContext (TypeContainer container) + { + this.container = container; + } + + public TypeSpec CurrentType { + get { + throw new NotImplementedException (); + } + } + + public TypeParameter[] CurrentTypeParameters { + get { + throw new NotImplementedException (); + } + } + + public MemberCore CurrentMemberDefinition { + get { + throw new NotImplementedException (); + } + } + + public bool IsObsolete { + get { + return false; + } + } + + public bool IsUnsafe { + get { + throw new NotImplementedException (); + } + } + + public bool IsStatic { + get { + return false; + } + } + + public ModuleContainer Module { + get { + return container.Module; + } + } + + public string GetSignatureForError () + { + throw new NotImplementedException (); + } + + public ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity) + { + throw new NotImplementedException (); + } + + public FullNamedExpression LookupNamespaceOrType (string name, int arity, LookupMode mode, Location loc) + { + throw new NotImplementedException (); + } + + public FullNamedExpression LookupNamespaceAlias (string name) + { + throw new NotImplementedException (); + } + } + public class PendingImplementation { /// @@ -273,14 +345,14 @@ namespace Mono.CSharp { /// /// Whether the specified method is an interface method implementation /// - public MethodSpec IsInterfaceMethod (MemberName name, TypeSpec ifaceType, MethodData method, out MethodSpec ambiguousCandidate) + public MethodSpec IsInterfaceMethod (MemberName name, TypeSpec ifaceType, MethodData method, out MethodSpec ambiguousCandidate, ref bool optional) { - return InterfaceMethod (name, ifaceType, method, Operation.Lookup, out ambiguousCandidate); + return InterfaceMethod (name, ifaceType, method, Operation.Lookup, out ambiguousCandidate, ref optional); } - public void ImplementMethod (MemberName name, TypeSpec ifaceType, MethodData method, bool clear_one, out MethodSpec ambiguousCandidate) + public void ImplementMethod (MemberName name, TypeSpec ifaceType, MethodData method, bool clear_one, out MethodSpec ambiguousCandidate, ref bool optional) { - InterfaceMethod (name, ifaceType, method, clear_one ? Operation.ClearOne : Operation.ClearAll, out ambiguousCandidate); + InterfaceMethod (name, ifaceType, method, clear_one ? Operation.ClearOne : Operation.ClearAll, out ambiguousCandidate, ref optional); } /// @@ -300,7 +372,7 @@ namespace Mono.CSharp { /// that was used in the interface, then we always need to create a proxy for it. /// /// - public MethodSpec InterfaceMethod (MemberName name, TypeSpec iType, MethodData method, Operation op, out MethodSpec ambiguousCandidate) + public MethodSpec InterfaceMethod (MemberName name, TypeSpec iType, MethodData method, Operation op, out MethodSpec ambiguousCandidate, ref bool optional) { ambiguousCandidate = null; @@ -367,6 +439,7 @@ namespace Mono.CSharp { } } else { tm.found [i] = method; + optional = tm.optional; } if (op == Operation.Lookup && name.Left != null && ambiguousCandidate == null) { @@ -434,10 +507,11 @@ namespace Mono.CSharp { } int top = param.Count; - var ec = new EmitContext (null, proxy.GetILGenerator (), null); + var ec = new EmitContext (new ProxyMethodContext (container), proxy.GetILGenerator (), null); + ec.EmitThis (); // TODO: GetAllParametersArguments - for (int i = 0; i <= top; i++) - ParameterReference.EmitLdArg (ec, i); + for (int i = 0; i < top; i++) + ec.EmitArgumentLoad (i); ec.Emit (OpCodes.Call, base_method); ec.Emit (OpCodes.Ret); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/property.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/property.cs index d5adfccad9..db013e307f 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/property.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/property.cs @@ -205,7 +205,7 @@ namespace Mono.CSharp method_data = new MethodData (method, ModFlags, flags, this); - if (!method_data.Define (parent, method.GetFullName (MemberName), Report)) + if (!method_data.Define (parent.PartialContainer, method.GetFullName (MemberName))) return null; Spec.SetMetaInfo (method_data.MethodBuilder); @@ -272,7 +272,7 @@ namespace Mono.CSharp method_data = new MethodData (method, ModFlags, flags, this); - if (!method_data.Define (parent, method.GetFullName (MemberName), Report)) + if (!method_data.Define (parent.PartialContainer, method.GetFullName (MemberName))) return null; Spec.SetMetaInfo (method_data.MethodBuilder); @@ -1165,7 +1165,7 @@ namespace Mono.CSharp method_data = new MethodData (method, method.ModFlags, method.flags | MethodAttributes.HideBySig | MethodAttributes.SpecialName, this); - if (!method_data.Define (parent, method.GetFullName (MemberName), Report)) + if (!method_data.Define (parent.PartialContainer, method.GetFullName (MemberName))) return null; MethodBuilder mb = method_data.MethodBuilder; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/report.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/report.cs index e34e6951f0..d785dad621 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/report.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/report.cs @@ -2,9 +2,10 @@ // report.cs: report errors and warnings. // // Author: Miguel de Icaza (miguel@ximian.com) -// Marek Safar (marek.safar@seznam.cz) +// Marek Safar (marek.safar@gmail.com) // // Copyright 2001 Ximian, Inc. (http://www.ximian.com) +// Copyright 2011 Xamarin, Inc (http://www.xamarin.com) // using System; @@ -62,7 +63,7 @@ namespace Mono.CSharp { 1522, 1570, 1571, 1572, 1573, 1574, 1580, 1581, 1584, 1587, 1589, 1590, 1591, 1592, 1607, 1616, 1633, 1634, 1635, 1685, 1690, 1691, 1692, 1695, 1696, 1699, 1700, 1701, 1702, 1709, 1711, 1717, 1718, 1720, 1735, - 1901, 1956, 1981, + 1901, 1956, 1981, 1998, 2002, 2023, 2029, 3000, 3001, 3002, 3003, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019, @@ -103,6 +104,9 @@ namespace Mono.CSharp { case LanguageVersion.V_3: version = "3.0"; break; + case LanguageVersion.V_4: + version = "4.0"; + break; default: throw new InternalErrorException ("Invalid feature version", compiler.Settings.Version); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/roottypes.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/roottypes.cs index df7962043c..b998806b8b 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/roottypes.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/roottypes.cs @@ -608,7 +608,7 @@ namespace Mono.CSharp return PartialContainer.IsClsComplianceRequired (); } - public override IList LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceContainer scope) + public override ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity) { return null; } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/statement.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/statement.cs index db028e02bd..5f0b31aa02 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/statement.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/statement.cs @@ -8,6 +8,7 @@ // // Copyright 2001, 2002, 2003 Ximian, Inc. // Copyright 2003, 2004 Novell, Inc. +// Copyright 2011 Xamarin Inc. // using System; @@ -732,8 +733,6 @@ namespace Mono.CSharp { return false; unwind_protect = ec.CurrentBranching.AddReturnOrigin (ec.CurrentBranching.CurrentUsageVector, this); - if (unwind_protect) - ec.NeedReturnLabel (); ec.CurrentBranching.CurrentUsageVector.Goto (); return true; } @@ -872,9 +871,12 @@ namespace Mono.CSharp { var async_return = ((AsyncTaskStorey) async_body.Storey).HoistedReturn; // It's null for await without async - if (async_return != null) + if (async_return != null) { async_return.EmitAssign (ec); + ec.Emit (unwind_protect ? OpCodes.Leave : OpCodes.Br, async_body.BodyEnd); + } + return; } @@ -883,7 +885,7 @@ namespace Mono.CSharp { } if (unwind_protect) - ec.Emit (OpCodes.Leave, ec.ReturnLabel); + ec.Emit (OpCodes.Leave, ec.CreateReturnLabel ()); else ec.Emit (OpCodes.Ret); } @@ -1413,6 +1415,11 @@ namespace Mono.CSharp { } public override bool Resolve (BlockContext bc) + { + return Resolve (bc, true); + } + + public bool Resolve (BlockContext bc, bool resolveDeclaratorInitializers) { if (li.Type == null) { TypeSpec type = null; @@ -1490,10 +1497,10 @@ namespace Mono.CSharp { d.Variable.PrepareForFlowAnalysis (bc); } - if (d.Initializer != null) { + if (d.Initializer != null && resolveDeclaratorInitializers) { d.Initializer = ResolveInitializer (bc, d.Variable, d.Initializer); // d.Variable.DefinitelyAssigned - } + } } } @@ -1773,7 +1780,7 @@ namespace Mono.CSharp { public static LocalVariable CreateCompilerGenerated (TypeSpec type, Block block, Location loc) { - LocalVariable li = new LocalVariable (block, "<$$>", Flags.CompilerGenerated | Flags.Used, loc); + LocalVariable li = new LocalVariable (block, GetCompilerGeneratedName (block), Flags.CompilerGenerated | Flags.Used, loc); li.Type = type; return li; } @@ -1809,6 +1816,11 @@ namespace Mono.CSharp { ec.Emit (OpCodes.Ldloca, builder); } + public static string GetCompilerGeneratedName (Block block) + { + return "$locvar" + block.ParametersBlock.TemporaryLocalsCount++.ToString ("X"); + } + public string GetReadOnlyContext () { switch (flags & Flags.ReadonlyMask) { @@ -2304,8 +2316,8 @@ namespace Mono.CSharp { // // An iterator has only 1 storey block // - if (ec.CurrentIterator != null) - return ec.CurrentIterator.Storey; + if (ec.CurrentAnonymousMethod.IsIterator) + return ec.CurrentAnonymousMethod.Storey; // // When referencing a variable in iterator storey from children anonymous method @@ -2487,6 +2499,11 @@ namespace Mono.CSharp { this.block = block; } + public override bool ContainsEmitWithAwait () + { + return child.ContainsEmitWithAwait (); + } + public override Expression CreateExpressionTree (ResolveContext ec) { throw new NotSupportedException (); @@ -2607,6 +2624,8 @@ namespace Mono.CSharp { } } + public int TemporaryLocalsCount { get; set; } + #endregion // @@ -2781,7 +2800,7 @@ namespace Mono.CSharp { AddStatement (new Return (iterator, iterator.Location)); } - public void WrapIntoAsyncTask (TypeContainer host, TypeSpec returnType) + public void WrapIntoAsyncTask (IMemberContext context, TypeContainer host, TypeSpec returnType) { ParametersBlock pb = new ParametersBlock (this, ParametersCompiled.EmptyReadOnlyParameters, StartLocation); pb.EndLocation = EndLocation; @@ -2791,7 +2810,7 @@ namespace Mono.CSharp { var initializer = new AsyncInitializer (pb, host, block_type); initializer.Type = block_type; - am_storey = new AsyncTaskStorey (initializer, returnType); + am_storey = new AsyncTaskStorey (context, initializer, returnType); statements = new List (1); AddStatement (new StatementExpression (initializer)); @@ -3119,8 +3138,6 @@ namespace Mono.CSharp { #if PRODUCTION try { #endif - if (ec.HasReturnLabel) - ec.ReturnLabel = ec.DefineLabel (); base.Emit (ec); @@ -4063,21 +4080,16 @@ namespace Mono.CSharp { } } - // Base class for statements that are implemented in terms of try...finally - public abstract class ExceptionStatement : ResumableStatement + public abstract class TryFinallyBlock : ExceptionStatement { - bool code_follows; - Iterator iter; - List resume_points; - int first_resume_pc; protected Statement stmt; Label dispose_try_block; bool prepared_for_dispose, emitted_dispose; - protected ExceptionStatement (Statement stmt, Location loc) + protected TryFinallyBlock (Statement stmt, Location loc) + : base (loc) { this.stmt = stmt; - this.loc = loc; } #region Properties @@ -4090,43 +4102,30 @@ namespace Mono.CSharp { #endregion - protected abstract void EmitPreTryBody (EmitContext ec); protected abstract void EmitTryBody (EmitContext ec); protected abstract void EmitFinallyBody (EmitContext ec); - protected sealed override void DoEmit (EmitContext ec) + public override Label PrepareForDispose (EmitContext ec, Label end) { - EmitPreTryBody (ec); - - if (resume_points != null) { - ec.EmitInt ((int) IteratorStorey.State.Running); - ec.Emit (OpCodes.Stloc, iter.CurrentPC); - } - - ec.BeginExceptionBlock (); - - if (resume_points != null) { - ec.MarkLabel (resume_point); - - // For normal control flow, we want to fall-through the Switch - // So, we use CurrentPC rather than the $PC field, and initialize it to an outside value above - ec.Emit (OpCodes.Ldloc, iter.CurrentPC); - ec.EmitInt (first_resume_pc); - ec.Emit (OpCodes.Sub); - - Label [] labels = new Label [resume_points.Count]; - for (int i = 0; i < resume_points.Count; ++i) - labels [i] = resume_points [i].PrepareForEmit (ec); - ec.Emit (OpCodes.Switch, labels); + if (!prepared_for_dispose) { + prepared_for_dispose = true; + dispose_try_block = ec.DefineLabel (); } + return dispose_try_block; + } + protected sealed override void DoEmit (EmitContext ec) + { + EmitTryBodyPrepare (ec); EmitTryBody (ec); ec.BeginFinallyBlock (); Label start_finally = ec.DefineLabel (); if (resume_points != null) { - ec.Emit (OpCodes.Ldloc, iter.SkipFinally); + var state_machine = (StateMachineInitializer) ec.CurrentAnonymousMethod; + + ec.Emit (OpCodes.Ldloc, state_machine.SkipFinally); ec.Emit (OpCodes.Brfalse_S, start_finally); ec.Emit (OpCodes.Endfinally); } @@ -4137,44 +4136,6 @@ namespace Mono.CSharp { ec.EndExceptionBlock (); } - public void SomeCodeFollows () - { - code_follows = true; - } - - public override bool Resolve (BlockContext ec) - { - // System.Reflection.Emit automatically emits a 'leave' at the end of a try clause - // So, ensure there's some IL code after this statement. - if (!code_follows && resume_points == null && ec.CurrentBranching.CurrentUsageVector.IsUnreachable) - ec.NeedReturnLabel (); - - iter = ec.CurrentIterator; - return true; - } - - public void AddResumePoint (ResumableStatement stmt, int pc) - { - if (resume_points == null) { - resume_points = new List (); - first_resume_pc = pc; - } - - if (pc != first_resume_pc + resume_points.Count) - throw new InternalErrorException ("missed an intervening AddResumePoint?"); - - resume_points.Add (stmt); - } - - public override Label PrepareForDispose (EmitContext ec, Label end) - { - if (!prepared_for_dispose) { - prepared_for_dispose = true; - dispose_try_block = ec.DefineLabel (); - } - return dispose_try_block; - } - public override void EmitForDispose (EmitContext ec, LocalBuilder pc, Label end, bool have_dispatcher) { if (emitted_dispose) @@ -4192,24 +4153,24 @@ namespace Mono.CSharp { ec.MarkLabel (dispose_try_block); - Label [] labels = null; + Label[] labels = null; for (int i = 0; i < resume_points.Count; ++i) { - ResumableStatement s = resume_points [i]; + ResumableStatement s = resume_points[i]; Label ret = s.PrepareForDispose (ec, end_of_try); if (ret.Equals (end_of_try) && labels == null) continue; if (labels == null) { - labels = new Label [resume_points.Count]; + labels = new Label[resume_points.Count]; for (int j = 0; j < i; ++j) - labels [j] = end_of_try; + labels[j] = end_of_try; } - labels [i] = ret; + labels[i] = ret; } if (labels != null) { int j; for (j = 1; j < labels.Length; ++j) - if (!labels [0].Equals (labels [j])) + if (!labels[0].Equals (labels[j])) break; bool emit_dispatcher = j < labels.Length; @@ -4236,7 +4197,84 @@ namespace Mono.CSharp { } } - public class Lock : ExceptionStatement + // + // Base class for blocks using exception handling + // + public abstract class ExceptionStatement : ResumableStatement + { +#if !STATIC + bool code_follows; +#endif + protected List resume_points; + protected int first_resume_pc; + + protected ExceptionStatement (Location loc) + { + this.loc = loc; + } + + protected virtual void EmitTryBodyPrepare (EmitContext ec) + { + StateMachineInitializer state_machine = null; + if (resume_points != null) { + state_machine = (StateMachineInitializer) ec.CurrentAnonymousMethod; + + ec.EmitInt ((int) IteratorStorey.State.Running); + ec.Emit (OpCodes.Stloc, state_machine.CurrentPC); + } + + ec.BeginExceptionBlock (); + + if (resume_points != null) { + ec.MarkLabel (resume_point); + + // For normal control flow, we want to fall-through the Switch + // So, we use CurrentPC rather than the $PC field, and initialize it to an outside value above + ec.Emit (OpCodes.Ldloc, state_machine.CurrentPC); + ec.EmitInt (first_resume_pc); + ec.Emit (OpCodes.Sub); + + Label[] labels = new Label[resume_points.Count]; + for (int i = 0; i < resume_points.Count; ++i) + labels[i] = resume_points[i].PrepareForEmit (ec); + ec.Emit (OpCodes.Switch, labels); + } + } + + public void SomeCodeFollows () + { +#if !STATIC + code_follows = true; +#endif + } + + public override bool Resolve (BlockContext ec) + { +#if !STATIC + // System.Reflection.Emit automatically emits a 'leave' at the end of a try clause + // So, ensure there's some IL code after this statement. + if (!code_follows && resume_points == null && ec.CurrentBranching.CurrentUsageVector.IsUnreachable) + ec.NeedReturnLabel (); +#endif + return true; + } + + public void AddResumePoint (ResumableStatement stmt, int pc) + { + if (resume_points == null) { + resume_points = new List (); + first_resume_pc = pc; + } + + if (pc != first_resume_pc + resume_points.Count) + throw new InternalErrorException ("missed an intervening AddResumePoint?"); + + resume_points.Add (stmt); + } + + } + + public class Lock : TryFinallyBlock { Expression expr; TemporaryVariableReference expr_copy; @@ -4294,21 +4332,21 @@ namespace Mono.CSharp { // Have to keep original lock value around to unlock same location // in the case the original has changed or is null // - expr_copy = TemporaryVariableReference.Create (ec.BuiltinTypes.Object, ec.CurrentBlock.Parent, loc); + expr_copy = TemporaryVariableReference.Create (ec.BuiltinTypes.Object, ec.CurrentBlock, loc); expr_copy.Resolve (ec); // // Ensure Monitor methods are available // if (ResolvePredefinedMethods (ec) > 1) { - lock_taken = TemporaryVariableReference.Create (ec.BuiltinTypes.Bool, ec.CurrentBlock.Parent, loc); + lock_taken = TemporaryVariableReference.Create (ec.BuiltinTypes.Bool, ec.CurrentBlock, loc); lock_taken.Resolve (ec); } return true; } - protected override void EmitPreTryBody (EmitContext ec) + protected override void EmitTryBodyPrepare (EmitContext ec) { expr_copy.EmitAssign (ec, expr); @@ -4324,6 +4362,8 @@ namespace Mono.CSharp { expr_copy.Emit (ec); ec.Emit (OpCodes.Call, ec.Module.PredefinedMembers.MonitorEnter.Get ()); } + + base.EmitTryBodyPrepare (ec); } protected override void EmitTryBody (EmitContext ec) @@ -4409,7 +4449,7 @@ namespace Mono.CSharp { protected override void DoEmit (EmitContext ec) { - using (ec.With (EmitContext.Options.AllCheckStateFlags, false)) + using (ec.With (EmitContext.Options.CheckedScope, false)) Block.Emit (ec); } @@ -4444,7 +4484,7 @@ namespace Mono.CSharp { protected override void DoEmit (EmitContext ec) { - using (ec.With (EmitContext.Options.AllCheckStateFlags, true)) + using (ec.With (EmitContext.Options.CheckedScope, true)) Block.Emit (ec); } @@ -4537,7 +4577,7 @@ namespace Mono.CSharp { public override void EmitExit (EmitContext ec) { - ec.Emit (OpCodes.Ldc_I4_0); + ec.EmitInt (0); ec.Emit (OpCodes.Conv_U); vi.EmitAssign (ec); } @@ -4589,7 +4629,7 @@ namespace Mono.CSharp { public override void EmitExit (EmitContext ec) { - ec.Emit (OpCodes.Ldnull); + ec.EmitNull (); pinned_string.EmitAssign (ec); } } @@ -4910,7 +4950,8 @@ namespace Mono.CSharp { } } - public class TryFinally : ExceptionStatement { + public class TryFinally : TryFinallyBlock + { Block fini; public Statement Stmt { @@ -4950,10 +4991,6 @@ namespace Mono.CSharp { return ok; } - protected override void EmitPreTryBody (EmitContext ec) - { - } - protected override void EmitTryBody (EmitContext ec) { stmt.Emit (ec); @@ -4979,13 +5016,15 @@ namespace Mono.CSharp { } } - public class TryCatch : Statement { + public class TryCatch : ExceptionStatement + { public Block Block; public List Specific; public Catch General; - bool inside_try_finally, code_follows; + readonly bool inside_try_finally; public TryCatch (Block block, List catch_clauses, Location l, bool inside_try_finally) + : base (l) { this.Block = block; this.Specific = catch_clauses; @@ -4996,8 +5035,12 @@ namespace Mono.CSharp { this.General = c; catch_clauses.RemoveAt (0); } + } - loc = l; + public bool IsTryCatchFinally { + get { + return inside_try_finally; + } } public override bool Resolve (BlockContext ec) @@ -5055,23 +5098,13 @@ namespace Mono.CSharp { ec.EndFlowBranching (); - // System.Reflection.Emit automatically emits a 'leave' at the end of a try/catch clause - // So, ensure there's some IL code after this statement - if (!inside_try_finally && !code_follows && ec.CurrentBranching.CurrentUsageVector.IsUnreachable) - ec.NeedReturnLabel (); - - return ok; + return base.Resolve (ec) && ok; } - public void SomeCodeFollows () - { - code_follows = true; - } - - protected override void DoEmit (EmitContext ec) + protected sealed override void DoEmit (EmitContext ec) { if (!inside_try_finally) - ec.BeginExceptionBlock (); + EmitTryBodyPrepare (ec); Block.Emit (ec); @@ -5104,7 +5137,7 @@ namespace Mono.CSharp { } } - public class Using : ExceptionStatement + public class Using : TryFinallyBlock { public class VariableDeclaration : BlockVariableDeclaration { @@ -5144,7 +5177,7 @@ namespace Mono.CSharp { if (IsNested) return true; - return base.Resolve (bc); + return base.Resolve (bc, false); } public Expression ResolveExpression (BlockContext bc) @@ -5230,7 +5263,12 @@ namespace Mono.CSharp { return dispose; } - public Statement RewriteForDeclarators (BlockContext bc, Statement stmt) + public void ResolveDeclaratorInitializer (BlockContext bc) + { + Initializer = base.ResolveInitializer (bc, Variable, Initializer); + } + + public Statement RewriteUsingDeclarators (BlockContext bc, Statement stmt) { for (int i = declarators.Count - 1; i >= 0; --i) { var d = declarators [i]; @@ -5283,9 +5321,10 @@ namespace Mono.CSharp { #endregion - protected override void EmitPreTryBody (EmitContext ec) + protected override void EmitTryBodyPrepare (EmitContext ec) { decl.Emit (ec); + base.EmitTryBodyPrepare (ec); } protected override void EmitTryBody (EmitContext ec) @@ -5311,11 +5350,15 @@ namespace Mono.CSharp { vr.IsLockedByStatement = true; } } else { - if (!decl.Resolve (ec)) - return false; + if (decl.IsNested) { + decl.ResolveDeclaratorInitializer (ec); + } else { + if (!decl.Resolve (ec)) + return false; - if (decl.Declarators != null) { - stmt = decl.RewriteForDeclarators (ec, stmt); + if (decl.Declarators != null) { + stmt = decl.RewriteUsingDeclarators (ec, stmt); + } } vr = null; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/support.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/support.cs index c10d13f893..4e4b3dbb21 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/support.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/support.cs @@ -240,7 +240,7 @@ namespace Mono.CSharp { public char[] ReadChars (int fromPosition, int toPosition) { char[] chars = new char[toPosition - fromPosition]; - if (buffer_start <= fromPosition && toPosition < buffer_start + buffer.Length) { + if (buffer_start <= fromPosition && toPosition <= buffer_start + buffer.Length) { Array.Copy (buffer, fromPosition - buffer_start, chars, 0, chars.Length); } else { throw new NotImplementedException (); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/typemanager.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/typemanager.cs index 2e2d17064d..708cace79d 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/typemanager.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/typemanager.cs @@ -310,9 +310,11 @@ namespace Mono.CSharp public readonly PredefinedMember ActivatorCreateInstance; public readonly PredefinedMember AsyncTaskMethodBuilderCreate; public readonly PredefinedMember AsyncTaskMethodBuilderSetResult; + public readonly PredefinedMember AsyncTaskMethodBuilderSetException; public readonly PredefinedMember AsyncTaskMethodBuilderTask; public readonly PredefinedMember AsyncTaskMethodBuilderGenericCreate; public readonly PredefinedMember AsyncTaskMethodBuilderGenericSetResult; + public readonly PredefinedMember AsyncTaskMethodBuilderGenericSetException; public readonly PredefinedMember AsyncTaskMethodBuilderGenericTask; public readonly PredefinedMember AsyncVoidMethodBuilderCreate; public readonly PredefinedMember AsyncVoidMethodBuilderSetException; @@ -366,6 +368,10 @@ namespace Mono.CSharp AsyncTaskMethodBuilderSetResult = new PredefinedMember (module, types.AsyncTaskMethodBuilder, MemberFilter.Method ("SetResult", 0, ParametersCompiled.EmptyReadOnlyParameters, btypes.Void)); + AsyncTaskMethodBuilderSetException = new PredefinedMember (module, types.AsyncTaskMethodBuilder, + MemberFilter.Method ("SetException", 0, + ParametersCompiled.CreateFullyResolved (btypes.Exception), btypes.Void)); + AsyncTaskMethodBuilderTask = new PredefinedMember (module, types.AsyncTaskMethodBuilder, MemberFilter.Property ("Task", null)); @@ -382,6 +388,10 @@ namespace Mono.CSharp new TypeParameterSpec (0, null, SpecialConstraint.None, Variance.None, null) }, false), btypes.Void)); + AsyncTaskMethodBuilderGenericSetException = new PredefinedMember (module, types.AsyncTaskMethodBuilderGeneric, + MemberFilter.Method ("SetException", 0, + ParametersCompiled.CreateFullyResolved (btypes.Exception), btypes.Void)); + AsyncTaskMethodBuilderGenericTask = new PredefinedMember (module, types.AsyncTaskMethodBuilderGeneric, MemberFilter.Property ("Task", null)); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/typespec.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/typespec.cs index 8c0a5ddc2f..5c8455224d 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/typespec.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Parser/mcs/typespec.cs @@ -6,6 +6,7 @@ // Dual licensed under the terms of the MIT X11 or GNU GPL // // Copyright 2010 Novell, Inc +// Copyright 2011 Xamarin, Inc (http://www.xamarin.com) // using System; @@ -464,12 +465,13 @@ namespace Mono.CSharp { var t = this; do { - if (t.Interfaces != null) { - foreach (TypeSpec i in t.Interfaces) { - if (i == iface || TypeSpecComparer.IsEqual (i, iface)) + var ifaces = t.Interfaces; + if (ifaces != null) { + for (int i = 0; i < ifaces.Count; ++i) { + if (TypeSpecComparer.IsEqual (ifaces[i], iface)) return true; - if (variantly && TypeSpecComparer.Variant.IsEqual (i, iface)) + if (variantly && TypeSpecComparer.Variant.IsEqual (ifaces[i], iface)) return true; } } @@ -535,6 +537,7 @@ namespace Mono.CSharp return ((TypeParameterSpec) t).IsReferenceType; case MemberKind.Struct: case MemberKind.Enum: + case MemberKind.Void: return false; case MemberKind.InternalCompilerType: // @@ -1016,10 +1019,11 @@ namespace Mono.CSharp } for (int i = 0; i < targs_definition.Length; ++i) { + if (TypeSpecComparer.IsEqual (t1_targs[i], t2_targs[i])) + continue; + Variance v = targs_definition[i].Variance; if (v == Variance.None) { - if (t1_targs[i] == t2_targs[i]) - continue; return false; } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/NodeOutputAction.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/NodeOutputAction.cs index 47d5e7ba70..fd0e81a4fc 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/NodeOutputAction.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/NodeOutputAction.cs @@ -1,4 +1,4 @@ -// +// // NodeOutputChange.cs // // Author: @@ -26,6 +26,7 @@ using System; using System.Collections.Generic; +using ICSharpCode.NRefactory.Editor; namespace ICSharpCode.NRefactory.CSharp.Refactoring { @@ -109,28 +110,4 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring this.NodeOutput = output; } } - - - /// - /// An (Offset,Length)-pair. - /// - public interface ISegment - { - /// - /// Gets the start offset of the segment. - /// - int Offset { get; } - - /// - /// Gets the length of the segment. - /// - /// Must not be negative. - int Length { get; } - - /// - /// Gets the end offset of the segment. - /// - /// EndOffset = Offset + Length; - int EndOffset { get; } - } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs index db6be31899..39d45f9afb 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Refactoring/Script.cs @@ -1,4 +1,4 @@ -// +// // Script.cs // // Author: @@ -157,7 +157,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring stringWriter.NewLine = Context.EolMarker; if (startWithNewLine) formatter.NewLine (); - var visitor = new OutputVisitor (formatter, Context.FormattingOptions); + var visitor = new CSharpOutputVisitor (formatter, Context.FormattingOptions); visitor.OutputStarted += (sender, e) => { result.NodeSegments [e.AstNode] = new NodeOutput.Segment (stringWriter.GetStringBuilder ().Length); }; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpResolver.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpResolver.cs index 0eb276cf86..1c17dac029 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpResolver.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/CSharpResolver.cs @@ -37,7 +37,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver /// public class CSharpResolver { - static readonly ResolveResult ErrorResult = new ErrorResolveResult(SharedTypes.UnknownType); + static readonly ResolveResult ErrorResult = ErrorResolveResult.UnknownError; static readonly ResolveResult DynamicResult = new ResolveResult(SharedTypes.Dynamic); static readonly ResolveResult NullResult = new ResolveResult(SharedTypes.Null); @@ -611,6 +611,17 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver return ErrorResult; case UnaryOperatorType.AddressOf: return new UnaryOperatorResolveResult(new PointerType(expression.Type), op, expression); + case UnaryOperatorType.Await: + ResolveResult getAwaiterMethodGroup = ResolveMemberAccess(expression, "GetAwaiter", EmptyList.Instance, true); + ResolveResult getAwaiterInvocation = ResolveInvocation(getAwaiterMethodGroup, new ResolveResult[0]); + var getResultMethodGroup = CreateMemberLookup().Lookup(getAwaiterInvocation, "GetResult", EmptyList.Instance, true) as MethodGroupResolveResult; + if (getResultMethodGroup != null) { + var or = getResultMethodGroup.PerformOverloadResolution(context, new ResolveResult[0], allowExtensionMethods: false, conversions: conversions); + IType awaitResultType = or.GetBestCandidateWithSubstitutedTypeArguments().ReturnType.Resolve(context); + return new UnaryOperatorResolveResult(awaitResultType, UnaryOperatorType.Await, expression); + } else { + return new UnaryOperatorResolveResult(SharedTypes.UnknownType, UnaryOperatorType.Await, expression); + } default: throw new ArgumentException("Invalid value for UnaryOperatorType", "op"); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/Conversions.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/Conversions.cs index a1f8876b19..e54b871151 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/Conversions.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/Conversions.cs @@ -635,18 +635,33 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver // Determines whether s is a subtype of t. // Helper method used for ImplicitReferenceConversion, BoxingConversion and ImplicitTypeParameterConversion + + int subtypeCheckNestingDepth; + bool IsSubtypeOf(IType s, IType t) { // conversion to dynamic + object are always possible if (t.Equals(SharedTypes.Dynamic) || t.Equals(objectType)) return true; - - // let GetAllBaseTypes do the work for us - foreach (IType baseType in s.GetAllBaseTypes(context)) { - if (IdentityOrVarianceConversion(baseType, t)) - return true; + try { + if (++subtypeCheckNestingDepth > 10) { + // Subtyping in C# is undecidable + // (see "On Decidability of Nominal Subtyping with Variance" by Andrew J. Kennedy and Benjamin C. Pierce), + // so we'll prevent infinite recursions by putting a limit on the nesting depth of variance conversions. + + // No real C# code should use generics nested more than 10 levels deep, and even if they do, most of + // those nestings should not involve variance. + return false; + } + // let GetAllBaseTypes do the work for us + foreach (IType baseType in s.GetAllBaseTypes(context)) { + if (IdentityOrVarianceConversion(baseType, t)) + return true; + } + return false; + } finally { + subtypeCheckNestingDepth--; } - return false; } bool IdentityOrVarianceConversion(IType s, IType t) @@ -1042,12 +1057,32 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver return 2; IType inferredRet = lambda.GetInferredReturnType(parameterTypes); - return BetterConversion(inferredRet, ret1, ret2); + r = BetterConversion(inferredRet, ret1, ret2); + if (r == 0 && lambda.IsAsync) { + ret1 = UnpackTask(ret1); + ret2 = UnpackTask(ret2); + inferredRet = UnpackTask(inferredRet); + if (ret1 != null && ret2 != null && inferredRet != null) + r = BetterConversion(inferredRet, ret1, ret2); + } + return r; } else { return BetterConversion(resolveResult.Type, t1, t2); } } + /// + /// Unpacks the generic Task[T]. Returns null if the input is not Task[T]. + /// + static IType UnpackTask(IType type) + { + ParameterizedType pt = type as ParameterizedType; + if (pt != null && pt.TypeParameterCount == 1 && pt.Name == "Task" && pt.Namespace == "System.Threading.Tasks") { + return pt.GetTypeArgument(0); + } + return null; + } + /// /// Gets the better conversion (C# 4.0 spec, §7.5.3.4) /// diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ErrorResolveResult.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ErrorResolveResult.cs index df0a49b82e..138453b26b 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ErrorResolveResult.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ErrorResolveResult.cs @@ -27,6 +27,11 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver /// public class ErrorResolveResult : ResolveResult { + /// + /// Gets an ErrorResolveResult instance with Type = SharedTypes.UnknownType. + /// + public static readonly ErrorResolveResult UnknownError = new ErrorResolveResult(SharedTypes.UnknownType); + public ErrorResolveResult(IType type) : base(type) { } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/LambdaResolveResult.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/LambdaResolveResult.cs index 3dfbccd79d..5c25cd5c2f 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/LambdaResolveResult.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/LambdaResolveResult.cs @@ -50,6 +50,11 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver /// This property returns false for anonymous methods without parameter list. public abstract bool IsImplicitlyTyped { get; } + /// + /// Gets whether the lambda is async. + /// + public abstract bool IsAsync { get; } + /// /// Gets the return type inferred when the parameter types are inferred to be /// diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/Log.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/Log.cs index c3d43c2f4d..d0cf0a8688 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/Log.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/Log.cs @@ -37,19 +37,19 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver { const bool logEnabled = false; - [Conditional(logEnabled ? "DEBUG" : "LOG_DISABLED")] +// [Conditional(logEnabled ? "DEBUG" : "LOG_DISABLED")] internal static void WriteLine(string text) { Debug.WriteLine(text); } - [Conditional(logEnabled ? "DEBUG" : "LOG_DISABLED")] +// [Conditional(logEnabled ? "DEBUG" : "LOG_DISABLED")] internal static void WriteLine(string format, params object[] args) { Debug.WriteLine(format, args); } - [Conditional(logEnabled ? "DEBUG" : "LOG_DISABLED")] +// [Conditional(logEnabled ? "DEBUG" : "LOG_DISABLED")] internal static void WriteCollection(string text, IEnumerable lines) { #if DEBUG @@ -65,13 +65,13 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver #endif } - [Conditional(logEnabled ? "DEBUG" : "LOG_DISABLED")] +// [Conditional(logEnabled ? "DEBUG" : "LOG_DISABLED")] public static void Indent() { Debug.Indent(); } - [Conditional(logEnabled ? "DEBUG" : "LOG_DISABLED")] +// [Conditional(logEnabled ? "DEBUG" : "LOG_DISABLED")] public static void Unindent() { Debug.Unindent(); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/MemberLookup.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/MemberLookup.cs index 6d174e8c29..5b924bb795 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/MemberLookup.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/MemberLookup.cs @@ -174,6 +174,13 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver #region LookupType public ResolveResult LookupType(IType declaringType, string name, IList typeArguments, bool parameterizeResultType = true) { + if (declaringType == null) + throw new ArgumentNullException("declaringType"); + if (name == null) + throw new ArgumentNullException("name"); + if (typeArguments == null) + throw new ArgumentNullException("typeArguments"); + int typeArgumentCount = typeArguments.Count; Predicate filter = delegate (ITypeDefinition d) { return InnerTypeParameterCount(d) == typeArgumentCount && d.Name == name && IsAccessible(d, true); @@ -226,6 +233,13 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver /// public ResolveResult Lookup(ResolveResult targetResolveResult, string name, IList typeArguments, bool isInvocation) { + if (targetResolveResult == null) + throw new ArgumentNullException("targetResolveResult"); + if (name == null) + throw new ArgumentNullException("name"); + if (typeArguments == null) + throw new ArgumentNullException("typeArguments"); + bool targetIsTypeParameter = targetResolveResult.Type.Kind == TypeKind.TypeParameter; bool allowProtectedAccess = IsProtectedAccessAllowed(targetResolveResult.Type); @@ -291,6 +305,9 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver /// public IList LookupIndexers(IType targetType) { + if (targetType == null) + throw new ArgumentNullException("targetType"); + bool allowProtectedAccess = IsProtectedAccessAllowed(targetType); Predicate filter = delegate(IProperty property) { return property.IsIndexer && IsAccessible(property, allowProtectedAccess); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveAtLocation.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveAtLocation.cs index aa6bffb7bc..adc2d572f7 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveAtLocation.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveAtLocation.cs @@ -36,7 +36,15 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver if (node == null) return null; AstNode resolvableNode; - if (node is Identifier) { + if (node is AstType) { + resolvableNode = node; + if (resolvableNode.Parent is ComposedType) { + while (resolvableNode.Parent is ComposedType) + resolvableNode = resolvableNode.Parent; + //node is preffered over the resolvable node. Which shouldn't be done in the case of nullables, arrays etc. + node = resolvableNode; + } + } else if (node is Identifier) { resolvableNode = node.Parent; } else if (node.NodeType == NodeType.Token) { if (node.Parent is ConstructorInitializer) { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveVisitor.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveVisitor.cs index 273b7d38a2..39ca25c072 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveVisitor.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/ResolveVisitor.cs @@ -56,7 +56,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver { // The ResolveVisitor is also responsible for handling lambda expressions. - static readonly ResolveResult errorResult = new ErrorResolveResult(SharedTypes.UnknownType); + static readonly ResolveResult errorResult = ErrorResolveResult.UnknownError; static readonly ResolveResult transparentIdentifierResolveResult = new ResolveResult(SharedTypes.UnboundTypeArgument); readonly ResolveResult voidResult; @@ -313,7 +313,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver /// void ResolveAndProcessConversion(Expression expr, IType targetType) { - if (targetType.Kind == TypeKind.Unknown) { + if (targetType.Kind == TypeKind.Unknown || targetType.Kind == TypeKind.Void) { // no need to resolve the expression right now Scan(expr); } else { @@ -1619,7 +1619,8 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver return HandleExplicitlyTypedLambda( anonymousMethodExpression.Parameters, anonymousMethodExpression.Body, isAnonymousMethod: true, - hasParameterList: anonymousMethodExpression.HasParameterList); + hasParameterList: anonymousMethodExpression.HasParameterList, + isAsync: anonymousMethodExpression.IsAsync); } ResolveResult IAstVisitor.VisitLambdaExpression(LambdaExpression lambdaExpression, object data) @@ -1634,7 +1635,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver if (isExplicitlyTyped || !isImplicitlyTyped) { return HandleExplicitlyTypedLambda( lambdaExpression.Parameters, lambdaExpression.Body, - isAnonymousMethod: false, hasParameterList: true); + isAnonymousMethod: false, hasParameterList: true, isAsync: lambdaExpression.IsAsync); } else { return new ImplicitlyTypedLambda(lambdaExpression, this); } @@ -1643,7 +1644,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver #region Explicitly typed ExplicitlyTypedLambda HandleExplicitlyTypedLambda( AstNodeCollection parameterDeclarations, - AstNode body, bool isAnonymousMethod, bool hasParameterList) + AstNode body, bool isAnonymousMethod, bool hasParameterList, bool isAsync) { List parameters = new List(); resolver.PushLambdaBlock(); @@ -1659,7 +1660,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver Scan(pd); } - var lambda = new ExplicitlyTypedLambda(parameters, isAnonymousMethod, resolver.Clone(), this, body); + var lambda = new ExplicitlyTypedLambda(parameters, isAnonymousMethod, isAsync, resolver.Clone(), this, body); // Don't scan the lambda body here - we'll do that later when analyzing the ExplicitlyTypedLambda. @@ -1676,6 +1677,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver { readonly IList parameters; readonly bool isAnonymousMethod; + readonly bool isAsync; CSharpResolver storedContext; ResolveVisitor visitor; @@ -1702,10 +1704,11 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver get { return body; } } - public ExplicitlyTypedLambda(IList parameters, bool isAnonymousMethod, CSharpResolver storedContext, ResolveVisitor visitor, AstNode body) + public ExplicitlyTypedLambda(IList parameters, bool isAnonymousMethod, bool isAsync, CSharpResolver storedContext, ResolveVisitor visitor, AstNode body) { this.parameters = parameters; this.isAnonymousMethod = isAnonymousMethod; + this.isAsync = isAsync; this.storedContext = storedContext; this.visitor = visitor; this.body = body; @@ -1734,7 +1737,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver delegate { var oldNavigator = visitor.navigator; visitor.navigator = new ConstantModeResolveVisitorNavigator(ResolveVisitorNavigationMode.Resolve, oldNavigator); - visitor.AnalyzeLambda(body, out success, out isValidAsVoidMethod, out inferredReturnType, out returnExpressions, out returnValues); + visitor.AnalyzeLambda(body, isAsync, out success, out isValidAsVoidMethod, out inferredReturnType, out returnExpressions, out returnValues); visitor.navigator = oldNavigator; }); Log.Unindent(); @@ -1750,7 +1753,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver { Log.WriteLine("Testing validity of {0} for return-type {1}...", this, returnType); Log.Indent(); - bool valid = Analyze() && IsValidLambda(isValidAsVoidMethod, returnValues, returnType, conversions); + bool valid = Analyze() && IsValidLambda(isValidAsVoidMethod, isAsync, returnValues, returnType, conversions); Log.Unindent(); Log.WriteLine("{0} is {1} for return-type {2}", this, valid ? "valid" : "invalid", returnType); if (valid) { @@ -1770,6 +1773,10 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver get { return false; } } + public override bool IsAsync { + get { return isAsync; } + } + public override bool IsAnonymousMethod { get { return isAnonymousMethod; } } @@ -1800,6 +1807,8 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver visitor.undecidedLambdas.Remove(this); Analyze(); Log.WriteLine("Applying return type {0} to explicitly-typed lambda {1}", returnType, this.LambdaExpression); + if (isAsync) + returnType = parentVisitor.UnpackTask(returnType); for (int i = 0; i < returnExpressions.Count; i++) { visitor.ProcessConversion(returnExpressions[i], returnValues[i], returnType); } @@ -1976,6 +1985,10 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver get { return true; } } + public override bool IsAsync { + get { return lambda != null && lambda.IsAsync; } + } + public override string ToString() { return "[ImplicitlyTypedLambda " + this.LambdaExpression + "]"; @@ -2030,7 +2043,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver } } - visitor.AnalyzeLambda(lambda.Body, out success, out isValidAsVoidMethod, out inferredReturnType, out returnExpressions, out returnValues); + visitor.AnalyzeLambda(lambda.Body, lambda.IsAsync, out success, out isValidAsVoidMethod, out inferredReturnType, out returnExpressions, out returnValues); visitor.resolver.PopBlock(); Log.Unindent(); Log.WriteLine("Finished analyzing " + ToString()); @@ -2048,7 +2061,7 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver public Conversion IsValid(IType returnType, Conversions conversions) { - if (success && IsValidLambda(isValidAsVoidMethod, returnValues, returnType, conversions)) { + if (success && IsValidLambda(isValidAsVoidMethod, lambda.IsAsync, returnValues, returnType, conversions)) { return Conversion.AnonymousFunctionConversion(new AnonymousFunctionConversionData(returnType, this)); } else { return Conversion.None; @@ -2069,6 +2082,9 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver lambda.winningHypothesis = this; + Log.WriteLine("Applying return type {0} to implicitly-typed lambda {1}", returnType, lambda.LambdaExpression); + if (lambda.IsAsync) + returnType = parentVisitor.UnpackTask(returnType); for (int i = 0; i < returnExpressions.Count; i++) { visitor.ProcessConversion(returnExpressions[i], returnValues[i], returnType); } @@ -2159,7 +2175,21 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver #endregion #region AnalyzeLambda - void AnalyzeLambda(AstNode body, out bool success, out bool isValidAsVoidMethod, out IType inferredReturnType, out IList returnExpressions, out IList returnValues) + IType GetTaskType(IType resultType) + { + if (resultType.Kind == TypeKind.Unknown) + return SharedTypes.UnknownType; + if (resultType.Kind == TypeKind.Void) + return resolver.Context.GetTypeDefinition("System.Threading.Tasks", "Task", 0, StringComparer.Ordinal) ?? SharedTypes.UnknownType; + + ITypeDefinition def = resolver.Context.GetTypeDefinition("System.Threading.Tasks", "Task", 1, StringComparer.Ordinal); + if (def != null) + return new ParameterizedType(def, new[] { resultType }); + else + return SharedTypes.UnknownType; + } + + void AnalyzeLambda(AstNode body, bool isAsync, out bool success, out bool isValidAsVoidMethod, out IType inferredReturnType, out IList returnExpressions, out IList returnValues) { Expression expr = body as Expression; if (expr != null) { @@ -2190,6 +2220,8 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver // so we can ignore the 'tiSuccess' value } } + if (isAsync) + inferredReturnType = GetTaskType(inferredReturnType); Log.WriteLine("Lambda return type was inferred to: " + inferredReturnType); // TODO: check for compiler errors within the lambda body @@ -2216,13 +2248,26 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver || expr is AssignmentExpression; } - static bool IsValidLambda(bool isValidAsVoidMethod, IList returnValues, IType returnType, Conversions conversions) + static bool IsValidLambda(bool isValidAsVoidMethod, bool isAsync, IList returnValues, IType returnType, Conversions conversions) { if (returnType.Kind == TypeKind.Void) { + // Lambdas that are valid statement lambdas or expression lambdas with a statement-expression + // can be converted to delegates with void return type. + // This holds for both async and regular lambdas. + return isValidAsVoidMethod; + } else if (isAsync && IsTask(returnType) && returnType.TypeParameterCount == 0) { + // Additionally, async lambdas with the above property can be converted to non-generic Task. return isValidAsVoidMethod; } else { if (returnValues.Count == 0) return false; + if (isAsync) { + // async lambdas must return Task + if (!(IsTask(returnType) && returnType.TypeParameterCount == 1)) + return false; + // unpack Task for testing the implicit conversions + returnType = ((ParameterizedType)returnType).GetTypeArgument(0); + } foreach (ResolveResult returnRR in returnValues) { if (!conversions.ImplicitConversion(returnRR, returnType)) return false; @@ -2231,6 +2276,34 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver } } + /// + /// Gets the T in Task<T>. + /// Returns void for non-generic Task. + /// + IType UnpackTask(IType type) + { + if (!IsTask(type)) + return type; + if (type.TypeParameterCount == 0) + return KnownTypeReference.Void.Resolve(resolver.Context); + else + return ((ParameterizedType)type).GetTypeArgument(0); + } + + /// + /// Gets whether the specified type is Task or Task<T>. + /// + static bool IsTask(IType type) + { + if (type.Kind == TypeKind.Class && type.Name == "Task" && type.Namespace == "System.Threading.Tasks") { + if (type.TypeParameterCount == 0) + return true; + if (type.TypeParameterCount == 1) + return type is ParameterizedType; + } + return false; + } + sealed class AnalyzeLambdaVisitor : DepthFirstAstVisitor { public bool HasVoidReturnStatements; @@ -2459,14 +2532,20 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver ResolveResult IAstVisitor.VisitReturnStatement(ReturnStatement returnStatement, object data) { if (resolverEnabled && !resolver.IsWithinLambdaExpression && resolver.CurrentMember != null) { - ResolveAndProcessConversion(returnStatement.Expression, resolver.CurrentMember.ReturnType.Resolve(resolver.Context)); + IType type = resolver.CurrentMember.ReturnType.Resolve(resolver.Context); + if (IsTask(type)) { + var methodDecl = returnStatement.Ancestors.OfType().FirstOrDefault(); + if (methodDecl != null && (methodDecl.Modifiers & Modifiers.Async) == Modifiers.Async) + type = UnpackTask(type); + } + ResolveAndProcessConversion(returnStatement.Expression, type); } else { Scan(returnStatement.Expression); } return voidResult; } - ResolveResult IAstVisitor.VisitYieldStatement(YieldStatement yieldStatement, object data) + ResolveResult IAstVisitor.VisitYieldReturnStatement(YieldReturnStatement yieldStatement, object data) { if (resolverEnabled && resolver.CurrentMember != null) { IType returnType = resolver.CurrentMember.ReturnType.Resolve(resolver.Context); @@ -2830,6 +2909,10 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver } } + public override bool IsAsync { + get { return false; } + } + public override bool IsImplicitlyTyped { get { return true; } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Demo/CSDemo.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Demo/CSDemo.cs index bbbc856ac0..82dd465598 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Demo/CSDemo.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Demo/CSDemo.cs @@ -148,7 +148,7 @@ namespace ICSharpCode.NRefactory.Demo void CSharpGenerateCodeButtonClick(object sender, EventArgs e) { StringWriter w = new StringWriter(); - OutputVisitor output = new OutputVisitor(w, new CSharpFormattingOptions()); + CSharpOutputVisitor output = new CSharpOutputVisitor(w, new CSharpFormattingOptions()); compilationUnit.AcceptVisitor(output, null); csharpCodeTextBox.Text = w.ToString(); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Demo/ICSharpCode.NRefactory.Demo.csproj b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Demo/ICSharpCode.NRefactory.Demo.csproj index d98289e5d4..8b91449b79 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Demo/ICSharpCode.NRefactory.Demo.csproj +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Demo/ICSharpCode.NRefactory.Demo.csproj @@ -8,7 +8,6 @@ ICSharpCode.NRefactory.Demo ICSharpCode.NRefactory.Demo v4.0 - Client Properties diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/OutputVisitorTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CSharpOutputVisitorTests.cs similarity index 92% rename from src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/OutputVisitorTests.cs rename to src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CSharpOutputVisitorTests.cs index ab1eaf7d9b..d836308e51 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/OutputVisitorTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CSharpOutputVisitorTests.cs @@ -23,7 +23,7 @@ using NUnit.Framework; namespace ICSharpCode.NRefactory.CSharp { [TestFixture] - public class OutputVisitorTests + public class CSharpOutputVisitorTests { void AssertOutput(string expected, Expression expr, CSharpFormattingOptions policy = null) { @@ -31,7 +31,7 @@ namespace ICSharpCode.NRefactory.CSharp policy = new CSharpFormattingOptions();; StringWriter w = new StringWriter(); w.NewLine = "\n"; - expr.AcceptVisitor(new OutputVisitor(new TextWriterOutputFormatter(w) { IndentationString = "\t" }, policy), null); + expr.AcceptVisitor(new CSharpOutputVisitor(new TextWriterOutputFormatter(w) { IndentationString = "\t" }, policy), null); Assert.AreEqual(expected.Replace("\r", ""), w.ToString()); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeDomConvertVisitorTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeDomConvertVisitorTests.cs new file mode 100644 index 0000000000..ab61edf510 --- /dev/null +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeDomConvertVisitorTests.cs @@ -0,0 +1,177 @@ +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +using System; +using System.CodeDom; +using System.CodeDom.Compiler; +using System.IO; +using System.Text.RegularExpressions; +using ICSharpCode.NRefactory.CSharp.Resolver; +using ICSharpCode.NRefactory.TypeSystem; +using ICSharpCode.NRefactory.TypeSystem.Implementation; +using Microsoft.CSharp; +using NUnit.Framework; + +namespace ICSharpCode.NRefactory.CSharp +{ + [TestFixture] + public class CodeDomConvertVisitorTests : ResolverTestBase + { + CodeDomConvertVisitor convertVisitor; + + public override void SetUp() + { + base.SetUp(); + AddUsing("System"); + AddUsing("System.Collections.Generic"); + AddUsing("System.Linq"); + resolver.CurrentTypeDefinition = new DefaultTypeDefinition(project, string.Empty, "MyClass"); + convertVisitor = new CodeDomConvertVisitor(); + convertVisitor.UseFullyQualifiedTypeNames = true; + } + + string Convert(Expression expr) + { + ResolveVisitor rv = new ResolveVisitor(resolver, null); + rv.Scan(expr); + var codeExpr = (CodeExpression)convertVisitor.Convert(expr, rv); + StringWriter writer = new StringWriter(); + writer.NewLine = " "; + new CSharpCodeProvider().GenerateCodeFromExpression(codeExpr, writer, new CodeGeneratorOptions { IndentString = " " }); + return Regex.Replace(writer.ToString(), @"\s+", " "); + } + + [Test] + public void CreateArray() + { + Assert.AreEqual("new int[10]", Convert( + new ArrayCreateExpression { + Type = new PrimitiveType("int"), + Arguments = { new PrimitiveExpression(10) } + })); + } + + [Test] + public void CreateJaggedArray() + { + Assert.AreEqual("new int[10][]", Convert( + new ArrayCreateExpression { + Type = new PrimitiveType("int"), + Arguments = { new PrimitiveExpression(10) }, + AdditionalArraySpecifiers = { new ArraySpecifier() } + })); + } + + [Test] + public void Create2DArray() + { + Assert.AreEqual("new int[10, 20]", Convert( + new ArrayCreateExpression { + Type = new PrimitiveType("int"), + Arguments = { new PrimitiveExpression(10), new PrimitiveExpression(20) } + })); + } + + [Test] + public void CreateImplicitlyTypedArray() + { + // implicitly-typed array not supported in CodeDom, so the conversion should infer the type + Assert.AreEqual("new int[] { 1, 2, 3}", Convert( + new ArrayCreateExpression { + AdditionalArraySpecifiers = { new ArraySpecifier() }, + Initializer = new ArrayInitializerExpression { + Elements = { + new PrimitiveExpression(1), + new PrimitiveExpression(2), + new PrimitiveExpression(3) + } + } + })); + } + + [Test] + public void Create2DImplicitlyTypedArray() + { + Assert.AreEqual("new int[,] { { 1, 2 }, { 3, 4 }}", Convert( + new ArrayCreateExpression { + AdditionalArraySpecifiers = { new ArraySpecifier(2) }, + Initializer = new ArrayInitializerExpression { + Elements = { + new ArrayInitializerExpression(new PrimitiveExpression(1), new PrimitiveExpression(2)), + new ArrayInitializerExpression(new PrimitiveExpression(3), new PrimitiveExpression(4)) + } + } + })); + } + + [Test] + public void AdditionOperator() + { + Assert.AreEqual("(0 + 1)", Convert( + new BinaryOperatorExpression(new PrimitiveExpression(0), BinaryOperatorType.Add, new PrimitiveExpression(1)))); + } + + [Test] + public void EqualityOperator() + { + Assert.AreEqual("(0 == 1)", Convert( + new BinaryOperatorExpression(new PrimitiveExpression(0), BinaryOperatorType.Equality, new PrimitiveExpression(1)))); + } + + [Test] + public void InEqualityOperator() + { + Assert.AreEqual("((0 == 1) == false)", Convert( + new BinaryOperatorExpression(new PrimitiveExpression(0), BinaryOperatorType.InEquality, new PrimitiveExpression(1)))); + } + + [Test] + public void ReferenceInEqualityOperator() + { + Assert.AreEqual("(default(object) != null)", Convert( + new BinaryOperatorExpression(new DefaultValueExpression(new PrimitiveType("object")), BinaryOperatorType.InEquality, new NullReferenceExpression()))); + } + + [Test] + public void StaticProperty() + { + Assert.AreEqual("System.Environment.TickCount", Convert( + new IdentifierExpression("Environment").Member("TickCount"))); + } + + [Test] + public void InstanceMethodInvocation() + { + Assert.AreEqual("this.Equals(null)", + Convert(new IdentifierExpression("Equals").Invoke(new NullReferenceExpression()))); + } + + [Test] + public void StaticMethodInvocation() + { + Assert.AreEqual("object.Equals(null, null)", + Convert(new IdentifierExpression("Equals").Invoke(new NullReferenceExpression(), new NullReferenceExpression()))); + } + + [Test] + public void NotOperator() + { + Assert.AreEqual("(a == false)", Convert(new UnaryOperatorExpression(UnaryOperatorType.Not, new IdentifierExpression("a")))); + } + } +} diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/InsertParenthesesVisitorTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/InsertParenthesesVisitorTests.cs index c26595b4d8..9951e8d028 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/InsertParenthesesVisitorTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/InsertParenthesesVisitorTests.cs @@ -39,7 +39,7 @@ namespace ICSharpCode.NRefactory.CSharp expr.AcceptVisitor(new InsertParenthesesVisitor { InsertParenthesesForReadability = true }, null); StringWriter w = new StringWriter(); w.NewLine = " "; - expr.AcceptVisitor(new OutputVisitor(new TextWriterOutputFormatter(w) { IndentationString = "" }, policy), null); + expr.AcceptVisitor(new CSharpOutputVisitor(new TextWriterOutputFormatter(w) { IndentationString = "" }, policy), null); return w.ToString(); } @@ -49,7 +49,7 @@ namespace ICSharpCode.NRefactory.CSharp expr.AcceptVisitor(new InsertParenthesesVisitor { InsertParenthesesForReadability = false }, null); StringWriter w = new StringWriter(); w.NewLine = " "; - expr.AcceptVisitor(new OutputVisitor(new TextWriterOutputFormatter(w) { IndentationString = "" }, policy), null); + expr.AcceptVisitor(new CSharpOutputVisitor(new TextWriterOutputFormatter(w) { IndentationString = "" }, policy), null); return w.ToString(); } @@ -360,5 +360,38 @@ namespace ICSharpCode.NRefactory.CSharp Assert.AreEqual("a && (b || c)", InsertRequired(expr)); Assert.AreEqual("a && (b || c)", InsertReadable(expr)); } + + [Test] + public void ArrayCreationInIndexer() + { + Expression expr = new IndexerExpression { + Target = new ArrayCreateExpression { + Type = new PrimitiveType("int"), + Arguments = { new PrimitiveExpression(1) } + }, + Arguments = { new PrimitiveExpression(0) } + }; + + Assert.AreEqual("(new int[1]) [0]", InsertRequired(expr)); + Assert.AreEqual("(new int[1]) [0]", InsertReadable(expr)); + } + + [Test] + public void ArrayCreationWithInitializerInIndexer() + { + Expression expr = new IndexerExpression { + Target = new ArrayCreateExpression { + Type = new PrimitiveType("int"), + Arguments = { new PrimitiveExpression(1) }, + Initializer = new ArrayInitializerExpression { + Elements = { new PrimitiveExpression(42) } + } + }, + Arguments = { new PrimitiveExpression(0) } + }; + + Assert.AreEqual("new int[1] { 42 } [0]", InsertRequired(expr)); + Assert.AreEqual("(new int[1] { 42 }) [0]", InsertReadable(expr)); + } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/AnonymousMethodTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/AnonymousMethodExpressionTests.cs similarity index 86% rename from src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/AnonymousMethodTests.cs rename to src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/AnonymousMethodExpressionTests.cs index 70cc862078..1858b8d4c0 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/AnonymousMethodTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/AnonymousMethodExpressionTests.cs @@ -24,7 +24,7 @@ using NUnit.Framework; namespace ICSharpCode.NRefactory.CSharp.Parser.Expression { [TestFixture] - public class AnonymousMethodTests + public class AnonymousMethodExpressionTests { AnonymousMethodExpression Parse(string expression) { @@ -37,6 +37,7 @@ namespace ICSharpCode.NRefactory.CSharp.Parser.Expression AnonymousMethodExpression ame = Parse("delegate {}"); Assert.AreEqual(0, ame.Parameters.Count()); Assert.AreEqual(0, ame.Body.Statements.Count()); + Assert.IsFalse(ame.IsAsync); Assert.IsFalse(ame.HasParameterList); } @@ -67,5 +68,15 @@ namespace ICSharpCode.NRefactory.CSharp.Parser.Expression Assert.AreEqual(1, ame.Body.Statements.Count()); Assert.IsTrue(ame.Body.Statements.First() is ReturnStatement); } + + [Test, Ignore("async/await not yet supported")] + public void AsyncAnonymousMethod() + { + AnonymousMethodExpression ame = Parse("async delegate {}"); + Assert.AreEqual(0, ame.Parameters.Count()); + Assert.AreEqual(0, ame.Body.Statements.Count()); + Assert.IsTrue(ame.IsAsync); + Assert.IsFalse(ame.HasParameterList); + } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/LambdaExpressionTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/LambdaExpressionTests.cs index caa7eb119e..7a67ccaad9 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/LambdaExpressionTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/LambdaExpressionTests.cs @@ -119,5 +119,29 @@ namespace ICSharpCode.NRefactory.CSharp.Parser.Expression FalseExpression = new NullReferenceExpression() }}); } + + [Test, Ignore("async/await not yet supported")] + public void AsyncLambdaExpression() + { + ParseUtilCSharp.AssertExpression( + "async x => x + 1", + new LambdaExpression { + IsAsync = true, + Parameters = { new ParameterDeclaration { Name = "x" } }, + Body = new BinaryOperatorExpression(new IdentifierExpression("x"), BinaryOperatorType.Add, new PrimitiveExpression(1)) + }); + } + + [Test, Ignore("async/await not yet supported")] + public void AsyncLambdaExpressionWithMultipleParameters() + { + ParseUtilCSharp.AssertExpression( + "async (x,y) => x + 1", + new LambdaExpression { + IsAsync = true, + Parameters = { new ParameterDeclaration { Name = "x" }, new ParameterDeclaration { Name = "y" } }, + Body = new BinaryOperatorExpression(new IdentifierExpression("x"), BinaryOperatorType.Add, new PrimitiveExpression(1)) + }); + } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/UnaryOperatorExpressionTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/UnaryOperatorExpressionTests.cs index 13afada640..a5c69f53b8 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/UnaryOperatorExpressionTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Expression/UnaryOperatorExpressionTests.cs @@ -92,6 +92,32 @@ namespace ICSharpCode.NRefactory.CSharp.Parser.Expression TestUnaryOperatorExpressionTest("&a", UnaryOperatorType.AddressOf); } + [Test, Ignore("async/await not yet supported")] + public void Await() + { + ParseUtilCSharp.AssertExpression( + "async a => await a", + new LambdaExpression { + IsAsync = true, + Parameters = { new ParameterDeclaration { Name = "a" } }, + Body = new UnaryOperatorExpression(UnaryOperatorType.Await, new IdentifierExpression("a")) + }); + } + + [Test, Ignore("async/await not yet supported")] + public void AwaitAwait() + { + ParseUtilCSharp.AssertExpression( + "async a => await await a", + new LambdaExpression { + IsAsync = true, + Parameters = { new ParameterDeclaration { Name = "a" } }, + Body = new UnaryOperatorExpression( + UnaryOperatorType.Await, + new UnaryOperatorExpression(UnaryOperatorType.Await, new IdentifierExpression("a"))) + }); + } + [Test] public void DereferenceAfterCast() { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/ParseSelfTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/ParseSelfTests.cs index 863a939529..924a3ebba1 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/ParseSelfTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/ParseSelfTests.cs @@ -70,21 +70,43 @@ namespace ICSharpCode.NRefactory.CSharp.Parser foreach (string fileName in fileNames) { this.currentDocument = new ReadOnlyDocument(File.ReadAllText(fileName)); CompilationUnit cu = parser.Parse(currentDocument.CreateReader()); + if (parser.HasErrors) + continue; this.currentFileName = fileName; CheckPositionConsistency(cu); CheckMissingTokens(cu); } } + + void PrintNode (AstNode node) + { + Console.WriteLine ("Parent:" + node.GetType ()); + Console.WriteLine ("Children:"); + foreach (var c in node.Children) + Console.WriteLine (c.GetType () +" at:"+ c.StartLocation +"-"+ c.EndLocation + " Role: "+ c.Role); + Console.WriteLine ("----"); + } - void CheckPositionConsistency(AstNode node) + void CheckPositionConsistency (AstNode node) { - string comment = "(" + node.GetType().Name + " at " + node.StartLocation + " in " + currentFileName + ")"; - Assert.IsTrue(node.StartLocation <= node.EndLocation, "StartLocation must be before EndLocation " + comment); + string comment = "(" + node.GetType ().Name + " at " + node.StartLocation + " in " + currentFileName + ")"; + var pred = node.StartLocation <= node.EndLocation; + if (!pred) + PrintNode (node); + Assert.IsTrue(pred, "StartLocation must be before EndLocation " + comment); var prevNodeEnd = node.StartLocation; + var prevNode = node; for (AstNode child = node.FirstChild; child != null; child = child.NextSibling) { - Assert.IsTrue(child.StartLocation >= prevNodeEnd, "Child must start after previous sibling " + comment); + bool assertion = child.StartLocation >= prevNodeEnd; + if (!assertion) { + PrintNode (prevNode); + PrintNode (node); + + } + Assert.IsTrue(assertion, currentFileName + ": Child " + child.GetType () +" (" + child.StartLocation + ")" +" must start after previous sibling " + prevNode.GetType () + "(" + prevNode.StartLocation + ")"); CheckPositionConsistency(child); prevNodeEnd = child.EndLocation; + prevNode = child; } Assert.IsTrue(prevNodeEnd <= node.EndLocation, "Last child must end before parent node ends " + comment); } @@ -95,24 +117,32 @@ namespace ICSharpCode.NRefactory.CSharp.Parser Assert.IsNull(node.FirstChild, "Token nodes should not have children"); } else { var prevNodeEnd = node.StartLocation; + var prevNode = node; for (AstNode child = node.FirstChild; child != null; child = child.NextSibling) { - CheckWhitespace(prevNodeEnd, child.StartLocation); + CheckWhitespace(prevNode, prevNodeEnd, child, child.StartLocation); CheckMissingTokens(child); + prevNode = child; prevNodeEnd = child.EndLocation; } - CheckWhitespace(prevNodeEnd, node.EndLocation); + CheckWhitespace(prevNode, prevNodeEnd, node, node.EndLocation); } } - void CheckWhitespace(TextLocation whitespaceStart, TextLocation whitespaceEnd) + void CheckWhitespace(AstNode startNode, TextLocation whitespaceStart, AstNode endNode, TextLocation whitespaceEnd) { - if (whitespaceStart == whitespaceEnd) + if (whitespaceStart == whitespaceEnd || startNode == endNode) return; int start = currentDocument.GetOffset(whitespaceStart.Line, whitespaceStart.Column); int end = currentDocument.GetOffset(whitespaceEnd.Line, whitespaceEnd.Column); string text = currentDocument.GetText(start, end - start); - Assert.IsTrue(string.IsNullOrWhiteSpace(text), "Expected whitespace between " + whitespaceStart + " and " + whitespaceEnd - + ", but got '" + text + "' (in " + currentFileName + ")"); + bool assertion = string.IsNullOrWhiteSpace(text); + if (!assertion) { + if (startNode.Parent != endNode.Parent) + PrintNode (startNode.Parent); + PrintNode (endNode.Parent); + } + Assert.IsTrue(assertion, "Expected whitespace between " + startNode.GetType () +":" + whitespaceStart + " and " + endNode.GetType () + ":" + whitespaceEnd + + ", but got '" + text + "' (in " + currentFileName + " parent:" + startNode.Parent.GetType () +")"); } #endregion } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/ParseUtil.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/ParseUtil.cs index 1b71c00e3a..c5068c9893 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/ParseUtil.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/ParseUtil.cs @@ -117,7 +117,7 @@ namespace ICSharpCode.NRefactory.CSharp.Parser static string ToCSharp(AstNode node) { StringWriter w = new StringWriter(); - node.AcceptVisitor(new OutputVisitor(w, new CSharpFormattingOptions()), null); + node.AcceptVisitor(new CSharpOutputVisitor(w, new CSharpFormattingOptions()), null); return w.ToString(); } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/YieldStatementTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/YieldStatementTests.cs index 5d55367e1f..dc46ae5dfb 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/YieldStatementTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Statements/YieldStatementTests.cs @@ -27,7 +27,7 @@ namespace ICSharpCode.NRefactory.CSharp.Parser.Statements [Test] public void YieldReturnStatementTest() { - YieldStatement yieldStmt = ParseUtilCSharp.ParseStatement("yield return \"Foo\";"); + YieldReturnStatement yieldStmt = ParseUtilCSharp.ParseStatement("yield return \"Foo\";"); PrimitiveExpression expr = (PrimitiveExpression)yieldStmt.Expression; Assert.AreEqual("Foo", expr.Value); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/TypeMembers/MethodDeclarationTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/TypeMembers/MethodDeclarationTests.cs index f0f9b86f67..5742b24254 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/TypeMembers/MethodDeclarationTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/TypeMembers/MethodDeclarationTests.cs @@ -355,5 +355,33 @@ namespace ICSharpCode.NRefactory.CSharp.Parser.TypeMembers } }}); } + + [Test, Ignore("async/await not yet supported")] + public void AsyncMethod() + { + ParseUtilCSharp.AssertTypeMember( + "async void MyMethod() {}", + new MethodDeclaration { + Modifiers = Modifiers.Async, + ReturnType = new PrimitiveType("void"), + Name = "MyMethod", + Body = new BlockStatement() + }); + } + + [Test, Ignore("async/await not yet supported")] + public void AsyncAsyncAsync() + { + ParseUtilCSharp.AssertTypeMember( + "async async async(async async) {}", + new MethodDeclaration { + Modifiers = Modifiers.Async, + ReturnType = new SimpleType("async"), + Name = "async", + Body = new BlockStatement(), + Parameters = { + new ParameterDeclaration(new SimpleType("async"), "async") + }}); + } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ConversionsTest.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ConversionsTest.cs index e2dce79c72..e1986cdb33 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ConversionsTest.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/ConversionsTest.cs @@ -478,5 +478,24 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver Assert.AreEqual(2, BetterConversion(typeof(ushort?), typeof(long?), typeof(int?))); Assert.AreEqual(0, BetterConversion(typeof(sbyte), typeof(int?), typeof(uint?))); } + + [Test] + public void ExpansiveInheritance() + { + SimpleProjectContent pc = new SimpleProjectContent(); + DefaultTypeDefinition a = new DefaultTypeDefinition(pc, string.Empty, "A"); + DefaultTypeDefinition b = new DefaultTypeDefinition(pc, string.Empty, "B"); + // interface A + a.Kind = TypeKind.Interface; + a.TypeParameters.Add(new DefaultTypeParameter(EntityType.TypeDefinition, 0, "U") { Variance = VarianceModifier.Contravariant }); + // interface B : A>> { } + DefaultTypeParameter x = new DefaultTypeParameter(EntityType.TypeDefinition, 0, "X"); + b.TypeParameters.Add(x); + b.BaseTypes.Add(new ParameterizedType(a, new[] { new ParameterizedType(a, new [] { new ParameterizedType(b, new [] { x }) } ) })); + + IType type1 = new ParameterizedType(b, new[] { KnownTypeReference.Double.Resolve(ctx) }); + IType type2 = new ParameterizedType(a, new [] { new ParameterizedType(b, new[] { KnownTypeReference.String.Resolve(ctx) }) }); + Assert.IsFalse(conversions.ImplicitConversion(type1, type2)); + } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/OverloadResolutionTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/OverloadResolutionTests.cs index c3367a5094..75620bf376 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/OverloadResolutionTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/OverloadResolutionTests.cs @@ -236,6 +236,10 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver get { return true; } } + public override bool IsAsync { + get { return false; } + } + public override IType GetInferredReturnType(IType[] parameterTypes) { return inferredReturnType; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/TypeInferenceTests.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/TypeInferenceTests.cs index 7afb04d737..12bdcdfe2c 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/TypeInferenceTests.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Resolver/TypeInferenceTests.cs @@ -175,6 +175,10 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver get { return true; } } + public override bool IsAsync { + get { return false; } + } + public override IType GetInferredReturnType(IType[] parameterTypes) { Assert.AreEqual(expectedParameterTypes, parameterTypes, "Parameters types passed to " + this); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestBlankLineFormatting.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestBlankLineFormatting.cs index 7557859e6d..d231327f1b 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestBlankLineFormatting.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestBlankLineFormatting.cs @@ -31,7 +31,6 @@ using ICSharpCode.NRefactory.CSharp; namespace ICSharpCode.NRefactory.FormattingTests { - [Ignore ("TODO")] [TestFixture()] public class TestBlankLineFormatting : TestBase { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestBraceStlye.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestBraceStlye.cs index 3746b3b0fa..033bf19245 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestBraceStlye.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestBraceStlye.cs @@ -34,7 +34,6 @@ namespace ICSharpCode.NRefactory.FormattingTests [TestFixture()] public class TestBraceStyle : TestBase { - [Ignore ("TODO")] [Test()] public void TestNamespaceBraceStyle () { @@ -222,7 +221,6 @@ namespace B { }"); } - [Ignore ("TODO")] [Test()] public void TestAllowPropertyGetBlockInline () { @@ -264,7 +262,6 @@ namespace B { }"); } - [Ignore ("TODO")] [Test()] public void TestAllowPropertySetBlockInline () { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestFormattingBugs.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestFormattingBugs.cs index 8e667542e7..ea509e221a 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestFormattingBugs.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestFormattingBugs.cs @@ -1,4 +1,4 @@ -// +// // TestFormattingBugs.cs // // Author: @@ -31,7 +31,6 @@ using ICSharpCode.NRefactory.CSharp; namespace ICSharpCode.NRefactory.FormattingTests { - [Ignore()] [TestFixture()] public class TestFormattingBugs : TestBase { @@ -131,9 +130,9 @@ using (IDisposable b = null) { " + input + @" } }"); - int start = result.GetLineOffset (5); - int end = result.GetLineOffset (result.LineCount - 1); - string text = result.GetTextAt (start, end - start).Trim (); + int start = result.GetOffset (5, 1); + int end = result.GetOffset (result.LineCount - 1, 1); + string text = result.GetText (start, end - start).Trim (); expectedOutput = expectedOutput.Replace ("\n", "\n\t\t"); Assert.AreEqual (expectedOutput, text); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestSpacingVisitor.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestSpacingVisitor.cs index 87d61ee511..3f0c236024 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestSpacingVisitor.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestSpacingVisitor.cs @@ -1,4 +1,4 @@ -// +// // TestFormattingVisitor.cs // // Author: @@ -142,7 +142,7 @@ namespace ICSharpCode.NRefactory.FormattingTests int i2 = result.Text.IndexOf ("right") + "right".Length; if (i1 < 0 || i2 < 0) Assert.Fail ("text invalid:" + result.Text); - Assert.AreEqual ("left " + op + " right", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual ("left " + op + " right", result.GetText (i1, i2 - i1)); } [Test()] @@ -234,7 +234,7 @@ namespace ICSharpCode.NRefactory.FormattingTests }"); int i1 = result.Text.IndexOf ("condition"); int i2 = result.Text.IndexOf ("falseexpr") + "falseexpr".Length; - Assert.AreEqual (@"condition ? trueexpr : falseexpr", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"condition ? trueexpr : falseexpr", result.GetText (i1, i2 - i1)); policy.SpaceBeforeConditionalOperatorCondition = false; @@ -250,7 +250,7 @@ namespace ICSharpCode.NRefactory.FormattingTests }"); i1 = result.Text.IndexOf ("true"); i2 = result.Text.IndexOf ("falseexpr") + "falseexpr".Length; - Assert.AreEqual (@"true?trueexpr:falseexpr", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"true?trueexpr:falseexpr", result.GetText (i1, i2 - i1)); } [Test()] @@ -268,7 +268,7 @@ namespace ICSharpCode.NRefactory.FormattingTests int i1 = result.Text.IndexOf ("MethodCall"); int i2 = result.Text.IndexOf (";") + ";".Length; - Assert.AreEqual (@"MethodCall ();", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"MethodCall ();", result.GetText (i1, i2 - i1)); result = GetResult (policy, @"class Test { @@ -282,7 +282,7 @@ namespace ICSharpCode.NRefactory.FormattingTests result = GetResult (policy, result.Text); i1 = result.Text.IndexOf ("MethodCall"); i2 = result.Text.IndexOf (";") + ";".Length; - Assert.AreEqual (@"MethodCall();", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"MethodCall();", result.GetText (i1, i2 - i1)); } [Test()] @@ -299,7 +299,7 @@ namespace ICSharpCode.NRefactory.FormattingTests }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( true )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( true )", result.GetText (i1, i2 - i1)); policy.SpaceWithinMethodCallParentheses = false; @@ -312,7 +312,7 @@ namespace ICSharpCode.NRefactory.FormattingTests i1 = result.Text.LastIndexOf ("("); i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"(true)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"(true)", result.GetText (i1, i2 - i1)); } [Test()] @@ -329,7 +329,7 @@ namespace ICSharpCode.NRefactory.FormattingTests }"); int i1 = result.Text.IndexOf ("if"); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"if (true)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"if (true)", result.GetText (i1, i2 - i1)); } [Test()] @@ -346,7 +346,7 @@ namespace ICSharpCode.NRefactory.FormattingTests }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( true )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( true )", result.GetText (i1, i2 - i1)); } [Test()] @@ -363,7 +363,7 @@ namespace ICSharpCode.NRefactory.FormattingTests }"); int i1 = result.Text.IndexOf ("while"); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"while (true)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"while (true)", result.GetText (i1, i2 - i1)); } [Test()] @@ -381,7 +381,7 @@ namespace ICSharpCode.NRefactory.FormattingTests int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( true )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( true )", result.GetText (i1, i2 - i1)); } [Test()] @@ -398,7 +398,7 @@ namespace ICSharpCode.NRefactory.FormattingTests }"); int i1 = result.Text.IndexOf ("for"); int i2 = result.Text.LastIndexOf ("(") + "(".Length; - Assert.AreEqual (@"for (", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"for (", result.GetText (i1, i2 - i1)); } [Test()] @@ -415,7 +415,7 @@ namespace ICSharpCode.NRefactory.FormattingTests }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( ;; )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( ;; )", result.GetText (i1, i2 - i1)); } [Test()] @@ -432,7 +432,7 @@ namespace ICSharpCode.NRefactory.FormattingTests }"); int i1 = result.Text.IndexOf ("foreach"); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"foreach (var o in list)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"foreach (var o in list)", result.GetText (i1, i2 - i1)); } [Test()] @@ -449,7 +449,7 @@ namespace ICSharpCode.NRefactory.FormattingTests }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( var o in list )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( var o in list )", result.GetText (i1, i2 - i1)); } [Test()] @@ -466,7 +466,7 @@ namespace ICSharpCode.NRefactory.FormattingTests }"); int i1 = result.Text.IndexOf ("catch"); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"catch (Exception)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"catch (Exception)", result.GetText (i1, i2 - i1)); } [Test()] @@ -483,7 +483,7 @@ namespace ICSharpCode.NRefactory.FormattingTests }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( Exception )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( Exception )", result.GetText (i1, i2 - i1)); } [Test()] @@ -500,7 +500,7 @@ namespace ICSharpCode.NRefactory.FormattingTests }"); int i1 = result.Text.IndexOf ("lock"); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"lock (this)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"lock (this)", result.GetText (i1, i2 - i1)); } [Test()] @@ -517,7 +517,7 @@ namespace ICSharpCode.NRefactory.FormattingTests }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( this )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( this )", result.GetText (i1, i2 - i1)); } [Test()] @@ -535,7 +535,7 @@ namespace ICSharpCode.NRefactory.FormattingTests int i1 = result.Text.LastIndexOf ("for"); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"for (int i; true; i++)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"for (int i; true; i++)", result.GetText (i1, i2 - i1)); } [Test()] @@ -554,7 +554,7 @@ namespace ICSharpCode.NRefactory.FormattingTests int i1 = result.Text.LastIndexOf ("for"); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"for (int i ;true ;i++)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"for (int i ;true ;i++)", result.GetText (i1, i2 - i1)); } [Test()] @@ -572,7 +572,7 @@ return (Test)null; int i1 = result.Text.LastIndexOf ("return"); int i2 = result.Text.LastIndexOf ("null") + "null".Length; - Assert.AreEqual (@"return (Test) null", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"return (Test) null", result.GetText (i1, i2 - i1)); } [Test()] @@ -589,7 +589,7 @@ return (Test)null; }"); int i1 = result.Text.IndexOf ("using"); int i2 = result.Text.LastIndexOf ("(") + "(".Length; - Assert.AreEqual (@"using (", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"using (", result.GetText (i1, i2 - i1)); } [Test()] @@ -606,7 +606,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( a )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( a )", result.GetText (i1, i2 - i1)); } static void TestAssignmentOperator (CSharpFormattingOptions policy, string op) @@ -617,7 +617,7 @@ return (Test)null; int i2 = result.Text.IndexOf ("right") + "right".Length; if (i1 < 0 || i2 < 0) Assert.Fail ("text invalid:" + result.Text); - Assert.AreEqual ("left " + op + " right", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual ("left " + op + " right", result.GetText (i1, i2 - i1)); } [Test()] @@ -653,7 +653,7 @@ return (Test)null; int i1 = result.Text.LastIndexOf ("left"); int i2 = result.Text.LastIndexOf ("right") + "right".Length; - Assert.AreEqual (@"left = right", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"left = right", result.GetText (i1, i2 - i1)); } [Test()] @@ -670,7 +670,7 @@ return (Test)null; }"); int i1 = result.Text.IndexOf ("switch"); int i2 = result.Text.LastIndexOf ("(") + "(".Length; - Assert.AreEqual (@"switch (", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"switch (", result.GetText (i1, i2 - i1)); } [Test()] @@ -687,7 +687,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( test )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( test )", result.GetText (i1, i2 - i1)); } [Test()] @@ -704,7 +704,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( test )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( test )", result.GetText (i1, i2 - i1)); } [Test()] @@ -720,7 +720,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( int a )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( int a )", result.GetText (i1, i2 - i1)); } [Test()] @@ -737,7 +737,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( int )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( int )", result.GetText (i1, i2 - i1)); } [Test()] @@ -754,7 +754,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( int )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( int )", result.GetText (i1, i2 - i1)); } [Test()] @@ -771,7 +771,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("sizeof"); int i2 = result.Text.LastIndexOf ("(") + "(".Length; - Assert.AreEqual (@"sizeof (", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"sizeof (", result.GetText (i1, i2 - i1)); } [Test()] @@ -788,7 +788,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( int )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( int )", result.GetText (i1, i2 - i1)); } [Test()] @@ -806,7 +806,7 @@ return (Test)null; int i1 = result.Text.LastIndexOf ("typeof"); int i2 = result.Text.LastIndexOf ("(") + "(".Length; - Assert.AreEqual (@"typeof (", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"typeof (", result.GetText (i1, i2 - i1)); } [Test()] @@ -823,7 +823,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( a + b )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( a + b )", result.GetText (i1, i2 - i1)); result = GetResult (policy, @"class Test { void TestMe () @@ -835,7 +835,7 @@ return (Test)null; result = GetResult (policy, result.Text); i1 = result.Text.LastIndexOf ("("); i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( a + b )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( a + b )", result.GetText (i1, i2 - i1)); } [Test()] @@ -852,7 +852,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("new"); int i2 = result.Text.LastIndexOf (";") + ";".Length; - Assert.AreEqual (@"new Test ();", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"new Test ();", result.GetText (i1, i2 - i1)); } [Test()] @@ -869,7 +869,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("new"); int i2 = result.Text.LastIndexOf (";") + ";".Length; - Assert.AreEqual (@"new Test ( 1 );", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"new Test ( 1 );", result.GetText (i1, i2 - i1)); } [Test()] @@ -886,7 +886,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("new"); int i2 = result.Text.LastIndexOf (";") + ";".Length; - Assert.AreEqual (@"new Test ( );", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"new Test ( );", result.GetText (i1, i2 - i1)); } [Test()] @@ -904,7 +904,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("new"); int i2 = result.Text.LastIndexOf (";") + ";".Length; - Assert.AreEqual (@"new Test (1 ,2);", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"new Test (1 ,2);", result.GetText (i1, i2 - i1)); } [Test()] @@ -921,7 +921,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("new"); int i2 = result.Text.LastIndexOf (";") + ";".Length; - Assert.AreEqual (@"new Test (1, 2);", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"new Test (1, 2);", result.GetText (i1, i2 - i1)); } [Test()] @@ -936,20 +936,20 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("int"); int i2 = result.Text.LastIndexOf (";") + ";".Length; - Assert.AreEqual (@"int a, b, c;", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"int a, b, c;", result.GetText (i1, i2 - i1)); policy.SpaceBeforeFieldDeclarationComma = true; result = GetResult (policy, result.Text); i1 = result.Text.LastIndexOf ("int"); i2 = result.Text.LastIndexOf (";") + ";".Length; - Assert.AreEqual (@"int a , b , c;", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"int a , b , c;", result.GetText (i1, i2 - i1)); policy.SpaceBeforeFieldDeclarationComma = false; policy.SpaceAfterFieldDeclarationComma = false; result = GetResult (policy, result.Text); i1 = result.Text.LastIndexOf ("int"); i2 = result.Text.LastIndexOf (";") + ";".Length; - Assert.AreEqual (@"int a,b,c;", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"int a,b,c;", result.GetText (i1, i2 - i1)); } [Test()] @@ -964,13 +964,13 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"(int a ,int b ,int c)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"(int a ,int b ,int c)", result.GetText (i1, i2 - i1)); policy.SpaceBeforeMethodDeclarationParameterComma = false; result = GetResult (policy, result.Text); i1 = result.Text.LastIndexOf ("("); i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"(int a,int b,int c)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"(int a,int b,int c)", result.GetText (i1, i2 - i1)); } [Test()] @@ -985,13 +985,13 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"(int a, int b, int c)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"(int a, int b, int c)", result.GetText (i1, i2 - i1)); policy.SpaceAfterMethodDeclarationParameterComma = false; result = GetResult (policy, result.Text); i1 = result.Text.LastIndexOf ("("); i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"(int a,int b,int c)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"(int a,int b,int c)", result.GetText (i1, i2 - i1)); } [Test()] @@ -1008,7 +1008,7 @@ return (Test)null; }"); int i1 = result.Text.IndexOf ("x"); int i2 = result.Text.LastIndexOf ("null") + "null".Length; - Assert.AreEqual (@"x => x != null", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"x => x != null", result.GetText (i1, i2 - i1)); } [Test()] @@ -1026,7 +1026,7 @@ return (Test)null; }"); int i1 = result.Text.IndexOf ("int"); int i2 = result.Text.IndexOf (";") + ";".Length; - Assert.AreEqual (@"int a ,b ,c;", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"int a ,b ,c;", result.GetText (i1, i2 - i1)); result = GetResult (policy, result.Text); @@ -1035,7 +1035,7 @@ return (Test)null; result = GetResult (policy, result.Text); i1 = result.Text.IndexOf ("int"); i2 = result.Text.IndexOf (";") + ";".Length; - Assert.AreEqual (@"int a,b,c;", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"int a,b,c;", result.GetText (i1, i2 - i1)); } [Test()] @@ -1053,7 +1053,7 @@ return (Test)null; }"); int i1 = result.Text.IndexOf ("int"); int i2 = result.Text.IndexOf (";") + ";".Length; - Assert.AreEqual (@"int a = 5 , b = 6 , c;", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"int a = 5 , b = 6 , c;", result.GetText (i1, i2 - i1)); result = GetResult (policy, result.Text); @@ -1063,7 +1063,7 @@ return (Test)null; result = GetResult (policy, result.Text); i1 = result.Text.IndexOf ("int"); i2 = result.Text.IndexOf (";") + ";".Length; - Assert.AreEqual (@"int a = 5,b = 6,c;", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"int a = 5,b = 6,c;", result.GetText (i1, i2 - i1)); } [Test()] @@ -1081,7 +1081,7 @@ return (Test)null; }"); int i1 = result.Text.IndexOf ("List"); int i2 = result.Text.IndexOf (";") + ";".Length; - Assert.AreEqual (@"List a;", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"List a;", result.GetText (i1, i2 - i1)); } @@ -1121,14 +1121,14 @@ return (Test)null; int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"(int a ,int b ,int c)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"(int a ,int b ,int c)", result.GetText (i1, i2 - i1)); policy.SpaceBeforeConstructorDeclarationParameterComma = false; result = GetResult (policy, result.Text); i1 = result.Text.LastIndexOf ("("); i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"(int a,int b,int c)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"(int a,int b,int c)", result.GetText (i1, i2 - i1)); } [Test()] @@ -1143,13 +1143,13 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"(int a, int b, int c)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"(int a, int b, int c)", result.GetText (i1, i2 - i1)); policy.SpaceAfterConstructorDeclarationParameterComma = false; result = GetResult (policy, result.Text); i1 = result.Text.LastIndexOf ("("); i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"(int a,int b,int c)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"(int a,int b,int c)", result.GetText (i1, i2 - i1)); } [Test()] @@ -1165,7 +1165,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( int a )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( int a )", result.GetText (i1, i2 - i1)); } [Test()] @@ -1181,7 +1181,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( )", result.GetText (i1, i2 - i1)); } #endregion @@ -1220,13 +1220,13 @@ return (Test)null; int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"(int a ,int b ,int c)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"(int a ,int b ,int c)", result.GetText (i1, i2 - i1)); policy.SpaceBeforeDelegateDeclarationParameterComma = false; result = GetResult (policy, result.Text); i1 = result.Text.LastIndexOf ("("); i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"(int a,int b,int c)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"(int a,int b,int c)", result.GetText (i1, i2 - i1)); } [Test()] @@ -1240,13 +1240,13 @@ return (Test)null; int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"(int a, int b, int c)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"(int a, int b, int c)", result.GetText (i1, i2 - i1)); policy.SpaceAfterDelegateDeclarationParameterComma = false; result = GetResult (policy, result.Text); i1 = result.Text.LastIndexOf ("("); i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"(int a,int b,int c)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"(int a,int b,int c)", result.GetText (i1, i2 - i1)); } [Test()] @@ -1258,7 +1258,7 @@ return (Test)null; int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( int a )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( int a )", result.GetText (i1, i2 - i1)); } [Test()] @@ -1270,7 +1270,7 @@ return (Test)null; int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( )", result.GetText (i1, i2 - i1)); } #endregion @@ -1315,13 +1315,13 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"(a ,b ,c)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"(a ,b ,c)", result.GetText (i1, i2 - i1)); policy.SpaceBeforeMethodCallParameterComma = false; result = GetResult (policy, result.Text); i1 = result.Text.LastIndexOf ("("); i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"(a,b,c)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"(a,b,c)", result.GetText (i1, i2 - i1)); } [Test()] @@ -1340,13 +1340,13 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"(a, b, c)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"(a, b, c)", result.GetText (i1, i2 - i1)); policy.SpaceAfterMethodCallParameterComma = false; result = GetResult (policy, result.Text); i1 = result.Text.LastIndexOf ("("); i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"(a,b,c)", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"(a,b,c)", result.GetText (i1, i2 - i1)); } [Test()] @@ -1364,7 +1364,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( a )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( a )", result.GetText (i1, i2 - i1)); } [Test()] @@ -1382,7 +1382,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("("); int i2 = result.Text.LastIndexOf (")") + ")".Length; - Assert.AreEqual (@"( )", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"( )", result.GetText (i1, i2 - i1)); } #endregion @@ -1430,7 +1430,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("["); int i2 = result.Text.LastIndexOf ("]") + "]".Length; - Assert.AreEqual (@"[int a ,int b]", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"[int a ,int b]", result.GetText (i1, i2 - i1)); } @@ -1450,7 +1450,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("["); int i2 = result.Text.LastIndexOf ("]") + "]".Length; - Assert.AreEqual (@"[int a, int b]", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"[int a, int b]", result.GetText (i1, i2 - i1)); } [Test()] @@ -1469,7 +1469,7 @@ return (Test)null; }"); int i1 = result.Text.LastIndexOf ("["); int i2 = result.Text.LastIndexOf ("]") + "]".Length; - Assert.AreEqual (@"[ int a, int b ]", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"[ int a, int b ]", result.GetText (i1, i2 - i1)); } #endregion @@ -1540,7 +1540,7 @@ return (Test)null; int i1 = result.Text.LastIndexOf ("["); int i2 = result.Text.LastIndexOf ("]") + "]".Length; - Assert.AreEqual (@"[1 ,2 ,3]", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"[1 ,2 ,3]", result.GetText (i1, i2 - i1)); } [Test()] @@ -1558,7 +1558,7 @@ return (Test)null; int i1 = result.Text.LastIndexOf ("["); int i2 = result.Text.LastIndexOf ("]") + "]".Length; - Assert.AreEqual (@"[1, 2, 3]", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"[1, 2, 3]", result.GetText (i1, i2 - i1)); } #endregion @@ -1595,7 +1595,7 @@ return (Test)null; }"); int i1 = result.Text.IndexOf ("Foo"); int i2 = result.Text.LastIndexOf (";") + ";".Length; - Assert.AreEqual (@"Foo ();", result.GetTextAt (i1, i2 - i1)); + Assert.AreEqual (@"Foo ();", result.GetText (i1, i2 - i1)); } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestStatementIndentation.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestStatementIndentation.cs index 96d06c1c27..e0bf27ad9c 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestStatementIndentation.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestStatementIndentation.cs @@ -55,7 +55,6 @@ this.TestMethod (); }"); } - [Ignore ("TODO")] [Test()] public void TestIndentBlocks () { @@ -499,7 +498,6 @@ using (var o = new MyObj()) { }"); } - [Ignore ("TODO")] [Test()] public void TestUsingAlignment () { @@ -946,7 +944,6 @@ do { }"); } - [Ignore ("TODO")] [Test()] public void TestIfAlignment () { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestTypeLevelIndentation.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestTypeLevelIndentation.cs index 1ba5ef5f53..6bef2a7803 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestTypeLevelIndentation.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TestTypeLevelIndentation.cs @@ -45,6 +45,20 @@ namespace ICSharpCode.NRefactory.FormattingTests @"class Test {}"); } + [Test()] + public void TestAttributeIndentation () + { + CSharpFormattingOptions policy = new CSharpFormattingOptions (); + policy.ClassBraceStyle = BraceStyle.DoNotChange; + + Test (policy, +@" [Attribute1] + [Attribute2()] + class Test {}", +@"[Attribute1] +[Attribute2()] +class Test {}"); + } [Test()] public void TestClassIndentationInNamespaces () @@ -249,7 +263,6 @@ A }"); } - [Ignore ("TODO")] [Test()] public void TestIndentMethodBodyOperatorCase () { @@ -284,7 +297,6 @@ A }"); } - [Ignore ("TODO")] [Test()] public void TestIndentPropertyBody () { @@ -356,7 +368,6 @@ set; }"); } - [Ignore ("TODO")] [Test()] public void TestIndentPropertyBodyIndexerCase () { @@ -401,7 +412,6 @@ set { }"); } - [Ignore ("TODO")] [Test()] public void TestPropertyAlignment () { @@ -435,7 +445,6 @@ set { } - [Ignore ("TODO")] [Test()] public void TestIndentNamespaceBody () { @@ -515,7 +524,6 @@ set; } - [Ignore ("TODO")] [Test()] public void TestIndentEventBody () { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TextEditorTestAdapter.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TextEditorTestAdapter.cs index a9cef844fb..b127d10529 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TextEditorTestAdapter.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/FormattingTests/TextEditorTestAdapter.cs @@ -1,218 +1,14 @@ using System; using System.Collections.Generic; +using System.Text; using ICSharpCode.NRefactory.CSharp; using System.IO; +using ICSharpCode.NRefactory.Editor; using NUnit.Framework; using ICSharpCode.NRefactory.CSharp.Refactoring; namespace ICSharpCode.NRefactory.FormattingTests { - /// - /// Text editor test adapter. Only implemented for testing purposes. Don't use in production code. - /// - class TextEditorTestAdapter : ITextEditorAdapter - { - string text; - - public string Text { - get { - return this.text; - } - } - - List delimiters; - - struct Delimiter - { - public readonly int Offset; - public readonly int Length; - - public int EndOffset { - get { return Offset + Length; } - } - - public Delimiter (int offset, int length) - { - Offset = offset; - Length = length; - } - - public override string ToString () - { - return string.Format ("[Delimiter: Offset={0}, Length={1}]", Offset, Length); - } - } - public void Replace (int offset, int count, string value) - { - this.text = this.text.Substring (0, offset) + value + this.text.Substring (offset + count); - } - static IEnumerable FindDelimiter (string text) - { - for (int i = 0; i < text.Length; i++) { - switch (text [i]) { - case '\r': - if (i + 1 < text.Length && text [i + 1] == '\n') { - yield return new Delimiter (i, 2); - i++; - } else { - yield return new Delimiter (i, 1); - } - break; - case '\n': - yield return new Delimiter (i, 1); - break; - } - } - } - - public TextEditorTestAdapter (string text) - { - this.text = text; - delimiters = new List (FindDelimiter (text)); - } - - class Segment - { - public readonly int Offset; - public readonly int Length; - public readonly int DelimiterLength; - - public Segment (int offset, int length, int delimiterLength) - { - this.Offset = offset; - this.Length = length; - this.DelimiterLength = delimiterLength; - } - - public override string ToString () - { - return string.Format ("[Segment: Offset={0}, Length={1}, DelimiterLength={2}]", Offset, Length, DelimiterLength); - } - } - - Segment Get (int number) - { - number--; - if (number < 0 || number - 1 >= delimiters.Count) - return null; - int startOffset = number > 0 ? delimiters [number - 1].EndOffset : 0; - int endOffset; - int delimiterLength; - if (number < delimiters.Count) { - endOffset = delimiters [number].EndOffset; - delimiterLength = delimiters [number].Length; - } else { - endOffset = text.Length; - delimiterLength = 0; - } - return new Segment (startOffset, endOffset - startOffset, delimiterLength); - } - - #region ITextEditorAdapter implementation - public int LocationToOffset (int line, int col) - { - Segment seg = Get (line); - if (seg == null) - return 0; - return seg.Offset + col - 1; - } - - public char GetCharAt (int offset) - { - if (offset < 0 || offset >= text.Length) - return '\0'; - return text [offset]; - } - - public string GetTextAt (int offset, int length) - { - if (offset < 0 || offset + length >= text.Length) - return ""; - if (length <= 0) - return ""; - - return text.Substring (offset, length); - } - - public int GetEditableLength (int lineNumber) - { - var seg = Get (lineNumber); - if (seg == null) - return 0; - return seg.Length - seg.DelimiterLength; - } - - public string GetIndentation (int lineNumber) - { - var seg = Get (lineNumber); - if (seg == null) - return ""; - int start = seg.Offset; - int end = seg.Offset; - int endOffset = seg.Offset + seg.Length - seg.DelimiterLength; - - while (end < endOffset && (text[end] == ' ' || text[end] == '\t')) - end++; - - return start < end ? text.Substring (start, end - start) : ""; - } - - public int GetLineOffset (int lineNumber) - { - var seg = Get (lineNumber); - if (seg == null) - return 0; - return seg.Offset; - } - - public int GetLineLength (int lineNumber) - { - var seg = Get (lineNumber); - if (seg == null) - return 0; - return seg.Length; - } - - public int GetLineEndOffset (int lineNumber) - { - var seg = Get (lineNumber); - if (seg == null) - return 0; - return seg.Offset + seg.Length; - } - - public bool TabsToSpaces { - get { - return false; - } - } - - public int TabSize { - get { - return 4; - } - } - - public string EolMarker { - get { - return Environment.NewLine; - } - } - - public int Length { - get { - return text.Length; - } - } - - public int LineCount { - get { - return delimiters.Count + 1; - } - } - #endregion - } - public abstract class TestBase { static IActionFactory factory = new TestFactory (); @@ -236,59 +32,55 @@ namespace ICSharpCode.NRefactory.FormattingTests } } - static void ApplyChanges (TextEditorTestAdapter adapter, List changes) + static string ApplyChanges (string text, List changes) { changes.Sort ((x, y) => y.Offset.CompareTo (x.Offset)); + StringBuilder b = new StringBuilder(text); foreach (var change in changes) { // Console.WriteLine ("---- apply:" + change); // Console.WriteLine (adapter.Text); - if (change.Offset > adapter.Length) + if (change.Offset > b.Length) continue; - adapter.Replace (change.Offset, change.RemovedChars, change.InsertedText); + b.Remove(change.Offset, change.RemovedChars); + b.Insert(change.Offset, change.InsertedText); } // Console.WriteLine ("---result:"); // Console.WriteLine (adapter.Text); + return b.ToString(); } - protected static ITextEditorAdapter GetResult (CSharpFormattingOptions policy, string input) + protected static IDocument GetResult (CSharpFormattingOptions policy, string input) { - var adapter = new TextEditorTestAdapter (input); - var visitior = new AstFormattingVisitor (policy, adapter, factory); + var adapter = new ReadOnlyDocument (input); + var visitor = new AstFormattingVisitor (policy, adapter, factory); - var compilationUnit = new CSharpParser ().Parse (new StringReader (adapter.Text)); - compilationUnit.AcceptVisitor (visitior, null); + var compilationUnit = new CSharpParser ().Parse (new StringReader (input)); + compilationUnit.AcceptVisitor (visitor, null); - ApplyChanges (adapter, visitior.Changes); - - return adapter; + return new ReadOnlyDocument(ApplyChanges (input, visitor.Changes)); } - protected static ITextEditorAdapter Test (CSharpFormattingOptions policy, string input, string expectedOutput) + protected static IDocument Test (CSharpFormattingOptions policy, string input, string expectedOutput) { - var adapter = new TextEditorTestAdapter (input); - var visitior = new AstFormattingVisitor (policy, adapter, factory); - - var compilationUnit = new CSharpParser ().Parse (new StringReader (adapter.Text)); - compilationUnit.AcceptVisitor (visitior, null); - ApplyChanges (adapter, visitior.Changes); - if (expectedOutput != adapter.Text) { - Console.WriteLine (adapter.Text); + IDocument doc = GetResult(policy, input); + if (expectedOutput != doc.Text) { + Console.WriteLine (doc.Text); } - Assert.AreEqual (expectedOutput, adapter.Text); - return adapter; + Assert.AreEqual (expectedOutput, doc.Text); + return doc; } - protected static void Continue (CSharpFormattingOptions policy, ITextEditorAdapter adapter, string expectedOutput) + protected static void Continue (CSharpFormattingOptions policy, IDocument document, string expectedOutput) { - var visitior = new AstFormattingVisitor (policy, adapter, factory); + var visitior = new AstFormattingVisitor (policy, document, factory); - var compilationUnit = new CSharpParser ().Parse (new StringReader (adapter.Text)); + var compilationUnit = new CSharpParser ().Parse (new StringReader (document.Text)); compilationUnit.AcceptVisitor (visitior, null); - ApplyChanges (((TextEditorTestAdapter)adapter), visitior.Changes); - if (expectedOutput != adapter.Text) { - Console.WriteLine (adapter.Text); + string newText = ApplyChanges (document.Text, visitior.Changes); + if (expectedOutput != newText) { + Console.WriteLine (newText); } - Assert.AreEqual (expectedOutput, adapter.Text); + Assert.AreEqual (expectedOutput, newText); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/ICSharpCode.NRefactory.Tests.csproj b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/ICSharpCode.NRefactory.Tests.csproj index 8eff5fbb2f..f2782af801 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/ICSharpCode.NRefactory.Tests.csproj +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/ICSharpCode.NRefactory.Tests.csproj @@ -11,7 +11,6 @@ Properties 10.0.0 2.0 - Client True False 4 @@ -79,8 +78,9 @@ + - + @@ -116,7 +116,7 @@ - + diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/AstBuilder/ExpressionBuilder.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/AstBuilder/ExpressionBuilder.cs deleted file mode 100644 index 7ac2ef32ce..0000000000 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/AstBuilder/ExpressionBuilder.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) - -using System; -using System.Collections.Generic; -using ICSharpCode.NRefactory.VB.Ast; - -namespace ICSharpCode.NRefactory.VB.AstBuilder -{ - /// - /// Extension methods for NRefactory.Dom.Expression. - /// - public static class ExpressionBuilder - {/* - public static SimpleNameExpression Identifier(string identifier) - { - return new SimpleNameExpression(identifier); - } - - public static MemberReferenceExpression Member(this Expression targetObject, string memberName) - { - if (targetObject == null) - throw new ArgumentNullException("targetObject"); - return new MemberReferenceExpression(targetObject, memberName); - } - - public static InvocationExpression Call(this Expression callTarget, string methodName, params Expression[] arguments) - { - if (callTarget == null) - throw new ArgumentNullException("callTarget"); - return Call(Member(callTarget, methodName), arguments); - } - - public static InvocationExpression Call(this Expression callTarget, params Expression[] arguments) - { - if (callTarget == null) - throw new ArgumentNullException("callTarget"); - if (arguments == null) - throw new ArgumentNullException("arguments"); - return new InvocationExpression(callTarget, new List(arguments)); - } - - public static ObjectCreateExpression New(this TypeReference createType, params Expression[] arguments) - { - if (createType == null) - throw new ArgumentNullException("createType"); - if (arguments == null) - throw new ArgumentNullException("arguments"); - return new ObjectCreateExpression(createType, new List(arguments)); - } - - public static Expression CreateDefaultValueForType(TypeReference type) - { - if (type != null && !type.IsArrayType) { - switch (type.Type) { - case "System.SByte": - case "System.Byte": - case "System.Int16": - case "System.UInt16": - case "System.Int32": - case "System.UInt32": - case "System.Int64": - case "System.UInt64": - case "System.Single": - case "System.Double": - return new PrimitiveExpression(0, "0"); - case "System.Char": - return new PrimitiveExpression('\0', "'\\0'"); - case "System.Object": - case "System.String": - return new PrimitiveExpression(null, "null"); - case "System.Boolean": - return new PrimitiveExpression(false, "false"); - default: - return new DefaultValueExpression(type); - } - } else { - return new PrimitiveExpression(null, "null"); - } - } - - /// - /// Just calls the BinaryOperatorExpression constructor, - /// but being an extension method; this allows for a nicer - /// infix syntax in some cases. - /// - public static BinaryOperatorExpression Operator(this Expression left, BinaryOperatorType op, Expression right) - { - return new BinaryOperatorExpression(left, op, right); - }*/ - } -} diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/AstBuilder/StatementBuilder.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/AstBuilder/StatementBuilder.cs deleted file mode 100644 index eb227171f9..0000000000 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/AstBuilder/StatementBuilder.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under MIT X11 license (for details please see \doc\license.txt) - -using System; -using System.Collections.Generic; -using ICSharpCode.NRefactory.VB.Ast; - -namespace ICSharpCode.NRefactory.VB.AstBuilder -{ - /// - /// Extension methods for NRefactory.Dom.Expression. - /// -// public static class StatementBuilder -// { -// public static void AddStatement(this BlockStatement block, Statement statement) -// { -// if (block == null) -// throw new ArgumentNullException("block"); -// if (statement == null) -// throw new ArgumentNullException("statement"); -// block.AddChild(statement); -// statement.Parent = block; -// } -// -// public static void AddStatement(this BlockStatement block, Expression expressionStatement) -// { -// if (expressionStatement == null) -// throw new ArgumentNullException("expressionStatement"); -// AddStatement(block, new ExpressionStatement(expressionStatement)); -// } -// -// public static void Throw(this BlockStatement block, Expression expression) -// { -// if (expression == null) -// throw new ArgumentNullException("expression"); -// AddStatement(block, new ThrowStatement(expression)); -// } -// -// public static void Return(this BlockStatement block, Expression expression) -// { -// if (expression == null) -// throw new ArgumentNullException("expression"); -// AddStatement(block, new ReturnStatement(expression)); -// } -// -// public static void Assign(this BlockStatement block, Expression left, Expression right) -// { -// if (left == null) -// throw new ArgumentNullException("left"); -// if (right == null) -// throw new ArgumentNullException("right"); -// AddStatement(block, new AssignmentExpression(left, AssignmentOperatorType.Assign, right)); -// } -// } -} diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/ICSharpCode.NRefactory.VB.csproj b/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/ICSharpCode.NRefactory.VB.csproj index 81fc417937..9f8c892183 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/ICSharpCode.NRefactory.VB.csproj +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/ICSharpCode.NRefactory.VB.csproj @@ -9,7 +9,6 @@ ICSharpCode.NRefactory.VB v4.0 Properties - Client False False 4 @@ -45,8 +44,6 @@ - - @@ -179,14 +176,10 @@ - - - - diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/OutputVisitor/OutputVisitor.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/OutputVisitor/OutputVisitor.cs index eacb30db42..40b17bcf1f 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/OutputVisitor/OutputVisitor.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/OutputVisitor/OutputVisitor.cs @@ -1012,7 +1012,7 @@ namespace ICSharpCode.NRefactory.VB #endregion #region IsKeyword Test - static readonly HashSet unconditionalKeywords = new HashSet { + static readonly HashSet unconditionalKeywords = new HashSet(StringComparer.OrdinalIgnoreCase) { "AddHandler", "AddressOf", "Alias", "And", "AndAlso", "As", "Boolean", "ByRef", "Byte", "ByVal", "Call", "Case", "Catch", "CBool", "CByte", "CChar", "CInt", "Class", "CLng", "CObj", "Const", "Continue", "CSByte", "CShort", "CSng", "CStr", "CType", "CUInt", @@ -1664,6 +1664,11 @@ namespace ICSharpCode.NRefactory.VB WriteCommaSeparatedListInParenthesis(objectCreationExpression.Arguments, false); if (!objectCreationExpression.Initializer.IsNull) { Space(); + if (objectCreationExpression.Initializer.Elements.Any(x => x is FieldInitializerExpression)) + WriteKeyword("With"); + else + WriteKeyword("From"); + Space(); objectCreationExpression.Initializer.AcceptVisitor(this, data); } @@ -1829,7 +1834,7 @@ namespace ICSharpCode.NRefactory.VB { StartNode(fieldInitializerExpression); - if (fieldInitializerExpression.IsKey) { + if (fieldInitializerExpression.IsKey && fieldInitializerExpression.Parent is AnonymousObjectCreationExpression) { WriteKeyword("Key"); Space(); } @@ -2104,8 +2109,10 @@ namespace ICSharpCode.NRefactory.VB WriteKeyword("Case"); if (caseStatement.Clauses.Count == 1 && caseStatement.Clauses.First().Expression.IsNull) WriteKeyword("Else"); - else + else { + Space(); WriteCommaSeparatedList(caseStatement.Clauses); + } NewLine(); Indent(); caseStatement.Body.AcceptVisitor(this, data); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/Visitors/AbstractAstTransformer.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/Visitors/AbstractAstTransformer.cs deleted file mode 100644 index 5441575067..0000000000 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/Visitors/AbstractAstTransformer.cs +++ /dev/null @@ -1,2078 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.1 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace ICSharpCode.NRefactory.VB.Visitors { - using System; - using System.Collections.Generic; - using System.Diagnostics; - using ICSharpCode.NRefactory.VB.Ast; - - - /// - /// The AbstractAstTransformer will iterate through the whole Ast, - /// just like the AbstractAstVisitor. However, the AbstractAstTransformer allows - /// you to modify the Ast at the same time: It does not use 'foreach' internally, - /// so you can add members to collections of parents of the current node (but - /// you cannot insert or delete items as that will make the index used invalid). - /// You can use the methods ReplaceCurrentNode and RemoveCurrentNode to replace - /// or remove the current node, totally independent from the type of the parent node. - /// -// public abstract class AbstractAstTransformer : IAstVisitor { -// -// private Stack nodeStack = new Stack(); -// -// public void ReplaceCurrentNode(INode newNode) { -// nodeStack.Pop(); -// nodeStack.Push(newNode); -// } -// -// public void RemoveCurrentNode() { -// nodeStack.Pop(); -// nodeStack.Push(null); -// } -// -// public virtual object VisitAddHandlerStatement(AddHandlerStatement addHandlerStatement, object data) { -// Debug.Assert((addHandlerStatement != null)); -// Debug.Assert((addHandlerStatement.EventExpression != null)); -// Debug.Assert((addHandlerStatement.HandlerExpression != null)); -// nodeStack.Push(addHandlerStatement.EventExpression); -// addHandlerStatement.EventExpression.AcceptVisitor(this, data); -// addHandlerStatement.EventExpression = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(addHandlerStatement.HandlerExpression); -// addHandlerStatement.HandlerExpression.AcceptVisitor(this, data); -// addHandlerStatement.HandlerExpression = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitAddressOfExpression(AddressOfExpression addressOfExpression, object data) { -// Debug.Assert((addressOfExpression != null)); -// Debug.Assert((addressOfExpression.Expression != null)); -// nodeStack.Push(addressOfExpression.Expression); -// addressOfExpression.Expression.AcceptVisitor(this, data); -// addressOfExpression.Expression = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, object data) { -// Debug.Assert((arrayCreateExpression != null)); -// Debug.Assert((arrayCreateExpression.CreateType != null)); -// Debug.Assert((arrayCreateExpression.Arguments != null)); -// Debug.Assert((arrayCreateExpression.ArrayInitializer != null)); -// nodeStack.Push(arrayCreateExpression.CreateType); -// arrayCreateExpression.CreateType.AcceptVisitor(this, data); -// arrayCreateExpression.CreateType = ((TypeReference)(nodeStack.Pop())); -// for (int i = 0; i < arrayCreateExpression.Arguments.Count; i++) { -// Expression o = arrayCreateExpression.Arguments[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (Expression)nodeStack.Pop(); -// if (o == null) -// arrayCreateExpression.Arguments.RemoveAt(i--); -// else -// arrayCreateExpression.Arguments[i] = o; -// } -// nodeStack.Push(arrayCreateExpression.ArrayInitializer); -// arrayCreateExpression.ArrayInitializer.AcceptVisitor(this, data); -// arrayCreateExpression.ArrayInitializer = ((CollectionInitializerExpression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data) { -// Debug.Assert((assignmentExpression != null)); -// Debug.Assert((assignmentExpression.Left != null)); -// Debug.Assert((assignmentExpression.Right != null)); -// nodeStack.Push(assignmentExpression.Left); -// assignmentExpression.Left.AcceptVisitor(this, data); -// assignmentExpression.Left = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(assignmentExpression.Right); -// assignmentExpression.Right.AcceptVisitor(this, data); -// assignmentExpression.Right = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitAttribute(ICSharpCode.NRefactory.VB.Ast.Attribute attribute, object data) { -// Debug.Assert((attribute != null)); -// Debug.Assert((attribute.PositionalArguments != null)); -// Debug.Assert((attribute.NamedArguments != null)); -// for (int i = 0; i < attribute.PositionalArguments.Count; i++) { -// Expression o = attribute.PositionalArguments[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (Expression)nodeStack.Pop(); -// if (o == null) -// attribute.PositionalArguments.RemoveAt(i--); -// else -// attribute.PositionalArguments[i] = o; -// } -// for (int i = 0; i < attribute.NamedArguments.Count; i++) { -// NamedArgumentExpression o = attribute.NamedArguments[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (NamedArgumentExpression)nodeStack.Pop(); -// if (o == null) -// attribute.NamedArguments.RemoveAt(i--); -// else -// attribute.NamedArguments[i] = o; -// } -// return null; -// } -// -// public virtual object VisitAttributeSection(AttributeSection attributeSection, object data) { -// Debug.Assert((attributeSection != null)); -// Debug.Assert((attributeSection.Attributes != null)); -// for (int i = 0; i < attributeSection.Attributes.Count; i++) { -// ICSharpCode.NRefactory.VB.Ast.Attribute o = attributeSection.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ICSharpCode.NRefactory.VB.Ast.Attribute)nodeStack.Pop(); -// if (o == null) -// attributeSection.Attributes.RemoveAt(i--); -// else -// attributeSection.Attributes[i] = o; -// } -// return null; -// } -// -// public virtual object VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression, object data) { -// Debug.Assert((baseReferenceExpression != null)); -// return null; -// } -// -// public virtual object VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression, object data) { -// Debug.Assert((binaryOperatorExpression != null)); -// Debug.Assert((binaryOperatorExpression.Left != null)); -// Debug.Assert((binaryOperatorExpression.Right != null)); -// nodeStack.Push(binaryOperatorExpression.Left); -// binaryOperatorExpression.Left.AcceptVisitor(this, data); -// binaryOperatorExpression.Left = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(binaryOperatorExpression.Right); -// binaryOperatorExpression.Right.AcceptVisitor(this, data); -// binaryOperatorExpression.Right = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitBlockStatement(BlockStatement blockStatement, object data) { -// Debug.Assert((blockStatement != null)); -// for (int i = 0; i < blockStatement.Children.Count; i++) { -// INode o = blockStatement.Children[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = nodeStack.Pop(); -// if (o == null) -// blockStatement.Children.RemoveAt(i--); -// else -// blockStatement.Children[i] = o; -// } -// return null; -// } -// -// public virtual object VisitCaseLabel(CaseLabel caseLabel, object data) { -// Debug.Assert((caseLabel != null)); -// Debug.Assert((caseLabel.Label != null)); -// Debug.Assert((caseLabel.ToExpression != null)); -// nodeStack.Push(caseLabel.Label); -// caseLabel.Label.AcceptVisitor(this, data); -// caseLabel.Label = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(caseLabel.ToExpression); -// caseLabel.ToExpression.AcceptVisitor(this, data); -// caseLabel.ToExpression = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitCastExpression(CastExpression castExpression, object data) { -// Debug.Assert((castExpression != null)); -// Debug.Assert((castExpression.CastTo != null)); -// Debug.Assert((castExpression.Expression != null)); -// nodeStack.Push(castExpression.CastTo); -// castExpression.CastTo.AcceptVisitor(this, data); -// castExpression.CastTo = ((TypeReference)(nodeStack.Pop())); -// nodeStack.Push(castExpression.Expression); -// castExpression.Expression.AcceptVisitor(this, data); -// castExpression.Expression = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitCatchClause(CatchClause catchClause, object data) { -// Debug.Assert((catchClause != null)); -// Debug.Assert((catchClause.TypeReference != null)); -// Debug.Assert((catchClause.StatementBlock != null)); -// Debug.Assert((catchClause.Condition != null)); -// nodeStack.Push(catchClause.TypeReference); -// catchClause.TypeReference.AcceptVisitor(this, data); -// catchClause.TypeReference = ((TypeReference)(nodeStack.Pop())); -// nodeStack.Push(catchClause.StatementBlock); -// catchClause.StatementBlock.AcceptVisitor(this, data); -// catchClause.StatementBlock = ((Statement)(nodeStack.Pop())); -// nodeStack.Push(catchClause.Condition); -// catchClause.Condition.AcceptVisitor(this, data); -// catchClause.Condition = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitClassReferenceExpression(ClassReferenceExpression classReferenceExpression, object data) { -// Debug.Assert((classReferenceExpression != null)); -// return null; -// } -// -// public virtual object VisitCollectionInitializerExpression(CollectionInitializerExpression collectionInitializerExpression, object data) { -// Debug.Assert((collectionInitializerExpression != null)); -// Debug.Assert((collectionInitializerExpression.CreateExpressions != null)); -// for (int i = 0; i < collectionInitializerExpression.CreateExpressions.Count; i++) { -// Expression o = collectionInitializerExpression.CreateExpressions[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (Expression)nodeStack.Pop(); -// if (o == null) -// collectionInitializerExpression.CreateExpressions.RemoveAt(i--); -// else -// collectionInitializerExpression.CreateExpressions[i] = o; -// } -// return null; -// } -// -// public virtual object VisitCollectionRangeVariable(CollectionRangeVariable collectionRangeVariable, object data) { -// Debug.Assert((collectionRangeVariable != null)); -// Debug.Assert((collectionRangeVariable.Expression != null)); -// Debug.Assert((collectionRangeVariable.Type != null)); -// nodeStack.Push(collectionRangeVariable.Expression); -// collectionRangeVariable.Expression.AcceptVisitor(this, data); -// collectionRangeVariable.Expression = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(collectionRangeVariable.Type); -// collectionRangeVariable.Type.AcceptVisitor(this, data); -// collectionRangeVariable.Type = ((TypeReference)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitCompilationUnit(CompilationUnit compilationUnit, object data) { -// Debug.Assert((compilationUnit != null)); -// for (int i = 0; i < compilationUnit.Children.Count; i++) { -// INode o = compilationUnit.Children[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = nodeStack.Pop(); -// if (o == null) -// compilationUnit.Children.RemoveAt(i--); -// else -// compilationUnit.Children[i] = o; -// } -// return null; -// } -// -// public virtual object VisitConditionalExpression(ConditionalExpression conditionalExpression, object data) { -// Debug.Assert((conditionalExpression != null)); -// Debug.Assert((conditionalExpression.Condition != null)); -// Debug.Assert((conditionalExpression.TrueExpression != null)); -// Debug.Assert((conditionalExpression.FalseExpression != null)); -// nodeStack.Push(conditionalExpression.Condition); -// conditionalExpression.Condition.AcceptVisitor(this, data); -// conditionalExpression.Condition = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(conditionalExpression.TrueExpression); -// conditionalExpression.TrueExpression.AcceptVisitor(this, data); -// conditionalExpression.TrueExpression = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(conditionalExpression.FalseExpression); -// conditionalExpression.FalseExpression.AcceptVisitor(this, data); -// conditionalExpression.FalseExpression = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration, object data) { -// Debug.Assert((constructorDeclaration != null)); -// Debug.Assert((constructorDeclaration.Attributes != null)); -// Debug.Assert((constructorDeclaration.Parameters != null)); -// Debug.Assert((constructorDeclaration.ConstructorInitializer != null)); -// Debug.Assert((constructorDeclaration.Body != null)); -// for (int i = 0; i < constructorDeclaration.Attributes.Count; i++) { -// AttributeSection o = constructorDeclaration.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (AttributeSection)nodeStack.Pop(); -// if (o == null) -// constructorDeclaration.Attributes.RemoveAt(i--); -// else -// constructorDeclaration.Attributes[i] = o; -// } -// for (int i = 0; i < constructorDeclaration.Parameters.Count; i++) { -// ParameterDeclarationExpression o = constructorDeclaration.Parameters[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ParameterDeclarationExpression)nodeStack.Pop(); -// if (o == null) -// constructorDeclaration.Parameters.RemoveAt(i--); -// else -// constructorDeclaration.Parameters[i] = o; -// } -// nodeStack.Push(constructorDeclaration.ConstructorInitializer); -// constructorDeclaration.ConstructorInitializer.AcceptVisitor(this, data); -// constructorDeclaration.ConstructorInitializer = ((ConstructorInitializer)(nodeStack.Pop())); -// nodeStack.Push(constructorDeclaration.Body); -// constructorDeclaration.Body.AcceptVisitor(this, data); -// constructorDeclaration.Body = ((BlockStatement)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitConstructorInitializer(ConstructorInitializer constructorInitializer, object data) { -// Debug.Assert((constructorInitializer != null)); -// Debug.Assert((constructorInitializer.Arguments != null)); -// for (int i = 0; i < constructorInitializer.Arguments.Count; i++) { -// Expression o = constructorInitializer.Arguments[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (Expression)nodeStack.Pop(); -// if (o == null) -// constructorInitializer.Arguments.RemoveAt(i--); -// else -// constructorInitializer.Arguments[i] = o; -// } -// return null; -// } -// -// public virtual object VisitContinueStatement(ContinueStatement continueStatement, object data) { -// Debug.Assert((continueStatement != null)); -// return null; -// } -// -// public virtual object VisitDeclareDeclaration(DeclareDeclaration declareDeclaration, object data) { -// Debug.Assert((declareDeclaration != null)); -// Debug.Assert((declareDeclaration.Attributes != null)); -// Debug.Assert((declareDeclaration.Parameters != null)); -// Debug.Assert((declareDeclaration.TypeReference != null)); -// for (int i = 0; i < declareDeclaration.Attributes.Count; i++) { -// AttributeSection o = declareDeclaration.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (AttributeSection)nodeStack.Pop(); -// if (o == null) -// declareDeclaration.Attributes.RemoveAt(i--); -// else -// declareDeclaration.Attributes[i] = o; -// } -// for (int i = 0; i < declareDeclaration.Parameters.Count; i++) { -// ParameterDeclarationExpression o = declareDeclaration.Parameters[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ParameterDeclarationExpression)nodeStack.Pop(); -// if (o == null) -// declareDeclaration.Parameters.RemoveAt(i--); -// else -// declareDeclaration.Parameters[i] = o; -// } -// nodeStack.Push(declareDeclaration.TypeReference); -// declareDeclaration.TypeReference.AcceptVisitor(this, data); -// declareDeclaration.TypeReference = ((TypeReference)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression, object data) { -// Debug.Assert((defaultValueExpression != null)); -// Debug.Assert((defaultValueExpression.TypeReference != null)); -// nodeStack.Push(defaultValueExpression.TypeReference); -// defaultValueExpression.TypeReference.AcceptVisitor(this, data); -// defaultValueExpression.TypeReference = ((TypeReference)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration, object data) { -// Debug.Assert((delegateDeclaration != null)); -// Debug.Assert((delegateDeclaration.Attributes != null)); -// Debug.Assert((delegateDeclaration.ReturnType != null)); -// Debug.Assert((delegateDeclaration.Parameters != null)); -// Debug.Assert((delegateDeclaration.Templates != null)); -// for (int i = 0; i < delegateDeclaration.Attributes.Count; i++) { -// AttributeSection o = delegateDeclaration.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (AttributeSection)nodeStack.Pop(); -// if (o == null) -// delegateDeclaration.Attributes.RemoveAt(i--); -// else -// delegateDeclaration.Attributes[i] = o; -// } -// nodeStack.Push(delegateDeclaration.ReturnType); -// delegateDeclaration.ReturnType.AcceptVisitor(this, data); -// delegateDeclaration.ReturnType = ((TypeReference)(nodeStack.Pop())); -// for (int i = 0; i < delegateDeclaration.Parameters.Count; i++) { -// ParameterDeclarationExpression o = delegateDeclaration.Parameters[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ParameterDeclarationExpression)nodeStack.Pop(); -// if (o == null) -// delegateDeclaration.Parameters.RemoveAt(i--); -// else -// delegateDeclaration.Parameters[i] = o; -// } -// for (int i = 0; i < delegateDeclaration.Templates.Count; i++) { -// TemplateDefinition o = delegateDeclaration.Templates[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (TemplateDefinition)nodeStack.Pop(); -// if (o == null) -// delegateDeclaration.Templates.RemoveAt(i--); -// else -// delegateDeclaration.Templates[i] = o; -// } -// return null; -// } -// -// public virtual object VisitDirectionExpression(DirectionExpression directionExpression, object data) { -// Debug.Assert((directionExpression != null)); -// Debug.Assert((directionExpression.Expression != null)); -// nodeStack.Push(directionExpression.Expression); -// directionExpression.Expression.AcceptVisitor(this, data); -// directionExpression.Expression = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitDoLoopStatement(DoLoopStatement doLoopStatement, object data) { -// Debug.Assert((doLoopStatement != null)); -// Debug.Assert((doLoopStatement.Condition != null)); -// Debug.Assert((doLoopStatement.EmbeddedStatement != null)); -// nodeStack.Push(doLoopStatement.Condition); -// doLoopStatement.Condition.AcceptVisitor(this, data); -// doLoopStatement.Condition = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(doLoopStatement.EmbeddedStatement); -// doLoopStatement.EmbeddedStatement.AcceptVisitor(this, data); -// doLoopStatement.EmbeddedStatement = ((Statement)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitElseIfSection(ElseIfSection elseIfSection, object data) { -// Debug.Assert((elseIfSection != null)); -// Debug.Assert((elseIfSection.Condition != null)); -// Debug.Assert((elseIfSection.EmbeddedStatement != null)); -// nodeStack.Push(elseIfSection.Condition); -// elseIfSection.Condition.AcceptVisitor(this, data); -// elseIfSection.Condition = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(elseIfSection.EmbeddedStatement); -// elseIfSection.EmbeddedStatement.AcceptVisitor(this, data); -// elseIfSection.EmbeddedStatement = ((Statement)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitEndStatement(EndStatement endStatement, object data) { -// Debug.Assert((endStatement != null)); -// return null; -// } -// -// public virtual object VisitEraseStatement(EraseStatement eraseStatement, object data) { -// Debug.Assert((eraseStatement != null)); -// Debug.Assert((eraseStatement.Expressions != null)); -// for (int i = 0; i < eraseStatement.Expressions.Count; i++) { -// Expression o = eraseStatement.Expressions[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (Expression)nodeStack.Pop(); -// if (o == null) -// eraseStatement.Expressions.RemoveAt(i--); -// else -// eraseStatement.Expressions[i] = o; -// } -// return null; -// } -// -// public virtual object VisitErrorStatement(ErrorStatement errorStatement, object data) { -// Debug.Assert((errorStatement != null)); -// Debug.Assert((errorStatement.Expression != null)); -// nodeStack.Push(errorStatement.Expression); -// errorStatement.Expression.AcceptVisitor(this, data); -// errorStatement.Expression = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitEventAddRegion(EventAddRegion eventAddRegion, object data) { -// Debug.Assert((eventAddRegion != null)); -// Debug.Assert((eventAddRegion.Attributes != null)); -// Debug.Assert((eventAddRegion.Block != null)); -// Debug.Assert((eventAddRegion.Parameters != null)); -// for (int i = 0; i < eventAddRegion.Attributes.Count; i++) { -// AttributeSection o = eventAddRegion.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (AttributeSection)nodeStack.Pop(); -// if (o == null) -// eventAddRegion.Attributes.RemoveAt(i--); -// else -// eventAddRegion.Attributes[i] = o; -// } -// nodeStack.Push(eventAddRegion.Block); -// eventAddRegion.Block.AcceptVisitor(this, data); -// eventAddRegion.Block = ((BlockStatement)(nodeStack.Pop())); -// for (int i = 0; i < eventAddRegion.Parameters.Count; i++) { -// ParameterDeclarationExpression o = eventAddRegion.Parameters[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ParameterDeclarationExpression)nodeStack.Pop(); -// if (o == null) -// eventAddRegion.Parameters.RemoveAt(i--); -// else -// eventAddRegion.Parameters[i] = o; -// } -// return null; -// } -// -// public virtual object VisitEventDeclaration(EventDeclaration eventDeclaration, object data) { -// Debug.Assert((eventDeclaration != null)); -// Debug.Assert((eventDeclaration.Attributes != null)); -// Debug.Assert((eventDeclaration.Parameters != null)); -// Debug.Assert((eventDeclaration.InterfaceImplementations != null)); -// Debug.Assert((eventDeclaration.TypeReference != null)); -// Debug.Assert((eventDeclaration.AddRegion != null)); -// Debug.Assert((eventDeclaration.RemoveRegion != null)); -// Debug.Assert((eventDeclaration.RaiseRegion != null)); -// Debug.Assert((eventDeclaration.Initializer != null)); -// for (int i = 0; i < eventDeclaration.Attributes.Count; i++) { -// AttributeSection o = eventDeclaration.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (AttributeSection)nodeStack.Pop(); -// if (o == null) -// eventDeclaration.Attributes.RemoveAt(i--); -// else -// eventDeclaration.Attributes[i] = o; -// } -// for (int i = 0; i < eventDeclaration.Parameters.Count; i++) { -// ParameterDeclarationExpression o = eventDeclaration.Parameters[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ParameterDeclarationExpression)nodeStack.Pop(); -// if (o == null) -// eventDeclaration.Parameters.RemoveAt(i--); -// else -// eventDeclaration.Parameters[i] = o; -// } -// for (int i = 0; i < eventDeclaration.InterfaceImplementations.Count; i++) { -// InterfaceImplementation o = eventDeclaration.InterfaceImplementations[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (InterfaceImplementation)nodeStack.Pop(); -// if (o == null) -// eventDeclaration.InterfaceImplementations.RemoveAt(i--); -// else -// eventDeclaration.InterfaceImplementations[i] = o; -// } -// nodeStack.Push(eventDeclaration.TypeReference); -// eventDeclaration.TypeReference.AcceptVisitor(this, data); -// eventDeclaration.TypeReference = ((TypeReference)(nodeStack.Pop())); -// nodeStack.Push(eventDeclaration.AddRegion); -// eventDeclaration.AddRegion.AcceptVisitor(this, data); -// eventDeclaration.AddRegion = ((EventAddRegion)(nodeStack.Pop())); -// nodeStack.Push(eventDeclaration.RemoveRegion); -// eventDeclaration.RemoveRegion.AcceptVisitor(this, data); -// eventDeclaration.RemoveRegion = ((EventRemoveRegion)(nodeStack.Pop())); -// nodeStack.Push(eventDeclaration.RaiseRegion); -// eventDeclaration.RaiseRegion.AcceptVisitor(this, data); -// eventDeclaration.RaiseRegion = ((EventRaiseRegion)(nodeStack.Pop())); -// nodeStack.Push(eventDeclaration.Initializer); -// eventDeclaration.Initializer.AcceptVisitor(this, data); -// eventDeclaration.Initializer = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitEventRaiseRegion(EventRaiseRegion eventRaiseRegion, object data) { -// Debug.Assert((eventRaiseRegion != null)); -// Debug.Assert((eventRaiseRegion.Attributes != null)); -// Debug.Assert((eventRaiseRegion.Block != null)); -// Debug.Assert((eventRaiseRegion.Parameters != null)); -// for (int i = 0; i < eventRaiseRegion.Attributes.Count; i++) { -// AttributeSection o = eventRaiseRegion.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (AttributeSection)nodeStack.Pop(); -// if (o == null) -// eventRaiseRegion.Attributes.RemoveAt(i--); -// else -// eventRaiseRegion.Attributes[i] = o; -// } -// nodeStack.Push(eventRaiseRegion.Block); -// eventRaiseRegion.Block.AcceptVisitor(this, data); -// eventRaiseRegion.Block = ((BlockStatement)(nodeStack.Pop())); -// for (int i = 0; i < eventRaiseRegion.Parameters.Count; i++) { -// ParameterDeclarationExpression o = eventRaiseRegion.Parameters[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ParameterDeclarationExpression)nodeStack.Pop(); -// if (o == null) -// eventRaiseRegion.Parameters.RemoveAt(i--); -// else -// eventRaiseRegion.Parameters[i] = o; -// } -// return null; -// } -// -// public virtual object VisitEventRemoveRegion(EventRemoveRegion eventRemoveRegion, object data) { -// Debug.Assert((eventRemoveRegion != null)); -// Debug.Assert((eventRemoveRegion.Attributes != null)); -// Debug.Assert((eventRemoveRegion.Block != null)); -// Debug.Assert((eventRemoveRegion.Parameters != null)); -// for (int i = 0; i < eventRemoveRegion.Attributes.Count; i++) { -// AttributeSection o = eventRemoveRegion.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (AttributeSection)nodeStack.Pop(); -// if (o == null) -// eventRemoveRegion.Attributes.RemoveAt(i--); -// else -// eventRemoveRegion.Attributes[i] = o; -// } -// nodeStack.Push(eventRemoveRegion.Block); -// eventRemoveRegion.Block.AcceptVisitor(this, data); -// eventRemoveRegion.Block = ((BlockStatement)(nodeStack.Pop())); -// for (int i = 0; i < eventRemoveRegion.Parameters.Count; i++) { -// ParameterDeclarationExpression o = eventRemoveRegion.Parameters[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ParameterDeclarationExpression)nodeStack.Pop(); -// if (o == null) -// eventRemoveRegion.Parameters.RemoveAt(i--); -// else -// eventRemoveRegion.Parameters[i] = o; -// } -// return null; -// } -// -// public virtual object VisitExitStatement(ExitStatement exitStatement, object data) { -// Debug.Assert((exitStatement != null)); -// return null; -// } -// -// public virtual object VisitExpressionRangeVariable(ExpressionRangeVariable expressionRangeVariable, object data) { -// Debug.Assert((expressionRangeVariable != null)); -// Debug.Assert((expressionRangeVariable.Expression != null)); -// Debug.Assert((expressionRangeVariable.Type != null)); -// nodeStack.Push(expressionRangeVariable.Expression); -// expressionRangeVariable.Expression.AcceptVisitor(this, data); -// expressionRangeVariable.Expression = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(expressionRangeVariable.Type); -// expressionRangeVariable.Type.AcceptVisitor(this, data); -// expressionRangeVariable.Type = ((TypeReference)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitExpressionStatement(ExpressionStatement expressionStatement, object data) { -// Debug.Assert((expressionStatement != null)); -// Debug.Assert((expressionStatement.Expression != null)); -// nodeStack.Push(expressionStatement.Expression); -// expressionStatement.Expression.AcceptVisitor(this, data); -// expressionStatement.Expression = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitExternAliasDirective(ExternAliasDirective externAliasDirective, object data) { -// Debug.Assert((externAliasDirective != null)); -// return null; -// } -// -// public virtual object VisitFieldDeclaration(FieldDeclaration fieldDeclaration, object data) { -// Debug.Assert((fieldDeclaration != null)); -// Debug.Assert((fieldDeclaration.Attributes != null)); -// Debug.Assert((fieldDeclaration.TypeReference != null)); -// Debug.Assert((fieldDeclaration.Fields != null)); -// for (int i = 0; i < fieldDeclaration.Attributes.Count; i++) { -// AttributeSection o = fieldDeclaration.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (AttributeSection)nodeStack.Pop(); -// if (o == null) -// fieldDeclaration.Attributes.RemoveAt(i--); -// else -// fieldDeclaration.Attributes[i] = o; -// } -// nodeStack.Push(fieldDeclaration.TypeReference); -// fieldDeclaration.TypeReference.AcceptVisitor(this, data); -// fieldDeclaration.TypeReference = ((TypeReference)(nodeStack.Pop())); -// for (int i = 0; i < fieldDeclaration.Fields.Count; i++) { -// VariableDeclaration o = fieldDeclaration.Fields[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (VariableDeclaration)nodeStack.Pop(); -// if (o == null) -// fieldDeclaration.Fields.RemoveAt(i--); -// else -// fieldDeclaration.Fields[i] = o; -// } -// return null; -// } -// -// public virtual object VisitForeachStatement(ForeachStatement foreachStatement, object data) { -// Debug.Assert((foreachStatement != null)); -// Debug.Assert((foreachStatement.TypeReference != null)); -// Debug.Assert((foreachStatement.Expression != null)); -// Debug.Assert((foreachStatement.NextExpression != null)); -// Debug.Assert((foreachStatement.EmbeddedStatement != null)); -// nodeStack.Push(foreachStatement.TypeReference); -// foreachStatement.TypeReference.AcceptVisitor(this, data); -// foreachStatement.TypeReference = ((TypeReference)(nodeStack.Pop())); -// nodeStack.Push(foreachStatement.Expression); -// foreachStatement.Expression.AcceptVisitor(this, data); -// foreachStatement.Expression = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(foreachStatement.NextExpression); -// foreachStatement.NextExpression.AcceptVisitor(this, data); -// foreachStatement.NextExpression = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(foreachStatement.EmbeddedStatement); -// foreachStatement.EmbeddedStatement.AcceptVisitor(this, data); -// foreachStatement.EmbeddedStatement = ((Statement)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitForNextStatement(ForNextStatement forNextStatement, object data) { -// Debug.Assert((forNextStatement != null)); -// Debug.Assert((forNextStatement.Start != null)); -// Debug.Assert((forNextStatement.End != null)); -// Debug.Assert((forNextStatement.Step != null)); -// Debug.Assert((forNextStatement.NextExpressions != null)); -// Debug.Assert((forNextStatement.TypeReference != null)); -// Debug.Assert((forNextStatement.LoopVariableExpression != null)); -// Debug.Assert((forNextStatement.EmbeddedStatement != null)); -// nodeStack.Push(forNextStatement.Start); -// forNextStatement.Start.AcceptVisitor(this, data); -// forNextStatement.Start = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(forNextStatement.End); -// forNextStatement.End.AcceptVisitor(this, data); -// forNextStatement.End = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(forNextStatement.Step); -// forNextStatement.Step.AcceptVisitor(this, data); -// forNextStatement.Step = ((Expression)(nodeStack.Pop())); -// for (int i = 0; i < forNextStatement.NextExpressions.Count; i++) { -// Expression o = forNextStatement.NextExpressions[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (Expression)nodeStack.Pop(); -// if (o == null) -// forNextStatement.NextExpressions.RemoveAt(i--); -// else -// forNextStatement.NextExpressions[i] = o; -// } -// nodeStack.Push(forNextStatement.TypeReference); -// forNextStatement.TypeReference.AcceptVisitor(this, data); -// forNextStatement.TypeReference = ((TypeReference)(nodeStack.Pop())); -// nodeStack.Push(forNextStatement.LoopVariableExpression); -// forNextStatement.LoopVariableExpression.AcceptVisitor(this, data); -// forNextStatement.LoopVariableExpression = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(forNextStatement.EmbeddedStatement); -// forNextStatement.EmbeddedStatement.AcceptVisitor(this, data); -// forNextStatement.EmbeddedStatement = ((Statement)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitGotoStatement(GotoStatement gotoStatement, object data) { -// Debug.Assert((gotoStatement != null)); -// return null; -// } -// -// public virtual object VisitIdentifierExpression(SimpleNameExpression identifierExpression, object data) { -// Debug.Assert((identifierExpression != null)); -// Debug.Assert((identifierExpression.TypeArguments != null)); -// for (int i = 0; i < identifierExpression.TypeArguments.Count; i++) { -// TypeReference o = identifierExpression.TypeArguments[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (TypeReference)nodeStack.Pop(); -// if (o == null) -// identifierExpression.TypeArguments.RemoveAt(i--); -// else -// identifierExpression.TypeArguments[i] = o; -// } -// return null; -// } -// -// public virtual object VisitIfElseStatement(IfElseStatement ifElseStatement, object data) { -// Debug.Assert((ifElseStatement != null)); -// Debug.Assert((ifElseStatement.Condition != null)); -// Debug.Assert((ifElseStatement.TrueStatement != null)); -// Debug.Assert((ifElseStatement.FalseStatement != null)); -// Debug.Assert((ifElseStatement.ElseIfSections != null)); -// nodeStack.Push(ifElseStatement.Condition); -// ifElseStatement.Condition.AcceptVisitor(this, data); -// ifElseStatement.Condition = ((Expression)(nodeStack.Pop())); -// for (int i = 0; i < ifElseStatement.TrueStatement.Count; i++) { -// Statement o = ifElseStatement.TrueStatement[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (Statement)nodeStack.Pop(); -// if (o == null) -// ifElseStatement.TrueStatement.RemoveAt(i--); -// else -// ifElseStatement.TrueStatement[i] = o; -// } -// for (int i = 0; i < ifElseStatement.FalseStatement.Count; i++) { -// Statement o = ifElseStatement.FalseStatement[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (Statement)nodeStack.Pop(); -// if (o == null) -// ifElseStatement.FalseStatement.RemoveAt(i--); -// else -// ifElseStatement.FalseStatement[i] = o; -// } -// for (int i = 0; i < ifElseStatement.ElseIfSections.Count; i++) { -// ElseIfSection o = ifElseStatement.ElseIfSections[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ElseIfSection)nodeStack.Pop(); -// if (o == null) -// ifElseStatement.ElseIfSections.RemoveAt(i--); -// else -// ifElseStatement.ElseIfSections[i] = o; -// } -// return null; -// } -// -// public virtual object VisitInnerClassTypeReference(InnerClassTypeReference innerClassTypeReference, object data) { -// Debug.Assert((innerClassTypeReference != null)); -// Debug.Assert((innerClassTypeReference.GenericTypes != null)); -// Debug.Assert((innerClassTypeReference.BaseType != null)); -// for (int i = 0; i < innerClassTypeReference.GenericTypes.Count; i++) { -// TypeReference o = innerClassTypeReference.GenericTypes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (TypeReference)nodeStack.Pop(); -// if (o == null) -// innerClassTypeReference.GenericTypes.RemoveAt(i--); -// else -// innerClassTypeReference.GenericTypes[i] = o; -// } -// nodeStack.Push(innerClassTypeReference.BaseType); -// innerClassTypeReference.BaseType.AcceptVisitor(this, data); -// innerClassTypeReference.BaseType = ((TypeReference)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitInterfaceImplementation(InterfaceImplementation interfaceImplementation, object data) { -// Debug.Assert((interfaceImplementation != null)); -// Debug.Assert((interfaceImplementation.InterfaceType != null)); -// nodeStack.Push(interfaceImplementation.InterfaceType); -// interfaceImplementation.InterfaceType.AcceptVisitor(this, data); -// interfaceImplementation.InterfaceType = ((TypeReference)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitInvocationExpression(InvocationExpression invocationExpression, object data) { -// Debug.Assert((invocationExpression != null)); -// Debug.Assert((invocationExpression.TargetObject != null)); -// Debug.Assert((invocationExpression.Arguments != null)); -// nodeStack.Push(invocationExpression.TargetObject); -// invocationExpression.TargetObject.AcceptVisitor(this, data); -// invocationExpression.TargetObject = ((Expression)(nodeStack.Pop())); -// for (int i = 0; i < invocationExpression.Arguments.Count; i++) { -// Expression o = invocationExpression.Arguments[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (Expression)nodeStack.Pop(); -// if (o == null) -// invocationExpression.Arguments.RemoveAt(i--); -// else -// invocationExpression.Arguments[i] = o; -// } -// return null; -// } -// -// public virtual object VisitLabelStatement(LabelStatement labelStatement, object data) { -// Debug.Assert((labelStatement != null)); -// return null; -// } -// -// public virtual object VisitLambdaExpression(LambdaExpression lambdaExpression, object data) { -// Debug.Assert((lambdaExpression != null)); -// Debug.Assert((lambdaExpression.Parameters != null)); -// Debug.Assert((lambdaExpression.StatementBody != null)); -// Debug.Assert((lambdaExpression.ExpressionBody != null)); -// Debug.Assert((lambdaExpression.ReturnType != null)); -// for (int i = 0; i < lambdaExpression.Parameters.Count; i++) { -// ParameterDeclarationExpression o = lambdaExpression.Parameters[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ParameterDeclarationExpression)nodeStack.Pop(); -// if (o == null) -// lambdaExpression.Parameters.RemoveAt(i--); -// else -// lambdaExpression.Parameters[i] = o; -// } -// nodeStack.Push(lambdaExpression.StatementBody); -// lambdaExpression.StatementBody.AcceptVisitor(this, data); -// lambdaExpression.StatementBody = ((Statement)(nodeStack.Pop())); -// nodeStack.Push(lambdaExpression.ExpressionBody); -// lambdaExpression.ExpressionBody.AcceptVisitor(this, data); -// lambdaExpression.ExpressionBody = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(lambdaExpression.ReturnType); -// lambdaExpression.ReturnType.AcceptVisitor(this, data); -// lambdaExpression.ReturnType = ((TypeReference)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitLocalVariableDeclaration(LocalVariableDeclaration localVariableDeclaration, object data) { -// Debug.Assert((localVariableDeclaration != null)); -// Debug.Assert((localVariableDeclaration.TypeReference != null)); -// Debug.Assert((localVariableDeclaration.Variables != null)); -// nodeStack.Push(localVariableDeclaration.TypeReference); -// localVariableDeclaration.TypeReference.AcceptVisitor(this, data); -// localVariableDeclaration.TypeReference = ((TypeReference)(nodeStack.Pop())); -// for (int i = 0; i < localVariableDeclaration.Variables.Count; i++) { -// VariableDeclaration o = localVariableDeclaration.Variables[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (VariableDeclaration)nodeStack.Pop(); -// if (o == null) -// localVariableDeclaration.Variables.RemoveAt(i--); -// else -// localVariableDeclaration.Variables[i] = o; -// } -// return null; -// } -// -// public virtual object VisitLockStatement(LockStatement lockStatement, object data) { -// Debug.Assert((lockStatement != null)); -// Debug.Assert((lockStatement.LockExpression != null)); -// Debug.Assert((lockStatement.EmbeddedStatement != null)); -// nodeStack.Push(lockStatement.LockExpression); -// lockStatement.LockExpression.AcceptVisitor(this, data); -// lockStatement.LockExpression = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(lockStatement.EmbeddedStatement); -// lockStatement.EmbeddedStatement.AcceptVisitor(this, data); -// lockStatement.EmbeddedStatement = ((Statement)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitMemberInitializerExpression(MemberInitializerExpression memberInitializerExpression, object data) { -// Debug.Assert((memberInitializerExpression != null)); -// Debug.Assert((memberInitializerExpression.Expression != null)); -// nodeStack.Push(memberInitializerExpression.Expression); -// memberInitializerExpression.Expression.AcceptVisitor(this, data); -// memberInitializerExpression.Expression = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression, object data) { -// Debug.Assert((memberReferenceExpression != null)); -// Debug.Assert((memberReferenceExpression.TargetObject != null)); -// Debug.Assert((memberReferenceExpression.TypeArguments != null)); -// nodeStack.Push(memberReferenceExpression.TargetObject); -// memberReferenceExpression.TargetObject.AcceptVisitor(this, data); -// memberReferenceExpression.TargetObject = ((Expression)(nodeStack.Pop())); -// for (int i = 0; i < memberReferenceExpression.TypeArguments.Count; i++) { -// TypeReference o = memberReferenceExpression.TypeArguments[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (TypeReference)nodeStack.Pop(); -// if (o == null) -// memberReferenceExpression.TypeArguments.RemoveAt(i--); -// else -// memberReferenceExpression.TypeArguments[i] = o; -// } -// return null; -// } -// -// public virtual object VisitMethodDeclaration(MethodDeclaration methodDeclaration, object data) { -// Debug.Assert((methodDeclaration != null)); -// Debug.Assert((methodDeclaration.Attributes != null)); -// Debug.Assert((methodDeclaration.Parameters != null)); -// Debug.Assert((methodDeclaration.InterfaceImplementations != null)); -// Debug.Assert((methodDeclaration.TypeReference != null)); -// Debug.Assert((methodDeclaration.Body != null)); -// Debug.Assert((methodDeclaration.Templates != null)); -// for (int i = 0; i < methodDeclaration.Attributes.Count; i++) { -// AttributeSection o = methodDeclaration.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (AttributeSection)nodeStack.Pop(); -// if (o == null) -// methodDeclaration.Attributes.RemoveAt(i--); -// else -// methodDeclaration.Attributes[i] = o; -// } -// for (int i = 0; i < methodDeclaration.Parameters.Count; i++) { -// ParameterDeclarationExpression o = methodDeclaration.Parameters[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ParameterDeclarationExpression)nodeStack.Pop(); -// if (o == null) -// methodDeclaration.Parameters.RemoveAt(i--); -// else -// methodDeclaration.Parameters[i] = o; -// } -// for (int i = 0; i < methodDeclaration.InterfaceImplementations.Count; i++) { -// InterfaceImplementation o = methodDeclaration.InterfaceImplementations[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (InterfaceImplementation)nodeStack.Pop(); -// if (o == null) -// methodDeclaration.InterfaceImplementations.RemoveAt(i--); -// else -// methodDeclaration.InterfaceImplementations[i] = o; -// } -// nodeStack.Push(methodDeclaration.TypeReference); -// methodDeclaration.TypeReference.AcceptVisitor(this, data); -// methodDeclaration.TypeReference = ((TypeReference)(nodeStack.Pop())); -// nodeStack.Push(methodDeclaration.Body); -// methodDeclaration.Body.AcceptVisitor(this, data); -// methodDeclaration.Body = ((BlockStatement)(nodeStack.Pop())); -// for (int i = 0; i < methodDeclaration.Templates.Count; i++) { -// TemplateDefinition o = methodDeclaration.Templates[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (TemplateDefinition)nodeStack.Pop(); -// if (o == null) -// methodDeclaration.Templates.RemoveAt(i--); -// else -// methodDeclaration.Templates[i] = o; -// } -// return null; -// } -// -// public virtual object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data) { -// Debug.Assert((namedArgumentExpression != null)); -// Debug.Assert((namedArgumentExpression.Expression != null)); -// nodeStack.Push(namedArgumentExpression.Expression); -// namedArgumentExpression.Expression.AcceptVisitor(this, data); -// namedArgumentExpression.Expression = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data) { -// Debug.Assert((namespaceDeclaration != null)); -// for (int i = 0; i < namespaceDeclaration.Children.Count; i++) { -// INode o = namespaceDeclaration.Children[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = nodeStack.Pop(); -// if (o == null) -// namespaceDeclaration.Children.RemoveAt(i--); -// else -// namespaceDeclaration.Children[i] = o; -// } -// return null; -// } -// -// public virtual object VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression, object data) { -// Debug.Assert((objectCreateExpression != null)); -// Debug.Assert((objectCreateExpression.CreateType != null)); -// Debug.Assert((objectCreateExpression.Parameters != null)); -// Debug.Assert((objectCreateExpression.ObjectInitializer != null)); -// nodeStack.Push(objectCreateExpression.CreateType); -// objectCreateExpression.CreateType.AcceptVisitor(this, data); -// objectCreateExpression.CreateType = ((TypeReference)(nodeStack.Pop())); -// for (int i = 0; i < objectCreateExpression.Parameters.Count; i++) { -// Expression o = objectCreateExpression.Parameters[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (Expression)nodeStack.Pop(); -// if (o == null) -// objectCreateExpression.Parameters.RemoveAt(i--); -// else -// objectCreateExpression.Parameters[i] = o; -// } -// nodeStack.Push(objectCreateExpression.ObjectInitializer); -// objectCreateExpression.ObjectInitializer.AcceptVisitor(this, data); -// objectCreateExpression.ObjectInitializer = ((CollectionInitializerExpression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitOnErrorStatement(OnErrorStatement onErrorStatement, object data) { -// Debug.Assert((onErrorStatement != null)); -// Debug.Assert((onErrorStatement.EmbeddedStatement != null)); -// nodeStack.Push(onErrorStatement.EmbeddedStatement); -// onErrorStatement.EmbeddedStatement.AcceptVisitor(this, data); -// onErrorStatement.EmbeddedStatement = ((Statement)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration, object data) { -// Debug.Assert((operatorDeclaration != null)); -// Debug.Assert((operatorDeclaration.Attributes != null)); -// Debug.Assert((operatorDeclaration.Parameters != null)); -// Debug.Assert((operatorDeclaration.InterfaceImplementations != null)); -// Debug.Assert((operatorDeclaration.TypeReference != null)); -// Debug.Assert((operatorDeclaration.Body != null)); -// Debug.Assert((operatorDeclaration.Templates != null)); -// for (int i = 0; i < operatorDeclaration.Attributes.Count; i++) { -// AttributeSection o = operatorDeclaration.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (AttributeSection)nodeStack.Pop(); -// if (o == null) -// operatorDeclaration.Attributes.RemoveAt(i--); -// else -// operatorDeclaration.Attributes[i] = o; -// } -// for (int i = 0; i < operatorDeclaration.Parameters.Count; i++) { -// ParameterDeclarationExpression o = operatorDeclaration.Parameters[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ParameterDeclarationExpression)nodeStack.Pop(); -// if (o == null) -// operatorDeclaration.Parameters.RemoveAt(i--); -// else -// operatorDeclaration.Parameters[i] = o; -// } -// for (int i = 0; i < operatorDeclaration.InterfaceImplementations.Count; i++) { -// InterfaceImplementation o = operatorDeclaration.InterfaceImplementations[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (InterfaceImplementation)nodeStack.Pop(); -// if (o == null) -// operatorDeclaration.InterfaceImplementations.RemoveAt(i--); -// else -// operatorDeclaration.InterfaceImplementations[i] = o; -// } -// nodeStack.Push(operatorDeclaration.TypeReference); -// operatorDeclaration.TypeReference.AcceptVisitor(this, data); -// operatorDeclaration.TypeReference = ((TypeReference)(nodeStack.Pop())); -// nodeStack.Push(operatorDeclaration.Body); -// operatorDeclaration.Body.AcceptVisitor(this, data); -// operatorDeclaration.Body = ((BlockStatement)(nodeStack.Pop())); -// for (int i = 0; i < operatorDeclaration.Templates.Count; i++) { -// TemplateDefinition o = operatorDeclaration.Templates[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (TemplateDefinition)nodeStack.Pop(); -// if (o == null) -// operatorDeclaration.Templates.RemoveAt(i--); -// else -// operatorDeclaration.Templates[i] = o; -// } -// return null; -// } -// -// public virtual object VisitOptionDeclaration(OptionDeclaration optionDeclaration, object data) { -// Debug.Assert((optionDeclaration != null)); -// return null; -// } -// -// public virtual object VisitParameterDeclarationExpression(ParameterDeclarationExpression parameterDeclarationExpression, object data) { -// Debug.Assert((parameterDeclarationExpression != null)); -// Debug.Assert((parameterDeclarationExpression.Attributes != null)); -// Debug.Assert((parameterDeclarationExpression.TypeReference != null)); -// Debug.Assert((parameterDeclarationExpression.DefaultValue != null)); -// for (int i = 0; i < parameterDeclarationExpression.Attributes.Count; i++) { -// AttributeSection o = parameterDeclarationExpression.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (AttributeSection)nodeStack.Pop(); -// if (o == null) -// parameterDeclarationExpression.Attributes.RemoveAt(i--); -// else -// parameterDeclarationExpression.Attributes[i] = o; -// } -// nodeStack.Push(parameterDeclarationExpression.TypeReference); -// parameterDeclarationExpression.TypeReference.AcceptVisitor(this, data); -// parameterDeclarationExpression.TypeReference = ((TypeReference)(nodeStack.Pop())); -// nodeStack.Push(parameterDeclarationExpression.DefaultValue); -// parameterDeclarationExpression.DefaultValue.AcceptVisitor(this, data); -// parameterDeclarationExpression.DefaultValue = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression, object data) { -// Debug.Assert((parenthesizedExpression != null)); -// Debug.Assert((parenthesizedExpression.Expression != null)); -// nodeStack.Push(parenthesizedExpression.Expression); -// parenthesizedExpression.Expression.AcceptVisitor(this, data); -// parenthesizedExpression.Expression = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitPrimitiveExpression(PrimitiveExpression primitiveExpression, object data) { -// Debug.Assert((primitiveExpression != null)); -// return null; -// } -// -// public virtual object VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration, object data) { -// Debug.Assert((propertyDeclaration != null)); -// Debug.Assert((propertyDeclaration.Attributes != null)); -// Debug.Assert((propertyDeclaration.Parameters != null)); -// Debug.Assert((propertyDeclaration.InterfaceImplementations != null)); -// Debug.Assert((propertyDeclaration.TypeReference != null)); -// Debug.Assert((propertyDeclaration.GetRegion != null)); -// Debug.Assert((propertyDeclaration.SetRegion != null)); -// Debug.Assert((propertyDeclaration.Initializer != null)); -// for (int i = 0; i < propertyDeclaration.Attributes.Count; i++) { -// AttributeSection o = propertyDeclaration.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (AttributeSection)nodeStack.Pop(); -// if (o == null) -// propertyDeclaration.Attributes.RemoveAt(i--); -// else -// propertyDeclaration.Attributes[i] = o; -// } -// for (int i = 0; i < propertyDeclaration.Parameters.Count; i++) { -// ParameterDeclarationExpression o = propertyDeclaration.Parameters[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ParameterDeclarationExpression)nodeStack.Pop(); -// if (o == null) -// propertyDeclaration.Parameters.RemoveAt(i--); -// else -// propertyDeclaration.Parameters[i] = o; -// } -// for (int i = 0; i < propertyDeclaration.InterfaceImplementations.Count; i++) { -// InterfaceImplementation o = propertyDeclaration.InterfaceImplementations[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (InterfaceImplementation)nodeStack.Pop(); -// if (o == null) -// propertyDeclaration.InterfaceImplementations.RemoveAt(i--); -// else -// propertyDeclaration.InterfaceImplementations[i] = o; -// } -// nodeStack.Push(propertyDeclaration.TypeReference); -// propertyDeclaration.TypeReference.AcceptVisitor(this, data); -// propertyDeclaration.TypeReference = ((TypeReference)(nodeStack.Pop())); -// nodeStack.Push(propertyDeclaration.GetRegion); -// propertyDeclaration.GetRegion.AcceptVisitor(this, data); -// propertyDeclaration.GetRegion = ((PropertyGetRegion)(nodeStack.Pop())); -// nodeStack.Push(propertyDeclaration.SetRegion); -// propertyDeclaration.SetRegion.AcceptVisitor(this, data); -// propertyDeclaration.SetRegion = ((PropertySetRegion)(nodeStack.Pop())); -// nodeStack.Push(propertyDeclaration.Initializer); -// propertyDeclaration.Initializer.AcceptVisitor(this, data); -// propertyDeclaration.Initializer = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitPropertyGetRegion(PropertyGetRegion propertyGetRegion, object data) { -// Debug.Assert((propertyGetRegion != null)); -// Debug.Assert((propertyGetRegion.Attributes != null)); -// Debug.Assert((propertyGetRegion.Block != null)); -// for (int i = 0; i < propertyGetRegion.Attributes.Count; i++) { -// AttributeSection o = propertyGetRegion.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (AttributeSection)nodeStack.Pop(); -// if (o == null) -// propertyGetRegion.Attributes.RemoveAt(i--); -// else -// propertyGetRegion.Attributes[i] = o; -// } -// nodeStack.Push(propertyGetRegion.Block); -// propertyGetRegion.Block.AcceptVisitor(this, data); -// propertyGetRegion.Block = ((BlockStatement)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitPropertySetRegion(PropertySetRegion propertySetRegion, object data) { -// Debug.Assert((propertySetRegion != null)); -// Debug.Assert((propertySetRegion.Attributes != null)); -// Debug.Assert((propertySetRegion.Block != null)); -// Debug.Assert((propertySetRegion.Parameters != null)); -// for (int i = 0; i < propertySetRegion.Attributes.Count; i++) { -// AttributeSection o = propertySetRegion.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (AttributeSection)nodeStack.Pop(); -// if (o == null) -// propertySetRegion.Attributes.RemoveAt(i--); -// else -// propertySetRegion.Attributes[i] = o; -// } -// nodeStack.Push(propertySetRegion.Block); -// propertySetRegion.Block.AcceptVisitor(this, data); -// propertySetRegion.Block = ((BlockStatement)(nodeStack.Pop())); -// for (int i = 0; i < propertySetRegion.Parameters.Count; i++) { -// ParameterDeclarationExpression o = propertySetRegion.Parameters[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ParameterDeclarationExpression)nodeStack.Pop(); -// if (o == null) -// propertySetRegion.Parameters.RemoveAt(i--); -// else -// propertySetRegion.Parameters[i] = o; -// } -// return null; -// } -// -// public virtual object VisitQueryExpression(QueryExpression queryExpression, object data) { -// Debug.Assert((queryExpression != null)); -// Debug.Assert((queryExpression.Clauses != null)); -// for (int i = 0; i < queryExpression.Clauses.Count; i++) { -// QueryExpressionClause o = queryExpression.Clauses[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (QueryExpressionClause)nodeStack.Pop(); -// if (o == null) -// queryExpression.Clauses.RemoveAt(i--); -// else -// queryExpression.Clauses[i] = o; -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionAggregateClause(QueryExpressionAggregateClause queryExpressionAggregateClause, object data) { -// Debug.Assert((queryExpressionAggregateClause != null)); -// Debug.Assert((queryExpressionAggregateClause.Source != null)); -// Debug.Assert((queryExpressionAggregateClause.MiddleClauses != null)); -// Debug.Assert((queryExpressionAggregateClause.IntoVariables != null)); -// nodeStack.Push(queryExpressionAggregateClause.Source); -// queryExpressionAggregateClause.Source.AcceptVisitor(this, data); -// queryExpressionAggregateClause.Source = ((CollectionRangeVariable)(nodeStack.Pop())); -// for (int i = 0; i < queryExpressionAggregateClause.MiddleClauses.Count; i++) { -// QueryExpressionClause o = queryExpressionAggregateClause.MiddleClauses[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (QueryExpressionClause)nodeStack.Pop(); -// if (o == null) -// queryExpressionAggregateClause.MiddleClauses.RemoveAt(i--); -// else -// queryExpressionAggregateClause.MiddleClauses[i] = o; -// } -// for (int i = 0; i < queryExpressionAggregateClause.IntoVariables.Count; i++) { -// ExpressionRangeVariable o = queryExpressionAggregateClause.IntoVariables[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ExpressionRangeVariable)nodeStack.Pop(); -// if (o == null) -// queryExpressionAggregateClause.IntoVariables.RemoveAt(i--); -// else -// queryExpressionAggregateClause.IntoVariables[i] = o; -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionDistinctClause(QueryExpressionDistinctClause queryExpressionDistinctClause, object data) { -// Debug.Assert((queryExpressionDistinctClause != null)); -// return null; -// } -// -// public virtual object VisitQueryExpressionFromClause(QueryExpressionFromClause queryExpressionFromClause, object data) { -// Debug.Assert((queryExpressionFromClause != null)); -// Debug.Assert((queryExpressionFromClause.Sources != null)); -// for (int i = 0; i < queryExpressionFromClause.Sources.Count; i++) { -// CollectionRangeVariable o = queryExpressionFromClause.Sources[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (CollectionRangeVariable)nodeStack.Pop(); -// if (o == null) -// queryExpressionFromClause.Sources.RemoveAt(i--); -// else -// queryExpressionFromClause.Sources[i] = o; -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionGroupClause(QueryExpressionGroupClause queryExpressionGroupClause, object data) { -// Debug.Assert((queryExpressionGroupClause != null)); -// Debug.Assert((queryExpressionGroupClause.Projection != null)); -// Debug.Assert((queryExpressionGroupClause.GroupBy != null)); -// nodeStack.Push(queryExpressionGroupClause.Projection); -// queryExpressionGroupClause.Projection.AcceptVisitor(this, data); -// queryExpressionGroupClause.Projection = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(queryExpressionGroupClause.GroupBy); -// queryExpressionGroupClause.GroupBy.AcceptVisitor(this, data); -// queryExpressionGroupClause.GroupBy = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitQueryExpressionGroupJoinVBClause(QueryExpressionGroupJoinVBClause queryExpressionGroupJoinVBClause, object data) { -// Debug.Assert((queryExpressionGroupJoinVBClause != null)); -// Debug.Assert((queryExpressionGroupJoinVBClause.JoinClause != null)); -// Debug.Assert((queryExpressionGroupJoinVBClause.IntoVariables != null)); -// nodeStack.Push(queryExpressionGroupJoinVBClause.JoinClause); -// queryExpressionGroupJoinVBClause.JoinClause.AcceptVisitor(this, data); -// queryExpressionGroupJoinVBClause.JoinClause = ((QueryExpressionJoinVBClause)(nodeStack.Pop())); -// for (int i = 0; i < queryExpressionGroupJoinVBClause.IntoVariables.Count; i++) { -// ExpressionRangeVariable o = queryExpressionGroupJoinVBClause.IntoVariables[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ExpressionRangeVariable)nodeStack.Pop(); -// if (o == null) -// queryExpressionGroupJoinVBClause.IntoVariables.RemoveAt(i--); -// else -// queryExpressionGroupJoinVBClause.IntoVariables[i] = o; -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionGroupVBClause(QueryExpressionGroupVBClause queryExpressionGroupVBClause, object data) { -// Debug.Assert((queryExpressionGroupVBClause != null)); -// Debug.Assert((queryExpressionGroupVBClause.GroupVariables != null)); -// Debug.Assert((queryExpressionGroupVBClause.ByVariables != null)); -// Debug.Assert((queryExpressionGroupVBClause.IntoVariables != null)); -// for (int i = 0; i < queryExpressionGroupVBClause.GroupVariables.Count; i++) { -// ExpressionRangeVariable o = queryExpressionGroupVBClause.GroupVariables[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ExpressionRangeVariable)nodeStack.Pop(); -// if (o == null) -// queryExpressionGroupVBClause.GroupVariables.RemoveAt(i--); -// else -// queryExpressionGroupVBClause.GroupVariables[i] = o; -// } -// for (int i = 0; i < queryExpressionGroupVBClause.ByVariables.Count; i++) { -// ExpressionRangeVariable o = queryExpressionGroupVBClause.ByVariables[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ExpressionRangeVariable)nodeStack.Pop(); -// if (o == null) -// queryExpressionGroupVBClause.ByVariables.RemoveAt(i--); -// else -// queryExpressionGroupVBClause.ByVariables[i] = o; -// } -// for (int i = 0; i < queryExpressionGroupVBClause.IntoVariables.Count; i++) { -// ExpressionRangeVariable o = queryExpressionGroupVBClause.IntoVariables[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ExpressionRangeVariable)nodeStack.Pop(); -// if (o == null) -// queryExpressionGroupVBClause.IntoVariables.RemoveAt(i--); -// else -// queryExpressionGroupVBClause.IntoVariables[i] = o; -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionJoinClause(QueryExpressionJoinClause queryExpressionJoinClause, object data) { -// Debug.Assert((queryExpressionJoinClause != null)); -// Debug.Assert((queryExpressionJoinClause.OnExpression != null)); -// Debug.Assert((queryExpressionJoinClause.EqualsExpression != null)); -// Debug.Assert((queryExpressionJoinClause.Source != null)); -// nodeStack.Push(queryExpressionJoinClause.OnExpression); -// queryExpressionJoinClause.OnExpression.AcceptVisitor(this, data); -// queryExpressionJoinClause.OnExpression = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(queryExpressionJoinClause.EqualsExpression); -// queryExpressionJoinClause.EqualsExpression.AcceptVisitor(this, data); -// queryExpressionJoinClause.EqualsExpression = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(queryExpressionJoinClause.Source); -// queryExpressionJoinClause.Source.AcceptVisitor(this, data); -// queryExpressionJoinClause.Source = ((CollectionRangeVariable)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitQueryExpressionJoinConditionVB(QueryExpressionJoinConditionVB queryExpressionJoinConditionVB, object data) { -// Debug.Assert((queryExpressionJoinConditionVB != null)); -// Debug.Assert((queryExpressionJoinConditionVB.LeftSide != null)); -// Debug.Assert((queryExpressionJoinConditionVB.RightSide != null)); -// nodeStack.Push(queryExpressionJoinConditionVB.LeftSide); -// queryExpressionJoinConditionVB.LeftSide.AcceptVisitor(this, data); -// queryExpressionJoinConditionVB.LeftSide = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(queryExpressionJoinConditionVB.RightSide); -// queryExpressionJoinConditionVB.RightSide.AcceptVisitor(this, data); -// queryExpressionJoinConditionVB.RightSide = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitQueryExpressionJoinVBClause(QueryExpressionJoinVBClause queryExpressionJoinVBClause, object data) { -// Debug.Assert((queryExpressionJoinVBClause != null)); -// Debug.Assert((queryExpressionJoinVBClause.JoinVariable != null)); -// Debug.Assert((queryExpressionJoinVBClause.SubJoin != null)); -// Debug.Assert((queryExpressionJoinVBClause.Conditions != null)); -// nodeStack.Push(queryExpressionJoinVBClause.JoinVariable); -// queryExpressionJoinVBClause.JoinVariable.AcceptVisitor(this, data); -// queryExpressionJoinVBClause.JoinVariable = ((CollectionRangeVariable)(nodeStack.Pop())); -// nodeStack.Push(queryExpressionJoinVBClause.SubJoin); -// queryExpressionJoinVBClause.SubJoin.AcceptVisitor(this, data); -// queryExpressionJoinVBClause.SubJoin = ((QueryExpressionJoinVBClause)(nodeStack.Pop())); -// for (int i = 0; i < queryExpressionJoinVBClause.Conditions.Count; i++) { -// QueryExpressionJoinConditionVB o = queryExpressionJoinVBClause.Conditions[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (QueryExpressionJoinConditionVB)nodeStack.Pop(); -// if (o == null) -// queryExpressionJoinVBClause.Conditions.RemoveAt(i--); -// else -// queryExpressionJoinVBClause.Conditions[i] = o; -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionLetClause(QueryExpressionLetClause queryExpressionLetVBClause, object data) { -// Debug.Assert((queryExpressionLetVBClause != null)); -// Debug.Assert((queryExpressionLetVBClause.Variables != null)); -// for (int i = 0; i < queryExpressionLetVBClause.Variables.Count; i++) { -// ExpressionRangeVariable o = queryExpressionLetVBClause.Variables[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ExpressionRangeVariable)nodeStack.Pop(); -// if (o == null) -// queryExpressionLetVBClause.Variables.RemoveAt(i--); -// else -// queryExpressionLetVBClause.Variables[i] = o; -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionOrderClause(QueryExpressionOrderClause queryExpressionOrderClause, object data) { -// Debug.Assert((queryExpressionOrderClause != null)); -// Debug.Assert((queryExpressionOrderClause.Orderings != null)); -// for (int i = 0; i < queryExpressionOrderClause.Orderings.Count; i++) { -// QueryExpressionOrdering o = queryExpressionOrderClause.Orderings[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (QueryExpressionOrdering)nodeStack.Pop(); -// if (o == null) -// queryExpressionOrderClause.Orderings.RemoveAt(i--); -// else -// queryExpressionOrderClause.Orderings[i] = o; -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionOrdering(QueryExpressionOrdering queryExpressionOrdering, object data) { -// Debug.Assert((queryExpressionOrdering != null)); -// Debug.Assert((queryExpressionOrdering.Criteria != null)); -// nodeStack.Push(queryExpressionOrdering.Criteria); -// queryExpressionOrdering.Criteria.AcceptVisitor(this, data); -// queryExpressionOrdering.Criteria = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitQueryExpressionPartitionVBClause(QueryExpressionPartitionVBClause queryExpressionPartitionVBClause, object data) { -// Debug.Assert((queryExpressionPartitionVBClause != null)); -// Debug.Assert((queryExpressionPartitionVBClause.Expression != null)); -// nodeStack.Push(queryExpressionPartitionVBClause.Expression); -// queryExpressionPartitionVBClause.Expression.AcceptVisitor(this, data); -// queryExpressionPartitionVBClause.Expression = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitQueryExpressionSelectClause(QueryExpressionSelectClause queryExpressionSelectClause, object data) { -// Debug.Assert((queryExpressionSelectClause != null)); -// Debug.Assert((queryExpressionSelectClause.Projection != null)); -// nodeStack.Push(queryExpressionSelectClause.Projection); -// queryExpressionSelectClause.Projection.AcceptVisitor(this, data); -// queryExpressionSelectClause.Projection = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitQueryExpressionSelectVBClause(QueryExpressionSelectVBClause queryExpressionSelectVBClause, object data) { -// Debug.Assert((queryExpressionSelectVBClause != null)); -// Debug.Assert((queryExpressionSelectVBClause.Variables != null)); -// for (int i = 0; i < queryExpressionSelectVBClause.Variables.Count; i++) { -// ExpressionRangeVariable o = queryExpressionSelectVBClause.Variables[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ExpressionRangeVariable)nodeStack.Pop(); -// if (o == null) -// queryExpressionSelectVBClause.Variables.RemoveAt(i--); -// else -// queryExpressionSelectVBClause.Variables[i] = o; -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionWhereClause(QueryExpressionWhereClause queryExpressionWhereClause, object data) { -// Debug.Assert((queryExpressionWhereClause != null)); -// Debug.Assert((queryExpressionWhereClause.Condition != null)); -// nodeStack.Push(queryExpressionWhereClause.Condition); -// queryExpressionWhereClause.Condition.AcceptVisitor(this, data); -// queryExpressionWhereClause.Condition = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitRaiseEventStatement(RaiseEventStatement raiseEventStatement, object data) { -// Debug.Assert((raiseEventStatement != null)); -// Debug.Assert((raiseEventStatement.Arguments != null)); -// for (int i = 0; i < raiseEventStatement.Arguments.Count; i++) { -// Expression o = raiseEventStatement.Arguments[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (Expression)nodeStack.Pop(); -// if (o == null) -// raiseEventStatement.Arguments.RemoveAt(i--); -// else -// raiseEventStatement.Arguments[i] = o; -// } -// return null; -// } -// -// public virtual object VisitReDimStatement(ReDimStatement reDimStatement, object data) { -// Debug.Assert((reDimStatement != null)); -// Debug.Assert((reDimStatement.ReDimClauses != null)); -// for (int i = 0; i < reDimStatement.ReDimClauses.Count; i++) { -// InvocationExpression o = reDimStatement.ReDimClauses[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (InvocationExpression)nodeStack.Pop(); -// if (o == null) -// reDimStatement.ReDimClauses.RemoveAt(i--); -// else -// reDimStatement.ReDimClauses[i] = o; -// } -// return null; -// } -// -// public virtual object VisitRemoveHandlerStatement(RemoveHandlerStatement removeHandlerStatement, object data) { -// Debug.Assert((removeHandlerStatement != null)); -// Debug.Assert((removeHandlerStatement.EventExpression != null)); -// Debug.Assert((removeHandlerStatement.HandlerExpression != null)); -// nodeStack.Push(removeHandlerStatement.EventExpression); -// removeHandlerStatement.EventExpression.AcceptVisitor(this, data); -// removeHandlerStatement.EventExpression = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(removeHandlerStatement.HandlerExpression); -// removeHandlerStatement.HandlerExpression.AcceptVisitor(this, data); -// removeHandlerStatement.HandlerExpression = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitResumeStatement(ResumeStatement resumeStatement, object data) { -// Debug.Assert((resumeStatement != null)); -// return null; -// } -// -// public virtual object VisitReturnStatement(ReturnStatement returnStatement, object data) { -// Debug.Assert((returnStatement != null)); -// Debug.Assert((returnStatement.Expression != null)); -// nodeStack.Push(returnStatement.Expression); -// returnStatement.Expression.AcceptVisitor(this, data); -// returnStatement.Expression = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitStopStatement(StopStatement stopStatement, object data) { -// Debug.Assert((stopStatement != null)); -// return null; -// } -// -// public virtual object VisitSwitchSection(SwitchSection switchSection, object data) { -// Debug.Assert((switchSection != null)); -// Debug.Assert((switchSection.SwitchLabels != null)); -// for (int i = 0; i < switchSection.SwitchLabels.Count; i++) { -// CaseLabel o = switchSection.SwitchLabels[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (CaseLabel)nodeStack.Pop(); -// if (o == null) -// switchSection.SwitchLabels.RemoveAt(i--); -// else -// switchSection.SwitchLabels[i] = o; -// } -// for (int i = 0; i < switchSection.Children.Count; i++) { -// INode o = switchSection.Children[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = nodeStack.Pop(); -// if (o == null) -// switchSection.Children.RemoveAt(i--); -// else -// switchSection.Children[i] = o; -// } -// return null; -// } -// -// public virtual object VisitSwitchStatement(SwitchStatement switchStatement, object data) { -// Debug.Assert((switchStatement != null)); -// Debug.Assert((switchStatement.SwitchExpression != null)); -// Debug.Assert((switchStatement.SwitchSections != null)); -// nodeStack.Push(switchStatement.SwitchExpression); -// switchStatement.SwitchExpression.AcceptVisitor(this, data); -// switchStatement.SwitchExpression = ((Expression)(nodeStack.Pop())); -// for (int i = 0; i < switchStatement.SwitchSections.Count; i++) { -// SwitchSection o = switchStatement.SwitchSections[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (SwitchSection)nodeStack.Pop(); -// if (o == null) -// switchStatement.SwitchSections.RemoveAt(i--); -// else -// switchStatement.SwitchSections[i] = o; -// } -// return null; -// } -// -// public virtual object VisitTemplateDefinition(TemplateDefinition templateDefinition, object data) { -// Debug.Assert((templateDefinition != null)); -// Debug.Assert((templateDefinition.Attributes != null)); -// Debug.Assert((templateDefinition.Bases != null)); -// for (int i = 0; i < templateDefinition.Attributes.Count; i++) { -// AttributeSection o = templateDefinition.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (AttributeSection)nodeStack.Pop(); -// if (o == null) -// templateDefinition.Attributes.RemoveAt(i--); -// else -// templateDefinition.Attributes[i] = o; -// } -// for (int i = 0; i < templateDefinition.Bases.Count; i++) { -// TypeReference o = templateDefinition.Bases[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (TypeReference)nodeStack.Pop(); -// if (o == null) -// templateDefinition.Bases.RemoveAt(i--); -// else -// templateDefinition.Bases[i] = o; -// } -// return null; -// } -// -// public virtual object VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, object data) { -// Debug.Assert((thisReferenceExpression != null)); -// return null; -// } -// -// public virtual object VisitThrowStatement(ThrowStatement throwStatement, object data) { -// Debug.Assert((throwStatement != null)); -// Debug.Assert((throwStatement.Expression != null)); -// nodeStack.Push(throwStatement.Expression); -// throwStatement.Expression.AcceptVisitor(this, data); -// throwStatement.Expression = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitTryCatchStatement(TryCatchStatement tryCatchStatement, object data) { -// Debug.Assert((tryCatchStatement != null)); -// Debug.Assert((tryCatchStatement.StatementBlock != null)); -// Debug.Assert((tryCatchStatement.CatchClauses != null)); -// Debug.Assert((tryCatchStatement.FinallyBlock != null)); -// nodeStack.Push(tryCatchStatement.StatementBlock); -// tryCatchStatement.StatementBlock.AcceptVisitor(this, data); -// tryCatchStatement.StatementBlock = ((Statement)(nodeStack.Pop())); -// for (int i = 0; i < tryCatchStatement.CatchClauses.Count; i++) { -// CatchClause o = tryCatchStatement.CatchClauses[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (CatchClause)nodeStack.Pop(); -// if (o == null) -// tryCatchStatement.CatchClauses.RemoveAt(i--); -// else -// tryCatchStatement.CatchClauses[i] = o; -// } -// nodeStack.Push(tryCatchStatement.FinallyBlock); -// tryCatchStatement.FinallyBlock.AcceptVisitor(this, data); -// tryCatchStatement.FinallyBlock = ((Statement)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitTypeDeclaration(TypeDeclaration typeDeclaration, object data) { -// Debug.Assert((typeDeclaration != null)); -// Debug.Assert((typeDeclaration.Attributes != null)); -// Debug.Assert((typeDeclaration.BaseTypes != null)); -// Debug.Assert((typeDeclaration.Templates != null)); -// for (int i = 0; i < typeDeclaration.Attributes.Count; i++) { -// AttributeSection o = typeDeclaration.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (AttributeSection)nodeStack.Pop(); -// if (o == null) -// typeDeclaration.Attributes.RemoveAt(i--); -// else -// typeDeclaration.Attributes[i] = o; -// } -// for (int i = 0; i < typeDeclaration.BaseTypes.Count; i++) { -// TypeReference o = typeDeclaration.BaseTypes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (TypeReference)nodeStack.Pop(); -// if (o == null) -// typeDeclaration.BaseTypes.RemoveAt(i--); -// else -// typeDeclaration.BaseTypes[i] = o; -// } -// for (int i = 0; i < typeDeclaration.Templates.Count; i++) { -// TemplateDefinition o = typeDeclaration.Templates[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (TemplateDefinition)nodeStack.Pop(); -// if (o == null) -// typeDeclaration.Templates.RemoveAt(i--); -// else -// typeDeclaration.Templates[i] = o; -// } -// for (int i = 0; i < typeDeclaration.Children.Count; i++) { -// INode o = typeDeclaration.Children[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = nodeStack.Pop(); -// if (o == null) -// typeDeclaration.Children.RemoveAt(i--); -// else -// typeDeclaration.Children[i] = o; -// } -// return null; -// } -// -// public virtual object VisitTypeOfExpression(TypeOfExpression typeOfExpression, object data) { -// Debug.Assert((typeOfExpression != null)); -// Debug.Assert((typeOfExpression.TypeReference != null)); -// nodeStack.Push(typeOfExpression.TypeReference); -// typeOfExpression.TypeReference.AcceptVisitor(this, data); -// typeOfExpression.TypeReference = ((TypeReference)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitTypeOfIsExpression(TypeOfIsExpression typeOfIsExpression, object data) { -// Debug.Assert((typeOfIsExpression != null)); -// Debug.Assert((typeOfIsExpression.Expression != null)); -// Debug.Assert((typeOfIsExpression.TypeReference != null)); -// nodeStack.Push(typeOfIsExpression.Expression); -// typeOfIsExpression.Expression.AcceptVisitor(this, data); -// typeOfIsExpression.Expression = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(typeOfIsExpression.TypeReference); -// typeOfIsExpression.TypeReference.AcceptVisitor(this, data); -// typeOfIsExpression.TypeReference = ((TypeReference)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitTypeReference(TypeReference typeReference, object data) { -// Debug.Assert((typeReference != null)); -// Debug.Assert((typeReference.GenericTypes != null)); -// for (int i = 0; i < typeReference.GenericTypes.Count; i++) { -// TypeReference o = typeReference.GenericTypes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (TypeReference)nodeStack.Pop(); -// if (o == null) -// typeReference.GenericTypes.RemoveAt(i--); -// else -// typeReference.GenericTypes[i] = o; -// } -// return null; -// } -// -// public virtual object VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression, object data) { -// Debug.Assert((typeReferenceExpression != null)); -// Debug.Assert((typeReferenceExpression.TypeReference != null)); -// nodeStack.Push(typeReferenceExpression.TypeReference); -// typeReferenceExpression.TypeReference.AcceptVisitor(this, data); -// typeReferenceExpression.TypeReference = ((TypeReference)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression, object data) { -// Debug.Assert((unaryOperatorExpression != null)); -// Debug.Assert((unaryOperatorExpression.Expression != null)); -// nodeStack.Push(unaryOperatorExpression.Expression); -// unaryOperatorExpression.Expression.AcceptVisitor(this, data); -// unaryOperatorExpression.Expression = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitUsing(ImportsClause @using, object data) { -// Debug.Assert((@using != null)); -// Debug.Assert((@using.Alias != null)); -// nodeStack.Push(@using.Alias); -// @using.Alias.AcceptVisitor(this, data); -// @using.Alias = ((TypeReference)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitUsingDeclaration(ImportsStatement usingDeclaration, object data) { -// Debug.Assert((usingDeclaration != null)); -// Debug.Assert((usingDeclaration.ImportsClauses != null)); -// for (int i = 0; i < usingDeclaration.ImportsClauses.Count; i++) { -// ImportsClause o = usingDeclaration.ImportsClauses[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (ImportsClause)nodeStack.Pop(); -// if (o == null) -// usingDeclaration.ImportsClauses.RemoveAt(i--); -// else -// usingDeclaration.ImportsClauses[i] = o; -// } -// return null; -// } -// -// public virtual object VisitUsingStatement(UsingStatement usingStatement, object data) { -// Debug.Assert((usingStatement != null)); -// Debug.Assert((usingStatement.ResourceAcquisition != null)); -// Debug.Assert((usingStatement.EmbeddedStatement != null)); -// nodeStack.Push(usingStatement.ResourceAcquisition); -// usingStatement.ResourceAcquisition.AcceptVisitor(this, data); -// usingStatement.ResourceAcquisition = ((Statement)(nodeStack.Pop())); -// nodeStack.Push(usingStatement.EmbeddedStatement); -// usingStatement.EmbeddedStatement.AcceptVisitor(this, data); -// usingStatement.EmbeddedStatement = ((Statement)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitVariableDeclaration(VariableDeclaration variableDeclaration, object data) { -// Debug.Assert((variableDeclaration != null)); -// Debug.Assert((variableDeclaration.Initializer != null)); -// Debug.Assert((variableDeclaration.TypeReference != null)); -// Debug.Assert((variableDeclaration.FixedArrayInitialization != null)); -// nodeStack.Push(variableDeclaration.Initializer); -// variableDeclaration.Initializer.AcceptVisitor(this, data); -// variableDeclaration.Initializer = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(variableDeclaration.TypeReference); -// variableDeclaration.TypeReference.AcceptVisitor(this, data); -// variableDeclaration.TypeReference = ((TypeReference)(nodeStack.Pop())); -// nodeStack.Push(variableDeclaration.FixedArrayInitialization); -// variableDeclaration.FixedArrayInitialization.AcceptVisitor(this, data); -// variableDeclaration.FixedArrayInitialization = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitWithStatement(WithStatement withStatement, object data) { -// Debug.Assert((withStatement != null)); -// Debug.Assert((withStatement.Expression != null)); -// Debug.Assert((withStatement.Body != null)); -// nodeStack.Push(withStatement.Expression); -// withStatement.Expression.AcceptVisitor(this, data); -// withStatement.Expression = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(withStatement.Body); -// withStatement.Body.AcceptVisitor(this, data); -// withStatement.Body = ((BlockStatement)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitXmlAttributeExpression(XmlAttributeExpression xmlAttributeExpression, object data) { -// Debug.Assert((xmlAttributeExpression != null)); -// Debug.Assert((xmlAttributeExpression.ExpressionValue != null)); -// nodeStack.Push(xmlAttributeExpression.ExpressionValue); -// xmlAttributeExpression.ExpressionValue.AcceptVisitor(this, data); -// xmlAttributeExpression.ExpressionValue = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitXmlContentExpression(XmlContentExpression xmlContentExpression, object data) { -// Debug.Assert((xmlContentExpression != null)); -// return null; -// } -// -// public virtual object VisitXmlDocumentExpression(XmlDocumentExpression xmlDocumentExpression, object data) { -// Debug.Assert((xmlDocumentExpression != null)); -// Debug.Assert((xmlDocumentExpression.Expressions != null)); -// for (int i = 0; i < xmlDocumentExpression.Expressions.Count; i++) { -// XmlExpression o = xmlDocumentExpression.Expressions[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (XmlExpression)nodeStack.Pop(); -// if (o == null) -// xmlDocumentExpression.Expressions.RemoveAt(i--); -// else -// xmlDocumentExpression.Expressions[i] = o; -// } -// return null; -// } -// -// public virtual object VisitXmlElementExpression(XmlElementExpression xmlElementExpression, object data) { -// Debug.Assert((xmlElementExpression != null)); -// Debug.Assert((xmlElementExpression.Content != null)); -// Debug.Assert((xmlElementExpression.NameExpression != null)); -// Debug.Assert((xmlElementExpression.Attributes != null)); -// nodeStack.Push(xmlElementExpression.Content); -// xmlElementExpression.Content.AcceptVisitor(this, data); -// xmlElementExpression.Content = ((Expression)(nodeStack.Pop())); -// nodeStack.Push(xmlElementExpression.NameExpression); -// xmlElementExpression.NameExpression.AcceptVisitor(this, data); -// xmlElementExpression.NameExpression = ((Expression)(nodeStack.Pop())); -// for (int i = 0; i < xmlElementExpression.Attributes.Count; i++) { -// XmlExpression o = xmlElementExpression.Attributes[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = (XmlExpression)nodeStack.Pop(); -// if (o == null) -// xmlElementExpression.Attributes.RemoveAt(i--); -// else -// xmlElementExpression.Attributes[i] = o; -// } -// for (int i = 0; i < xmlElementExpression.Children.Count; i++) { -// INode o = xmlElementExpression.Children[i]; -// Debug.Assert(o != null); -// nodeStack.Push(o); -// o.AcceptVisitor(this, data); -// o = nodeStack.Pop(); -// if (o == null) -// xmlElementExpression.Children.RemoveAt(i--); -// else -// xmlElementExpression.Children[i] = o; -// } -// return null; -// } -// -// public virtual object VisitXmlEmbeddedExpression(XmlEmbeddedExpression xmlEmbeddedExpression, object data) { -// Debug.Assert((xmlEmbeddedExpression != null)); -// Debug.Assert((xmlEmbeddedExpression.InlineVBExpression != null)); -// nodeStack.Push(xmlEmbeddedExpression.InlineVBExpression); -// xmlEmbeddedExpression.InlineVBExpression.AcceptVisitor(this, data); -// xmlEmbeddedExpression.InlineVBExpression = ((Expression)(nodeStack.Pop())); -// return null; -// } -// -// public virtual object VisitXmlMemberAccessExpression(XmlMemberAccessExpression xmlMemberAccessExpression, object data) { -// Debug.Assert((xmlMemberAccessExpression != null)); -// Debug.Assert((xmlMemberAccessExpression.TargetObject != null)); -// nodeStack.Push(xmlMemberAccessExpression.TargetObject); -// xmlMemberAccessExpression.TargetObject.AcceptVisitor(this, data); -// xmlMemberAccessExpression.TargetObject = ((Expression)(nodeStack.Pop())); -// return null; -// } -// } -} diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/Visitors/AbstractAstVisitor.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/Visitors/AbstractAstVisitor.cs deleted file mode 100644 index 6f44974418..0000000000 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/Visitors/AbstractAstVisitor.cs +++ /dev/null @@ -1,1156 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.1 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace ICSharpCode.NRefactory.VB.Visitors { - using System; - using System.Collections.Generic; - using System.Diagnostics; - using ICSharpCode.NRefactory.VB.Ast; - - -// public abstract class AbstractAstVisitor : IAstVisitor { -// -// public virtual object VisitAddHandlerStatement(AddHandlerStatement addHandlerStatement, object data) { -// Debug.Assert((addHandlerStatement != null)); -// Debug.Assert((addHandlerStatement.EventExpression != null)); -// Debug.Assert((addHandlerStatement.HandlerExpression != null)); -// addHandlerStatement.EventExpression.AcceptVisitor(this, data); -// return addHandlerStatement.HandlerExpression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitAddressOfExpression(AddressOfExpression addressOfExpression, object data) { -// Debug.Assert((addressOfExpression != null)); -// Debug.Assert((addressOfExpression.Expression != null)); -// return addressOfExpression.Expression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, object data) { -// Debug.Assert((arrayCreateExpression != null)); -// Debug.Assert((arrayCreateExpression.CreateType != null)); -// Debug.Assert((arrayCreateExpression.Arguments != null)); -// Debug.Assert((arrayCreateExpression.ArrayInitializer != null)); -// arrayCreateExpression.CreateType.AcceptVisitor(this, data); -// foreach (Expression o in arrayCreateExpression.Arguments) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return arrayCreateExpression.ArrayInitializer.AcceptVisitor(this, data); -// } -// -// public virtual object VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data) { -// Debug.Assert((assignmentExpression != null)); -// Debug.Assert((assignmentExpression.Left != null)); -// Debug.Assert((assignmentExpression.Right != null)); -// assignmentExpression.Left.AcceptVisitor(this, data); -// return assignmentExpression.Right.AcceptVisitor(this, data); -// } -// -// public virtual object VisitAttribute(ICSharpCode.NRefactory.VB.Ast.Attribute attribute, object data) { -// Debug.Assert((attribute != null)); -// Debug.Assert((attribute.PositionalArguments != null)); -// Debug.Assert((attribute.NamedArguments != null)); -// foreach (Expression o in attribute.PositionalArguments) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (NamedArgumentExpression o in attribute.NamedArguments) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitAttributeSection(AttributeSection attributeSection, object data) { -// Debug.Assert((attributeSection != null)); -// Debug.Assert((attributeSection.Attributes != null)); -// foreach (ICSharpCode.NRefactory.VB.Ast.Attribute o in attributeSection.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression, object data) { -// Debug.Assert((baseReferenceExpression != null)); -// return null; -// } -// -// public virtual object VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression, object data) { -// Debug.Assert((binaryOperatorExpression != null)); -// Debug.Assert((binaryOperatorExpression.Left != null)); -// Debug.Assert((binaryOperatorExpression.Right != null)); -// binaryOperatorExpression.Left.AcceptVisitor(this, data); -// return binaryOperatorExpression.Right.AcceptVisitor(this, data); -// } -// -// public virtual object VisitBlockStatement(BlockStatement blockStatement, object data) { -// Debug.Assert((blockStatement != null)); -// return blockStatement.AcceptChildren(this, data); -// } -// -// public virtual object VisitCaseLabel(CaseLabel caseLabel, object data) { -// Debug.Assert((caseLabel != null)); -// Debug.Assert((caseLabel.Label != null)); -// Debug.Assert((caseLabel.ToExpression != null)); -// caseLabel.Label.AcceptVisitor(this, data); -// return caseLabel.ToExpression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitCastExpression(CastExpression castExpression, object data) { -// Debug.Assert((castExpression != null)); -// Debug.Assert((castExpression.CastTo != null)); -// Debug.Assert((castExpression.Expression != null)); -// castExpression.CastTo.AcceptVisitor(this, data); -// return castExpression.Expression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitCatchClause(CatchClause catchClause, object data) { -// Debug.Assert((catchClause != null)); -// Debug.Assert((catchClause.TypeReference != null)); -// Debug.Assert((catchClause.StatementBlock != null)); -// Debug.Assert((catchClause.Condition != null)); -// catchClause.TypeReference.AcceptVisitor(this, data); -// catchClause.StatementBlock.AcceptVisitor(this, data); -// return catchClause.Condition.AcceptVisitor(this, data); -// } -// -// public virtual object VisitClassReferenceExpression(ClassReferenceExpression classReferenceExpression, object data) { -// Debug.Assert((classReferenceExpression != null)); -// return null; -// } -// -// public virtual object VisitCollectionInitializerExpression(CollectionInitializerExpression collectionInitializerExpression, object data) { -// Debug.Assert((collectionInitializerExpression != null)); -// Debug.Assert((collectionInitializerExpression.CreateExpressions != null)); -// foreach (Expression o in collectionInitializerExpression.CreateExpressions) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitCollectionRangeVariable(CollectionRangeVariable collectionRangeVariable, object data) { -// Debug.Assert((collectionRangeVariable != null)); -// Debug.Assert((collectionRangeVariable.Expression != null)); -// Debug.Assert((collectionRangeVariable.Type != null)); -// collectionRangeVariable.Expression.AcceptVisitor(this, data); -// return collectionRangeVariable.Type.AcceptVisitor(this, data); -// } -// -// public virtual object VisitCompilationUnit(CompilationUnit compilationUnit, object data) { -// Debug.Assert((compilationUnit != null)); -// return compilationUnit.AcceptChildren(this, data); -// } -// -// public virtual object VisitConditionalExpression(ConditionalExpression conditionalExpression, object data) { -// Debug.Assert((conditionalExpression != null)); -// Debug.Assert((conditionalExpression.Condition != null)); -// Debug.Assert((conditionalExpression.TrueExpression != null)); -// Debug.Assert((conditionalExpression.FalseExpression != null)); -// conditionalExpression.Condition.AcceptVisitor(this, data); -// conditionalExpression.TrueExpression.AcceptVisitor(this, data); -// return conditionalExpression.FalseExpression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration, object data) { -// Debug.Assert((constructorDeclaration != null)); -// Debug.Assert((constructorDeclaration.Attributes != null)); -// Debug.Assert((constructorDeclaration.Parameters != null)); -// Debug.Assert((constructorDeclaration.ConstructorInitializer != null)); -// Debug.Assert((constructorDeclaration.Body != null)); -// foreach (AttributeSection o in constructorDeclaration.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (ParameterDeclarationExpression o in constructorDeclaration.Parameters) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// constructorDeclaration.ConstructorInitializer.AcceptVisitor(this, data); -// return constructorDeclaration.Body.AcceptVisitor(this, data); -// } -// -// public virtual object VisitConstructorInitializer(ConstructorInitializer constructorInitializer, object data) { -// Debug.Assert((constructorInitializer != null)); -// Debug.Assert((constructorInitializer.Arguments != null)); -// foreach (Expression o in constructorInitializer.Arguments) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitContinueStatement(ContinueStatement continueStatement, object data) { -// Debug.Assert((continueStatement != null)); -// return null; -// } -// -// public virtual object VisitDeclareDeclaration(DeclareDeclaration declareDeclaration, object data) { -// Debug.Assert((declareDeclaration != null)); -// Debug.Assert((declareDeclaration.Attributes != null)); -// Debug.Assert((declareDeclaration.Parameters != null)); -// Debug.Assert((declareDeclaration.TypeReference != null)); -// foreach (AttributeSection o in declareDeclaration.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (ParameterDeclarationExpression o in declareDeclaration.Parameters) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return declareDeclaration.TypeReference.AcceptVisitor(this, data); -// } -// -// public virtual object VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression, object data) { -// Debug.Assert((defaultValueExpression != null)); -// Debug.Assert((defaultValueExpression.TypeReference != null)); -// return defaultValueExpression.TypeReference.AcceptVisitor(this, data); -// } -// -// public virtual object VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration, object data) { -// Debug.Assert((delegateDeclaration != null)); -// Debug.Assert((delegateDeclaration.Attributes != null)); -// Debug.Assert((delegateDeclaration.ReturnType != null)); -// Debug.Assert((delegateDeclaration.Parameters != null)); -// Debug.Assert((delegateDeclaration.Templates != null)); -// foreach (AttributeSection o in delegateDeclaration.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// delegateDeclaration.ReturnType.AcceptVisitor(this, data); -// foreach (ParameterDeclarationExpression o in delegateDeclaration.Parameters) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (TemplateDefinition o in delegateDeclaration.Templates) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitDirectionExpression(DirectionExpression directionExpression, object data) { -// Debug.Assert((directionExpression != null)); -// Debug.Assert((directionExpression.Expression != null)); -// return directionExpression.Expression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitDoLoopStatement(DoLoopStatement doLoopStatement, object data) { -// Debug.Assert((doLoopStatement != null)); -// Debug.Assert((doLoopStatement.Condition != null)); -// Debug.Assert((doLoopStatement.EmbeddedStatement != null)); -// doLoopStatement.Condition.AcceptVisitor(this, data); -// return doLoopStatement.EmbeddedStatement.AcceptVisitor(this, data); -// } -// -// public virtual object VisitElseIfSection(ElseIfSection elseIfSection, object data) { -// Debug.Assert((elseIfSection != null)); -// Debug.Assert((elseIfSection.Condition != null)); -// Debug.Assert((elseIfSection.EmbeddedStatement != null)); -// elseIfSection.Condition.AcceptVisitor(this, data); -// return elseIfSection.EmbeddedStatement.AcceptVisitor(this, data); -// } -// -// public virtual object VisitEndStatement(EndStatement endStatement, object data) { -// Debug.Assert((endStatement != null)); -// return null; -// } -// -// public virtual object VisitEraseStatement(EraseStatement eraseStatement, object data) { -// Debug.Assert((eraseStatement != null)); -// Debug.Assert((eraseStatement.Expressions != null)); -// foreach (Expression o in eraseStatement.Expressions) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitErrorStatement(ErrorStatement errorStatement, object data) { -// Debug.Assert((errorStatement != null)); -// Debug.Assert((errorStatement.Expression != null)); -// return errorStatement.Expression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitEventAddRegion(EventAddRegion eventAddRegion, object data) { -// Debug.Assert((eventAddRegion != null)); -// Debug.Assert((eventAddRegion.Attributes != null)); -// Debug.Assert((eventAddRegion.Block != null)); -// Debug.Assert((eventAddRegion.Parameters != null)); -// foreach (AttributeSection o in eventAddRegion.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// eventAddRegion.Block.AcceptVisitor(this, data); -// foreach (ParameterDeclarationExpression o in eventAddRegion.Parameters) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitEventDeclaration(EventDeclaration eventDeclaration, object data) { -// Debug.Assert((eventDeclaration != null)); -// Debug.Assert((eventDeclaration.Attributes != null)); -// Debug.Assert((eventDeclaration.Parameters != null)); -// Debug.Assert((eventDeclaration.InterfaceImplementations != null)); -// Debug.Assert((eventDeclaration.TypeReference != null)); -// Debug.Assert((eventDeclaration.AddRegion != null)); -// Debug.Assert((eventDeclaration.RemoveRegion != null)); -// Debug.Assert((eventDeclaration.RaiseRegion != null)); -// Debug.Assert((eventDeclaration.Initializer != null)); -// foreach (AttributeSection o in eventDeclaration.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (ParameterDeclarationExpression o in eventDeclaration.Parameters) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (InterfaceImplementation o in eventDeclaration.InterfaceImplementations) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// eventDeclaration.TypeReference.AcceptVisitor(this, data); -// eventDeclaration.AddRegion.AcceptVisitor(this, data); -// eventDeclaration.RemoveRegion.AcceptVisitor(this, data); -// eventDeclaration.RaiseRegion.AcceptVisitor(this, data); -// return eventDeclaration.Initializer.AcceptVisitor(this, data); -// } -// -// public virtual object VisitEventRaiseRegion(EventRaiseRegion eventRaiseRegion, object data) { -// Debug.Assert((eventRaiseRegion != null)); -// Debug.Assert((eventRaiseRegion.Attributes != null)); -// Debug.Assert((eventRaiseRegion.Block != null)); -// Debug.Assert((eventRaiseRegion.Parameters != null)); -// foreach (AttributeSection o in eventRaiseRegion.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// eventRaiseRegion.Block.AcceptVisitor(this, data); -// foreach (ParameterDeclarationExpression o in eventRaiseRegion.Parameters) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitEventRemoveRegion(EventRemoveRegion eventRemoveRegion, object data) { -// Debug.Assert((eventRemoveRegion != null)); -// Debug.Assert((eventRemoveRegion.Attributes != null)); -// Debug.Assert((eventRemoveRegion.Block != null)); -// Debug.Assert((eventRemoveRegion.Parameters != null)); -// foreach (AttributeSection o in eventRemoveRegion.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// eventRemoveRegion.Block.AcceptVisitor(this, data); -// foreach (ParameterDeclarationExpression o in eventRemoveRegion.Parameters) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitExitStatement(ExitStatement exitStatement, object data) { -// Debug.Assert((exitStatement != null)); -// return null; -// } -// -// public virtual object VisitExpressionRangeVariable(ExpressionRangeVariable expressionRangeVariable, object data) { -// Debug.Assert((expressionRangeVariable != null)); -// Debug.Assert((expressionRangeVariable.Expression != null)); -// Debug.Assert((expressionRangeVariable.Type != null)); -// expressionRangeVariable.Expression.AcceptVisitor(this, data); -// return expressionRangeVariable.Type.AcceptVisitor(this, data); -// } -// -// public virtual object VisitExpressionStatement(ExpressionStatement expressionStatement, object data) { -// Debug.Assert((expressionStatement != null)); -// Debug.Assert((expressionStatement.Expression != null)); -// return expressionStatement.Expression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitExternAliasDirective(ExternAliasDirective externAliasDirective, object data) { -// Debug.Assert((externAliasDirective != null)); -// return null; -// } -// -// public virtual object VisitFieldDeclaration(FieldDeclaration fieldDeclaration, object data) { -// Debug.Assert((fieldDeclaration != null)); -// Debug.Assert((fieldDeclaration.Attributes != null)); -// Debug.Assert((fieldDeclaration.TypeReference != null)); -// Debug.Assert((fieldDeclaration.Fields != null)); -// foreach (AttributeSection o in fieldDeclaration.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// fieldDeclaration.TypeReference.AcceptVisitor(this, data); -// foreach (VariableDeclaration o in fieldDeclaration.Fields) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitForeachStatement(ForeachStatement foreachStatement, object data) { -// Debug.Assert((foreachStatement != null)); -// Debug.Assert((foreachStatement.TypeReference != null)); -// Debug.Assert((foreachStatement.Expression != null)); -// Debug.Assert((foreachStatement.NextExpression != null)); -// Debug.Assert((foreachStatement.EmbeddedStatement != null)); -// foreachStatement.TypeReference.AcceptVisitor(this, data); -// foreachStatement.Expression.AcceptVisitor(this, data); -// foreachStatement.NextExpression.AcceptVisitor(this, data); -// return foreachStatement.EmbeddedStatement.AcceptVisitor(this, data); -// } -// -// public virtual object VisitForNextStatement(ForNextStatement forNextStatement, object data) { -// Debug.Assert((forNextStatement != null)); -// Debug.Assert((forNextStatement.Start != null)); -// Debug.Assert((forNextStatement.End != null)); -// Debug.Assert((forNextStatement.Step != null)); -// Debug.Assert((forNextStatement.NextExpressions != null)); -// Debug.Assert((forNextStatement.TypeReference != null)); -// Debug.Assert((forNextStatement.LoopVariableExpression != null)); -// Debug.Assert((forNextStatement.EmbeddedStatement != null)); -// forNextStatement.Start.AcceptVisitor(this, data); -// forNextStatement.End.AcceptVisitor(this, data); -// forNextStatement.Step.AcceptVisitor(this, data); -// foreach (Expression o in forNextStatement.NextExpressions) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// forNextStatement.TypeReference.AcceptVisitor(this, data); -// forNextStatement.LoopVariableExpression.AcceptVisitor(this, data); -// return forNextStatement.EmbeddedStatement.AcceptVisitor(this, data); -// } -// -// public virtual object VisitGotoStatement(GotoStatement gotoStatement, object data) { -// Debug.Assert((gotoStatement != null)); -// return null; -// } -// -// public virtual object VisitIdentifierExpression(SimpleNameExpression identifierExpression, object data) { -// Debug.Assert((identifierExpression != null)); -// Debug.Assert((identifierExpression.TypeArguments != null)); -// foreach (TypeReference o in identifierExpression.TypeArguments) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitIfElseStatement(IfElseStatement ifElseStatement, object data) { -// Debug.Assert((ifElseStatement != null)); -// Debug.Assert((ifElseStatement.Condition != null)); -// Debug.Assert((ifElseStatement.TrueStatement != null)); -// Debug.Assert((ifElseStatement.FalseStatement != null)); -// Debug.Assert((ifElseStatement.ElseIfSections != null)); -// ifElseStatement.Condition.AcceptVisitor(this, data); -// foreach (Statement o in ifElseStatement.TrueStatement) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (Statement o in ifElseStatement.FalseStatement) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (ElseIfSection o in ifElseStatement.ElseIfSections) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitInnerClassTypeReference(InnerClassTypeReference innerClassTypeReference, object data) { -// Debug.Assert((innerClassTypeReference != null)); -// Debug.Assert((innerClassTypeReference.GenericTypes != null)); -// Debug.Assert((innerClassTypeReference.BaseType != null)); -// foreach (TypeReference o in innerClassTypeReference.GenericTypes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return innerClassTypeReference.BaseType.AcceptVisitor(this, data); -// } -// -// public virtual object VisitInterfaceImplementation(InterfaceImplementation interfaceImplementation, object data) { -// Debug.Assert((interfaceImplementation != null)); -// Debug.Assert((interfaceImplementation.InterfaceType != null)); -// return interfaceImplementation.InterfaceType.AcceptVisitor(this, data); -// } -// -// public virtual object VisitInvocationExpression(InvocationExpression invocationExpression, object data) { -// Debug.Assert((invocationExpression != null)); -// Debug.Assert((invocationExpression.TargetObject != null)); -// Debug.Assert((invocationExpression.Arguments != null)); -// invocationExpression.TargetObject.AcceptVisitor(this, data); -// foreach (Expression o in invocationExpression.Arguments) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitLabelStatement(LabelStatement labelStatement, object data) { -// Debug.Assert((labelStatement != null)); -// return null; -// } -// -// public virtual object VisitLambdaExpression(LambdaExpression lambdaExpression, object data) { -// Debug.Assert((lambdaExpression != null)); -// Debug.Assert((lambdaExpression.Parameters != null)); -// Debug.Assert((lambdaExpression.StatementBody != null)); -// Debug.Assert((lambdaExpression.ExpressionBody != null)); -// Debug.Assert((lambdaExpression.ReturnType != null)); -// foreach (ParameterDeclarationExpression o in lambdaExpression.Parameters) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// lambdaExpression.StatementBody.AcceptVisitor(this, data); -// lambdaExpression.ExpressionBody.AcceptVisitor(this, data); -// return lambdaExpression.ReturnType.AcceptVisitor(this, data); -// } -// -// public virtual object VisitLocalVariableDeclaration(LocalVariableDeclaration localVariableDeclaration, object data) { -// Debug.Assert((localVariableDeclaration != null)); -// Debug.Assert((localVariableDeclaration.TypeReference != null)); -// Debug.Assert((localVariableDeclaration.Variables != null)); -// localVariableDeclaration.TypeReference.AcceptVisitor(this, data); -// foreach (VariableDeclaration o in localVariableDeclaration.Variables) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitLockStatement(LockStatement lockStatement, object data) { -// Debug.Assert((lockStatement != null)); -// Debug.Assert((lockStatement.LockExpression != null)); -// Debug.Assert((lockStatement.EmbeddedStatement != null)); -// lockStatement.LockExpression.AcceptVisitor(this, data); -// return lockStatement.EmbeddedStatement.AcceptVisitor(this, data); -// } -// -// public virtual object VisitMemberInitializerExpression(MemberInitializerExpression memberInitializerExpression, object data) { -// Debug.Assert((memberInitializerExpression != null)); -// Debug.Assert((memberInitializerExpression.Expression != null)); -// return memberInitializerExpression.Expression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression, object data) { -// Debug.Assert((memberReferenceExpression != null)); -// Debug.Assert((memberReferenceExpression.TargetObject != null)); -// Debug.Assert((memberReferenceExpression.TypeArguments != null)); -// memberReferenceExpression.TargetObject.AcceptVisitor(this, data); -// foreach (TypeReference o in memberReferenceExpression.TypeArguments) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitMethodDeclaration(MethodDeclaration methodDeclaration, object data) { -// Debug.Assert((methodDeclaration != null)); -// Debug.Assert((methodDeclaration.Attributes != null)); -// Debug.Assert((methodDeclaration.Parameters != null)); -// Debug.Assert((methodDeclaration.InterfaceImplementations != null)); -// Debug.Assert((methodDeclaration.TypeReference != null)); -// Debug.Assert((methodDeclaration.Body != null)); -// Debug.Assert((methodDeclaration.Templates != null)); -// foreach (AttributeSection o in methodDeclaration.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (ParameterDeclarationExpression o in methodDeclaration.Parameters) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (InterfaceImplementation o in methodDeclaration.InterfaceImplementations) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// methodDeclaration.TypeReference.AcceptVisitor(this, data); -// methodDeclaration.Body.AcceptVisitor(this, data); -// foreach (TemplateDefinition o in methodDeclaration.Templates) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data) { -// Debug.Assert((namedArgumentExpression != null)); -// Debug.Assert((namedArgumentExpression.Expression != null)); -// return namedArgumentExpression.Expression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data) { -// Debug.Assert((namespaceDeclaration != null)); -// return namespaceDeclaration.AcceptChildren(this, data); -// } -// -// public virtual object VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression, object data) { -// Debug.Assert((objectCreateExpression != null)); -// Debug.Assert((objectCreateExpression.CreateType != null)); -// Debug.Assert((objectCreateExpression.Parameters != null)); -// Debug.Assert((objectCreateExpression.ObjectInitializer != null)); -// objectCreateExpression.CreateType.AcceptVisitor(this, data); -// foreach (Expression o in objectCreateExpression.Parameters) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return objectCreateExpression.ObjectInitializer.AcceptVisitor(this, data); -// } -// -// public virtual object VisitOnErrorStatement(OnErrorStatement onErrorStatement, object data) { -// Debug.Assert((onErrorStatement != null)); -// Debug.Assert((onErrorStatement.EmbeddedStatement != null)); -// return onErrorStatement.EmbeddedStatement.AcceptVisitor(this, data); -// } -// -// public virtual object VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration, object data) { -// Debug.Assert((operatorDeclaration != null)); -// Debug.Assert((operatorDeclaration.Attributes != null)); -// Debug.Assert((operatorDeclaration.Parameters != null)); -// Debug.Assert((operatorDeclaration.InterfaceImplementations != null)); -// Debug.Assert((operatorDeclaration.TypeReference != null)); -// Debug.Assert((operatorDeclaration.Body != null)); -// Debug.Assert((operatorDeclaration.Templates != null)); -// foreach (AttributeSection o in operatorDeclaration.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (ParameterDeclarationExpression o in operatorDeclaration.Parameters) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (InterfaceImplementation o in operatorDeclaration.InterfaceImplementations) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// operatorDeclaration.TypeReference.AcceptVisitor(this, data); -// operatorDeclaration.Body.AcceptVisitor(this, data); -// foreach (TemplateDefinition o in operatorDeclaration.Templates) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitOptionDeclaration(OptionDeclaration optionDeclaration, object data) { -// Debug.Assert((optionDeclaration != null)); -// return null; -// } -// -// public virtual object VisitParameterDeclarationExpression(ParameterDeclarationExpression parameterDeclarationExpression, object data) { -// Debug.Assert((parameterDeclarationExpression != null)); -// Debug.Assert((parameterDeclarationExpression.Attributes != null)); -// Debug.Assert((parameterDeclarationExpression.TypeReference != null)); -// Debug.Assert((parameterDeclarationExpression.DefaultValue != null)); -// foreach (AttributeSection o in parameterDeclarationExpression.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// parameterDeclarationExpression.TypeReference.AcceptVisitor(this, data); -// return parameterDeclarationExpression.DefaultValue.AcceptVisitor(this, data); -// } -// -// public virtual object VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression, object data) { -// Debug.Assert((parenthesizedExpression != null)); -// Debug.Assert((parenthesizedExpression.Expression != null)); -// return parenthesizedExpression.Expression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitPrimitiveExpression(PrimitiveExpression primitiveExpression, object data) { -// Debug.Assert((primitiveExpression != null)); -// return null; -// } -// -// public virtual object VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration, object data) { -// Debug.Assert((propertyDeclaration != null)); -// Debug.Assert((propertyDeclaration.Attributes != null)); -// Debug.Assert((propertyDeclaration.Parameters != null)); -// Debug.Assert((propertyDeclaration.InterfaceImplementations != null)); -// Debug.Assert((propertyDeclaration.TypeReference != null)); -// Debug.Assert((propertyDeclaration.GetRegion != null)); -// Debug.Assert((propertyDeclaration.SetRegion != null)); -// Debug.Assert((propertyDeclaration.Initializer != null)); -// foreach (AttributeSection o in propertyDeclaration.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (ParameterDeclarationExpression o in propertyDeclaration.Parameters) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (InterfaceImplementation o in propertyDeclaration.InterfaceImplementations) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// propertyDeclaration.TypeReference.AcceptVisitor(this, data); -// propertyDeclaration.GetRegion.AcceptVisitor(this, data); -// propertyDeclaration.SetRegion.AcceptVisitor(this, data); -// return propertyDeclaration.Initializer.AcceptVisitor(this, data); -// } -// -// public virtual object VisitPropertyGetRegion(PropertyGetRegion propertyGetRegion, object data) { -// Debug.Assert((propertyGetRegion != null)); -// Debug.Assert((propertyGetRegion.Attributes != null)); -// Debug.Assert((propertyGetRegion.Block != null)); -// foreach (AttributeSection o in propertyGetRegion.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return propertyGetRegion.Block.AcceptVisitor(this, data); -// } -// -// public virtual object VisitPropertySetRegion(PropertySetRegion propertySetRegion, object data) { -// Debug.Assert((propertySetRegion != null)); -// Debug.Assert((propertySetRegion.Attributes != null)); -// Debug.Assert((propertySetRegion.Block != null)); -// Debug.Assert((propertySetRegion.Parameters != null)); -// foreach (AttributeSection o in propertySetRegion.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// propertySetRegion.Block.AcceptVisitor(this, data); -// foreach (ParameterDeclarationExpression o in propertySetRegion.Parameters) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitQueryExpression(QueryExpression queryExpression, object data) { -// Debug.Assert((queryExpression != null)); -// Debug.Assert((queryExpression.Clauses != null)); -// foreach (QueryExpressionClause o in queryExpression.Clauses) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionAggregateClause(QueryExpressionAggregateClause queryExpressionAggregateClause, object data) { -// Debug.Assert((queryExpressionAggregateClause != null)); -// Debug.Assert((queryExpressionAggregateClause.Source != null)); -// Debug.Assert((queryExpressionAggregateClause.MiddleClauses != null)); -// Debug.Assert((queryExpressionAggregateClause.IntoVariables != null)); -// queryExpressionAggregateClause.Source.AcceptVisitor(this, data); -// foreach (QueryExpressionClause o in queryExpressionAggregateClause.MiddleClauses) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (ExpressionRangeVariable o in queryExpressionAggregateClause.IntoVariables) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionDistinctClause(QueryExpressionDistinctClause queryExpressionDistinctClause, object data) { -// Debug.Assert((queryExpressionDistinctClause != null)); -// return null; -// } -// -// public virtual object VisitQueryExpressionFromClause(QueryExpressionFromClause queryExpressionFromClause, object data) { -// Debug.Assert((queryExpressionFromClause != null)); -// Debug.Assert((queryExpressionFromClause.Sources != null)); -// foreach (CollectionRangeVariable o in queryExpressionFromClause.Sources) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionGroupClause(QueryExpressionGroupClause queryExpressionGroupClause, object data) { -// Debug.Assert((queryExpressionGroupClause != null)); -// Debug.Assert((queryExpressionGroupClause.Projection != null)); -// Debug.Assert((queryExpressionGroupClause.GroupBy != null)); -// queryExpressionGroupClause.Projection.AcceptVisitor(this, data); -// return queryExpressionGroupClause.GroupBy.AcceptVisitor(this, data); -// } -// -// public virtual object VisitQueryExpressionGroupJoinVBClause(QueryExpressionGroupJoinVBClause queryExpressionGroupJoinVBClause, object data) { -// Debug.Assert((queryExpressionGroupJoinVBClause != null)); -// Debug.Assert((queryExpressionGroupJoinVBClause.JoinClause != null)); -// Debug.Assert((queryExpressionGroupJoinVBClause.IntoVariables != null)); -// queryExpressionGroupJoinVBClause.JoinClause.AcceptVisitor(this, data); -// foreach (ExpressionRangeVariable o in queryExpressionGroupJoinVBClause.IntoVariables) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionGroupVBClause(QueryExpressionGroupVBClause queryExpressionGroupVBClause, object data) { -// Debug.Assert((queryExpressionGroupVBClause != null)); -// Debug.Assert((queryExpressionGroupVBClause.GroupVariables != null)); -// Debug.Assert((queryExpressionGroupVBClause.ByVariables != null)); -// Debug.Assert((queryExpressionGroupVBClause.IntoVariables != null)); -// foreach (ExpressionRangeVariable o in queryExpressionGroupVBClause.GroupVariables) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (ExpressionRangeVariable o in queryExpressionGroupVBClause.ByVariables) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (ExpressionRangeVariable o in queryExpressionGroupVBClause.IntoVariables) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionJoinClause(QueryExpressionJoinClause queryExpressionJoinClause, object data) { -// Debug.Assert((queryExpressionJoinClause != null)); -// Debug.Assert((queryExpressionJoinClause.OnExpression != null)); -// Debug.Assert((queryExpressionJoinClause.EqualsExpression != null)); -// Debug.Assert((queryExpressionJoinClause.Source != null)); -// queryExpressionJoinClause.OnExpression.AcceptVisitor(this, data); -// queryExpressionJoinClause.EqualsExpression.AcceptVisitor(this, data); -// return queryExpressionJoinClause.Source.AcceptVisitor(this, data); -// } -// -// public virtual object VisitQueryExpressionJoinConditionVB(QueryExpressionJoinConditionVB queryExpressionJoinConditionVB, object data) { -// Debug.Assert((queryExpressionJoinConditionVB != null)); -// Debug.Assert((queryExpressionJoinConditionVB.LeftSide != null)); -// Debug.Assert((queryExpressionJoinConditionVB.RightSide != null)); -// queryExpressionJoinConditionVB.LeftSide.AcceptVisitor(this, data); -// return queryExpressionJoinConditionVB.RightSide.AcceptVisitor(this, data); -// } -// -// public virtual object VisitQueryExpressionJoinVBClause(QueryExpressionJoinVBClause queryExpressionJoinVBClause, object data) { -// Debug.Assert((queryExpressionJoinVBClause != null)); -// Debug.Assert((queryExpressionJoinVBClause.JoinVariable != null)); -// Debug.Assert((queryExpressionJoinVBClause.SubJoin != null)); -// Debug.Assert((queryExpressionJoinVBClause.Conditions != null)); -// queryExpressionJoinVBClause.JoinVariable.AcceptVisitor(this, data); -// queryExpressionJoinVBClause.SubJoin.AcceptVisitor(this, data); -// foreach (QueryExpressionJoinConditionVB o in queryExpressionJoinVBClause.Conditions) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionLetClause(QueryExpressionLetClause queryExpressionLetClause, object data) { -// Debug.Assert((queryExpressionLetClause != null)); -// Debug.Assert((queryExpressionLetClause.Expression != null)); -// return queryExpressionLetClause.Expression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitQueryExpressionLetVBClause(QueryExpressionLetClause queryExpressionLetVBClause, object data) { -// Debug.Assert((queryExpressionLetVBClause != null)); -// Debug.Assert((queryExpressionLetVBClause.Variables != null)); -// foreach (ExpressionRangeVariable o in queryExpressionLetVBClause.Variables) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionOrderClause(QueryExpressionOrderClause queryExpressionOrderClause, object data) { -// Debug.Assert((queryExpressionOrderClause != null)); -// Debug.Assert((queryExpressionOrderClause.Orderings != null)); -// foreach (QueryExpressionOrdering o in queryExpressionOrderClause.Orderings) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionOrdering(QueryExpressionOrdering queryExpressionOrdering, object data) { -// Debug.Assert((queryExpressionOrdering != null)); -// Debug.Assert((queryExpressionOrdering.Criteria != null)); -// return queryExpressionOrdering.Criteria.AcceptVisitor(this, data); -// } -// -// public virtual object VisitQueryExpressionPartitionVBClause(QueryExpressionPartitionVBClause queryExpressionPartitionVBClause, object data) { -// Debug.Assert((queryExpressionPartitionVBClause != null)); -// Debug.Assert((queryExpressionPartitionVBClause.Expression != null)); -// return queryExpressionPartitionVBClause.Expression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitQueryExpressionSelectClause(QueryExpressionSelectClause queryExpressionSelectClause, object data) { -// Debug.Assert((queryExpressionSelectClause != null)); -// Debug.Assert((queryExpressionSelectClause.Projection != null)); -// return queryExpressionSelectClause.Projection.AcceptVisitor(this, data); -// } -// -// public virtual object VisitQueryExpressionSelectVBClause(QueryExpressionSelectVBClause queryExpressionSelectVBClause, object data) { -// Debug.Assert((queryExpressionSelectVBClause != null)); -// Debug.Assert((queryExpressionSelectVBClause.Variables != null)); -// foreach (ExpressionRangeVariable o in queryExpressionSelectVBClause.Variables) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitQueryExpressionWhereClause(QueryExpressionWhereClause queryExpressionWhereClause, object data) { -// Debug.Assert((queryExpressionWhereClause != null)); -// Debug.Assert((queryExpressionWhereClause.Condition != null)); -// return queryExpressionWhereClause.Condition.AcceptVisitor(this, data); -// } -// -// public virtual object VisitRaiseEventStatement(RaiseEventStatement raiseEventStatement, object data) { -// Debug.Assert((raiseEventStatement != null)); -// Debug.Assert((raiseEventStatement.Arguments != null)); -// foreach (Expression o in raiseEventStatement.Arguments) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitReDimStatement(ReDimStatement reDimStatement, object data) { -// Debug.Assert((reDimStatement != null)); -// Debug.Assert((reDimStatement.ReDimClauses != null)); -// foreach (InvocationExpression o in reDimStatement.ReDimClauses) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitRemoveHandlerStatement(RemoveHandlerStatement removeHandlerStatement, object data) { -// Debug.Assert((removeHandlerStatement != null)); -// Debug.Assert((removeHandlerStatement.EventExpression != null)); -// Debug.Assert((removeHandlerStatement.HandlerExpression != null)); -// removeHandlerStatement.EventExpression.AcceptVisitor(this, data); -// return removeHandlerStatement.HandlerExpression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitResumeStatement(ResumeStatement resumeStatement, object data) { -// Debug.Assert((resumeStatement != null)); -// return null; -// } -// -// public virtual object VisitReturnStatement(ReturnStatement returnStatement, object data) { -// Debug.Assert((returnStatement != null)); -// Debug.Assert((returnStatement.Expression != null)); -// return returnStatement.Expression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitStopStatement(StopStatement stopStatement, object data) { -// Debug.Assert((stopStatement != null)); -// return null; -// } -// -// public virtual object VisitSwitchSection(SwitchSection switchSection, object data) { -// Debug.Assert((switchSection != null)); -// Debug.Assert((switchSection.SwitchLabels != null)); -// foreach (CaseLabel o in switchSection.SwitchLabels) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return switchSection.AcceptChildren(this, data); -// } -// -// public virtual object VisitSwitchStatement(SwitchStatement switchStatement, object data) { -// Debug.Assert((switchStatement != null)); -// Debug.Assert((switchStatement.SwitchExpression != null)); -// Debug.Assert((switchStatement.SwitchSections != null)); -// switchStatement.SwitchExpression.AcceptVisitor(this, data); -// foreach (SwitchSection o in switchStatement.SwitchSections) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitTemplateDefinition(TemplateDefinition templateDefinition, object data) { -// Debug.Assert((templateDefinition != null)); -// Debug.Assert((templateDefinition.Attributes != null)); -// Debug.Assert((templateDefinition.Bases != null)); -// foreach (AttributeSection o in templateDefinition.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (TypeReference o in templateDefinition.Bases) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, object data) { -// Debug.Assert((thisReferenceExpression != null)); -// return null; -// } -// -// public virtual object VisitThrowStatement(ThrowStatement throwStatement, object data) { -// Debug.Assert((throwStatement != null)); -// Debug.Assert((throwStatement.Expression != null)); -// return throwStatement.Expression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitTryCatchStatement(TryCatchStatement tryCatchStatement, object data) { -// Debug.Assert((tryCatchStatement != null)); -// Debug.Assert((tryCatchStatement.StatementBlock != null)); -// Debug.Assert((tryCatchStatement.CatchClauses != null)); -// Debug.Assert((tryCatchStatement.FinallyBlock != null)); -// tryCatchStatement.StatementBlock.AcceptVisitor(this, data); -// foreach (CatchClause o in tryCatchStatement.CatchClauses) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return tryCatchStatement.FinallyBlock.AcceptVisitor(this, data); -// } -// -// public virtual object VisitTypeDeclaration(TypeDeclaration typeDeclaration, object data) { -// Debug.Assert((typeDeclaration != null)); -// Debug.Assert((typeDeclaration.Attributes != null)); -// Debug.Assert((typeDeclaration.BaseTypes != null)); -// Debug.Assert((typeDeclaration.Templates != null)); -// foreach (AttributeSection o in typeDeclaration.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (TypeReference o in typeDeclaration.BaseTypes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// foreach (TemplateDefinition o in typeDeclaration.Templates) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return typeDeclaration.AcceptChildren(this, data); -// } -// -// public virtual object VisitTypeOfExpression(TypeOfExpression typeOfExpression, object data) { -// Debug.Assert((typeOfExpression != null)); -// Debug.Assert((typeOfExpression.TypeReference != null)); -// return typeOfExpression.TypeReference.AcceptVisitor(this, data); -// } -// -// public virtual object VisitTypeOfIsExpression(TypeOfIsExpression typeOfIsExpression, object data) { -// Debug.Assert((typeOfIsExpression != null)); -// Debug.Assert((typeOfIsExpression.Expression != null)); -// Debug.Assert((typeOfIsExpression.TypeReference != null)); -// typeOfIsExpression.Expression.AcceptVisitor(this, data); -// return typeOfIsExpression.TypeReference.AcceptVisitor(this, data); -// } -// -// public virtual object VisitTypeReference(TypeReference typeReference, object data) { -// Debug.Assert((typeReference != null)); -// Debug.Assert((typeReference.GenericTypes != null)); -// foreach (TypeReference o in typeReference.GenericTypes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression, object data) { -// Debug.Assert((typeReferenceExpression != null)); -// Debug.Assert((typeReferenceExpression.TypeReference != null)); -// return typeReferenceExpression.TypeReference.AcceptVisitor(this, data); -// } -// -// public virtual object VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression, object data) { -// Debug.Assert((unaryOperatorExpression != null)); -// Debug.Assert((unaryOperatorExpression.Expression != null)); -// return unaryOperatorExpression.Expression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitUsing(ImportsClause @using, object data) { -// Debug.Assert((@using != null)); -// Debug.Assert((@using.Alias != null)); -// return @using.Alias.AcceptVisitor(this, data); -// } -// -// public virtual object VisitUsingDeclaration(ImportsStatement usingDeclaration, object data) { -// Debug.Assert((usingDeclaration != null)); -// Debug.Assert((usingDeclaration.ImportsClauses != null)); -// foreach (ImportsClause o in usingDeclaration.ImportsClauses) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitUsingStatement(UsingStatement usingStatement, object data) { -// Debug.Assert((usingStatement != null)); -// Debug.Assert((usingStatement.ResourceAcquisition != null)); -// Debug.Assert((usingStatement.EmbeddedStatement != null)); -// usingStatement.ResourceAcquisition.AcceptVisitor(this, data); -// return usingStatement.EmbeddedStatement.AcceptVisitor(this, data); -// } -// -// public virtual object VisitVariableDeclaration(VariableDeclaration variableDeclaration, object data) { -// Debug.Assert((variableDeclaration != null)); -// Debug.Assert((variableDeclaration.Initializer != null)); -// Debug.Assert((variableDeclaration.TypeReference != null)); -// Debug.Assert((variableDeclaration.FixedArrayInitialization != null)); -// variableDeclaration.Initializer.AcceptVisitor(this, data); -// variableDeclaration.TypeReference.AcceptVisitor(this, data); -// return variableDeclaration.FixedArrayInitialization.AcceptVisitor(this, data); -// } -// -// public virtual object VisitWithStatement(WithStatement withStatement, object data) { -// Debug.Assert((withStatement != null)); -// Debug.Assert((withStatement.Expression != null)); -// Debug.Assert((withStatement.Body != null)); -// withStatement.Expression.AcceptVisitor(this, data); -// return withStatement.Body.AcceptVisitor(this, data); -// } -// -// public virtual object VisitXmlAttributeExpression(XmlAttributeExpression xmlAttributeExpression, object data) { -// Debug.Assert((xmlAttributeExpression != null)); -// Debug.Assert((xmlAttributeExpression.ExpressionValue != null)); -// return xmlAttributeExpression.ExpressionValue.AcceptVisitor(this, data); -// } -// -// public virtual object VisitXmlContentExpression(XmlContentExpression xmlContentExpression, object data) { -// Debug.Assert((xmlContentExpression != null)); -// return null; -// } -// -// public virtual object VisitXmlDocumentExpression(XmlDocumentExpression xmlDocumentExpression, object data) { -// Debug.Assert((xmlDocumentExpression != null)); -// Debug.Assert((xmlDocumentExpression.Expressions != null)); -// foreach (XmlExpression o in xmlDocumentExpression.Expressions) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return null; -// } -// -// public virtual object VisitXmlElementExpression(XmlElementExpression xmlElementExpression, object data) { -// Debug.Assert((xmlElementExpression != null)); -// Debug.Assert((xmlElementExpression.Content != null)); -// Debug.Assert((xmlElementExpression.NameExpression != null)); -// Debug.Assert((xmlElementExpression.Attributes != null)); -// xmlElementExpression.Content.AcceptVisitor(this, data); -// xmlElementExpression.NameExpression.AcceptVisitor(this, data); -// foreach (XmlExpression o in xmlElementExpression.Attributes) { -// Debug.Assert(o != null); -// o.AcceptVisitor(this, data); -// } -// return xmlElementExpression.AcceptChildren(this, data); -// } -// -// public virtual object VisitXmlEmbeddedExpression(XmlEmbeddedExpression xmlEmbeddedExpression, object data) { -// Debug.Assert((xmlEmbeddedExpression != null)); -// Debug.Assert((xmlEmbeddedExpression.InlineVBExpression != null)); -// return xmlEmbeddedExpression.InlineVBExpression.AcceptVisitor(this, data); -// } -// -// public virtual object VisitXmlMemberAccessExpression(XmlMemberAccessExpression xmlMemberAccessExpression, object data) { -// Debug.Assert((xmlMemberAccessExpression != null)); -// Debug.Assert((xmlMemberAccessExpression.TargetObject != null)); -// return xmlMemberAccessExpression.TargetObject.AcceptVisitor(this, data); -// } -// } -} diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/Visitors/CSharpToVBConverterVisitor.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/Visitors/CSharpToVBConverterVisitor.cs index f2b8543b05..c515e28110 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/Visitors/CSharpToVBConverterVisitor.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/Visitors/CSharpToVBConverterVisitor.cs @@ -15,7 +15,7 @@ namespace ICSharpCode.NRefactory.VB.Visitors { string RootNamespace { get; } string GetTypeNameForAttribute(CSharp.Attribute attribute); - ClassType GetClassTypeForAstType(CSharp.AstType type); + TypeKind GetTypeKindForAstType(CSharp.AstType type); TypeCode ResolveExpression(CSharp.Expression expression); bool? IsReferenceType(CSharp.Expression expression); ITypeResolveContext ResolveContext { get; } @@ -881,7 +881,7 @@ namespace ICSharpCode.NRefactory.VB.Visitors if (typeDeclaration.BaseTypes.Any()) { var first = typeDeclaration.BaseTypes.First(); - if (provider.GetClassTypeForAstType(first) != ClassType.Interface) { + if (provider.GetTypeKindForAstType(first) != TypeKind.Interface) { ConvertNodes(typeDeclaration.BaseTypes.Skip(1), type.ImplementsTypes); type.InheritsType = (AstType)first.AcceptVisitor(this, data); } else @@ -1369,11 +1369,11 @@ namespace ICSharpCode.NRefactory.VB.Visitors return EndNode(yieldBreakStatement, new ReturnStatement()); } - public AstNode VisitYieldStatement(CSharp.YieldStatement yieldStatement, object data) + public AstNode VisitYieldReturnStatement(CSharp.YieldReturnStatement yieldReturnStatement, object data) { var frame = members.Peek(); frame.inIterator = true; - return EndNode(yieldStatement, new YieldStatement((Expression)yieldStatement.Expression.AcceptVisitor(this, data))); + return EndNode(yieldReturnStatement, new YieldStatement((Expression)yieldReturnStatement.Expression.AcceptVisitor(this, data))); } public AstNode VisitAccessor(CSharp.Accessor accessor, object data) @@ -1822,11 +1822,9 @@ namespace ICSharpCode.NRefactory.VB.Visitors ConvertNodes(parameterDeclaration.Attributes, param.Attributes); param.Modifiers = ConvertParamModifiers(parameterDeclaration.ParameterModifier); - if ((param.Modifiers & Modifiers.None) == Modifiers.None) - param.Modifiers = Modifiers.ByVal; if ((parameterDeclaration.ParameterModifier & ICSharpCode.NRefactory.CSharp.ParameterModifier.Out) == ICSharpCode.NRefactory.CSharp.ParameterModifier.Out) { AttributeBlock block = new AttributeBlock(); - block.Attributes.Add(new Ast.Attribute() { Type = new SimpleType("System.Runtime.InteropServices.OutAttribute") }); + block.Attributes.Add(new Ast.Attribute() { Type = new SimpleType("Out") }); param.Attributes.Add(block); } param.Name = new Identifier(parameterDeclaration.Name, TextLocation.Empty); @@ -1845,7 +1843,6 @@ namespace ICSharpCode.NRefactory.VB.Visitors case ICSharpCode.NRefactory.CSharp.ParameterModifier.This: return Modifiers.None; case ICSharpCode.NRefactory.CSharp.ParameterModifier.Ref: - return Modifiers.ByRef; case ICSharpCode.NRefactory.CSharp.ParameterModifier.Out: return Modifiers.ByRef; case ICSharpCode.NRefactory.CSharp.ParameterModifier.Params: @@ -2126,6 +2123,10 @@ namespace ICSharpCode.NRefactory.VB.Visitors if (readable && !writeable) mod |= Modifiers.ReadOnly; + if ((modifier & CSharp.Modifiers.Override) == CSharp.Modifiers.Override) + mod |= Modifiers.Override; + if ((modifier & CSharp.Modifiers.Virtual) == CSharp.Modifiers.Virtual) + mod |= Modifiers.Overridable; return mod; } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/Visitors/NodeTrackingAstVisitor.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/Visitors/NodeTrackingAstVisitor.cs deleted file mode 100644 index a94cb0333e..0000000000 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.VB/Visitors/NodeTrackingAstVisitor.cs +++ /dev/null @@ -1,1266 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.1 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace ICSharpCode.NRefactory.VB.Visitors { - using System; - using ICSharpCode.NRefactory.VB.Ast; - - - /// - /// The NodeTrackingAstVisitor will iterate through the whole Ast, - /// just like the AbstractAstVisitor, and calls the virtual methods - /// BeginVisit and EndVisit for each node being visited. - /// - /// - /// base.Visit(node, data) calls this.TrackedVisit(node, data), so if - /// you want to visit child nodes using the default visiting behaviour, - /// use base.TrackedVisit(parentNode, data). - /// -// public abstract class NodeTrackingAstVisitor : AbstractAstVisitor { -// -// protected virtual void BeginVisit(INode node) { -// } -// -// protected virtual void EndVisit(INode node) { -// } -// -// public sealed override object VisitAddHandlerStatement(AddHandlerStatement addHandlerStatement, object data) { -// this.BeginVisit(addHandlerStatement); -// object result = this.TrackedVisitAddHandlerStatement(addHandlerStatement, data); -// this.EndVisit(addHandlerStatement); -// return result; -// } -// -// public sealed override object VisitAddressOfExpression(AddressOfExpression addressOfExpression, object data) { -// this.BeginVisit(addressOfExpression); -// object result = this.TrackedVisitAddressOfExpression(addressOfExpression, data); -// this.EndVisit(addressOfExpression); -// return result; -// } -// -// public sealed override object VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, object data) { -// this.BeginVisit(arrayCreateExpression); -// object result = this.TrackedVisitArrayCreateExpression(arrayCreateExpression, data); -// this.EndVisit(arrayCreateExpression); -// return result; -// } -// -// public sealed override object VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data) { -// this.BeginVisit(assignmentExpression); -// object result = this.TrackedVisitAssignmentExpression(assignmentExpression, data); -// this.EndVisit(assignmentExpression); -// return result; -// } -// -// public sealed override object VisitAttribute(ICSharpCode.NRefactory.VB.Ast.Attribute attribute, object data) { -// this.BeginVisit(attribute); -// object result = this.TrackedVisitAttribute(attribute, data); -// this.EndVisit(attribute); -// return result; -// } -// -// public sealed override object VisitAttributeSection(AttributeSection attributeSection, object data) { -// this.BeginVisit(attributeSection); -// object result = this.TrackedVisitAttributeSection(attributeSection, data); -// this.EndVisit(attributeSection); -// return result; -// } -// -// public sealed override object VisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression, object data) { -// this.BeginVisit(baseReferenceExpression); -// object result = this.TrackedVisitBaseReferenceExpression(baseReferenceExpression, data); -// this.EndVisit(baseReferenceExpression); -// return result; -// } -// -// public sealed override object VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression, object data) { -// this.BeginVisit(binaryOperatorExpression); -// object result = this.TrackedVisitBinaryOperatorExpression(binaryOperatorExpression, data); -// this.EndVisit(binaryOperatorExpression); -// return result; -// } -// -// public sealed override object VisitBlockStatement(BlockStatement blockStatement, object data) { -// this.BeginVisit(blockStatement); -// object result = this.TrackedVisitBlockStatement(blockStatement, data); -// this.EndVisit(blockStatement); -// return result; -// } -// -// public sealed override object VisitCaseLabel(CaseLabel caseLabel, object data) { -// this.BeginVisit(caseLabel); -// object result = this.TrackedVisitCaseLabel(caseLabel, data); -// this.EndVisit(caseLabel); -// return result; -// } -// -// public sealed override object VisitCastExpression(CastExpression castExpression, object data) { -// this.BeginVisit(castExpression); -// object result = this.TrackedVisitCastExpression(castExpression, data); -// this.EndVisit(castExpression); -// return result; -// } -// -// public sealed override object VisitCatchClause(CatchClause catchClause, object data) { -// this.BeginVisit(catchClause); -// object result = this.TrackedVisitCatchClause(catchClause, data); -// this.EndVisit(catchClause); -// return result; -// } -// -// public sealed override object VisitClassReferenceExpression(ClassReferenceExpression classReferenceExpression, object data) { -// this.BeginVisit(classReferenceExpression); -// object result = this.TrackedVisitClassReferenceExpression(classReferenceExpression, data); -// this.EndVisit(classReferenceExpression); -// return result; -// } -// -// public sealed override object VisitCollectionInitializerExpression(CollectionInitializerExpression collectionInitializerExpression, object data) { -// this.BeginVisit(collectionInitializerExpression); -// object result = this.TrackedVisitCollectionInitializerExpression(collectionInitializerExpression, data); -// this.EndVisit(collectionInitializerExpression); -// return result; -// } -// -// public sealed override object VisitCollectionRangeVariable(CollectionRangeVariable collectionRangeVariable, object data) { -// this.BeginVisit(collectionRangeVariable); -// object result = this.TrackedVisitCollectionRangeVariable(collectionRangeVariable, data); -// this.EndVisit(collectionRangeVariable); -// return result; -// } -// -// public sealed override object VisitCompilationUnit(CompilationUnit compilationUnit, object data) { -// this.BeginVisit(compilationUnit); -// object result = this.TrackedVisitCompilationUnit(compilationUnit, data); -// this.EndVisit(compilationUnit); -// return result; -// } -// -// public sealed override object VisitConditionalExpression(ConditionalExpression conditionalExpression, object data) { -// this.BeginVisit(conditionalExpression); -// object result = this.TrackedVisitConditionalExpression(conditionalExpression, data); -// this.EndVisit(conditionalExpression); -// return result; -// } -// -// public sealed override object VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration, object data) { -// this.BeginVisit(constructorDeclaration); -// object result = this.TrackedVisitConstructorDeclaration(constructorDeclaration, data); -// this.EndVisit(constructorDeclaration); -// return result; -// } -// -// public sealed override object VisitConstructorInitializer(ConstructorInitializer constructorInitializer, object data) { -// this.BeginVisit(constructorInitializer); -// object result = this.TrackedVisitConstructorInitializer(constructorInitializer, data); -// this.EndVisit(constructorInitializer); -// return result; -// } -// -// public sealed override object VisitContinueStatement(ContinueStatement continueStatement, object data) { -// this.BeginVisit(continueStatement); -// object result = this.TrackedVisitContinueStatement(continueStatement, data); -// this.EndVisit(continueStatement); -// return result; -// } -// -// public sealed override object VisitDeclareDeclaration(DeclareDeclaration declareDeclaration, object data) { -// this.BeginVisit(declareDeclaration); -// object result = this.TrackedVisitDeclareDeclaration(declareDeclaration, data); -// this.EndVisit(declareDeclaration); -// return result; -// } -// -// public sealed override object VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression, object data) { -// this.BeginVisit(defaultValueExpression); -// object result = this.TrackedVisitDefaultValueExpression(defaultValueExpression, data); -// this.EndVisit(defaultValueExpression); -// return result; -// } -// -// public sealed override object VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration, object data) { -// this.BeginVisit(delegateDeclaration); -// object result = this.TrackedVisitDelegateDeclaration(delegateDeclaration, data); -// this.EndVisit(delegateDeclaration); -// return result; -// } -// -// public sealed override object VisitDirectionExpression(DirectionExpression directionExpression, object data) { -// this.BeginVisit(directionExpression); -// object result = this.TrackedVisitDirectionExpression(directionExpression, data); -// this.EndVisit(directionExpression); -// return result; -// } -// -// public sealed override object VisitDoLoopStatement(DoLoopStatement doLoopStatement, object data) { -// this.BeginVisit(doLoopStatement); -// object result = this.TrackedVisitDoLoopStatement(doLoopStatement, data); -// this.EndVisit(doLoopStatement); -// return result; -// } -// -// public sealed override object VisitElseIfSection(ElseIfSection elseIfSection, object data) { -// this.BeginVisit(elseIfSection); -// object result = this.TrackedVisitElseIfSection(elseIfSection, data); -// this.EndVisit(elseIfSection); -// return result; -// } -// -// public sealed override object VisitEndStatement(EndStatement endStatement, object data) { -// this.BeginVisit(endStatement); -// object result = this.TrackedVisitEndStatement(endStatement, data); -// this.EndVisit(endStatement); -// return result; -// } -// -// public sealed override object VisitEraseStatement(EraseStatement eraseStatement, object data) { -// this.BeginVisit(eraseStatement); -// object result = this.TrackedVisitEraseStatement(eraseStatement, data); -// this.EndVisit(eraseStatement); -// return result; -// } -// -// public sealed override object VisitErrorStatement(ErrorStatement errorStatement, object data) { -// this.BeginVisit(errorStatement); -// object result = this.TrackedVisitErrorStatement(errorStatement, data); -// this.EndVisit(errorStatement); -// return result; -// } -// -// public sealed override object VisitEventAddRegion(EventAddRegion eventAddRegion, object data) { -// this.BeginVisit(eventAddRegion); -// object result = this.TrackedVisitEventAddRegion(eventAddRegion, data); -// this.EndVisit(eventAddRegion); -// return result; -// } -// -// public sealed override object VisitEventDeclaration(EventDeclaration eventDeclaration, object data) { -// this.BeginVisit(eventDeclaration); -// object result = this.TrackedVisitEventDeclaration(eventDeclaration, data); -// this.EndVisit(eventDeclaration); -// return result; -// } -// -// public sealed override object VisitEventRaiseRegion(EventRaiseRegion eventRaiseRegion, object data) { -// this.BeginVisit(eventRaiseRegion); -// object result = this.TrackedVisitEventRaiseRegion(eventRaiseRegion, data); -// this.EndVisit(eventRaiseRegion); -// return result; -// } -// -// public sealed override object VisitEventRemoveRegion(EventRemoveRegion eventRemoveRegion, object data) { -// this.BeginVisit(eventRemoveRegion); -// object result = this.TrackedVisitEventRemoveRegion(eventRemoveRegion, data); -// this.EndVisit(eventRemoveRegion); -// return result; -// } -// -// public sealed override object VisitExitStatement(ExitStatement exitStatement, object data) { -// this.BeginVisit(exitStatement); -// object result = this.TrackedVisitExitStatement(exitStatement, data); -// this.EndVisit(exitStatement); -// return result; -// } -// -// public sealed override object VisitExpressionRangeVariable(ExpressionRangeVariable expressionRangeVariable, object data) { -// this.BeginVisit(expressionRangeVariable); -// object result = this.TrackedVisitExpressionRangeVariable(expressionRangeVariable, data); -// this.EndVisit(expressionRangeVariable); -// return result; -// } -// -// public sealed override object VisitExpressionStatement(ExpressionStatement expressionStatement, object data) { -// this.BeginVisit(expressionStatement); -// object result = this.TrackedVisitExpressionStatement(expressionStatement, data); -// this.EndVisit(expressionStatement); -// return result; -// } -// -// public sealed override object VisitExternAliasDirective(ExternAliasDirective externAliasDirective, object data) { -// this.BeginVisit(externAliasDirective); -// object result = this.TrackedVisitExternAliasDirective(externAliasDirective, data); -// this.EndVisit(externAliasDirective); -// return result; -// } -// -// public sealed override object VisitFieldDeclaration(FieldDeclaration fieldDeclaration, object data) { -// this.BeginVisit(fieldDeclaration); -// object result = this.TrackedVisitFieldDeclaration(fieldDeclaration, data); -// this.EndVisit(fieldDeclaration); -// return result; -// } -// -// public sealed override object VisitForeachStatement(ForeachStatement foreachStatement, object data) { -// this.BeginVisit(foreachStatement); -// object result = this.TrackedVisitForeachStatement(foreachStatement, data); -// this.EndVisit(foreachStatement); -// return result; -// } -// -// public sealed override object VisitForNextStatement(ForNextStatement forNextStatement, object data) { -// this.BeginVisit(forNextStatement); -// object result = this.TrackedVisitForNextStatement(forNextStatement, data); -// this.EndVisit(forNextStatement); -// return result; -// } -// -// public sealed override object VisitGotoStatement(GotoStatement gotoStatement, object data) { -// this.BeginVisit(gotoStatement); -// object result = this.TrackedVisitGotoStatement(gotoStatement, data); -// this.EndVisit(gotoStatement); -// return result; -// } -// -// public sealed override object VisitIdentifierExpression(SimpleNameExpression identifierExpression, object data) { -// this.BeginVisit(identifierExpression); -// object result = this.TrackedVisitIdentifierExpression(identifierExpression, data); -// this.EndVisit(identifierExpression); -// return result; -// } -// -// public sealed override object VisitIfElseStatement(IfElseStatement ifElseStatement, object data) { -// this.BeginVisit(ifElseStatement); -// object result = this.TrackedVisitIfElseStatement(ifElseStatement, data); -// this.EndVisit(ifElseStatement); -// return result; -// } -// -// public sealed override object VisitInnerClassTypeReference(InnerClassTypeReference innerClassTypeReference, object data) { -// this.BeginVisit(innerClassTypeReference); -// object result = this.TrackedVisitInnerClassTypeReference(innerClassTypeReference, data); -// this.EndVisit(innerClassTypeReference); -// return result; -// } -// -// public sealed override object VisitInterfaceImplementation(InterfaceImplementation interfaceImplementation, object data) { -// this.BeginVisit(interfaceImplementation); -// object result = this.TrackedVisitInterfaceImplementation(interfaceImplementation, data); -// this.EndVisit(interfaceImplementation); -// return result; -// } -// -// public sealed override object VisitInvocationExpression(InvocationExpression invocationExpression, object data) { -// this.BeginVisit(invocationExpression); -// object result = this.TrackedVisitInvocationExpression(invocationExpression, data); -// this.EndVisit(invocationExpression); -// return result; -// } -// -// public sealed override object VisitLabelStatement(LabelStatement labelStatement, object data) { -// this.BeginVisit(labelStatement); -// object result = this.TrackedVisitLabelStatement(labelStatement, data); -// this.EndVisit(labelStatement); -// return result; -// } -// -// public sealed override object VisitLambdaExpression(LambdaExpression lambdaExpression, object data) { -// this.BeginVisit(lambdaExpression); -// object result = this.TrackedVisitLambdaExpression(lambdaExpression, data); -// this.EndVisit(lambdaExpression); -// return result; -// } -// -// public sealed override object VisitLocalVariableDeclaration(LocalVariableDeclaration localVariableDeclaration, object data) { -// this.BeginVisit(localVariableDeclaration); -// object result = this.TrackedVisitLocalVariableDeclaration(localVariableDeclaration, data); -// this.EndVisit(localVariableDeclaration); -// return result; -// } -// -// public sealed override object VisitLockStatement(LockStatement lockStatement, object data) { -// this.BeginVisit(lockStatement); -// object result = this.TrackedVisitLockStatement(lockStatement, data); -// this.EndVisit(lockStatement); -// return result; -// } -// -// public sealed override object VisitMemberInitializerExpression(MemberInitializerExpression memberInitializerExpression, object data) { -// this.BeginVisit(memberInitializerExpression); -// object result = this.TrackedVisitMemberInitializerExpression(memberInitializerExpression, data); -// this.EndVisit(memberInitializerExpression); -// return result; -// } -// -// public sealed override object VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression, object data) { -// this.BeginVisit(memberReferenceExpression); -// object result = this.TrackedVisitMemberReferenceExpression(memberReferenceExpression, data); -// this.EndVisit(memberReferenceExpression); -// return result; -// } -// -// public sealed override object VisitMethodDeclaration(MethodDeclaration methodDeclaration, object data) { -// this.BeginVisit(methodDeclaration); -// object result = this.TrackedVisitMethodDeclaration(methodDeclaration, data); -// this.EndVisit(methodDeclaration); -// return result; -// } -// -// public sealed override object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data) { -// this.BeginVisit(namedArgumentExpression); -// object result = this.TrackedVisitNamedArgumentExpression(namedArgumentExpression, data); -// this.EndVisit(namedArgumentExpression); -// return result; -// } -// -// public sealed override object VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data) { -// this.BeginVisit(namespaceDeclaration); -// object result = this.TrackedVisitNamespaceDeclaration(namespaceDeclaration, data); -// this.EndVisit(namespaceDeclaration); -// return result; -// } -// -// public sealed override object VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression, object data) { -// this.BeginVisit(objectCreateExpression); -// object result = this.TrackedVisitObjectCreateExpression(objectCreateExpression, data); -// this.EndVisit(objectCreateExpression); -// return result; -// } -// -// public sealed override object VisitOnErrorStatement(OnErrorStatement onErrorStatement, object data) { -// this.BeginVisit(onErrorStatement); -// object result = this.TrackedVisitOnErrorStatement(onErrorStatement, data); -// this.EndVisit(onErrorStatement); -// return result; -// } -// -// public sealed override object VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration, object data) { -// this.BeginVisit(operatorDeclaration); -// object result = this.TrackedVisitOperatorDeclaration(operatorDeclaration, data); -// this.EndVisit(operatorDeclaration); -// return result; -// } -// -// public sealed override object VisitOptionDeclaration(OptionDeclaration optionDeclaration, object data) { -// this.BeginVisit(optionDeclaration); -// object result = this.TrackedVisitOptionDeclaration(optionDeclaration, data); -// this.EndVisit(optionDeclaration); -// return result; -// } -// -// public sealed override object VisitParameterDeclarationExpression(ParameterDeclarationExpression parameterDeclarationExpression, object data) { -// this.BeginVisit(parameterDeclarationExpression); -// object result = this.TrackedVisitParameterDeclarationExpression(parameterDeclarationExpression, data); -// this.EndVisit(parameterDeclarationExpression); -// return result; -// } -// -// public sealed override object VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression, object data) { -// this.BeginVisit(parenthesizedExpression); -// object result = this.TrackedVisitParenthesizedExpression(parenthesizedExpression, data); -// this.EndVisit(parenthesizedExpression); -// return result; -// } -// -// public sealed override object VisitPrimitiveExpression(PrimitiveExpression primitiveExpression, object data) { -// this.BeginVisit(primitiveExpression); -// object result = this.TrackedVisitPrimitiveExpression(primitiveExpression, data); -// this.EndVisit(primitiveExpression); -// return result; -// } -// -// public sealed override object VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration, object data) { -// this.BeginVisit(propertyDeclaration); -// object result = this.TrackedVisitPropertyDeclaration(propertyDeclaration, data); -// this.EndVisit(propertyDeclaration); -// return result; -// } -// -// public sealed override object VisitPropertyGetRegion(PropertyGetRegion propertyGetRegion, object data) { -// this.BeginVisit(propertyGetRegion); -// object result = this.TrackedVisitPropertyGetRegion(propertyGetRegion, data); -// this.EndVisit(propertyGetRegion); -// return result; -// } -// -// public sealed override object VisitPropertySetRegion(PropertySetRegion propertySetRegion, object data) { -// this.BeginVisit(propertySetRegion); -// object result = this.TrackedVisitPropertySetRegion(propertySetRegion, data); -// this.EndVisit(propertySetRegion); -// return result; -// } -// -// public sealed override object VisitQueryExpression(QueryExpression queryExpression, object data) { -// this.BeginVisit(queryExpression); -// object result = this.TrackedVisitQueryExpression(queryExpression, data); -// this.EndVisit(queryExpression); -// return result; -// } -// -// public sealed override object VisitQueryExpressionAggregateClause(QueryExpressionAggregateClause queryExpressionAggregateClause, object data) { -// this.BeginVisit(queryExpressionAggregateClause); -// object result = this.TrackedVisitQueryExpressionAggregateClause(queryExpressionAggregateClause, data); -// this.EndVisit(queryExpressionAggregateClause); -// return result; -// } -// -// public sealed override object VisitQueryExpressionDistinctClause(QueryExpressionDistinctClause queryExpressionDistinctClause, object data) { -// this.BeginVisit(queryExpressionDistinctClause); -// object result = this.TrackedVisitQueryExpressionDistinctClause(queryExpressionDistinctClause, data); -// this.EndVisit(queryExpressionDistinctClause); -// return result; -// } -// -// public sealed override object VisitQueryExpressionFromClause(QueryExpressionFromClause queryExpressionFromClause, object data) { -// this.BeginVisit(queryExpressionFromClause); -// object result = this.TrackedVisitQueryExpressionFromClause(queryExpressionFromClause, data); -// this.EndVisit(queryExpressionFromClause); -// return result; -// } -// -// public sealed override object VisitQueryExpressionGroupClause(QueryExpressionGroupClause queryExpressionGroupClause, object data) { -// this.BeginVisit(queryExpressionGroupClause); -// object result = this.TrackedVisitQueryExpressionGroupClause(queryExpressionGroupClause, data); -// this.EndVisit(queryExpressionGroupClause); -// return result; -// } -// -// public sealed override object VisitQueryExpressionGroupJoinVBClause(QueryExpressionGroupJoinVBClause queryExpressionGroupJoinVBClause, object data) { -// this.BeginVisit(queryExpressionGroupJoinVBClause); -// object result = this.TrackedVisitQueryExpressionGroupJoinVBClause(queryExpressionGroupJoinVBClause, data); -// this.EndVisit(queryExpressionGroupJoinVBClause); -// return result; -// } -// -// public sealed override object VisitQueryExpressionGroupVBClause(QueryExpressionGroupVBClause queryExpressionGroupVBClause, object data) { -// this.BeginVisit(queryExpressionGroupVBClause); -// object result = this.TrackedVisitQueryExpressionGroupVBClause(queryExpressionGroupVBClause, data); -// this.EndVisit(queryExpressionGroupVBClause); -// return result; -// } -// -// public sealed override object VisitQueryExpressionJoinClause(QueryExpressionJoinClause queryExpressionJoinClause, object data) { -// this.BeginVisit(queryExpressionJoinClause); -// object result = this.TrackedVisitQueryExpressionJoinClause(queryExpressionJoinClause, data); -// this.EndVisit(queryExpressionJoinClause); -// return result; -// } -// -// public sealed override object VisitQueryExpressionJoinConditionVB(QueryExpressionJoinConditionVB queryExpressionJoinConditionVB, object data) { -// this.BeginVisit(queryExpressionJoinConditionVB); -// object result = this.TrackedVisitQueryExpressionJoinConditionVB(queryExpressionJoinConditionVB, data); -// this.EndVisit(queryExpressionJoinConditionVB); -// return result; -// } -// -// public sealed override object VisitQueryExpressionJoinVBClause(QueryExpressionJoinVBClause queryExpressionJoinVBClause, object data) { -// this.BeginVisit(queryExpressionJoinVBClause); -// object result = this.TrackedVisitQueryExpressionJoinVBClause(queryExpressionJoinVBClause, data); -// this.EndVisit(queryExpressionJoinVBClause); -// return result; -// } -// -// public sealed override object VisitQueryExpressionLetClause(QueryExpressionLetClause queryExpressionLetClause, object data) { -// this.BeginVisit(queryExpressionLetClause); -// object result = this.TrackedVisitQueryExpressionLetClause(queryExpressionLetClause, data); -// this.EndVisit(queryExpressionLetClause); -// return result; -// } -// -// public sealed override object VisitQueryExpressionLetVBClause(QueryExpressionLetClause queryExpressionLetVBClause, object data) { -// this.BeginVisit(queryExpressionLetVBClause); -// object result = this.TrackedVisitQueryExpressionLetVBClause(queryExpressionLetVBClause, data); -// this.EndVisit(queryExpressionLetVBClause); -// return result; -// } -// -// public sealed override object VisitQueryExpressionOrderClause(QueryExpressionOrderClause queryExpressionOrderClause, object data) { -// this.BeginVisit(queryExpressionOrderClause); -// object result = this.TrackedVisitQueryExpressionOrderClause(queryExpressionOrderClause, data); -// this.EndVisit(queryExpressionOrderClause); -// return result; -// } -// -// public sealed override object VisitQueryExpressionOrdering(QueryExpressionOrdering queryExpressionOrdering, object data) { -// this.BeginVisit(queryExpressionOrdering); -// object result = this.TrackedVisitQueryExpressionOrdering(queryExpressionOrdering, data); -// this.EndVisit(queryExpressionOrdering); -// return result; -// } -// -// public sealed override object VisitQueryExpressionPartitionVBClause(QueryExpressionPartitionVBClause queryExpressionPartitionVBClause, object data) { -// this.BeginVisit(queryExpressionPartitionVBClause); -// object result = this.TrackedVisitQueryExpressionPartitionVBClause(queryExpressionPartitionVBClause, data); -// this.EndVisit(queryExpressionPartitionVBClause); -// return result; -// } -// -// public sealed override object VisitQueryExpressionSelectClause(QueryExpressionSelectClause queryExpressionSelectClause, object data) { -// this.BeginVisit(queryExpressionSelectClause); -// object result = this.TrackedVisitQueryExpressionSelectClause(queryExpressionSelectClause, data); -// this.EndVisit(queryExpressionSelectClause); -// return result; -// } -// -// public sealed override object VisitQueryExpressionSelectVBClause(QueryExpressionSelectVBClause queryExpressionSelectVBClause, object data) { -// this.BeginVisit(queryExpressionSelectVBClause); -// object result = this.TrackedVisitQueryExpressionSelectVBClause(queryExpressionSelectVBClause, data); -// this.EndVisit(queryExpressionSelectVBClause); -// return result; -// } -// -// public sealed override object VisitQueryExpressionWhereClause(QueryExpressionWhereClause queryExpressionWhereClause, object data) { -// this.BeginVisit(queryExpressionWhereClause); -// object result = this.TrackedVisitQueryExpressionWhereClause(queryExpressionWhereClause, data); -// this.EndVisit(queryExpressionWhereClause); -// return result; -// } -// -// public sealed override object VisitRaiseEventStatement(RaiseEventStatement raiseEventStatement, object data) { -// this.BeginVisit(raiseEventStatement); -// object result = this.TrackedVisitRaiseEventStatement(raiseEventStatement, data); -// this.EndVisit(raiseEventStatement); -// return result; -// } -// -// public sealed override object VisitReDimStatement(ReDimStatement reDimStatement, object data) { -// this.BeginVisit(reDimStatement); -// object result = this.TrackedVisitReDimStatement(reDimStatement, data); -// this.EndVisit(reDimStatement); -// return result; -// } -// -// public sealed override object VisitRemoveHandlerStatement(RemoveHandlerStatement removeHandlerStatement, object data) { -// this.BeginVisit(removeHandlerStatement); -// object result = this.TrackedVisitRemoveHandlerStatement(removeHandlerStatement, data); -// this.EndVisit(removeHandlerStatement); -// return result; -// } -// -// public sealed override object VisitResumeStatement(ResumeStatement resumeStatement, object data) { -// this.BeginVisit(resumeStatement); -// object result = this.TrackedVisitResumeStatement(resumeStatement, data); -// this.EndVisit(resumeStatement); -// return result; -// } -// -// public sealed override object VisitReturnStatement(ReturnStatement returnStatement, object data) { -// this.BeginVisit(returnStatement); -// object result = this.TrackedVisitReturnStatement(returnStatement, data); -// this.EndVisit(returnStatement); -// return result; -// } -// -// public sealed override object VisitStopStatement(StopStatement stopStatement, object data) { -// this.BeginVisit(stopStatement); -// object result = this.TrackedVisitStopStatement(stopStatement, data); -// this.EndVisit(stopStatement); -// return result; -// } -// -// public sealed override object VisitSwitchSection(SwitchSection switchSection, object data) { -// this.BeginVisit(switchSection); -// object result = this.TrackedVisitSwitchSection(switchSection, data); -// this.EndVisit(switchSection); -// return result; -// } -// -// public sealed override object VisitSwitchStatement(SwitchStatement switchStatement, object data) { -// this.BeginVisit(switchStatement); -// object result = this.TrackedVisitSwitchStatement(switchStatement, data); -// this.EndVisit(switchStatement); -// return result; -// } -// -// public sealed override object VisitTemplateDefinition(TemplateDefinition templateDefinition, object data) { -// this.BeginVisit(templateDefinition); -// object result = this.TrackedVisitTemplateDefinition(templateDefinition, data); -// this.EndVisit(templateDefinition); -// return result; -// } -// -// public sealed override object VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, object data) { -// this.BeginVisit(thisReferenceExpression); -// object result = this.TrackedVisitThisReferenceExpression(thisReferenceExpression, data); -// this.EndVisit(thisReferenceExpression); -// return result; -// } -// -// public sealed override object VisitThrowStatement(ThrowStatement throwStatement, object data) { -// this.BeginVisit(throwStatement); -// object result = this.TrackedVisitThrowStatement(throwStatement, data); -// this.EndVisit(throwStatement); -// return result; -// } -// -// public sealed override object VisitTryCatchStatement(TryCatchStatement tryCatchStatement, object data) { -// this.BeginVisit(tryCatchStatement); -// object result = this.TrackedVisitTryCatchStatement(tryCatchStatement, data); -// this.EndVisit(tryCatchStatement); -// return result; -// } -// -// public sealed override object VisitTypeDeclaration(TypeDeclaration typeDeclaration, object data) { -// this.BeginVisit(typeDeclaration); -// object result = this.TrackedVisitTypeDeclaration(typeDeclaration, data); -// this.EndVisit(typeDeclaration); -// return result; -// } -// -// public sealed override object VisitTypeOfExpression(TypeOfExpression typeOfExpression, object data) { -// this.BeginVisit(typeOfExpression); -// object result = this.TrackedVisitTypeOfExpression(typeOfExpression, data); -// this.EndVisit(typeOfExpression); -// return result; -// } -// -// public sealed override object VisitTypeOfIsExpression(TypeOfIsExpression typeOfIsExpression, object data) { -// this.BeginVisit(typeOfIsExpression); -// object result = this.TrackedVisitTypeOfIsExpression(typeOfIsExpression, data); -// this.EndVisit(typeOfIsExpression); -// return result; -// } -// -// public sealed override object VisitTypeReference(TypeReference typeReference, object data) { -// this.BeginVisit(typeReference); -// object result = this.TrackedVisitTypeReference(typeReference, data); -// this.EndVisit(typeReference); -// return result; -// } -// -// public sealed override object VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression, object data) { -// this.BeginVisit(typeReferenceExpression); -// object result = this.TrackedVisitTypeReferenceExpression(typeReferenceExpression, data); -// this.EndVisit(typeReferenceExpression); -// return result; -// } -// -// public sealed override object VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression, object data) { -// this.BeginVisit(unaryOperatorExpression); -// object result = this.TrackedVisitUnaryOperatorExpression(unaryOperatorExpression, data); -// this.EndVisit(unaryOperatorExpression); -// return result; -// } -// -// public sealed override object VisitUsing(ImportsClause @using, object data) { -// this.BeginVisit(@using); -// object result = this.TrackedVisitUsing(@using, data); -// this.EndVisit(@using); -// return result; -// } -// -// public sealed override object VisitUsingDeclaration(ImportsStatement usingDeclaration, object data) { -// this.BeginVisit(usingDeclaration); -// object result = this.TrackedVisitUsingDeclaration(usingDeclaration, data); -// this.EndVisit(usingDeclaration); -// return result; -// } -// -// public sealed override object VisitUsingStatement(UsingStatement usingStatement, object data) { -// this.BeginVisit(usingStatement); -// object result = this.TrackedVisitUsingStatement(usingStatement, data); -// this.EndVisit(usingStatement); -// return result; -// } -// -// public sealed override object VisitVariableDeclaration(VariableDeclaration variableDeclaration, object data) { -// this.BeginVisit(variableDeclaration); -// object result = this.TrackedVisitVariableDeclaration(variableDeclaration, data); -// this.EndVisit(variableDeclaration); -// return result; -// } -// -// public sealed override object VisitWithStatement(WithStatement withStatement, object data) { -// this.BeginVisit(withStatement); -// object result = this.TrackedVisitWithStatement(withStatement, data); -// this.EndVisit(withStatement); -// return result; -// } -// -// public sealed override object VisitXmlAttributeExpression(XmlAttributeExpression xmlAttributeExpression, object data) { -// this.BeginVisit(xmlAttributeExpression); -// object result = this.TrackedVisitXmlAttributeExpression(xmlAttributeExpression, data); -// this.EndVisit(xmlAttributeExpression); -// return result; -// } -// -// public sealed override object VisitXmlContentExpression(XmlContentExpression xmlContentExpression, object data) { -// this.BeginVisit(xmlContentExpression); -// object result = this.TrackedVisitXmlContentExpression(xmlContentExpression, data); -// this.EndVisit(xmlContentExpression); -// return result; -// } -// -// public sealed override object VisitXmlDocumentExpression(XmlDocumentExpression xmlDocumentExpression, object data) { -// this.BeginVisit(xmlDocumentExpression); -// object result = this.TrackedVisitXmlDocumentExpression(xmlDocumentExpression, data); -// this.EndVisit(xmlDocumentExpression); -// return result; -// } -// -// public sealed override object VisitXmlElementExpression(XmlElementExpression xmlElementExpression, object data) { -// this.BeginVisit(xmlElementExpression); -// object result = this.TrackedVisitXmlElementExpression(xmlElementExpression, data); -// this.EndVisit(xmlElementExpression); -// return result; -// } -// -// public sealed override object VisitXmlEmbeddedExpression(XmlEmbeddedExpression xmlEmbeddedExpression, object data) { -// this.BeginVisit(xmlEmbeddedExpression); -// object result = this.TrackedVisitXmlEmbeddedExpression(xmlEmbeddedExpression, data); -// this.EndVisit(xmlEmbeddedExpression); -// return result; -// } -// -// public sealed override object VisitXmlMemberAccessExpression(XmlMemberAccessExpression xmlMemberAccessExpression, object data) { -// this.BeginVisit(xmlMemberAccessExpression); -// object result = this.TrackedVisitXmlMemberAccessExpression(xmlMemberAccessExpression, data); -// this.EndVisit(xmlMemberAccessExpression); -// return result; -// } -// -// public virtual object TrackedVisitAddHandlerStatement(AddHandlerStatement addHandlerStatement, object data) { -// return base.VisitAddHandlerStatement(addHandlerStatement, data); -// } -// -// public virtual object TrackedVisitAddressOfExpression(AddressOfExpression addressOfExpression, object data) { -// return base.VisitAddressOfExpression(addressOfExpression, data); -// } -// -// public virtual object TrackedVisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, object data) { -// return base.VisitArrayCreateExpression(arrayCreateExpression, data); -// } -// -// public virtual object TrackedVisitAssignmentExpression(AssignmentExpression assignmentExpression, object data) { -// return base.VisitAssignmentExpression(assignmentExpression, data); -// } -// -// public virtual object TrackedVisitAttribute(ICSharpCode.NRefactory.VB.Ast.Attribute attribute, object data) { -// return base.VisitAttribute(attribute, data); -// } -// -// public virtual object TrackedVisitAttributeSection(AttributeSection attributeSection, object data) { -// return base.VisitAttributeSection(attributeSection, data); -// } -// -// public virtual object TrackedVisitBaseReferenceExpression(BaseReferenceExpression baseReferenceExpression, object data) { -// return base.VisitBaseReferenceExpression(baseReferenceExpression, data); -// } -// -// public virtual object TrackedVisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression, object data) { -// return base.VisitBinaryOperatorExpression(binaryOperatorExpression, data); -// } -// -// public virtual object TrackedVisitBlockStatement(BlockStatement blockStatement, object data) { -// return base.VisitBlockStatement(blockStatement, data); -// } -// -// public virtual object TrackedVisitCaseLabel(CaseLabel caseLabel, object data) { -// return base.VisitCaseLabel(caseLabel, data); -// } -// -// public virtual object TrackedVisitCastExpression(CastExpression castExpression, object data) { -// return base.VisitCastExpression(castExpression, data); -// } -// -// public virtual object TrackedVisitCatchClause(CatchClause catchClause, object data) { -// return base.VisitCatchClause(catchClause, data); -// } -// -// public virtual object TrackedVisitClassReferenceExpression(ClassReferenceExpression classReferenceExpression, object data) { -// return base.VisitClassReferenceExpression(classReferenceExpression, data); -// } -// -// public virtual object TrackedVisitCollectionInitializerExpression(CollectionInitializerExpression collectionInitializerExpression, object data) { -// return base.VisitCollectionInitializerExpression(collectionInitializerExpression, data); -// } -// -// public virtual object TrackedVisitCollectionRangeVariable(CollectionRangeVariable collectionRangeVariable, object data) { -// return base.VisitCollectionRangeVariable(collectionRangeVariable, data); -// } -// -// public virtual object TrackedVisitCompilationUnit(CompilationUnit compilationUnit, object data) { -// return base.VisitCompilationUnit(compilationUnit, data); -// } -// -// public virtual object TrackedVisitConditionalExpression(ConditionalExpression conditionalExpression, object data) { -// return base.VisitConditionalExpression(conditionalExpression, data); -// } -// -// public virtual object TrackedVisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration, object data) { -// return base.VisitConstructorDeclaration(constructorDeclaration, data); -// } -// -// public virtual object TrackedVisitConstructorInitializer(ConstructorInitializer constructorInitializer, object data) { -// return base.VisitConstructorInitializer(constructorInitializer, data); -// } -// -// public virtual object TrackedVisitContinueStatement(ContinueStatement continueStatement, object data) { -// return base.VisitContinueStatement(continueStatement, data); -// } -// -// public virtual object TrackedVisitDeclareDeclaration(DeclareDeclaration declareDeclaration, object data) { -// return base.VisitDeclareDeclaration(declareDeclaration, data); -// } -// -// public virtual object TrackedVisitDefaultValueExpression(DefaultValueExpression defaultValueExpression, object data) { -// return base.VisitDefaultValueExpression(defaultValueExpression, data); -// } -// -// public virtual object TrackedVisitDelegateDeclaration(DelegateDeclaration delegateDeclaration, object data) { -// return base.VisitDelegateDeclaration(delegateDeclaration, data); -// } -// -// public virtual object TrackedVisitDirectionExpression(DirectionExpression directionExpression, object data) { -// return base.VisitDirectionExpression(directionExpression, data); -// } -// -// public virtual object TrackedVisitDoLoopStatement(DoLoopStatement doLoopStatement, object data) { -// return base.VisitDoLoopStatement(doLoopStatement, data); -// } -// -// public virtual object TrackedVisitElseIfSection(ElseIfSection elseIfSection, object data) { -// return base.VisitElseIfSection(elseIfSection, data); -// } -// -// public virtual object TrackedVisitEndStatement(EndStatement endStatement, object data) { -// return base.VisitEndStatement(endStatement, data); -// } -// -// public virtual object TrackedVisitEraseStatement(EraseStatement eraseStatement, object data) { -// return base.VisitEraseStatement(eraseStatement, data); -// } -// -// public virtual object TrackedVisitErrorStatement(ErrorStatement errorStatement, object data) { -// return base.VisitErrorStatement(errorStatement, data); -// } -// -// public virtual object TrackedVisitEventAddRegion(EventAddRegion eventAddRegion, object data) { -// return base.VisitEventAddRegion(eventAddRegion, data); -// } -// -// public virtual object TrackedVisitEventDeclaration(EventDeclaration eventDeclaration, object data) { -// return base.VisitEventDeclaration(eventDeclaration, data); -// } -// -// public virtual object TrackedVisitEventRaiseRegion(EventRaiseRegion eventRaiseRegion, object data) { -// return base.VisitEventRaiseRegion(eventRaiseRegion, data); -// } -// -// public virtual object TrackedVisitEventRemoveRegion(EventRemoveRegion eventRemoveRegion, object data) { -// return base.VisitEventRemoveRegion(eventRemoveRegion, data); -// } -// -// public virtual object TrackedVisitExitStatement(ExitStatement exitStatement, object data) { -// return base.VisitExitStatement(exitStatement, data); -// } -// -// public virtual object TrackedVisitExpressionRangeVariable(ExpressionRangeVariable expressionRangeVariable, object data) { -// return base.VisitExpressionRangeVariable(expressionRangeVariable, data); -// } -// -// public virtual object TrackedVisitExpressionStatement(ExpressionStatement expressionStatement, object data) { -// return base.VisitExpressionStatement(expressionStatement, data); -// } -// -// public virtual object TrackedVisitExternAliasDirective(ExternAliasDirective externAliasDirective, object data) { -// return base.VisitExternAliasDirective(externAliasDirective, data); -// } -// -// public virtual object TrackedVisitFieldDeclaration(FieldDeclaration fieldDeclaration, object data) { -// return base.VisitFieldDeclaration(fieldDeclaration, data); -// } -// -// public virtual object TrackedVisitForeachStatement(ForeachStatement foreachStatement, object data) { -// return base.VisitForeachStatement(foreachStatement, data); -// } -// -// public virtual object TrackedVisitForNextStatement(ForNextStatement forNextStatement, object data) { -// return base.VisitForNextStatement(forNextStatement, data); -// } -// -// public virtual object TrackedVisitGotoStatement(GotoStatement gotoStatement, object data) { -// return base.VisitGotoStatement(gotoStatement, data); -// } -// -// public virtual object TrackedVisitIdentifierExpression(SimpleNameExpression identifierExpression, object data) { -// return base.VisitIdentifierExpression(identifierExpression, data); -// } -// -// public virtual object TrackedVisitIfElseStatement(IfElseStatement ifElseStatement, object data) { -// return base.VisitIfElseStatement(ifElseStatement, data); -// } -// -// public virtual object TrackedVisitInnerClassTypeReference(InnerClassTypeReference innerClassTypeReference, object data) { -// return base.VisitInnerClassTypeReference(innerClassTypeReference, data); -// } -// -// public virtual object TrackedVisitInterfaceImplementation(InterfaceImplementation interfaceImplementation, object data) { -// return base.VisitInterfaceImplementation(interfaceImplementation, data); -// } -// -// public virtual object TrackedVisitInvocationExpression(InvocationExpression invocationExpression, object data) { -// return base.VisitInvocationExpression(invocationExpression, data); -// } -// -// public virtual object TrackedVisitLabelStatement(LabelStatement labelStatement, object data) { -// return base.VisitLabelStatement(labelStatement, data); -// } -// -// public virtual object TrackedVisitLambdaExpression(LambdaExpression lambdaExpression, object data) { -// return base.VisitLambdaExpression(lambdaExpression, data); -// } -// -// public virtual object TrackedVisitLocalVariableDeclaration(LocalVariableDeclaration localVariableDeclaration, object data) { -// return base.VisitLocalVariableDeclaration(localVariableDeclaration, data); -// } -// -// public virtual object TrackedVisitLockStatement(LockStatement lockStatement, object data) { -// return base.VisitLockStatement(lockStatement, data); -// } -// -// public virtual object TrackedVisitMemberInitializerExpression(MemberInitializerExpression memberInitializerExpression, object data) { -// return base.VisitMemberInitializerExpression(memberInitializerExpression, data); -// } -// -// public virtual object TrackedVisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression, object data) { -// return base.VisitMemberReferenceExpression(memberReferenceExpression, data); -// } -// -// public virtual object TrackedVisitMethodDeclaration(MethodDeclaration methodDeclaration, object data) { -// return base.VisitMethodDeclaration(methodDeclaration, data); -// } -// -// public virtual object TrackedVisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data) { -// return base.VisitNamedArgumentExpression(namedArgumentExpression, data); -// } -// -// public virtual object TrackedVisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, object data) { -// return base.VisitNamespaceDeclaration(namespaceDeclaration, data); -// } -// -// public virtual object TrackedVisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression, object data) { -// return base.VisitObjectCreateExpression(objectCreateExpression, data); -// } -// -// public virtual object TrackedVisitOnErrorStatement(OnErrorStatement onErrorStatement, object data) { -// return base.VisitOnErrorStatement(onErrorStatement, data); -// } -// -// public virtual object TrackedVisitOperatorDeclaration(OperatorDeclaration operatorDeclaration, object data) { -// return base.VisitOperatorDeclaration(operatorDeclaration, data); -// } -// -// public virtual object TrackedVisitOptionDeclaration(OptionDeclaration optionDeclaration, object data) { -// return base.VisitOptionDeclaration(optionDeclaration, data); -// } -// -// public virtual object TrackedVisitParameterDeclarationExpression(ParameterDeclarationExpression parameterDeclarationExpression, object data) { -// return base.VisitParameterDeclarationExpression(parameterDeclarationExpression, data); -// } -// -// public virtual object TrackedVisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression, object data) { -// return base.VisitParenthesizedExpression(parenthesizedExpression, data); -// } -// -// public virtual object TrackedVisitPrimitiveExpression(PrimitiveExpression primitiveExpression, object data) { -// return base.VisitPrimitiveExpression(primitiveExpression, data); -// } -// -// public virtual object TrackedVisitPropertyDeclaration(PropertyDeclaration propertyDeclaration, object data) { -// return base.VisitPropertyDeclaration(propertyDeclaration, data); -// } -// -// public virtual object TrackedVisitPropertyGetRegion(PropertyGetRegion propertyGetRegion, object data) { -// return base.VisitPropertyGetRegion(propertyGetRegion, data); -// } -// -// public virtual object TrackedVisitPropertySetRegion(PropertySetRegion propertySetRegion, object data) { -// return base.VisitPropertySetRegion(propertySetRegion, data); -// } -// -// public virtual object TrackedVisitQueryExpression(QueryExpression queryExpression, object data) { -// return base.VisitQueryExpression(queryExpression, data); -// } -// -// public virtual object TrackedVisitQueryExpressionAggregateClause(QueryExpressionAggregateClause queryExpressionAggregateClause, object data) { -// return base.VisitQueryExpressionAggregateClause(queryExpressionAggregateClause, data); -// } -// -// public virtual object TrackedVisitQueryExpressionDistinctClause(QueryExpressionDistinctClause queryExpressionDistinctClause, object data) { -// return base.VisitQueryExpressionDistinctClause(queryExpressionDistinctClause, data); -// } -// -// public virtual object TrackedVisitQueryExpressionFromClause(QueryExpressionFromClause queryExpressionFromClause, object data) { -// return base.VisitQueryExpressionFromClause(queryExpressionFromClause, data); -// } -// -// public virtual object TrackedVisitQueryExpressionGroupClause(QueryExpressionGroupClause queryExpressionGroupClause, object data) { -// return base.VisitQueryExpressionGroupClause(queryExpressionGroupClause, data); -// } -// -// public virtual object TrackedVisitQueryExpressionGroupJoinVBClause(QueryExpressionGroupJoinVBClause queryExpressionGroupJoinVBClause, object data) { -// return base.VisitQueryExpressionGroupJoinVBClause(queryExpressionGroupJoinVBClause, data); -// } -// -// public virtual object TrackedVisitQueryExpressionGroupVBClause(QueryExpressionGroupVBClause queryExpressionGroupVBClause, object data) { -// return base.VisitQueryExpressionGroupVBClause(queryExpressionGroupVBClause, data); -// } -// -// public virtual object TrackedVisitQueryExpressionJoinClause(QueryExpressionJoinClause queryExpressionJoinClause, object data) { -// return base.VisitQueryExpressionJoinClause(queryExpressionJoinClause, data); -// } -// -// public virtual object TrackedVisitQueryExpressionJoinConditionVB(QueryExpressionJoinConditionVB queryExpressionJoinConditionVB, object data) { -// return base.VisitQueryExpressionJoinConditionVB(queryExpressionJoinConditionVB, data); -// } -// -// public virtual object TrackedVisitQueryExpressionJoinVBClause(QueryExpressionJoinVBClause queryExpressionJoinVBClause, object data) { -// return base.VisitQueryExpressionJoinVBClause(queryExpressionJoinVBClause, data); -// } -// -// public virtual object TrackedVisitQueryExpressionLetClause(QueryExpressionLetClause queryExpressionLetClause, object data) { -// return base.VisitQueryExpressionLetClause(queryExpressionLetClause, data); -// } -// -// public virtual object TrackedVisitQueryExpressionLetVBClause(QueryExpressionLetClause queryExpressionLetVBClause, object data) { -// return base.VisitQueryExpressionLetVBClause(queryExpressionLetVBClause, data); -// } -// -// public virtual object TrackedVisitQueryExpressionOrderClause(QueryExpressionOrderClause queryExpressionOrderClause, object data) { -// return base.VisitQueryExpressionOrderClause(queryExpressionOrderClause, data); -// } -// -// public virtual object TrackedVisitQueryExpressionOrdering(QueryExpressionOrdering queryExpressionOrdering, object data) { -// return base.VisitQueryExpressionOrdering(queryExpressionOrdering, data); -// } -// -// public virtual object TrackedVisitQueryExpressionPartitionVBClause(QueryExpressionPartitionVBClause queryExpressionPartitionVBClause, object data) { -// return base.VisitQueryExpressionPartitionVBClause(queryExpressionPartitionVBClause, data); -// } -// -// public virtual object TrackedVisitQueryExpressionSelectClause(QueryExpressionSelectClause queryExpressionSelectClause, object data) { -// return base.VisitQueryExpressionSelectClause(queryExpressionSelectClause, data); -// } -// -// public virtual object TrackedVisitQueryExpressionSelectVBClause(QueryExpressionSelectVBClause queryExpressionSelectVBClause, object data) { -// return base.VisitQueryExpressionSelectVBClause(queryExpressionSelectVBClause, data); -// } -// -// public virtual object TrackedVisitQueryExpressionWhereClause(QueryExpressionWhereClause queryExpressionWhereClause, object data) { -// return base.VisitQueryExpressionWhereClause(queryExpressionWhereClause, data); -// } -// -// public virtual object TrackedVisitRaiseEventStatement(RaiseEventStatement raiseEventStatement, object data) { -// return base.VisitRaiseEventStatement(raiseEventStatement, data); -// } -// -// public virtual object TrackedVisitReDimStatement(ReDimStatement reDimStatement, object data) { -// return base.VisitReDimStatement(reDimStatement, data); -// } -// -// public virtual object TrackedVisitRemoveHandlerStatement(RemoveHandlerStatement removeHandlerStatement, object data) { -// return base.VisitRemoveHandlerStatement(removeHandlerStatement, data); -// } -// -// public virtual object TrackedVisitResumeStatement(ResumeStatement resumeStatement, object data) { -// return base.VisitResumeStatement(resumeStatement, data); -// } -// -// public virtual object TrackedVisitReturnStatement(ReturnStatement returnStatement, object data) { -// return base.VisitReturnStatement(returnStatement, data); -// } -// -// public virtual object TrackedVisitStopStatement(StopStatement stopStatement, object data) { -// return base.VisitStopStatement(stopStatement, data); -// } -// -// public virtual object TrackedVisitSwitchSection(SwitchSection switchSection, object data) { -// return base.VisitSwitchSection(switchSection, data); -// } -// -// public virtual object TrackedVisitSwitchStatement(SwitchStatement switchStatement, object data) { -// return base.VisitSwitchStatement(switchStatement, data); -// } -// -// public virtual object TrackedVisitTemplateDefinition(TemplateDefinition templateDefinition, object data) { -// return base.VisitTemplateDefinition(templateDefinition, data); -// } -// -// public virtual object TrackedVisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, object data) { -// return base.VisitThisReferenceExpression(thisReferenceExpression, data); -// } -// -// public virtual object TrackedVisitThrowStatement(ThrowStatement throwStatement, object data) { -// return base.VisitThrowStatement(throwStatement, data); -// } -// -// public virtual object TrackedVisitTryCatchStatement(TryCatchStatement tryCatchStatement, object data) { -// return base.VisitTryCatchStatement(tryCatchStatement, data); -// } -// -// public virtual object TrackedVisitTypeDeclaration(TypeDeclaration typeDeclaration, object data) { -// return base.VisitTypeDeclaration(typeDeclaration, data); -// } -// -// public virtual object TrackedVisitTypeOfExpression(TypeOfExpression typeOfExpression, object data) { -// return base.VisitTypeOfExpression(typeOfExpression, data); -// } -// -// public virtual object TrackedVisitTypeOfIsExpression(TypeOfIsExpression typeOfIsExpression, object data) { -// return base.VisitTypeOfIsExpression(typeOfIsExpression, data); -// } -// -// public virtual object TrackedVisitTypeReference(TypeReference typeReference, object data) { -// return base.VisitTypeReference(typeReference, data); -// } -// -// public virtual object TrackedVisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression, object data) { -// return base.VisitTypeReferenceExpression(typeReferenceExpression, data); -// } -// -// public virtual object TrackedVisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression, object data) { -// return base.VisitUnaryOperatorExpression(unaryOperatorExpression, data); -// } -// -// public virtual object TrackedVisitUsing(ImportsClause @using, object data) { -// return base.VisitUsing(@using, data); -// } -// -// public virtual object TrackedVisitUsingDeclaration(ImportsStatement usingDeclaration, object data) { -// return base.VisitUsingDeclaration(usingDeclaration, data); -// } -// -// public virtual object TrackedVisitUsingStatement(UsingStatement usingStatement, object data) { -// return base.VisitUsingStatement(usingStatement, data); -// } -// -// public virtual object TrackedVisitVariableDeclaration(VariableDeclaration variableDeclaration, object data) { -// return base.VisitVariableDeclaration(variableDeclaration, data); -// } -// -// public virtual object TrackedVisitWithStatement(WithStatement withStatement, object data) { -// return base.VisitWithStatement(withStatement, data); -// } -// -// public virtual object TrackedVisitXmlAttributeExpression(XmlAttributeExpression xmlAttributeExpression, object data) { -// return base.VisitXmlAttributeExpression(xmlAttributeExpression, data); -// } -// -// public virtual object TrackedVisitXmlContentExpression(XmlContentExpression xmlContentExpression, object data) { -// return base.VisitXmlContentExpression(xmlContentExpression, data); -// } -// -// public virtual object TrackedVisitXmlDocumentExpression(XmlDocumentExpression xmlDocumentExpression, object data) { -// return base.VisitXmlDocumentExpression(xmlDocumentExpression, data); -// } -// -// public virtual object TrackedVisitXmlElementExpression(XmlElementExpression xmlElementExpression, object data) { -// return base.VisitXmlElementExpression(xmlElementExpression, data); -// } -// -// public virtual object TrackedVisitXmlEmbeddedExpression(XmlEmbeddedExpression xmlEmbeddedExpression, object data) { -// return base.VisitXmlEmbeddedExpression(xmlEmbeddedExpression, data); -// } -// -// public virtual object TrackedVisitXmlMemberAccessExpression(XmlMemberAccessExpression xmlMemberAccessExpression, object data) { -// return base.VisitXmlMemberAccessExpression(xmlMemberAccessExpression, data); -// } -// } -} diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Completion/DisplayFlags.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Completion/DisplayFlags.cs new file mode 100644 index 0000000000..ae4e1fe5f5 --- /dev/null +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Completion/DisplayFlags.cs @@ -0,0 +1,38 @@ +// +// DisplayFlags.cs +// +// Author: +// Mike Krüger +// +// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; + +namespace ICSharpCode.NRefactory.Completion +{ + [Flags] + public enum DisplayFlags + { + None = 0, + Hidden = 1, + Obsolete = 2 + } +} + diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Completion/ICompletionData.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Completion/ICompletionData.cs new file mode 100644 index 0000000000..8320755137 --- /dev/null +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Completion/ICompletionData.cs @@ -0,0 +1,47 @@ +// +// ICompletionData.cs +// +// Author: +// Mike Krüger +// +// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Collections.Generic; + +namespace ICSharpCode.NRefactory.Completion +{ + public interface ICompletionData + { + string DisplayText { get; set; } + string Description { get; set; } + + DisplayFlags DisplayFlags { get; set; } + + bool HasOverloads { + get; + } + + IEnumerable OverloadedData { + get; + } + } +} diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Completion/ICompletionDataFactory.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Completion/ICompletionDataFactory.cs new file mode 100644 index 0000000000..41000503b1 --- /dev/null +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Completion/ICompletionDataFactory.cs @@ -0,0 +1,49 @@ +// +// ICompletionDataFactory.cs +// +// Author: +// Mike Krüger +// +// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using ICSharpCode.NRefactory.TypeSystem; + +namespace ICSharpCode.NRefactory.Completion +{ + public interface ICompletionDataFactory + { + ICompletionData CreateEntityCompletionData (IEntity entity); + + /// + /// Creates a generic completion data. + /// + /// + /// The title of the completion data + /// + /// + /// The description of the literal. + /// + /// + /// The insert text. If null, title is taken. + /// + ICompletionData CreateLiteralCompletionData (string title, string description, string insertText = null); + } +} diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Completion/IEntityCompletionData.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Completion/IEntityCompletionData.cs new file mode 100644 index 0000000000..0744f47230 --- /dev/null +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Completion/IEntityCompletionData.cs @@ -0,0 +1,37 @@ +// +// IEntityCompletionData.cs +// +// Author: +// Mike Krüger +// +// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using ICSharpCode.NRefactory.TypeSystem; + +namespace ICSharpCode.NRefactory.Completion +{ + public interface IEntityCompletionData : ICompletionData + { + IEntity Entity { + get; + } + } +} diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/IDocumentLine.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/IDocumentLine.cs index 193f761149..0471509fdd 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/IDocumentLine.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/IDocumentLine.cs @@ -41,5 +41,15 @@ namespace ICSharpCode.NRefactory.Editor /// The first line has the number 1. /// int LineNumber { get; } + + /// + /// Gets the previous line. Returns null if this is the first line in the document. + /// + IDocumentLine PreviousLine { get; } + + /// + /// Gets the next line. Returns null if this is the last line in the document. + /// + IDocumentLine NextLine { get; } } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/ISegment.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/ISegment.cs index 8bf9c5172d..f0e430ec0b 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/ISegment.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/ISegment.cs @@ -33,7 +33,7 @@ namespace ICSharpCode.NRefactory.Editor /// /// Gets the length of the segment. /// - /// Must not be negative. + /// For line segments (IDocumentLine), the length does not include the line delimeter. int Length { get; } /// diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/ReadOnlyDocument.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/ReadOnlyDocument.cs index cde58d8af7..0d5e810065 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/ReadOnlyDocument.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/Editor/ReadOnlyDocument.cs @@ -111,6 +111,24 @@ namespace ICSharpCode.NRefactory.Editor public int LineNumber { get { return lineNumber; } } + + public IDocumentLine PreviousLine { + get { + if (lineNumber == 1) + return null; + else + return new ReadOnlyDocumentLine(doc, lineNumber - 1); + } + } + + public IDocumentLine NextLine { + get { + if (lineNumber == doc.LineCount) + return null; + else + return new ReadOnlyDocumentLine(doc, lineNumber + 1); + } + } } int GetStartOffset(int lineNumber) @@ -151,10 +169,10 @@ namespace ICSharpCode.NRefactory.Editor if (line < 1 || line > lines.Length) throw new ArgumentOutOfRangeException("line", line, "Value must be between 1 and " + lines.Length); int lineStart = GetStartOffset(line); - if (column <= 0) + if (column <= 1) return lineStart; int lineEnd = GetEndOffset(line); - if (column >= lineEnd - lineStart) + if (column - 1 >= lineEnd - lineStart) return lineEnd; return lineStart + column - 1; } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj b/src/Libraries/NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj index e614362884..6006cb708c 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj @@ -1,4 +1,4 @@ - + {3B2A5653-EC97-4001-BB9B-D90F1AF2C371} @@ -20,15 +20,12 @@ ..\ICSharpCode.NRefactory.snk False File - Client - v4.0 AnyCPU False Auto - 4194304 - 4096 + 465371136 bin\Debug\ @@ -40,7 +37,8 @@ bin\Release\ - None + true + PdbOnly True TRACE False @@ -188,10 +186,13 @@ + + + + - - + diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/IAnnotatable.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/IAnnotatable.cs index 25f2684a97..2c5f7cd802 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/IAnnotatable.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/IAnnotatable.cs @@ -78,6 +78,7 @@ namespace ICSharpCode.NRefactory void RemoveAnnotations(Type type); } + [Serializable] public abstract class AbstractAnnotatable : IAnnotatable { // Annotations: points either null (no annotations), to the single annotation, @@ -85,6 +86,7 @@ namespace ICSharpCode.NRefactory // Once it is pointed at an AnnotationList, it will never change (this allows thread-safety support by locking the list) [CLSCompliant(false)] + [NonSerialized] protected object annotations; sealed class AnnotationList : List, ICloneable diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultParameter.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultParameter.cs index 1c41fa577a..97818b4a64 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultParameter.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultParameter.cs @@ -155,13 +155,15 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation int ISupportsInterning.GetHashCodeForInterning() { - return type.GetHashCode() ^ (attributes != null ? attributes.GetHashCode() : 0) ^ (defaultValue != null ? defaultValue.GetHashCode() : 0); + return type.GetHashCode() ^ name.GetHashCode() + ^ (attributes != null ? attributes.GetHashCode() : 0) + ^ (defaultValue != null ? defaultValue.GetHashCode() : 0); } bool ISupportsInterning.EqualsForInterning(ISupportsInterning other) { DefaultParameter p = other as DefaultParameter; - return p != null && type == p.type && attributes == p.attributes + return p != null && type == p.type && attributes == p.attributes && name == p.name && defaultValue == p.defaultValue && region == p.region && flags == p.flags; } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultTypeParameter.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultTypeParameter.cs index 29a1c4f893..424c55cdb0 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultTypeParameter.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/TypeSystem/Implementation/DefaultTypeParameter.cs @@ -382,6 +382,7 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation return o != null && this.attributes == o.attributes && this.constraints == o.constraints + && this.name == o.name && this.flags == o.flags && this.ownerType == o.ownerType && this.index == o.index