Browse Source
Conflicts: ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj ILSpy.SharpDevelop.LGPL/ILSpy.SharpDevelop.LGPL.csprojnewNRvisualizers
125 changed files with 8453 additions and 415 deletions
@ -0,0 +1,67 @@
@@ -0,0 +1,67 @@
|
||||
// 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; |
||||
using System.Collections.Generic; |
||||
using System.Diagnostics; |
||||
using System.Linq; |
||||
using System.Threading; |
||||
using ICSharpCode.NRefactory.PatternMatching; |
||||
using ICSharpCode.NRefactory.VB.Ast; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB |
||||
{ |
||||
public class Comment : AstNode |
||||
{ |
||||
public bool IsDocumentationComment { get; set; } |
||||
|
||||
public bool StartsLine { |
||||
get; |
||||
set; |
||||
} |
||||
|
||||
public string Content { |
||||
get; |
||||
set; |
||||
} |
||||
|
||||
AstLocation startLocation; |
||||
public override AstLocation StartLocation { |
||||
get { |
||||
return startLocation; |
||||
} |
||||
} |
||||
|
||||
AstLocation endLocation; |
||||
public override AstLocation EndLocation { |
||||
get { |
||||
return endLocation; |
||||
} |
||||
} |
||||
|
||||
public Comment (string content, bool isDocumentation = false) |
||||
{ |
||||
this.IsDocumentationComment = isDocumentation; |
||||
this.Content = content; |
||||
} |
||||
|
||||
public Comment (bool isDocumentation, AstLocation startLocation, AstLocation endLocation) |
||||
{ |
||||
this.IsDocumentationComment = isDocumentation; |
||||
this.startLocation = startLocation; |
||||
this.endLocation = endLocation; |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitComment(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
Comment o = other as Comment; |
||||
return o != null && this.IsDocumentationComment == o.IsDocumentationComment && MatchString(this.Content, o.Content); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,41 @@
@@ -0,0 +1,41 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class AnonymousObjectCreationExpression : Expression |
||||
{ |
||||
public AstNodeCollection<Expression> Initializer { |
||||
get { return GetChildrenByRole(Roles.Expression); } |
||||
} |
||||
|
||||
public AnonymousObjectCreationExpression () |
||||
{ |
||||
} |
||||
|
||||
public AnonymousObjectCreationExpression (IEnumerable<Expression> initializer) |
||||
{ |
||||
foreach (var ini in initializer) { |
||||
AddChild (ini, Roles.Expression); |
||||
} |
||||
} |
||||
|
||||
public AnonymousObjectCreationExpression (params Expression[] initializer) : this ((IEnumerable<Expression>)initializer) |
||||
{ |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitAnonymousObjectCreationExpression(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
var o = other as AnonymousObjectCreationExpression; |
||||
return o != null && this.Initializer.DoMatch(o.Initializer, match); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,64 @@
@@ -0,0 +1,64 @@
|
||||
// Copyright (c) 2011 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// New Type[Dimensions]
|
||||
/// </summary>
|
||||
public class ArrayCreateExpression : Expression |
||||
{ |
||||
public readonly static Role<ArraySpecifier> AdditionalArraySpecifierRole = new Role<ArraySpecifier>("AdditionalArraySpecifier"); |
||||
public readonly static Role<ArrayInitializerExpression> InitializerRole = new Role<ArrayInitializerExpression>("Initializer", ArrayInitializerExpression.Null); |
||||
|
||||
public AstType Type { |
||||
get { return GetChildByRole (Roles.Type); } |
||||
set { SetChildByRole (Roles.Type, value); } |
||||
} |
||||
|
||||
public AstNodeCollection<Expression> Arguments { |
||||
get { return GetChildrenByRole (Roles.Argument); } |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets additional array ranks (those without size info).
|
||||
/// Empty for "New Integer(5,1)"; will contain a single element for "New Integer(5)()".
|
||||
/// </summary>
|
||||
public AstNodeCollection<ArraySpecifier> AdditionalArraySpecifiers { |
||||
get { return GetChildrenByRole(AdditionalArraySpecifierRole); } |
||||
} |
||||
|
||||
public ArrayInitializerExpression Initializer { |
||||
get { return GetChildByRole (InitializerRole); } |
||||
set { SetChildByRole (InitializerRole, value); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitArrayCreateExpression (this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
ArrayCreateExpression o = other as ArrayCreateExpression; |
||||
return o != null && this.Type.DoMatch(o.Type, match) && this.Arguments.DoMatch(o.Arguments, match) && this.AdditionalArraySpecifiers.DoMatch(o.AdditionalArraySpecifiers, match) && this.Initializer.DoMatch(o.Initializer, match); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,53 @@
@@ -0,0 +1,53 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// { Elements }
|
||||
/// </summary>
|
||||
public class ArrayInitializerExpression : Expression |
||||
{ |
||||
#region Null
|
||||
public new static readonly ArrayInitializerExpression Null = new NullArrayInitializerExpression (); |
||||
|
||||
sealed class NullArrayInitializerExpression : ArrayInitializerExpression |
||||
{ |
||||
public override bool IsNull { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return default (S); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
return other == null || other.IsNull; |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
public readonly static Role<ArrayInitializerExpression> InitializerRole = new Role<ArrayInitializerExpression>("Initializer", ArrayInitializerExpression.Null); |
||||
|
||||
public AstNodeCollection<Expression> Elements { |
||||
get { return GetChildrenByRole(Roles.Expression); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitArrayInitializerExpression (this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
ArrayInitializerExpression o = other as ArrayInitializerExpression; |
||||
return o != null && this.Elements.DoMatch(o.Elements, match); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class AssignmentExpression : Expression |
||||
{ |
||||
public readonly static Role<Expression> LeftExpressionRole = BinaryOperatorExpression.LeftExpressionRole; |
||||
public readonly static Role<VBTokenNode> OperatorRole = BinaryOperatorExpression.OperatorRole; |
||||
public readonly static Role<Expression> RightExpressionRole = BinaryOperatorExpression.RightExpressionRole; |
||||
|
||||
public AssignmentExpression(Expression left, AssignmentOperatorType type, Expression right) |
||||
{ |
||||
AddChild(left, LeftExpressionRole); |
||||
AddChild(right, RightExpressionRole); |
||||
Operator = type; |
||||
} |
||||
|
||||
public Expression Left { |
||||
get { return GetChildByRole(LeftExpressionRole); } |
||||
set { SetChildByRole(LeftExpressionRole, value); } |
||||
} |
||||
|
||||
public AssignmentOperatorType Operator { get; set; } |
||||
|
||||
public Expression Right { |
||||
get { return GetChildByRole(RightExpressionRole); } |
||||
set { SetChildByRole(RightExpressionRole, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitAssignmentExpression(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,110 @@
@@ -0,0 +1,110 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class BinaryOperatorExpression : Expression |
||||
{ |
||||
public readonly static Role<Expression> LeftExpressionRole = new Role<Expression>("Left"); |
||||
public readonly static Role<VBTokenNode> OperatorRole = new Role<VBTokenNode>("Operator"); |
||||
public readonly static Role<Expression> RightExpressionRole = new Role<Expression>("Right"); |
||||
|
||||
public BinaryOperatorExpression(Expression left, BinaryOperatorType type, Expression right) |
||||
{ |
||||
AddChild(left, LeftExpressionRole); |
||||
AddChild(right, RightExpressionRole); |
||||
Operator = type; |
||||
} |
||||
|
||||
public Expression Left { |
||||
get { return GetChildByRole(LeftExpressionRole); } |
||||
set { SetChildByRole(LeftExpressionRole, value); } |
||||
} |
||||
|
||||
public BinaryOperatorType Operator { get; set; } |
||||
|
||||
public Expression Right { |
||||
get { return GetChildByRole(RightExpressionRole); } |
||||
set { SetChildByRole(RightExpressionRole, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitBinaryOperatorExpression(this, data); |
||||
} |
||||
} |
||||
|
||||
public enum BinaryOperatorType |
||||
{ |
||||
None, |
||||
|
||||
/// <summary>'&' in C#, 'And' in VB.</summary>
|
||||
BitwiseAnd, |
||||
/// <summary>'|' in C#, 'Or' in VB.</summary>
|
||||
BitwiseOr, |
||||
/// <summary>'&&' in C#, 'AndAlso' in VB.</summary>
|
||||
LogicalAnd, |
||||
/// <summary>'||' in C#, 'OrElse' in VB.</summary>
|
||||
LogicalOr, |
||||
/// <summary>'^' in C#, 'Xor' in VB.</summary>
|
||||
ExclusiveOr, |
||||
|
||||
/// <summary>></summary>
|
||||
GreaterThan, |
||||
/// <summary>>=</summary>
|
||||
GreaterThanOrEqual, |
||||
/// <summary>'==' in C#, '=' in VB.</summary>
|
||||
Equality, |
||||
/// <summary>'!=' in C#, '<>' in VB.</summary>
|
||||
InEquality, |
||||
/// <summary><</summary>
|
||||
LessThan, |
||||
/// <summary><=</summary>
|
||||
LessThanOrEqual, |
||||
|
||||
/// <summary>+</summary>
|
||||
Add, |
||||
/// <summary>-</summary>
|
||||
Subtract, |
||||
/// <summary>*</summary>
|
||||
Multiply, |
||||
/// <summary>/</summary>
|
||||
Divide, |
||||
/// <summary>'%' in C#, 'Mod' in VB.</summary>
|
||||
Modulus, |
||||
/// <summary>VB-only: \</summary>
|
||||
DivideInteger, |
||||
/// <summary>VB-only: ^</summary>
|
||||
Power, |
||||
/// <summary>VB-only: &</summary>
|
||||
Concat, |
||||
|
||||
/// <summary>C#: <<</summary>
|
||||
ShiftLeft, |
||||
/// <summary>C#: >></summary>
|
||||
ShiftRight, |
||||
/// <summary>VB-only: Is</summary>
|
||||
ReferenceEquality, |
||||
/// <summary>VB-only: IsNot</summary>
|
||||
ReferenceInequality, |
||||
|
||||
/// <summary>VB-only: Like</summary>
|
||||
Like, |
||||
/// <summary>
|
||||
/// C#: ??
|
||||
/// VB: IF(x, y)
|
||||
/// </summary>
|
||||
NullCoalescing, |
||||
|
||||
/// <summary>VB-only: !</summary>
|
||||
DictionaryAccess |
||||
} |
||||
} |
||||
@ -0,0 +1,95 @@
@@ -0,0 +1,95 @@
|
||||
// Copyright (c) 2011 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// CastType(Expression, AstType)
|
||||
/// </summary>
|
||||
public class CastExpression : Expression |
||||
{ |
||||
public CastType CastType { get; set; } |
||||
|
||||
public VBTokenNode CastTypeToken { |
||||
get { return GetChildByRole (Roles.Keyword); } |
||||
} |
||||
|
||||
public AstType Type { |
||||
get { return GetChildByRole (Roles.Type); } |
||||
set { SetChildByRole (Roles.Type, value); } |
||||
} |
||||
|
||||
public Expression Expression { |
||||
get { return GetChildByRole (Roles.Expression); } |
||||
set { SetChildByRole (Roles.Expression, value); } |
||||
} |
||||
|
||||
public CastExpression () |
||||
{ |
||||
} |
||||
|
||||
public CastExpression (CastType castType, AstType castToType, Expression expression) |
||||
{ |
||||
CastType = castType; |
||||
AddChild (castToType, Roles.Type); |
||||
AddChild (expression, Roles.Expression); |
||||
} |
||||
|
||||
public CastExpression (CastType castType, Expression expression) |
||||
{ |
||||
CastType = castType; |
||||
AddChild (expression, Roles.Expression); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitCastExpression (this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
CastExpression o = other as CastExpression; |
||||
return o != null && this.CastType == o.CastType && this.Type.DoMatch(o.Type, match) && this.Expression.DoMatch(o.Expression, match); |
||||
} |
||||
} |
||||
|
||||
public enum CastType |
||||
{ |
||||
DirectCast, |
||||
TryCast, |
||||
CType, |
||||
CBool, |
||||
CByte, |
||||
CChar, |
||||
CDate, |
||||
CDec, |
||||
CDbl, |
||||
CInt, |
||||
CLng, |
||||
CObj, |
||||
CSByte, |
||||
CShort, |
||||
CSng, |
||||
CStr, |
||||
CUInt, |
||||
CULng, |
||||
CUShort |
||||
} |
||||
} |
||||
@ -0,0 +1,42 @@
@@ -0,0 +1,42 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// Identifier As Type In Expression
|
||||
/// </summary>
|
||||
public class CollectionRangeVariableDeclaration : AstNode |
||||
{ |
||||
public static readonly Role<CollectionRangeVariableDeclaration> CollectionRangeVariableDeclarationRole = new Role<CollectionRangeVariableDeclaration>("CollectionRangeVariableDeclaration"); |
||||
|
||||
public VariableIdentifier Identifier { |
||||
get { return GetChildByRole(VariableIdentifier.VariableIdentifierRole); } |
||||
set { SetChildByRole(VariableIdentifier.VariableIdentifierRole, value); } |
||||
} |
||||
|
||||
public AstType Type { |
||||
get { return GetChildByRole(Roles.Type); } |
||||
set { SetChildByRole(Roles.Type, value); } |
||||
} |
||||
|
||||
public Expression Expression { |
||||
get { return GetChildByRole (Roles.Expression); } |
||||
set { SetChildByRole (Roles.Expression, value); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitCollectionRangeVariableDeclaration(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
CollectionRangeVariableDeclaration o = other as CollectionRangeVariableDeclaration; |
||||
return o != null && this.Identifier.DoMatch(o.Identifier, match) && this.Type.DoMatch(o.Type, match) && this.Expression.DoMatch(o.Expression, match); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class ConditionalExpression : Expression |
||||
{ |
||||
public readonly static Role<Expression> ConditionExpressionRole = new Role<Expression>("ConditionExpressionRole", Expression.Null); |
||||
public readonly static Role<Expression> TrueExpressionRole = new Role<Expression>("TrueExpressionRole", Expression.Null); |
||||
public readonly static Role<Expression> FalseExpressionRole = new Role<Expression>("FalseExpressionRole", Expression.Null); |
||||
|
||||
public VBTokenNode IfToken { |
||||
get { return GetChildByRole (Roles.Keyword); } |
||||
} |
||||
|
||||
public Expression ConditionExpression { |
||||
get { return GetChildByRole (ConditionExpressionRole); } |
||||
set { SetChildByRole (ConditionExpressionRole, value); } |
||||
} |
||||
|
||||
public Expression TrueExpression { |
||||
get { return GetChildByRole (TrueExpressionRole); } |
||||
set { SetChildByRole (TrueExpressionRole, value); } |
||||
} |
||||
|
||||
public Expression FalseExpression { |
||||
get { return GetChildByRole (FalseExpressionRole); } |
||||
set { SetChildByRole (FalseExpressionRole, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitConditionalExpression(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,59 @@
@@ -0,0 +1,59 @@
|
||||
// Copyright (c) 2011 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class EmptyExpression : Expression |
||||
{ |
||||
AstLocation location; |
||||
|
||||
public override AstLocation StartLocation { |
||||
get { |
||||
return location; |
||||
} |
||||
} |
||||
|
||||
public override AstLocation EndLocation { |
||||
get { |
||||
return location; |
||||
} |
||||
} |
||||
|
||||
public EmptyExpression() |
||||
{ |
||||
} |
||||
|
||||
public EmptyExpression(AstLocation location) |
||||
{ |
||||
this.location = location; |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitEmptyExpression(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
var o = other as EmptyExpression; |
||||
return o != null; |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// [ Key ] .Identifier = Expression
|
||||
/// </summary>
|
||||
public class FieldInitializerExpression : Expression |
||||
{ |
||||
public bool IsKey { get; set; } |
||||
|
||||
public VBTokenNode KeyToken { |
||||
get { return GetChildByRole (Roles.Keyword); } |
||||
} |
||||
|
||||
public VBTokenNode DotToken { |
||||
get { return GetChildByRole (Roles.Dot); } |
||||
} |
||||
|
||||
public Identifier Identifier { |
||||
get { return GetChildByRole(Roles.Identifier); } |
||||
set { SetChildByRole(Roles.Identifier, value); } |
||||
} |
||||
|
||||
public VBTokenNode AssignToken { |
||||
get { return GetChildByRole (Roles.Assign); } |
||||
} |
||||
|
||||
public Expression Expression { |
||||
get { return GetChildByRole (Roles.Expression); } |
||||
set { SetChildByRole (Roles.Expression, value); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitFieldInitializerExpression(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
FieldInitializerExpression o = other as FieldInitializerExpression; |
||||
return o != null && this.IsKey == o.IsKey && this.Identifier.DoMatch(o.Identifier, match) && this.Expression.DoMatch(o.Expression, match); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class GetTypeExpression : Expression |
||||
{ |
||||
public GetTypeExpression() |
||||
{ |
||||
} |
||||
|
||||
public AstType Type { |
||||
get { return GetChildByRole(Roles.Type); } |
||||
set { SetChildByRole(Roles.Type, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
var expr = other as GetTypeExpression; |
||||
return expr != null && |
||||
Type.DoMatch(expr.Type, match); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitGetTypeExpression(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class GetXmlNamespaceExpression : Expression |
||||
{ |
||||
public GetXmlNamespaceExpression(XmlIdentifier namespaceName) |
||||
{ |
||||
SetChildByRole(Roles.XmlIdentifier, namespaceName); |
||||
} |
||||
|
||||
public XmlIdentifier NamespaceName { |
||||
get { return GetChildByRole(Roles.XmlIdentifier); } |
||||
set { SetChildByRole(Roles.XmlIdentifier, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
var expr = other as GetXmlNamespaceExpression; |
||||
return expr != null && |
||||
NamespaceName.DoMatch(expr.NamespaceName, match); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitGetXmlNamespaceExpression(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class IdentifierExpression : Expression |
||||
{ |
||||
public IdentifierExpression() |
||||
{ |
||||
|
||||
} |
||||
|
||||
public IdentifierExpression(Identifier identifier) |
||||
{ |
||||
this.Identifier = identifier; |
||||
} |
||||
|
||||
public Identifier Identifier { |
||||
get { return GetChildByRole(Roles.Identifier); } |
||||
set { SetChildByRole(Roles.Identifier, value); } |
||||
} |
||||
|
||||
public AstNodeCollection<AstType> TypeArguments { |
||||
get { return GetChildrenByRole(Roles.TypeArgument); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitIdentifierExpression(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,61 @@
@@ -0,0 +1,61 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// Description of InstanceExpression.
|
||||
/// </summary>
|
||||
public class InstanceExpression : Expression |
||||
{ |
||||
AstLocation location; |
||||
|
||||
public InstanceExpression(InstanceExpressionType type, AstLocation location) |
||||
{ |
||||
this.Type = type; |
||||
this.location = location; |
||||
} |
||||
|
||||
public override AstLocation StartLocation { |
||||
get { return location; } |
||||
} |
||||
|
||||
public override AstLocation EndLocation { |
||||
get { |
||||
switch (Type) { |
||||
case InstanceExpressionType.Me: |
||||
return new AstLocation(location.Line, location.Column + "Me".Length); |
||||
case InstanceExpressionType.MyBase: |
||||
return new AstLocation(location.Line, location.Column + "MyBase".Length); |
||||
case InstanceExpressionType.MyClass: |
||||
return new AstLocation(location.Line, location.Column + "MyClass".Length); |
||||
default: |
||||
throw new Exception("Invalid value for InstanceExpressionType"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public InstanceExpressionType Type { get; set; } |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
var expr = other as InstanceExpression; |
||||
return expr != null && |
||||
Type == expr.Type; |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitInstanceExpression(this, data); |
||||
} |
||||
} |
||||
|
||||
public enum InstanceExpressionType |
||||
{ |
||||
Me, |
||||
MyBase, |
||||
MyClass |
||||
} |
||||
} |
||||
@ -0,0 +1,52 @@
@@ -0,0 +1,52 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// Target(Arguments)
|
||||
/// </summary>
|
||||
public class InvocationExpression : Expression |
||||
{ |
||||
public Expression Target { |
||||
get { return GetChildByRole (Roles.TargetExpression); } |
||||
set { SetChildByRole(Roles.TargetExpression, value); } |
||||
} |
||||
|
||||
public AstNodeCollection<Expression> Arguments { |
||||
get { return GetChildrenByRole<Expression>(Roles.Argument); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitInvocationExpression(this, data); |
||||
} |
||||
|
||||
public InvocationExpression () |
||||
{ |
||||
} |
||||
|
||||
public InvocationExpression (Expression target, IEnumerable<Expression> arguments) |
||||
{ |
||||
AddChild (target, Roles.TargetExpression); |
||||
if (arguments != null) { |
||||
foreach (var arg in arguments) { |
||||
AddChild (arg, Roles.Argument); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public InvocationExpression (Expression target, params Expression[] arguments) : this (target, (IEnumerable<Expression>)arguments) |
||||
{ |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
InvocationExpression o = other as InvocationExpression; |
||||
return o != null && this.Target.DoMatch(o.Target, match) && this.Arguments.DoMatch(o.Arguments, match); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,124 @@
@@ -0,0 +1,124 @@
|
||||
// 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 System.Linq; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public abstract class LambdaExpression : Expression |
||||
{ |
||||
public static readonly Role<VBModifierToken> ModifierRole = AttributedNode.ModifierRole; |
||||
|
||||
public LambdaExpressionModifiers Modifiers { |
||||
get { return GetModifiers(this); } |
||||
set { SetModifiers(this, value); } |
||||
} |
||||
|
||||
public AstNodeCollection<VBModifierToken> ModifierTokens { |
||||
get { return GetChildrenByRole (ModifierRole); } |
||||
} |
||||
|
||||
internal static LambdaExpressionModifiers GetModifiers(AstNode node) |
||||
{ |
||||
LambdaExpressionModifiers m = 0; |
||||
foreach (VBModifierToken t in node.GetChildrenByRole (ModifierRole)) { |
||||
m |= (LambdaExpressionModifiers)t.Modifier; |
||||
} |
||||
return m; |
||||
} |
||||
|
||||
internal static void SetModifiers(AstNode node, LambdaExpressionModifiers newValue) |
||||
{ |
||||
LambdaExpressionModifiers oldValue = GetModifiers(node); |
||||
AstNode insertionPos = null; |
||||
foreach (Modifiers m in VBModifierToken.AllModifiers) { |
||||
if ((m & (Modifiers)newValue) != 0) { |
||||
if ((m & (Modifiers)oldValue) == 0) { |
||||
// Modifier was added
|
||||
var newToken = new VBModifierToken(AstLocation.Empty, m); |
||||
node.InsertChildAfter(insertionPos, newToken, ModifierRole); |
||||
insertionPos = newToken; |
||||
} else { |
||||
// Modifier already exists
|
||||
insertionPos = node.GetChildrenByRole(ModifierRole).First(t => t.Modifier == m); |
||||
} |
||||
} else { |
||||
if ((m & (Modifiers)oldValue) != 0) { |
||||
// Modifier was removed
|
||||
node.GetChildrenByRole (ModifierRole).First(t => t.Modifier == m).Remove(); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
public AstNodeCollection<ParameterDeclaration> Parameters { |
||||
get { return GetChildrenByRole(Roles.Parameter); } |
||||
} |
||||
} |
||||
|
||||
public class SingleLineSubLambdaExpression : LambdaExpression |
||||
{ |
||||
public static readonly Role<Statement> StatementRole = BlockStatement.StatementRole; |
||||
|
||||
public Statement EmbeddedStatement { |
||||
get { return GetChildByRole(StatementRole); } |
||||
set { SetChildByRole(StatementRole, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitSingleLineSubLambdaExpression(this, data); |
||||
} |
||||
} |
||||
|
||||
public class SingleLineFunctionLambdaExpression : LambdaExpression |
||||
{ |
||||
public Expression EmbeddedExpression { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitSingleLineFunctionLambdaExpression(this, data); |
||||
} |
||||
} |
||||
|
||||
public class MultiLineLambdaExpression : LambdaExpression |
||||
{ |
||||
public bool IsSub { get; set; } |
||||
|
||||
public BlockStatement Body { |
||||
get { return GetChildByRole(Roles.Body); } |
||||
set { SetChildByRole(Roles.Body, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitMultiLineLambdaExpression(this, data); |
||||
} |
||||
} |
||||
|
||||
public enum LambdaExpressionModifiers |
||||
{ |
||||
Async = Modifiers.Async, |
||||
Iterator = Modifiers.Iterator |
||||
} |
||||
} |
||||
@ -0,0 +1,42 @@
@@ -0,0 +1,42 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class MemberAccessExpression : Expression |
||||
{ |
||||
public MemberAccessExpression() |
||||
{ |
||||
} |
||||
|
||||
public Expression Target { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
public Identifier MemberName { |
||||
get { return GetChildByRole(Roles.Identifier); } |
||||
set { SetChildByRole(Roles.Identifier, value); } |
||||
} |
||||
|
||||
public AstNodeCollection<AstType> TypeArguments { |
||||
get { return GetChildrenByRole(Roles.TypeArgument); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
var expr = other as MemberAccessExpression; |
||||
return expr != null && |
||||
Target.DoMatch(expr.Target, match) && |
||||
MemberName.DoMatch(expr.MemberName, match) && |
||||
TypeArguments.DoMatch(expr.TypeArguments, match); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitMemberAccessExpression(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// Represents a named argument passed to a method or attribute.
|
||||
/// </summary>
|
||||
public class NamedArgumentExpression : Expression |
||||
{ |
||||
public Identifier Identifier { |
||||
get { return GetChildByRole(Roles.Identifier); } |
||||
set { SetChildByRole(Roles.Identifier, value); } |
||||
} |
||||
|
||||
public VBTokenNode AssignToken { |
||||
get { return GetChildByRole (Roles.Assign); } |
||||
} |
||||
|
||||
public Expression Expression { |
||||
get { return GetChildByRole (Roles.Expression); } |
||||
set { SetChildByRole (Roles.Expression, value); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitNamedArgumentExpression(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
NamedArgumentExpression o = other as NamedArgumentExpression; |
||||
return o != null && this.Identifier.DoMatch(o.Identifier, match) && this.Expression.DoMatch(o.Expression, match); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,59 @@
@@ -0,0 +1,59 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// New Type(Arguments) { Initializer }
|
||||
/// </summary>
|
||||
public class ObjectCreationExpression : Expression |
||||
{ |
||||
public readonly static Role<ArrayInitializerExpression> InitializerRole = ArrayInitializerExpression.InitializerRole; |
||||
|
||||
public AstType Type { |
||||
get { return GetChildByRole (Roles.Type); } |
||||
set { SetChildByRole (Roles.Type, value); } |
||||
} |
||||
|
||||
public AstNodeCollection<Expression> Arguments { |
||||
get { return GetChildrenByRole (Roles.Argument); } |
||||
} |
||||
|
||||
public ArrayInitializerExpression Initializer { |
||||
get { return GetChildByRole (InitializerRole); } |
||||
set { SetChildByRole (InitializerRole, value); } |
||||
} |
||||
|
||||
public ObjectCreationExpression() |
||||
{ |
||||
} |
||||
|
||||
public ObjectCreationExpression (AstType type, IEnumerable<Expression> arguments = null) |
||||
{ |
||||
AddChild (type, Roles.Type); |
||||
if (arguments != null) { |
||||
foreach (var arg in arguments) { |
||||
AddChild (arg, Roles.Argument); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public ObjectCreationExpression (AstType type, params Expression[] arguments) : this (type, (IEnumerable<Expression>)arguments) |
||||
{ |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitObjectCreationExpression(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
ObjectCreationExpression o = other as ObjectCreationExpression; |
||||
return o != null && this.Type.DoMatch(o.Type, match) && this.Arguments.DoMatch(o.Arguments, match) && this.Initializer.DoMatch(o.Initializer, match); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ParenthesizedExpression.
|
||||
/// </summary>
|
||||
public class ParenthesizedExpression : Expression |
||||
{ |
||||
public ParenthesizedExpression() |
||||
{ |
||||
} |
||||
|
||||
public Expression Expression { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
var expr = other as ParenthesizedExpression; |
||||
return expr != null && |
||||
Expression.DoMatch(expr.Expression, match); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitParenthesizedExpression(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,348 @@
@@ -0,0 +1,348 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class QueryExpression : Expression |
||||
{ |
||||
public AstNodeCollection<QueryOperator> QueryOperators { |
||||
get { return GetChildrenByRole(QueryOperator.QueryOperatorRole); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitQueryExpression(this, data); |
||||
} |
||||
} |
||||
|
||||
public abstract class QueryOperator : AstNode |
||||
{ |
||||
#region Null
|
||||
public new static readonly QueryOperator Null = new NullQueryOperator(); |
||||
|
||||
sealed class NullQueryOperator : QueryOperator |
||||
{ |
||||
public override bool IsNull { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return default (S); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
return other == null || other.IsNull; |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
public static readonly Role<QueryOperator> QueryOperatorRole = new Role<QueryOperator>("QueryOperator", QueryOperator.Null); |
||||
} |
||||
|
||||
public class FromQueryOperator : QueryOperator |
||||
{ |
||||
public AstNodeCollection<CollectionRangeVariableDeclaration> Variables { |
||||
get { return GetChildrenByRole (CollectionRangeVariableDeclaration.CollectionRangeVariableDeclarationRole); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitFromQueryOperator(this, data); |
||||
} |
||||
} |
||||
|
||||
public class AggregateQueryOperator : QueryOperator |
||||
{ |
||||
public CollectionRangeVariableDeclaration Variable { |
||||
get { return GetChildByRole(CollectionRangeVariableDeclaration.CollectionRangeVariableDeclarationRole); } |
||||
set { SetChildByRole(CollectionRangeVariableDeclaration.CollectionRangeVariableDeclarationRole, value); } |
||||
} |
||||
|
||||
public AstNodeCollection<QueryOperator> SubQueryOperators { |
||||
get { return GetChildrenByRole(QueryOperatorRole); } |
||||
} |
||||
|
||||
public AstNodeCollection<VariableInitializer> IntoExpressions { |
||||
get { return GetChildrenByRole(VariableInitializer.VariableInitializerRole); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitAggregateQueryOperator(this, data); |
||||
} |
||||
} |
||||
|
||||
public class SelectQueryOperator : QueryOperator |
||||
{ |
||||
public AstNodeCollection<VariableInitializer> Variables { |
||||
get { return GetChildrenByRole(VariableInitializer.VariableInitializerRole); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitSelectQueryOperator(this, data); |
||||
} |
||||
} |
||||
|
||||
public class DistinctQueryOperator : QueryOperator |
||||
{ |
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitDistinctQueryOperator(this, data); |
||||
} |
||||
} |
||||
|
||||
public class WhereQueryOperator : QueryOperator |
||||
{ |
||||
public Expression Condition { |
||||
get { return GetChildByRole (Roles.Expression); } |
||||
set { SetChildByRole (Roles.Expression, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitWhereQueryOperator(this, data); |
||||
} |
||||
} |
||||
|
||||
public class OrderExpression : AstNode |
||||
{ |
||||
public static readonly Role<OrderExpression> OrderExpressionRole = new Role<OrderExpression>("OrderExpression"); |
||||
|
||||
public Expression Expression { |
||||
get { return GetChildByRole (Roles.Expression); } |
||||
set { SetChildByRole (Roles.Expression, value); } |
||||
} |
||||
|
||||
public QueryOrderingDirection Direction { get; set; } |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitOrderExpression(this, data); |
||||
} |
||||
} |
||||
|
||||
public class OrderByQueryOperator : QueryOperator |
||||
{ |
||||
public AstNodeCollection<OrderExpression> Expressions { |
||||
get { return GetChildrenByRole(OrderExpression.OrderExpressionRole); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitOrderByQueryOperator(this, data); |
||||
} |
||||
} |
||||
|
||||
public class PartitionQueryOperator : QueryOperator |
||||
{ |
||||
public PartitionKind Kind { get; set; } |
||||
|
||||
public Expression Expression { |
||||
get { return GetChildByRole (Roles.Expression); } |
||||
set { SetChildByRole (Roles.Expression, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitPartitionQueryOperator(this, data); |
||||
} |
||||
} |
||||
|
||||
public class LetQueryOperator : QueryOperator |
||||
{ |
||||
public AstNodeCollection<VariableInitializer> Variables { |
||||
get { return GetChildrenByRole(VariableInitializer.VariableInitializerRole); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitLetQueryOperator(this, data); |
||||
} |
||||
} |
||||
|
||||
public class GroupByQueryOperator : QueryOperator |
||||
{ |
||||
public static readonly Role<VariableInitializer> GroupExpressionRole = new Role<VariableInitializer>("GroupExpression"); |
||||
public static readonly Role<VariableInitializer> ByExpressionRole = new Role<VariableInitializer>("ByExpression"); |
||||
public static readonly Role<VariableInitializer> IntoExpressionRole = new Role<VariableInitializer>("IntoExpression"); |
||||
|
||||
public AstNodeCollection<VariableInitializer> GroupExpressions { |
||||
get { return GetChildrenByRole(GroupExpressionRole); } |
||||
} |
||||
|
||||
public AstNodeCollection<VariableInitializer> ByExpressions { |
||||
get { return GetChildrenByRole(ByExpressionRole); } |
||||
} |
||||
|
||||
public AstNodeCollection<VariableInitializer> IntoExpressions { |
||||
get { return GetChildrenByRole(IntoExpressionRole); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitGroupByQueryOperator(this, data); |
||||
} |
||||
} |
||||
|
||||
public class JoinQueryOperator : QueryOperator |
||||
{ |
||||
#region Null
|
||||
public new static readonly JoinQueryOperator Null = new NullJoinQueryOperator(); |
||||
|
||||
sealed class NullJoinQueryOperator : JoinQueryOperator |
||||
{ |
||||
public override bool IsNull { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return default (S); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
return other == null || other.IsNull; |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
public static readonly Role<JoinQueryOperator> JoinQueryOperatorRole = new Role<JoinQueryOperator>("JoinQueryOperator", JoinQueryOperator.Null); |
||||
|
||||
public CollectionRangeVariableDeclaration JoinVariable { |
||||
get { return GetChildByRole(CollectionRangeVariableDeclaration.CollectionRangeVariableDeclarationRole); } |
||||
set { SetChildByRole(CollectionRangeVariableDeclaration.CollectionRangeVariableDeclarationRole, value); } |
||||
} |
||||
|
||||
public JoinQueryOperator SubJoinQuery { |
||||
get { return GetChildByRole(JoinQueryOperatorRole); } |
||||
set { SetChildByRole(JoinQueryOperatorRole, value); } |
||||
} |
||||
|
||||
public AstNodeCollection<JoinCondition> JoinConditions { |
||||
get { return GetChildrenByRole(JoinCondition.JoinConditionRole); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitJoinQueryOperator(this, data); |
||||
} |
||||
} |
||||
|
||||
public class JoinCondition : AstNode |
||||
{ |
||||
public static readonly Role<JoinCondition> JoinConditionRole = new Role<JoinCondition>("JoinCondition"); |
||||
|
||||
public static readonly Role<Expression> LeftExpressionRole = BinaryOperatorExpression.LeftExpressionRole; |
||||
public static readonly Role<Expression> RightExpressionRole = BinaryOperatorExpression.RightExpressionRole; |
||||
|
||||
public Expression Left { |
||||
get { return GetChildByRole (LeftExpressionRole); } |
||||
set { SetChildByRole (LeftExpressionRole, value); } |
||||
} |
||||
|
||||
public Expression Right { |
||||
get { return GetChildByRole (RightExpressionRole); } |
||||
set { SetChildByRole (RightExpressionRole, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitJoinCondition(this, data); |
||||
} |
||||
} |
||||
|
||||
public class GroupJoinQueryOperator : JoinQueryOperator |
||||
{ |
||||
public static readonly Role<VariableInitializer> IntoExpressionRole = GroupByQueryOperator.IntoExpressionRole; |
||||
|
||||
public AstNodeCollection<VariableInitializer> IntoExpressions { |
||||
get { return GetChildrenByRole(IntoExpressionRole); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitGroupJoinQueryOperator(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class TypeOfIsExpression : Expression |
||||
{ |
||||
public TypeOfIsExpression() |
||||
{ |
||||
} |
||||
|
||||
public Expression TypeOfExpression { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
public AstType Type { |
||||
get { return GetChildByRole(Roles.Type); } |
||||
set { SetChildByRole(Roles.Type, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
var expr = other as TypeOfIsExpression; |
||||
return expr != null && |
||||
TypeOfExpression.DoMatch(expr.TypeOfExpression, match) && |
||||
Type.DoMatch(expr.Type, match); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitTypeOfIsExpression(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// Represents an AstType as an expression.
|
||||
/// This is used when calling a method on a primitive type: "Integer.Parse()"
|
||||
/// </summary>
|
||||
public class TypeReferenceExpression : Expression |
||||
{ |
||||
public AstType Type { |
||||
get { return GetChildByRole(Roles.Type); } |
||||
set { SetChildByRole(Roles.Type, value); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitTypeReferenceExpression(this, data); |
||||
} |
||||
|
||||
public TypeReferenceExpression () |
||||
{ |
||||
} |
||||
|
||||
public TypeReferenceExpression (AstType type) |
||||
{ |
||||
SetChildByRole(Roles.Type, type); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
TypeReferenceExpression o = other as TypeReferenceExpression; |
||||
return o != null && this.Type.DoMatch(o.Type, match); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,80 @@
@@ -0,0 +1,80 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// Operator Expression
|
||||
/// </summary>
|
||||
public class UnaryOperatorExpression : Expression |
||||
{ |
||||
public readonly static Role<VBTokenNode> OperatorRole = BinaryOperatorExpression.OperatorRole; |
||||
|
||||
public UnaryOperatorExpression() |
||||
{ |
||||
} |
||||
|
||||
public UnaryOperatorExpression(UnaryOperatorType op, Expression expression) |
||||
{ |
||||
this.Operator = op; |
||||
this.Expression = expression; |
||||
} |
||||
|
||||
public UnaryOperatorType Operator { |
||||
get; |
||||
set; |
||||
} |
||||
|
||||
public VBTokenNode OperatorToken { |
||||
get { return GetChildByRole (OperatorRole); } |
||||
} |
||||
|
||||
public Expression Expression { |
||||
get { return GetChildByRole (Roles.Expression); } |
||||
set { SetChildByRole (Roles.Expression, value); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitUnaryOperatorExpression(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
UnaryOperatorExpression o = other as UnaryOperatorExpression; |
||||
return o != null && this.Operator == o.Operator && this.Expression.DoMatch(o.Expression, match); |
||||
} |
||||
|
||||
public static string GetOperatorSymbol(UnaryOperatorType op) |
||||
{ |
||||
switch (op) { |
||||
case UnaryOperatorType.Not: |
||||
return "Not"; |
||||
case UnaryOperatorType.Minus: |
||||
return "-"; |
||||
case UnaryOperatorType.Plus: |
||||
return "+"; |
||||
default: |
||||
throw new NotSupportedException("Invalid value for UnaryOperatorType"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public enum UnaryOperatorType |
||||
{ |
||||
/// <summary>Logical/Bitwise not (Not a)</summary>
|
||||
Not, |
||||
/// <summary>Unary minus (-a)</summary>
|
||||
Minus, |
||||
/// <summary>Unary plus (+a)</summary>
|
||||
Plus, |
||||
/// <summary>AddressOf</summary>
|
||||
AddressOf, |
||||
/// <summary>Await</summary>
|
||||
Await |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,46 @@
@@ -0,0 +1,46 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// Identifier As Type = Expression
|
||||
/// </summary>
|
||||
public class VariableInitializer : AstNode |
||||
{ |
||||
public static readonly Role<VariableInitializer> VariableInitializerRole = new Role<VariableInitializer>("VariableInitializer"); |
||||
|
||||
public VariableIdentifier Identifier { |
||||
get { return GetChildByRole(VariableIdentifier.VariableIdentifierRole); } |
||||
set { SetChildByRole(VariableIdentifier.VariableIdentifierRole, value); } |
||||
} |
||||
|
||||
public AstType Type { |
||||
get { return GetChildByRole(Roles.Type); } |
||||
set { SetChildByRole(Roles.Type, value); } |
||||
} |
||||
|
||||
public VBTokenNode AssignToken { |
||||
get { return GetChildByRole (Roles.Assign); } |
||||
} |
||||
|
||||
public Expression Expression { |
||||
get { return GetChildByRole (Roles.Expression); } |
||||
set { SetChildByRole (Roles.Expression, value); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitVariableInitializer(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
VariableInitializer o = other as VariableInitializer; |
||||
return o != null && this.Identifier.DoMatch(o.Identifier, match) && this.Type.DoMatch(o.Type, match) && this.Expression.DoMatch(o.Expression, match); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class EventMemberSpecifier : AstNode |
||||
{ |
||||
public static readonly Role<EventMemberSpecifier> EventMemberSpecifierRole = new Role<EventMemberSpecifier>("EventMemberSpecifier"); |
||||
|
||||
public EventMemberSpecifier() |
||||
{ |
||||
} |
||||
|
||||
public Expression Target { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
public Identifier Member { |
||||
get { return GetChildByRole(Roles.Identifier); } |
||||
set { SetChildByRole(Roles.Identifier, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
var expr = other as EventMemberSpecifier; |
||||
return expr != null && |
||||
Target.DoMatch(expr.Target, match) && |
||||
Member.DoMatch(expr.Member, match); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitEventMemberSpecifier(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,47 @@
@@ -0,0 +1,47 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class InterfaceMemberSpecifier : AstNode |
||||
{ |
||||
public static readonly Role<InterfaceMemberSpecifier> InterfaceMemberSpecifierRole = new Role<InterfaceMemberSpecifier>("InterfaceMemberSpecifier"); |
||||
|
||||
public InterfaceMemberSpecifier(Expression target, Identifier member) |
||||
{ |
||||
Target = target; |
||||
Member = member; |
||||
} |
||||
|
||||
public InterfaceMemberSpecifier(AstType target, string member) |
||||
{ |
||||
Target = new TypeReferenceExpression(target); |
||||
Member = new Identifier(member, AstLocation.Empty); |
||||
} |
||||
|
||||
public Expression Target { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
public Identifier Member { |
||||
get { return GetChildByRole(Roles.Identifier); } |
||||
set { SetChildByRole(Roles.Identifier, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
var expr = other as InterfaceMemberSpecifier; |
||||
return expr != null && |
||||
Target.DoMatch(expr.Target, match) && |
||||
Member.DoMatch(expr.Member, match); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitInterfaceMemberSpecifier(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,50 @@
@@ -0,0 +1,50 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// Continue ( Do | For | While )
|
||||
/// </summary>
|
||||
public class ContinueStatement : Statement |
||||
{ |
||||
public static readonly Role<VBTokenNode> ContinueKindTokenRole = new Role<VBTokenNode>("ContinueKindToken"); |
||||
|
||||
public ContinueKind ContinueKind { get; set; } |
||||
|
||||
public VBTokenNode ContinueToken { |
||||
get { return GetChildByRole (Roles.Keyword); } |
||||
} |
||||
|
||||
public VBTokenNode ContinueKindToken { |
||||
get { return GetChildByRole (ContinueKindTokenRole); } |
||||
} |
||||
|
||||
public ContinueStatement(ContinueKind kind) |
||||
{ |
||||
this.ContinueKind = kind; |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitContinueStatement(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
ContinueStatement o = other as ContinueStatement; |
||||
return o != null && this.ContinueKind == o.ContinueKind; |
||||
} |
||||
} |
||||
|
||||
public enum ContinueKind |
||||
{ |
||||
None, |
||||
Do, |
||||
For, |
||||
While |
||||
} |
||||
} |
||||
@ -0,0 +1,33 @@
@@ -0,0 +1,33 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class DoLoopStatement : Statement |
||||
{ |
||||
public ConditionType ConditionType { get; set; } |
||||
|
||||
public Expression Expression { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
public BlockStatement Body { |
||||
get { return GetChildByRole(Roles.Body); } |
||||
set { SetChildByRole(Roles.Body, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitDoLoopStatement(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,55 @@
@@ -0,0 +1,55 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// Exit ( Do | For | While | Select | Sub | Function | Property | Try )
|
||||
/// </summary>
|
||||
public class ExitStatement : Statement |
||||
{ |
||||
public static readonly Role<VBTokenNode> ExitKindTokenRole = new Role<VBTokenNode>("ExitKindToken"); |
||||
|
||||
public ExitKind ExitKind { get; set; } |
||||
|
||||
public VBTokenNode ExitToken { |
||||
get { return GetChildByRole (Roles.Keyword); } |
||||
} |
||||
|
||||
public VBTokenNode ExitKindToken { |
||||
get { return GetChildByRole (ExitKindTokenRole); } |
||||
} |
||||
|
||||
public ExitStatement(ExitKind kind) |
||||
{ |
||||
this.ExitKind = kind; |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitExitStatement(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
ExitStatement o = other as ExitStatement; |
||||
return o != null && this.ExitKind == o.ExitKind; |
||||
} |
||||
} |
||||
|
||||
public enum ExitKind |
||||
{ |
||||
None, |
||||
Sub, |
||||
Function, |
||||
Property, |
||||
Do, |
||||
For, |
||||
While, |
||||
Select, |
||||
Try |
||||
} |
||||
} |
||||
@ -0,0 +1,40 @@
@@ -0,0 +1,40 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// Expression
|
||||
/// </summary>
|
||||
// TODO this does not directly reflect the VB grammar!
|
||||
public class ExpressionStatement : Statement |
||||
{ |
||||
public Expression Expression { |
||||
get { return GetChildByRole (Roles.Expression); } |
||||
set { SetChildByRole (Roles.Expression, value); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitExpressionStatement(this, data); |
||||
} |
||||
|
||||
public ExpressionStatement() |
||||
{ |
||||
} |
||||
|
||||
public ExpressionStatement(Expression expression) |
||||
{ |
||||
this.Expression = expression; |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
ExpressionStatement o = other as ExpressionStatement; |
||||
return o != null && this.Expression.DoMatch(o.Expression, match); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class ForEachStatement : Statement |
||||
{ |
||||
public static readonly Role<AstNode> VariableRole = new Role<AstNode>("Variable", AstNode.Null); |
||||
|
||||
public AstNode Variable { |
||||
get { return GetChildByRole(VariableRole); } |
||||
set { SetChildByRole(VariableRole, value); } |
||||
} |
||||
|
||||
public Expression InExpression { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
public BlockStatement Body { |
||||
get { return GetChildByRole(Roles.Body); } |
||||
set { SetChildByRole(Roles.Body, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitForEachStatement(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,45 @@
@@ -0,0 +1,45 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class ForStatement : Statement |
||||
{ |
||||
public static readonly Role<AstNode> VariableRole = new Role<AstNode>("Variable", AstNode.Null); |
||||
public static readonly Role<Expression> ToExpressionRole = new Role<Expression>("ToExpression", Expression.Null); |
||||
public static readonly Role<Expression> StepExpressionRole = new Role<Expression>("StepExpression", Expression.Null); |
||||
|
||||
public AstNode Variable { |
||||
get { return GetChildByRole(VariableRole); } |
||||
set { SetChildByRole(VariableRole, value); } |
||||
} |
||||
|
||||
public Expression ToExpression { |
||||
get { return GetChildByRole(ToExpressionRole); } |
||||
set { SetChildByRole(ToExpressionRole, value); } |
||||
} |
||||
|
||||
public Expression StepExpression { |
||||
get { return GetChildByRole(StepExpressionRole); } |
||||
set { SetChildByRole(StepExpressionRole, value); } |
||||
} |
||||
|
||||
public BlockStatement Body { |
||||
get { return GetChildByRole(Roles.Body); } |
||||
set { SetChildByRole(Roles.Body, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitForStatement(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class GoToStatement : Statement |
||||
{ |
||||
/// <remarks>either PrimitiveExpression or IdentifierExpression</remarks>
|
||||
public Expression Label { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitGoToStatement(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class IfElseStatement : Statement |
||||
{ |
||||
public static readonly Role<Statement> FalseStatementRole = new Role<Statement>("False", Ast.Statement.Null); |
||||
public static readonly Role<Statement> TrueStatementRole = new Role<Statement>("True", Ast.Statement.Null); |
||||
|
||||
public Expression Condition { |
||||
get { return GetChildByRole(Roles.Condition); } |
||||
set { SetChildByRole(Roles.Condition, value); } |
||||
} |
||||
|
||||
public Statement Body { |
||||
get { return GetChildByRole(TrueStatementRole); } |
||||
set { SetChildByRole(TrueStatementRole, value); } |
||||
} |
||||
|
||||
public Statement ElseBlock { |
||||
get { return GetChildByRole(FalseStatementRole); } |
||||
set { SetChildByRole(FalseStatementRole, value); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitIfElseStatement(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// Label:
|
||||
/// </summary>
|
||||
public class LabelDeclarationStatement : Statement |
||||
{ |
||||
/// <remarks>either PrimitiveExpression or IdentifierExpression</remarks>
|
||||
public Expression Label { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
public VBTokenNode Colon { |
||||
get { return GetChildByRole(Roles.Colon); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitLabelDeclarationStatement(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
LabelDeclarationStatement o = other as LabelDeclarationStatement; |
||||
return o != null && this.Label.DoMatch(o.Label, match); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// ( Dim | Static | Const ) VariableDeclarator { , VariableDeclarator }
|
||||
/// </summary>
|
||||
public class LocalDeclarationStatement : Statement |
||||
{ |
||||
public AstNodeCollection<VariableDeclarator> Variables { |
||||
get { return GetChildrenByRole(VariableDeclarator.VariableDeclaratorRole); } |
||||
} |
||||
|
||||
public Modifiers Modifiers { |
||||
get { return AttributedNode.GetModifiers(this); } |
||||
set { AttributedNode.SetModifiers(this, value); } |
||||
} |
||||
|
||||
public VBModifierToken ModifierToken { |
||||
get { return GetChildByRole(AttributedNode.ModifierRole); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitLocalDeclarationStatement(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// Return Expression
|
||||
/// </summary>
|
||||
public class ReturnStatement : Statement |
||||
{ |
||||
public VBTokenNode ReturnToken { |
||||
get { return GetChildByRole (Roles.Keyword); } |
||||
} |
||||
|
||||
public Expression Expression { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
public ReturnStatement() |
||||
{ |
||||
} |
||||
|
||||
public ReturnStatement(Expression expression) |
||||
{ |
||||
AddChild (expression, Roles.Expression); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitReturnStatement(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
ReturnStatement o = other as ReturnStatement; |
||||
return o != null && this.Expression.DoMatch(o.Expression, match); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,147 @@
@@ -0,0 +1,147 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class SelectStatement : Statement |
||||
{ |
||||
public Expression Expression { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
public AstNodeCollection<CaseStatement> Cases { |
||||
get { return GetChildrenByRole(CaseStatement.CaseStatementRole); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitSelectStatement(this, data); |
||||
} |
||||
} |
||||
|
||||
public class CaseStatement : Statement |
||||
{ |
||||
public static readonly Role<CaseStatement> CaseStatementRole = new Role<CaseStatement>("CaseStatement"); |
||||
|
||||
public AstNodeCollection<CaseClause> Clauses { |
||||
get { return GetChildrenByRole(CaseClause.CaseClauseRole); } |
||||
} |
||||
|
||||
public BlockStatement Body { |
||||
get { return GetChildByRole(Roles.Body); } |
||||
set { SetChildByRole(Roles.Body, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitCaseStatement(this, data); |
||||
} |
||||
} |
||||
|
||||
public abstract class CaseClause : AstNode |
||||
{ |
||||
#region Null
|
||||
public new static readonly CaseClause Null = new NullCaseClause(); |
||||
|
||||
sealed class NullCaseClause : CaseClause |
||||
{ |
||||
public override bool IsNull { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return default (S); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
return other == null || other.IsNull; |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
public static readonly Role<CaseClause> CaseClauseRole = new Role<CaseClause>("CaseClause", CaseClause.Null); |
||||
|
||||
public Expression Expression { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
} |
||||
|
||||
public class SimpleCaseClause : CaseClause |
||||
{ |
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitSimpleCaseClause(this, data); |
||||
} |
||||
} |
||||
|
||||
public class RangeCaseClause : CaseClause |
||||
{ |
||||
public static readonly Role<Expression> ToExpressionRole = ForStatement.ToExpressionRole; |
||||
|
||||
public Expression ToExpression { |
||||
get { return GetChildByRole(ToExpressionRole); } |
||||
set { SetChildByRole(ToExpressionRole, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitRangeCaseClause(this, data); |
||||
} |
||||
} |
||||
|
||||
public class ComparisonCaseClause : CaseClause |
||||
{ |
||||
public static readonly Role<VBTokenNode> OperatorRole = BinaryOperatorExpression.OperatorRole; |
||||
|
||||
public ComparisonOperator Operator { get; set; } |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitComparisonCaseClause(this, data); |
||||
} |
||||
} |
||||
|
||||
public enum ComparisonOperator |
||||
{ |
||||
Equality = BinaryOperatorType.Equality, |
||||
InEquality = BinaryOperatorType.InEquality, |
||||
LessThan = BinaryOperatorType.LessThan, |
||||
GreaterThan = BinaryOperatorType.GreaterThan, |
||||
LessThanOrEqual = BinaryOperatorType.LessThanOrEqual, |
||||
GreaterThanOrEqual = BinaryOperatorType.GreaterThanOrEqual |
||||
} |
||||
} |
||||
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// SyncLock Expression <br />
|
||||
/// Block <br />
|
||||
/// End SyncLock
|
||||
/// </summary>
|
||||
public class SyncLockStatement : Statement |
||||
{ |
||||
public Expression Expression { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
public BlockStatement Body { |
||||
get { return GetChildByRole(Roles.Body); } |
||||
set { SetChildByRole(Roles.Body, value); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitSyncLockStatement(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// Throw Expression
|
||||
/// </summary>
|
||||
public class ThrowStatement : Statement |
||||
{ |
||||
public VBTokenNode ThrowToken { |
||||
get { return GetChildByRole (Roles.Keyword); } |
||||
} |
||||
|
||||
public Expression Expression { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
public ThrowStatement() |
||||
{ |
||||
} |
||||
|
||||
public ThrowStatement(Expression expression) |
||||
{ |
||||
AddChild (expression, Roles.Expression); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitThrowStatement(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
ThrowStatement o = other as ThrowStatement; |
||||
return o != null && this.Expression.DoMatch(o.Expression, match); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,67 @@
@@ -0,0 +1,67 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class TryStatement : Statement |
||||
{ |
||||
public static readonly Role<BlockStatement> FinallyBlockRole = new Role<BlockStatement>("FinallyBlock", Ast.BlockStatement.Null); |
||||
|
||||
public BlockStatement Body { |
||||
get { return GetChildByRole(Roles.Body); } |
||||
set { SetChildByRole(Roles.Body, value); } |
||||
} |
||||
|
||||
public AstNodeCollection<CatchBlock> CatchBlocks { |
||||
get { return GetChildrenByRole(CatchBlock.CatchBlockRole); } |
||||
} |
||||
|
||||
public BlockStatement FinallyBlock { |
||||
get { return GetChildByRole(FinallyBlockRole); } |
||||
set { SetChildByRole(FinallyBlockRole, value); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitTryStatement(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public class CatchBlock : BlockStatement |
||||
{ |
||||
public static readonly Role<CatchBlock> CatchBlockRole = new Role<CatchBlock>("CatchBlockRole"); |
||||
|
||||
public Identifier ExceptionVariable { |
||||
get { return GetChildByRole(Roles.Identifier); } |
||||
set { SetChildByRole(Roles.Identifier, value); } |
||||
} |
||||
|
||||
public AstType ExceptionType { |
||||
get { return GetChildByRole(Roles.Type); } |
||||
set { SetChildByRole(Roles.Type, value); } |
||||
} |
||||
|
||||
public Expression WhenExpression { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitCatchBlock(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,33 @@
@@ -0,0 +1,33 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class UsingStatement : Statement |
||||
{ |
||||
public static readonly Role<AstNode> ResourceRole = new Role<AstNode>("Resource", AstNode.Null); |
||||
|
||||
/// <remarks>either multiple VariableInitializers or one Expression</remarks>
|
||||
public AstNodeCollection<AstNode> Resources { |
||||
get { return GetChildrenByRole(ResourceRole); } |
||||
} |
||||
|
||||
public BlockStatement Body { |
||||
get { return GetChildByRole(Roles.Body); } |
||||
set { SetChildByRole(Roles.Body, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitUsingStatement(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class WhileStatement : Statement |
||||
{ |
||||
public Expression Condition { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
public BlockStatement Body { |
||||
get { return GetChildByRole(Roles.Body); } |
||||
set { SetChildByRole(Roles.Body, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitWhileStatement(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// With Expression <br />
|
||||
/// Block <br />
|
||||
/// End With
|
||||
/// </summary>
|
||||
public class WithStatement : Statement |
||||
{ |
||||
public Expression Expression { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
public BlockStatement Body { |
||||
get { return GetChildByRole(Roles.Body); } |
||||
set { SetChildByRole(Roles.Body, value); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitWithStatement(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
// 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.IO; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// Yield Expression
|
||||
/// </summary>
|
||||
/// <remarks>VB 11</remarks>
|
||||
public class YieldStatement : Statement |
||||
{ |
||||
public VBTokenNode YieldToken { |
||||
get { return GetChildByRole (Roles.Keyword); } |
||||
} |
||||
|
||||
public Expression Expression { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
public YieldStatement() |
||||
{ |
||||
} |
||||
|
||||
public YieldStatement(Expression expression) |
||||
{ |
||||
AddChild (expression, Roles.Expression); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitYieldStatement(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
YieldStatement o = other as YieldStatement; |
||||
return o != null && this.Expression.DoMatch(o.Expression, match); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <summary>
|
||||
/// Get/Set/AddHandler/RemoveHandler/RaiseEvent
|
||||
/// </summary>
|
||||
public class Accessor : AttributedNode |
||||
{ |
||||
public static readonly new Accessor Null = new NullAccessor (); |
||||
sealed class NullAccessor : Accessor |
||||
{ |
||||
public override bool IsNull { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return default (S); |
||||
} |
||||
} |
||||
|
||||
public BlockStatement Body { |
||||
get { return GetChildByRole(Roles.Body); } |
||||
set { SetChildByRole(Roles.Body, value); } |
||||
} |
||||
|
||||
public AstNodeCollection<ParameterDeclaration> Parameters { |
||||
get { return GetChildrenByRole(Roles.Parameter); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitAccessor(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
Accessor o = other as Accessor; |
||||
return o != null && !o.IsNull && this.MatchAttributesAndModifiers(o, match) && |
||||
this.Body.DoMatch(o.Body, match) && Parameters.DoMatch(o.Parameters, match); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,45 @@
@@ -0,0 +1,45 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public abstract class MemberDeclaration : AttributedNode |
||||
{ |
||||
|
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Description of ConstructorDeclaration.
|
||||
/// </summary>
|
||||
public class ConstructorDeclaration : MemberDeclaration |
||||
{ |
||||
public ConstructorDeclaration() |
||||
{ |
||||
} |
||||
|
||||
public AstNodeCollection<ParameterDeclaration> Parameters { |
||||
get { return GetChildrenByRole(Roles.Parameter); } |
||||
} |
||||
|
||||
public BlockStatement Body { |
||||
get { return GetChildByRole(Roles.Body); } |
||||
set { SetChildByRole(Roles.Body, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
var ctor = other as ConstructorDeclaration; |
||||
return ctor != null && |
||||
MatchAttributesAndModifiers(ctor, match) && |
||||
Parameters.DoMatch(ctor.Parameters, match) && |
||||
Body.DoMatch(ctor.Body, match); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitConstructorDeclaration(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,59 @@
@@ -0,0 +1,59 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class EventDeclaration : MemberDeclaration |
||||
{ |
||||
public bool IsCustom { get; set; } |
||||
|
||||
public static readonly Role<Accessor> AddHandlerRole = new Role<Accessor>("AddHandler", Accessor.Null); |
||||
public static readonly Role<Accessor> RemoveHandlerRole = new Role<Accessor>("RemoveHandler", Accessor.Null); |
||||
public static readonly Role<Accessor> RaiseEventRole = new Role<Accessor>("RaiseEvent", Accessor.Null); |
||||
|
||||
public Identifier Name { |
||||
get { return GetChildByRole(Roles.Identifier); } |
||||
set { SetChildByRole(Roles.Identifier, value); } |
||||
} |
||||
|
||||
public AstType ReturnType { |
||||
get { return GetChildByRole(Roles.Type); } |
||||
set { SetChildByRole(Roles.Type, value); } |
||||
} |
||||
|
||||
public AstNodeCollection<ParameterDeclaration> Parameters { |
||||
get { return GetChildrenByRole(Roles.Parameter); } |
||||
} |
||||
|
||||
public AstNodeCollection<InterfaceMemberSpecifier> ImplementsClause { |
||||
get { return GetChildrenByRole(InterfaceMemberSpecifier.InterfaceMemberSpecifierRole); } |
||||
} |
||||
|
||||
public Accessor AddHandlerBlock { |
||||
get { return GetChildByRole(AddHandlerRole); } |
||||
set { SetChildByRole(AddHandlerRole, value); } |
||||
} |
||||
|
||||
public Accessor RemoveHandlerBlock { |
||||
get { return GetChildByRole(RemoveHandlerRole); } |
||||
set { SetChildByRole(RemoveHandlerRole, value); } |
||||
} |
||||
|
||||
public Accessor RaiseEventBlock { |
||||
get { return GetChildByRole(RaiseEventRole); } |
||||
set { SetChildByRole(RaiseEventRole, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitEventDeclaration(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,71 @@
@@ -0,0 +1,71 @@
|
||||
// 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.Runtime.InteropServices; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class ExternalMethodDeclaration : MemberDeclaration |
||||
{ |
||||
public ExternalMethodDeclaration() |
||||
{ |
||||
} |
||||
|
||||
public CharsetModifier CharsetModifier { get; set; } |
||||
|
||||
public bool IsSub { get; set; } |
||||
|
||||
public Identifier Name { |
||||
get { return GetChildByRole(Roles.Identifier); } |
||||
set { SetChildByRole(Roles.Identifier, value); } |
||||
} |
||||
|
||||
public string Library { get; set; } |
||||
|
||||
public string Alias { get; set; } |
||||
|
||||
public AstNodeCollection<ParameterDeclaration> Parameters { |
||||
get { return GetChildrenByRole(Roles.Parameter); } |
||||
} |
||||
|
||||
public AstNodeCollection<AttributeBlock> ReturnTypeAttributes { |
||||
get { return GetChildrenByRole(AttributeBlock.ReturnTypeAttributeBlockRole); } |
||||
} |
||||
|
||||
public AstType ReturnType { |
||||
get { return GetChildByRole(Roles.Type); } |
||||
set { SetChildByRole(Roles.Type, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
// TODO : finish
|
||||
var method = other as ExternalMethodDeclaration; |
||||
return method != null && |
||||
MatchAttributesAndModifiers(method, match) && |
||||
IsSub == method.IsSub && |
||||
Name.DoMatch(method.Name, match) && |
||||
Parameters.DoMatch(method.Parameters, match) && |
||||
ReturnTypeAttributes.DoMatch(method.ReturnTypeAttributes, match) && |
||||
ReturnType.DoMatch(method.ReturnType, match); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitExternalMethodDeclaration(this, data); |
||||
} |
||||
} |
||||
|
||||
///<summary>
|
||||
/// Charset types, used in external methods
|
||||
/// declarations (VB only).
|
||||
///</summary>
|
||||
public enum CharsetModifier |
||||
{ |
||||
None, |
||||
Auto, |
||||
Unicode, |
||||
Ansi |
||||
} |
||||
} |
||||
@ -0,0 +1,81 @@
@@ -0,0 +1,81 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <remarks>
|
||||
/// Attributes? VariableModifier+ VariableDeclarators StatementTerminator
|
||||
/// </remarks>
|
||||
public class FieldDeclaration : MemberDeclaration |
||||
{ |
||||
public AstNodeCollection<VariableDeclarator> Variables { |
||||
get { return GetChildrenByRole(VariableDeclarator.VariableDeclaratorRole); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitFieldDeclaration(this, data); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
/// <remarks>
|
||||
/// Identifier IdentifierModifiers
|
||||
/// </remarks>
|
||||
public class VariableIdentifier : AstNode |
||||
{ |
||||
#region Null
|
||||
public new static readonly VariableIdentifier Null = new NullVariableIdentifier(); |
||||
|
||||
sealed class NullVariableIdentifier : VariableIdentifier |
||||
{ |
||||
public override bool IsNull { |
||||
get { |
||||
return true; |
||||
} |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return default (S); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
return other == null || other.IsNull; |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
public static readonly Role<VariableIdentifier> VariableIdentifierRole = new Role<VariableIdentifier>("VariableIdentifier", VariableIdentifier.Null); |
||||
|
||||
public Identifier Name { |
||||
get { return GetChildByRole(Roles.Identifier); } |
||||
set { SetChildByRole(Roles.Identifier, value); } |
||||
} |
||||
|
||||
public bool HasNullableSpecifier { get; set; } |
||||
|
||||
public AstNodeCollection<ArraySpecifier> ArraySpecifiers { |
||||
get { return GetChildrenByRole(ComposedType.ArraySpecifierRole); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitVariableIdentifier(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,72 @@
@@ -0,0 +1,72 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class MethodDeclaration : MemberDeclaration |
||||
{ |
||||
public MethodDeclaration() |
||||
{ |
||||
} |
||||
|
||||
public bool IsSub { get; set; } |
||||
|
||||
public Identifier Name { |
||||
get { return GetChildByRole(Roles.Identifier); } |
||||
set { SetChildByRole(Roles.Identifier, value); } |
||||
} |
||||
|
||||
public AstNodeCollection<TypeParameterDeclaration> TypeParameters { |
||||
get { return GetChildrenByRole(Roles.TypeParameter); } |
||||
} |
||||
|
||||
public AstNodeCollection<ParameterDeclaration> Parameters { |
||||
get { return GetChildrenByRole(Roles.Parameter); } |
||||
} |
||||
|
||||
public AstNodeCollection<AttributeBlock> ReturnTypeAttributes { |
||||
get { return GetChildrenByRole(AttributeBlock.ReturnTypeAttributeBlockRole); } |
||||
} |
||||
|
||||
public AstType ReturnType { |
||||
get { return GetChildByRole(Roles.Type); } |
||||
set { SetChildByRole(Roles.Type, value); } |
||||
} |
||||
|
||||
public AstNodeCollection<EventMemberSpecifier> HandlesClause { |
||||
get { return GetChildrenByRole(EventMemberSpecifier.EventMemberSpecifierRole); } |
||||
} |
||||
|
||||
public AstNodeCollection<InterfaceMemberSpecifier> ImplementsClause { |
||||
get { return GetChildrenByRole(InterfaceMemberSpecifier.InterfaceMemberSpecifierRole); } |
||||
} |
||||
|
||||
public BlockStatement Body { |
||||
get { return GetChildByRole(Roles.Body); } |
||||
set { SetChildByRole(Roles.Body, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
var method = other as MethodDeclaration; |
||||
return method != null && |
||||
MatchAttributesAndModifiers(method, match) && |
||||
IsSub == method.IsSub && |
||||
Name.DoMatch(method.Name, match) && |
||||
TypeParameters.DoMatch(method.TypeParameters, match) && |
||||
Parameters.DoMatch(method.Parameters, match) && |
||||
ReturnTypeAttributes.DoMatch(method.ReturnTypeAttributes, match) && |
||||
ReturnType.DoMatch(method.ReturnType, match) && |
||||
HandlesClause.DoMatch(method.HandlesClause, match) && |
||||
ImplementsClause.DoMatch(method.ImplementsClause, match) && |
||||
Body.DoMatch(method.Body, match); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitMethodDeclaration(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,83 @@
@@ -0,0 +1,83 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class OperatorDeclaration : MemberDeclaration |
||||
{ |
||||
public OperatorDeclaration() |
||||
{ |
||||
} |
||||
|
||||
public OverloadableOperatorType Operator { get; set; } |
||||
|
||||
public AstNodeCollection<ParameterDeclaration> Parameters { |
||||
get { return GetChildrenByRole(Roles.Parameter); } |
||||
} |
||||
|
||||
public AstNodeCollection<AttributeBlock> ReturnTypeAttributes { |
||||
get { return GetChildrenByRole(AttributeBlock.ReturnTypeAttributeBlockRole); } |
||||
} |
||||
|
||||
public AstType ReturnType { |
||||
get { return GetChildByRole(Roles.Type); } |
||||
set { SetChildByRole(Roles.Type, value); } |
||||
} |
||||
|
||||
public BlockStatement Body { |
||||
get { return GetChildByRole(Roles.Body); } |
||||
set { SetChildByRole(Roles.Body, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitOperatorDeclaration(this, data); |
||||
} |
||||
} |
||||
|
||||
public enum OverloadableOperatorType |
||||
{ |
||||
None, |
||||
|
||||
Add, |
||||
Subtract, |
||||
Multiply, |
||||
Divide, |
||||
Modulus, |
||||
Concat, |
||||
|
||||
UnaryPlus, |
||||
UnaryMinus, |
||||
|
||||
Not, |
||||
|
||||
BitwiseAnd, |
||||
BitwiseOr, |
||||
ExclusiveOr, |
||||
|
||||
ShiftLeft, |
||||
ShiftRight, |
||||
|
||||
GreaterThan, |
||||
GreaterThanOrEqual, |
||||
Equality, |
||||
InEquality, |
||||
LessThan, |
||||
LessThanOrEqual, |
||||
|
||||
IsTrue, |
||||
IsFalse, |
||||
|
||||
Like, |
||||
Power, |
||||
CType, |
||||
DivideInteger |
||||
}//
|
||||
} |
||||
@ -0,0 +1,57 @@
@@ -0,0 +1,57 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
public class PropertyDeclaration : MemberDeclaration |
||||
{ |
||||
// TODO : support automatic properties
|
||||
|
||||
public static readonly Role<Accessor> GetterRole = new Role<Accessor>("Getter", Accessor.Null); |
||||
public static readonly Role<Accessor> SetterRole = new Role<Accessor>("Setter", Accessor.Null); |
||||
|
||||
public Identifier Name { |
||||
get { return GetChildByRole(Roles.Identifier); } |
||||
set { SetChildByRole(Roles.Identifier, value); } |
||||
} |
||||
|
||||
public AstNodeCollection<ParameterDeclaration> Parameters { |
||||
get { return GetChildrenByRole(Roles.Parameter); } |
||||
} |
||||
|
||||
public AstNodeCollection<AttributeBlock> ReturnTypeAttributes { |
||||
get { return GetChildrenByRole(AttributeBlock.ReturnTypeAttributeBlockRole); } |
||||
} |
||||
|
||||
public AstType ReturnType { |
||||
get { return GetChildByRole(Roles.Type); } |
||||
set { SetChildByRole(Roles.Type, value); } |
||||
} |
||||
|
||||
public AstNodeCollection<InterfaceMemberSpecifier> ImplementsClause { |
||||
get { return GetChildrenByRole(InterfaceMemberSpecifier.InterfaceMemberSpecifierRole); } |
||||
} |
||||
|
||||
public Accessor Getter { |
||||
get { return GetChildByRole(GetterRole); } |
||||
set { SetChildByRole(GetterRole, value); } |
||||
} |
||||
|
||||
public Accessor Setter { |
||||
get { return GetChildByRole(SetterRole); } |
||||
set { SetChildByRole(SetterRole, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitPropertyDeclaration(this, data); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,63 @@
@@ -0,0 +1,63 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.NRefactory.VB.Ast |
||||
{ |
||||
/// <remarks>
|
||||
/// VariableIdentifiers As ObjectCreationExpression <br />
|
||||
/// VariableIdentifiers ( As TypeName )? ( Equals Expression )?
|
||||
/// </remarks>
|
||||
public abstract class VariableDeclarator : AstNode |
||||
{ |
||||
public static readonly Role<VariableDeclarator> VariableDeclaratorRole = new Role<VariableDeclarator>("VariableDeclarator"); |
||||
|
||||
public AstNodeCollection<VariableIdentifier> Identifiers { |
||||
get { return GetChildrenByRole(VariableIdentifier.VariableIdentifierRole); } |
||||
} |
||||
} |
||||
|
||||
public class VariableDeclaratorWithTypeAndInitializer : VariableDeclarator |
||||
{ |
||||
public AstType Type { |
||||
get { return GetChildByRole(Roles.Type); } |
||||
set { SetChildByRole(Roles.Type, value); } |
||||
} |
||||
|
||||
public Expression Initializer { |
||||
get { return GetChildByRole(Roles.Expression); } |
||||
set { SetChildByRole(Roles.Expression, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitVariableDeclaratorWithTypeAndInitializer(this, data); |
||||
} |
||||
} |
||||
|
||||
public class VariableDeclaratorWithObjectCreation : VariableDeclarator |
||||
{ |
||||
public static readonly Role<ObjectCreationExpression> InitializerRole = new Role<ObjectCreationExpression>("InitializerRole"); |
||||
|
||||
public ObjectCreationExpression Initializer { |
||||
get { return GetChildByRole(InitializerRole); } |
||||
set { SetChildByRole(InitializerRole, value); } |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
||||
{ |
||||
return visitor.VisitVariableDeclaratorWithObjectCreation(this, data); |
||||
} |
||||
} |
||||
} |
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue