Browse Source

Merge branch 'master' of git://github.com/icsharpcode/ILSpy

Conflicts:
	ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj
	ILSpy.SharpDevelop.LGPL/ILSpy.SharpDevelop.LGPL.csproj
newNRvisualizers
Pent Ploompuu 15 years ago
parent
commit
ddc5d8ae50
  1. 39
      ICSharpCode.NRefactory.VB/Ast/AstNode.cs
  2. 67
      ICSharpCode.NRefactory.VB/Ast/Comment.cs
  3. 221
      ICSharpCode.NRefactory.VB/Ast/Enums.cs
  4. 41
      ICSharpCode.NRefactory.VB/Ast/Expressions/AnonymousObjectCreationExpression.cs
  5. 64
      ICSharpCode.NRefactory.VB/Ast/Expressions/ArrayCreateExpression.cs
  6. 53
      ICSharpCode.NRefactory.VB/Ast/Expressions/ArrayInitializerExpression.cs
  7. 44
      ICSharpCode.NRefactory.VB/Ast/Expressions/AssignmentExpression.cs
  8. 110
      ICSharpCode.NRefactory.VB/Ast/Expressions/BinaryOperatorExpression.cs
  9. 95
      ICSharpCode.NRefactory.VB/Ast/Expressions/CastExpression.cs
  10. 42
      ICSharpCode.NRefactory.VB/Ast/Expressions/CollectionRangeVariableDeclaration.cs
  11. 44
      ICSharpCode.NRefactory.VB/Ast/Expressions/ConditionalExpression.cs
  12. 59
      ICSharpCode.NRefactory.VB/Ast/Expressions/EmptyExpression.cs
  13. 76
      ICSharpCode.NRefactory.VB/Ast/Expressions/Expression.cs
  14. 49
      ICSharpCode.NRefactory.VB/Ast/Expressions/FieldInitializerExpression.cs
  15. 31
      ICSharpCode.NRefactory.VB/Ast/Expressions/GetTypeExpression.cs
  16. 32
      ICSharpCode.NRefactory.VB/Ast/Expressions/GetXmlNamespaceExpression.cs
  17. 39
      ICSharpCode.NRefactory.VB/Ast/Expressions/IdentifierExpression.cs
  18. 61
      ICSharpCode.NRefactory.VB/Ast/Expressions/InstanceExpression.cs
  19. 52
      ICSharpCode.NRefactory.VB/Ast/Expressions/InvocationExpression.cs
  20. 124
      ICSharpCode.NRefactory.VB/Ast/Expressions/LambdaExpression.cs
  21. 42
      ICSharpCode.NRefactory.VB/Ast/Expressions/MemberAccessExpression.cs
  22. 39
      ICSharpCode.NRefactory.VB/Ast/Expressions/NamedArgumentExpression.cs
  23. 59
      ICSharpCode.NRefactory.VB/Ast/Expressions/ObjectCreationExpression.cs
  24. 34
      ICSharpCode.NRefactory.VB/Ast/Expressions/ParenthesizedExpression.cs
  25. 4
      ICSharpCode.NRefactory.VB/Ast/Expressions/PrimitiveExpression.cs
  26. 348
      ICSharpCode.NRefactory.VB/Ast/Expressions/QueryExpression.cs
  27. 11
      ICSharpCode.NRefactory.VB/Ast/Expressions/SimpleNameExpression.cs
  28. 37
      ICSharpCode.NRefactory.VB/Ast/Expressions/TypeOfIsExpression.cs
  29. 39
      ICSharpCode.NRefactory.VB/Ast/Expressions/TypeReferenceExpression.cs
  30. 80
      ICSharpCode.NRefactory.VB/Ast/Expressions/UnaryOperatorExpression.cs
  31. 46
      ICSharpCode.NRefactory.VB/Ast/Expressions/VariableInitializer.cs
  32. 2
      ICSharpCode.NRefactory.VB/Ast/Expressions/XmlIdentifier.cs
  33. 2
      ICSharpCode.NRefactory.VB/Ast/Expressions/XmlLiteralString.cs
  34. 9
      ICSharpCode.NRefactory.VB/Ast/General/Attribute.cs
  35. 2
      ICSharpCode.NRefactory.VB/Ast/General/AttributeBlock.cs
  36. 4
      ICSharpCode.NRefactory.VB/Ast/General/AttributedNode.cs
  37. 2
      ICSharpCode.NRefactory.VB/Ast/General/CompilationUnit.cs
  38. 39
      ICSharpCode.NRefactory.VB/Ast/General/EventMemberSpecifier.cs
  39. 47
      ICSharpCode.NRefactory.VB/Ast/General/InterfaceMemberSpecifier.cs
  40. 6
      ICSharpCode.NRefactory.VB/Ast/General/ParameterDeclaration.cs
  41. 4
      ICSharpCode.NRefactory.VB/Ast/General/TypeParameterDeclaration.cs
  42. 2
      ICSharpCode.NRefactory.VB/Ast/Generated.cs
  43. 2
      ICSharpCode.NRefactory.VB/Ast/GlobalScope/DelegateDeclaration.cs
  44. 6
      ICSharpCode.NRefactory.VB/Ast/GlobalScope/EnumDeclaration.cs
  45. 2
      ICSharpCode.NRefactory.VB/Ast/GlobalScope/EnumMemberDeclaration.cs
  46. 4
      ICSharpCode.NRefactory.VB/Ast/GlobalScope/ImportsClause.cs
  47. 2
      ICSharpCode.NRefactory.VB/Ast/GlobalScope/ImportsStatement.cs
  48. 2
      ICSharpCode.NRefactory.VB/Ast/GlobalScope/NamespaceDeclaration.cs
  49. 2
      ICSharpCode.NRefactory.VB/Ast/GlobalScope/OptionStatement.cs
  50. 13
      ICSharpCode.NRefactory.VB/Ast/GlobalScope/TypeDeclaration.cs
  51. 2
      ICSharpCode.NRefactory.VB/Ast/INullable.cs
  52. 11
      ICSharpCode.NRefactory.VB/Ast/Identifier.cs
  53. 32
      ICSharpCode.NRefactory.VB/Ast/Statements/BlockStatement.cs
  54. 50
      ICSharpCode.NRefactory.VB/Ast/Statements/ContinueStatement.cs
  55. 33
      ICSharpCode.NRefactory.VB/Ast/Statements/DoLoopStatement.cs
  56. 55
      ICSharpCode.NRefactory.VB/Ast/Statements/ExitStatement.cs
  57. 40
      ICSharpCode.NRefactory.VB/Ast/Statements/ExpressionStatement.cs
  58. 38
      ICSharpCode.NRefactory.VB/Ast/Statements/ForEachStatement.cs
  59. 45
      ICSharpCode.NRefactory.VB/Ast/Statements/ForStatement.cs
  60. 27
      ICSharpCode.NRefactory.VB/Ast/Statements/GoToStatement.cs
  61. 39
      ICSharpCode.NRefactory.VB/Ast/Statements/IfElseStatement.cs
  62. 35
      ICSharpCode.NRefactory.VB/Ast/Statements/LabelDeclarationStatement.cs
  63. 37
      ICSharpCode.NRefactory.VB/Ast/Statements/LocalDeclarationStatement.cs
  64. 43
      ICSharpCode.NRefactory.VB/Ast/Statements/ReturnStatement.cs
  65. 147
      ICSharpCode.NRefactory.VB/Ast/Statements/SelectStatement.cs
  66. 26
      ICSharpCode.NRefactory.VB/Ast/Statements/Statement.cs
  67. 36
      ICSharpCode.NRefactory.VB/Ast/Statements/SyncLockStatement.cs
  68. 43
      ICSharpCode.NRefactory.VB/Ast/Statements/ThrowStatement.cs
  69. 67
      ICSharpCode.NRefactory.VB/Ast/Statements/TryStatement.cs
  70. 33
      ICSharpCode.NRefactory.VB/Ast/Statements/UsingStatement.cs
  71. 31
      ICSharpCode.NRefactory.VB/Ast/Statements/WhileStatement.cs
  72. 36
      ICSharpCode.NRefactory.VB/Ast/Statements/WithStatement.cs
  73. 44
      ICSharpCode.NRefactory.VB/Ast/Statements/YieldStatement.cs
  74. 49
      ICSharpCode.NRefactory.VB/Ast/TypeMembers/Accessor.cs
  75. 45
      ICSharpCode.NRefactory.VB/Ast/TypeMembers/ConstructorDeclaration.cs
  76. 59
      ICSharpCode.NRefactory.VB/Ast/TypeMembers/EventDeclaration.cs
  77. 71
      ICSharpCode.NRefactory.VB/Ast/TypeMembers/ExternalMethodDeclaration.cs
  78. 81
      ICSharpCode.NRefactory.VB/Ast/TypeMembers/FieldDeclaration.cs
  79. 72
      ICSharpCode.NRefactory.VB/Ast/TypeMembers/MethodDeclaration.cs
  80. 83
      ICSharpCode.NRefactory.VB/Ast/TypeMembers/OperatorDeclaration.cs
  81. 57
      ICSharpCode.NRefactory.VB/Ast/TypeMembers/PropertyDeclaration.cs
  82. 63
      ICSharpCode.NRefactory.VB/Ast/TypeMembers/VariableDeclarator.cs
  83. 84
      ICSharpCode.NRefactory.VB/Ast/TypeName/AstType.cs
  84. 2
      ICSharpCode.NRefactory.VB/Ast/TypeName/ComposedType.cs
  85. 2
      ICSharpCode.NRefactory.VB/Ast/TypeName/PrimitiveType.cs
  86. 2
      ICSharpCode.NRefactory.VB/Ast/TypeName/QualifiedType.cs
  87. 40
      ICSharpCode.NRefactory.VB/Ast/VBModifierToken.cs
  88. 2
      ICSharpCode.NRefactory.VB/AstBuilder/ExpressionBuilder.cs
  89. 2
      ICSharpCode.NRefactory.VB/AstBuilder/StatementBuilder.cs
  90. 91
      ICSharpCode.NRefactory.VB/IAstVisitor.cs
  91. 68
      ICSharpCode.NRefactory.VB/ICSharpCode.NRefactory.VB.csproj
  92. 2
      ICSharpCode.NRefactory.VB/Lexer/Block.cs
  93. 2
      ICSharpCode.NRefactory.VB/Lexer/ExpressionFinder.cs
  94. 2
      ICSharpCode.NRefactory.VB/Lexer/ExpressionFinderState.cs
  95. 2
      ICSharpCode.NRefactory.VB/Lexer/Extensions.cs
  96. 2
      ICSharpCode.NRefactory.VB/Lexer/LATextReader.cs
  97. 2
      ICSharpCode.NRefactory.VB/Lexer/LookupTable.cs
  98. 2
      ICSharpCode.NRefactory.VB/Lexer/SavepointEventArgs.cs
  99. 2
      ICSharpCode.NRefactory.VB/Lexer/Special/BlankLine.cs
  100. 2
      ICSharpCode.NRefactory.VB/Lexer/Special/Comment.cs
  101. Some files were not shown because too many files have changed in this diff Show More

39
ICSharpCode.NRefactory.VB/Ast/AstNode.cs

@ -1,28 +1,5 @@ @@ -1,28 +1,5 @@
//
// AstNode.cs
//
// Author:
// Mike Krüger <mkrueger@novell.com>
//
// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// 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;
@ -532,13 +509,13 @@ namespace ICSharpCode.NRefactory.VB @@ -532,13 +509,13 @@ namespace ICSharpCode.NRefactory.VB
public static readonly Role<XmlIdentifier> XmlIdentifier = new Role<XmlIdentifier>("XmlIdentifier", Ast.XmlIdentifier.Null);
public static readonly Role<XmlLiteralString> XmlLiteralString = new Role<XmlLiteralString>("XmlLiteralString", Ast.XmlLiteralString.Null);
// public static readonly Role<BlockStatement> Body = new Role<BlockStatement>("Body", CSharp.BlockStatement.Null);
public static readonly Role<BlockStatement> Body = new Role<BlockStatement>("Body", Ast.BlockStatement.Null);
public static readonly Role<ParameterDeclaration> Parameter = new Role<ParameterDeclaration>("Parameter");
public static readonly Role<Expression> Argument = new Role<Expression>("Argument", Ast.Expression.Null);
public static readonly Role<AstType> Type = new Role<AstType>("Type", AstType.Null);
public static readonly Role<Expression> Expression = new Role<Expression>("Expression", Ast.Expression.Null);
// public static readonly Role<Expression> TargetExpression = new Role<Expression>("Target", CSharp.Expression.Null);
// public readonly static Role<Expression> Condition = new Role<Expression>("Condition", CSharp.Expression.Null);
public static readonly Role<Expression> TargetExpression = new Role<Expression>("Target", Ast.Expression.Null);
public readonly static Role<Expression> Condition = new Role<Expression>("Condition", Ast.Expression.Null);
//
public static readonly Role<TypeParameterDeclaration> TypeParameter = new Role<TypeParameterDeclaration>("TypeParameter");
public static readonly Role<AstType> TypeArgument = new Role<AstType>("TypeArgument", AstType.Null);
@ -558,6 +535,7 @@ namespace ICSharpCode.NRefactory.VB @@ -558,6 +535,7 @@ namespace ICSharpCode.NRefactory.VB
public static readonly Role<VBTokenNode> LChevron = new Role<VBTokenNode>("LChevron", VBTokenNode.Null);
public static readonly Role<VBTokenNode> RChevron = new Role<VBTokenNode>("RChevron", VBTokenNode.Null);
public static readonly Role<VBTokenNode> Comma = new Role<VBTokenNode>("Comma", VBTokenNode.Null);
public static readonly Role<VBTokenNode> QuestionMark = new Role<VBTokenNode>("QuestionMark", VBTokenNode.Null);
public static readonly Role<VBTokenNode> Dot = new Role<VBTokenNode>("Dot", VBTokenNode.Null);
public static readonly Role<VBTokenNode> Semicolon = new Role<VBTokenNode>("Semicolon", VBTokenNode.Null);
public static readonly Role<VBTokenNode> Assign = new Role<VBTokenNode>("Assign", VBTokenNode.Null);
@ -579,8 +557,5 @@ namespace ICSharpCode.NRefactory.VB @@ -579,8 +557,5 @@ namespace ICSharpCode.NRefactory.VB
}
}
public class Comment
{
}
}

67
ICSharpCode.NRefactory.VB/Ast/Comment.cs

@ -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);
}
}
}

221
ICSharpCode.NRefactory.VB/Ast/Enums.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
@ -25,7 +25,7 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -25,7 +25,7 @@ namespace ICSharpCode.NRefactory.VB.Ast
Const = 0x0200,
Shared = 0x0400,
Static = 0x0800,
Override = 0x1000,
Overrides = 0x1000,
ReadOnly = 0x2000,
Shadows = 0x4000,
Partial = 0x8000,
@ -45,6 +45,12 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -45,6 +45,12 @@ namespace ICSharpCode.NRefactory.VB.Ast
ParamArray = 0x800000,
Optional = 0x1000000,
Narrowing = 0x2000000,
Widening = 0x4000000,
Iterator = 0x8000000,
Async = 0x10000000,
/// <summary>
/// Special value used to match any modifiers during pattern matching.
/// </summary>
@ -67,13 +73,6 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -67,13 +73,6 @@ namespace ICSharpCode.NRefactory.VB.Ast
Ref
}
public enum VarianceModifier
{
Invariant,
Covariant,
Contravariant
};
public enum AssignmentOperatorType
{
None,
@ -83,7 +82,6 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -83,7 +82,6 @@ namespace ICSharpCode.NRefactory.VB.Ast
Subtract,
Multiply,
Divide,
Modulus,
Power, // (VB only)
DivideInteger, // (VB only)
@ -91,117 +89,6 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -91,117 +89,6 @@ namespace ICSharpCode.NRefactory.VB.Ast
ShiftLeft,
ShiftRight,
BitwiseAnd,
BitwiseOr,
ExclusiveOr,
}
public enum BinaryOperatorType
{
None,
/// <summary>'&amp;' in C#, 'And' in VB.</summary>
BitwiseAnd,
/// <summary>'|' in C#, 'Or' in VB.</summary>
BitwiseOr,
/// <summary>'&amp;&amp;' in C#, 'AndAlso' in VB.</summary>
LogicalAnd,
/// <summary>'||' in C#, 'OrElse' in VB.</summary>
LogicalOr,
/// <summary>'^' in C#, 'Xor' in VB.</summary>
ExclusiveOr,
/// <summary>&gt;</summary>
GreaterThan,
/// <summary>&gt;=</summary>
GreaterThanOrEqual,
/// <summary>'==' in C#, '=' in VB.</summary>
Equality,
/// <summary>'!=' in C#, '&lt;&gt;' in VB.</summary>
InEquality,
/// <summary>&lt;</summary>
LessThan,
/// <summary>&lt;=</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: &amp;</summary>
Concat,
/// <summary>C#: &lt;&lt;</summary>
ShiftLeft,
/// <summary>C#: &gt;&gt;</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
}
public enum CastType
{
/// <summary>
/// direct cast (C#, VB "DirectCast")
/// </summary>
Cast,
/// <summary>
/// try cast (C# "as", VB "TryCast")
/// </summary>
TryCast,
/// <summary>
/// converting cast (VB "CType")
/// </summary>
Conversion,
/// <summary>
/// primitive converting cast (VB "CString" etc.)
/// </summary>
PrimitiveConversion
}
public enum UnaryOperatorType
{
None,
Not,
BitNot,
Minus,
Plus,
Increment,
Decrement,
PostIncrement,
PostDecrement,
/// <summary>Dereferencing pointer</summary>
Dereference,
/// <summary>Get address of</summary>
AddressOf
}
public enum ContinueType
@ -215,38 +102,12 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -215,38 +102,12 @@ namespace ICSharpCode.NRefactory.VB.Ast
public enum ConditionType
{
None,
Until,
While,
LoopUntil,
LoopWhile,
DoUntil,
DoWhile
}
public enum ConditionPosition
{
None,
Start,
End
}
public enum ExitType
{
None,
Sub,
Function,
Property,
Do,
For,
While,
Select,
Try
}
public enum ConstructorInitializerType
{
None,
Base,
This
}
public enum ConversionType
{
None,
@ -254,66 +115,10 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -254,66 +115,10 @@ namespace ICSharpCode.NRefactory.VB.Ast
Explicit
}
public enum OverloadableOperatorType
{
None,
Add,
Subtract,
Multiply,
Divide,
Modulus,
Concat,
UnaryPlus,
UnaryMinus,
Not,
BitNot,
BitwiseAnd,
BitwiseOr,
ExclusiveOr,
ShiftLeft,
ShiftRight,
GreaterThan,
GreaterThanOrEqual,
Equality,
InEquality,
LessThan,
LessThanOrEqual,
Increment,
Decrement,
IsTrue,
IsFalse,
// VB specific
Like,
Power,
CType,
DivideInteger
}
///<summary>
/// Charset types, used in external methods
/// declarations (VB only).
///</summary>
public enum CharsetModifier
{
None,
Auto,
Unicode,
Ansi
}
/// <summary>
/// Specifies the ordering direction of a QueryExpressionOrdering node.
/// </summary>
public enum QueryExpressionOrderingDirection
public enum QueryOrderingDirection
{
None,
Ascending,
@ -324,7 +129,7 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -324,7 +129,7 @@ namespace ICSharpCode.NRefactory.VB.Ast
/// Specifies the partition type for a VB.NET
/// query expression.
/// </summary>
public enum QueryExpressionPartitionType
public enum PartitionKind
{
Take,
TakeWhile,

41
ICSharpCode.NRefactory.VB/Ast/Expressions/AnonymousObjectCreationExpression.cs

@ -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);
}
}
}

64
ICSharpCode.NRefactory.VB/Ast/Expressions/ArrayCreateExpression.cs

@ -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);
}
}
}

53
ICSharpCode.NRefactory.VB/Ast/Expressions/ArrayInitializerExpression.cs

@ -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);
}
}
}

44
ICSharpCode.NRefactory.VB/Ast/Expressions/AssignmentExpression.cs

@ -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);
}
}
}

110
ICSharpCode.NRefactory.VB/Ast/Expressions/BinaryOperatorExpression.cs

@ -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>'&amp;' in C#, 'And' in VB.</summary>
BitwiseAnd,
/// <summary>'|' in C#, 'Or' in VB.</summary>
BitwiseOr,
/// <summary>'&amp;&amp;' in C#, 'AndAlso' in VB.</summary>
LogicalAnd,
/// <summary>'||' in C#, 'OrElse' in VB.</summary>
LogicalOr,
/// <summary>'^' in C#, 'Xor' in VB.</summary>
ExclusiveOr,
/// <summary>&gt;</summary>
GreaterThan,
/// <summary>&gt;=</summary>
GreaterThanOrEqual,
/// <summary>'==' in C#, '=' in VB.</summary>
Equality,
/// <summary>'!=' in C#, '&lt;&gt;' in VB.</summary>
InEquality,
/// <summary>&lt;</summary>
LessThan,
/// <summary>&lt;=</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: &amp;</summary>
Concat,
/// <summary>C#: &lt;&lt;</summary>
ShiftLeft,
/// <summary>C#: &gt;&gt;</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
}
}

95
ICSharpCode.NRefactory.VB/Ast/Expressions/CastExpression.cs

@ -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
}
}

42
ICSharpCode.NRefactory.VB/Ast/Expressions/CollectionRangeVariableDeclaration.cs

@ -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);
}
}
}

44
ICSharpCode.NRefactory.VB/Ast/Expressions/ConditionalExpression.cs

@ -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);
}
}
}

59
ICSharpCode.NRefactory.VB/Ast/Expressions/EmptyExpression.cs

@ -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;
}
}
}

76
ICSharpCode.NRefactory.VB/Ast/Expressions/Expression.cs

@ -1,7 +1,8 @@ @@ -1,7 +1,8 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This 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
{
@ -29,5 +30,78 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -29,5 +30,78 @@ namespace ICSharpCode.NRefactory.VB.Ast
}
}
#endregion
#region Builder methods
/// <summary>
/// Builds an member reference expression using this expression as target.
/// </summary>
public MemberAccessExpression Member(string memberName)
{
return new MemberAccessExpression { Target = this, MemberName = memberName };
}
/// <summary>
/// Builds an invocation expression using this expression as target.
/// </summary>
public InvocationExpression Invoke(string methodName, IEnumerable<Expression> arguments)
{
return Invoke(methodName, null, arguments);
}
/// <summary>
/// Builds an invocation expression using this expression as target.
/// </summary>
public InvocationExpression Invoke(string methodName, params Expression[] arguments)
{
return Invoke(methodName, null, arguments);
}
/// <summary>
/// Builds an invocation expression using this expression as target.
/// </summary>
public InvocationExpression Invoke(string methodName, IEnumerable<AstType> typeArguments, IEnumerable<Expression> arguments)
{
InvocationExpression ie = new InvocationExpression();
MemberAccessExpression mre = new MemberAccessExpression();
mre.Target = this;
mre.MemberName = methodName;
mre.TypeArguments.AddRange(typeArguments);
ie.Target = mre;
ie.Arguments.AddRange(arguments);
return ie;
}
/// <summary>
/// Builds an invocation expression using this expression as target.
/// </summary>
public InvocationExpression Invoke(IEnumerable<Expression> arguments)
{
InvocationExpression ie = new InvocationExpression();
ie.Target = this;
ie.Arguments.AddRange(arguments);
return ie;
}
/// <summary>
/// Builds an invocation expression using this expression as target.
/// </summary>
public InvocationExpression Invoke(params Expression[] arguments)
{
InvocationExpression ie = new InvocationExpression();
ie.Target = this;
ie.Arguments.AddRange(arguments);
return ie;
}
public CastExpression CastTo(AstType type)
{
return new CastExpression { CastType = CastType.CType, Type = type, Expression = this };
}
public CastExpression CastTo(Type type)
{
return new CastExpression { CastType = CastType.CType, Type = AstType.Create(type), Expression = this };
}
#endregion
}
}

49
ICSharpCode.NRefactory.VB/Ast/Expressions/FieldInitializerExpression.cs

@ -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);
}
}
}

31
ICSharpCode.NRefactory.VB/Ast/Expressions/GetTypeExpression.cs

@ -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);
}
}
}

32
ICSharpCode.NRefactory.VB/Ast/Expressions/GetXmlNamespaceExpression.cs

@ -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);
}
}
}

39
ICSharpCode.NRefactory.VB/Ast/Expressions/IdentifierExpression.cs

@ -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);
}
}
}

61
ICSharpCode.NRefactory.VB/Ast/Expressions/InstanceExpression.cs

@ -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
}
}

52
ICSharpCode.NRefactory.VB/Ast/Expressions/InvocationExpression.cs

@ -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);
}
}
}

124
ICSharpCode.NRefactory.VB/Ast/Expressions/LambdaExpression.cs

@ -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
}
}

42
ICSharpCode.NRefactory.VB/Ast/Expressions/MemberAccessExpression.cs

@ -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);
}
}
}

39
ICSharpCode.NRefactory.VB/Ast/Expressions/NamedArgumentExpression.cs

@ -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);
}
}
}

59
ICSharpCode.NRefactory.VB/Ast/Expressions/ObjectCreationExpression.cs

@ -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);
}
}
}

34
ICSharpCode.NRefactory.VB/Ast/Expressions/ParenthesizedExpression.cs

@ -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);
}
}
}

4
ICSharpCode.NRefactory.VB/Ast/Expressions/PrimitiveExpression.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using ICSharpCode.NRefactory.VB.PrettyPrinter;
using System;
@ -32,7 +32,7 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -32,7 +32,7 @@ namespace ICSharpCode.NRefactory.VB.Ast
string stringValue;
public string StringValue {
get { return stringValue; } // TODO ?? VBNetOutputVisitor.ToVBNetString(this); }
get { return stringValue ?? OutputVisitor.ToVBNetString(this); }
}
public PrimitiveExpression(object value)

348
ICSharpCode.NRefactory.VB/Ast/Expressions/QueryExpression.cs

@ -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);
}
}
}

11
ICSharpCode.NRefactory.VB/Ast/Expressions/SimpleNameExpression.cs

@ -1,22 +1,27 @@ @@ -1,22 +1,27 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.NRefactory.VB.Ast
{
/// <summary>
/// Description of IdentifierExpression.
/// Description of SimpleNameExpression.
/// </summary>
public class SimpleNameExpression : Expression
{
public Identifier Identifier { get; set; }
public AstNodeCollection<AstType> TypeArguments {
get { return GetChildrenByRole(Roles.TypeArgument); }
}
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
{
var node = other as SimpleNameExpression;
return node != null
&& Identifier.DoMatch(node.Identifier, match);
&& Identifier.DoMatch(node.Identifier, match)
&& TypeArguments.DoMatch(node.TypeArguments, match);
}
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)

37
ICSharpCode.NRefactory.VB/Ast/Expressions/TypeOfIsExpression.cs

@ -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);
}
}
}

39
ICSharpCode.NRefactory.VB/Ast/Expressions/TypeReferenceExpression.cs

@ -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);
}
}
}

80
ICSharpCode.NRefactory.VB/Ast/Expressions/UnaryOperatorExpression.cs

@ -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
}
}

46
ICSharpCode.NRefactory.VB/Ast/Expressions/VariableInitializer.cs

@ -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);
}
}
}

2
ICSharpCode.NRefactory.VB/Ast/Expressions/XmlIdentifier.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;

2
ICSharpCode.NRefactory.VB/Ast/Expressions/XmlLiteralString.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;

9
ICSharpCode.NRefactory.VB/Ast/General/Attribute.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
@ -42,7 +42,9 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -42,7 +42,9 @@ namespace ICSharpCode.NRefactory.VB.Ast
public static readonly Role<Attribute> AttributeRole = new Role<Attribute>("Attribute");
public static readonly Role<VBTokenNode> TargetRole = new Role<VBTokenNode>("Target", VBTokenNode.Null);
public VBTokenNode Target {
public AttributeTarget Target { get; set; }
public VBTokenNode TargetKeyword {
get { return GetChildByRole(TargetRole); }
set { SetChildByRole(TargetRole, value); }
}
@ -81,12 +83,13 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -81,12 +83,13 @@ namespace ICSharpCode.NRefactory.VB.Ast
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
{
var node = other as Attribute;
return node != null && node.Target.DoMatch(this.Target, match) && node.Type.DoMatch(this.Type, match) && node.Arguments.DoMatch(this.Arguments, match);
return node != null && node.Target == Target && node.TargetKeyword.DoMatch(this.TargetKeyword, match) && node.Type.DoMatch(this.Type, match) && node.Arguments.DoMatch(this.Arguments, match);
}
}
public enum AttributeTarget
{
None,
Assembly,
Module
}

2
ICSharpCode.NRefactory.VB/Ast/General/AttributeBlock.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;

4
ICSharpCode.NRefactory.VB/Ast/General/AttributedNode.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
@ -20,7 +20,7 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -20,7 +20,7 @@ namespace ICSharpCode.NRefactory.VB.Ast
set { SetModifiers(this, value); }
}
public IEnumerable<VBModifierToken> ModifierTokens {
public AstNodeCollection<VBModifierToken> ModifierTokens {
get { return GetChildrenByRole (ModifierRole); }
}

2
ICSharpCode.NRefactory.VB/Ast/General/CompilationUnit.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;

39
ICSharpCode.NRefactory.VB/Ast/General/EventMemberSpecifier.cs

@ -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);
}
}
}

47
ICSharpCode.NRefactory.VB/Ast/General/InterfaceMemberSpecifier.cs

@ -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);
}
}
}

6
ICSharpCode.NRefactory.VB/Ast/General/ParameterDeclaration.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
@ -17,7 +17,7 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -17,7 +17,7 @@ namespace ICSharpCode.NRefactory.VB.Ast
set { SetChildByRole(Roles.Expression, value); }
}
public AstType ReturnType {
public AstType Type {
get { return GetChildByRole(Roles.Type); }
set { SetChildByRole(Roles.Type, value); }
}
@ -29,7 +29,7 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -29,7 +29,7 @@ namespace ICSharpCode.NRefactory.VB.Ast
MatchAttributesAndModifiers(param, match) &&
Name.DoMatch(param.Name, match) &&
OptionalValue.DoMatch(param.OptionalValue, match) &&
ReturnType.DoMatch(param.ReturnType, match);
Type.DoMatch(param.Type, match);
}
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)

4
ICSharpCode.NRefactory.VB/Ast/General/TypeParameterDeclaration.cs

@ -1,10 +1,12 @@ @@ -1,10 +1,12 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Linq;
using ICSharpCode.NRefactory.TypeSystem;
namespace ICSharpCode.NRefactory.VB.Ast
{
/// <summary>

2
ICSharpCode.NRefactory.VB/Ast/Generated.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
//// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
//// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
//// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
//using System;
//using System.Collections.Generic;
//

2
ICSharpCode.NRefactory.VB/Ast/GlobalScope/DelegateDeclaration.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;

6
ICSharpCode.NRefactory.VB/Ast/GlobalScope/EnumDeclaration.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
@ -22,7 +22,7 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -22,7 +22,7 @@ namespace ICSharpCode.NRefactory.VB.Ast
set { SetChildByRole(UnderlyingTypeRole, value); }
}
public AstNodeCollection<EnumMemberDeclaration> Member {
public AstNodeCollection<EnumMemberDeclaration> Members {
get { return GetChildrenByRole(MemberRole); }
}
@ -33,7 +33,7 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -33,7 +33,7 @@ namespace ICSharpCode.NRefactory.VB.Ast
MatchAttributesAndModifiers(decl, match) &&
Name.DoMatch(decl.Name, match) &&
UnderlyingType.DoMatch(decl.UnderlyingType, match) &&
Member.DoMatch(decl.Member, match);
Members.DoMatch(decl.Members, match);
}
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)

2
ICSharpCode.NRefactory.VB/Ast/GlobalScope/EnumMemberDeclaration.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;

4
ICSharpCode.NRefactory.VB/Ast/GlobalScope/ImportsClause.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
@ -73,7 +73,7 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -73,7 +73,7 @@ namespace ICSharpCode.NRefactory.VB.Ast
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitMembersImportsClause(this, data);
return visitor.VisitMemberImportsClause(this, data);
}
public override string ToString()

2
ICSharpCode.NRefactory.VB/Ast/GlobalScope/ImportsStatement.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using ICSharpCode.NRefactory.PatternMatching;

2
ICSharpCode.NRefactory.VB/Ast/GlobalScope/NamespaceDeclaration.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;

2
ICSharpCode.NRefactory.VB/Ast/GlobalScope/OptionStatement.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using ICSharpCode.NRefactory.PatternMatching;

13
ICSharpCode.NRefactory.VB/Ast/GlobalScope/TypeDeclaration.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
@ -20,11 +20,9 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -20,11 +20,9 @@ namespace ICSharpCode.NRefactory.VB.Ast
public ClassType ClassType { get; set; }
public string Name {
get { return GetChildByRole(Roles.Identifier).Name; }
set {
SetChildByRole(Roles.Identifier, new Identifier (value, AstLocation.Empty));
}
public Identifier Name {
get { return GetChildByRole(Roles.Identifier); }
set { SetChildByRole(Roles.Identifier, value); }
}
public AstNodeCollection<TypeParameterDeclaration> TypeParameters {
@ -33,6 +31,7 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -33,6 +31,7 @@ namespace ICSharpCode.NRefactory.VB.Ast
public AstType InheritsType {
get { return GetChildByRole(InheritsTypeRole); }
set { SetChildByRole(InheritsTypeRole, value); }
}
public AstNodeCollection<AstType> ImplementsTypes {
@ -46,7 +45,7 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -46,7 +45,7 @@ namespace ICSharpCode.NRefactory.VB.Ast
MatchAttributesAndModifiers(t, match) &&
Members.DoMatch(t.Members, match) &&
ClassType == t.ClassType &&
MatchString(Name, t.Name) &&
Name.DoMatch(t.Name, match) &&
TypeParameters.DoMatch(t.TypeParameters, match) &&
InheritsType.DoMatch(t.InheritsType, match) &&
ImplementsTypes.DoMatch(t.ImplementsTypes, match);

2
ICSharpCode.NRefactory.VB/Ast/INullable.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
namespace ICSharpCode.NRefactory.VB.Ast
{

11
ICSharpCode.NRefactory.VB/Ast/Identifier.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
@ -69,6 +69,11 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -69,6 +69,11 @@ namespace ICSharpCode.NRefactory.VB.Ast
this.startLocation = location;
}
public static implicit operator Identifier(string name)
{
return new Identifier(name, AstLocation.Empty);
}
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
{
var node = other as Identifier;
@ -84,8 +89,8 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -84,8 +89,8 @@ namespace ICSharpCode.NRefactory.VB.Ast
public override string ToString()
{
return string.Format("[Identifier Name={0}, StartLocation={1}, TypeCharacter{4}]",
name, startLocation, TypeCharacter);
return string.Format("{0}",
name);
}
}
}

32
ICSharpCode.NRefactory.VB/Ast/Statements/BlockStatement.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
@ -79,7 +79,7 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -79,7 +79,7 @@ namespace ICSharpCode.NRefactory.VB.Ast
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
BlockStatement o = other as BlockStatement;
return o != null && !o.IsNull && this.Statements.DoMatch(o.Statements, match);
return o != null && !(o is CatchBlock) && !o.IsNull && this.Statements.DoMatch(o.Statements, match);
}
#region Builder methods
@ -88,28 +88,26 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -88,28 +88,26 @@ namespace ICSharpCode.NRefactory.VB.Ast
AddChild(statement, StatementRole);
}
// TODO : uncomment
public void Add(Expression expression)
{
AddChild(new ExpressionStatement { Expression = expression }, StatementRole);
}
// public void Add(Expression expression)
// {
// AddChild(new ExpressionStatement { Expression = expression }, StatementRole);
// }
//
public void AddRange(IEnumerable<Statement> statements)
{
foreach (Statement st in statements)
AddChild(st, StatementRole);
}
// public void AddAssignment(Expression left, Expression right)
// {
// Add(new AssignmentExpression { Left = left, Operator = AssignmentOperatorType.Assign, Right = right });
// }
//
// public void AddReturnStatement(Expression expression)
// {
// Add(new ReturnStatement { Expression = expression });
// }
public void AddAssignment(Expression left, Expression right)
{
Add(new AssignmentExpression(left, AssignmentOperatorType.Assign, right));
}
public void AddReturnStatement(Expression expression)
{
Add(new ReturnStatement { Expression = expression });
}
#endregion
IEnumerator<Statement> IEnumerable<Statement>.GetEnumerator()

50
ICSharpCode.NRefactory.VB/Ast/Statements/ContinueStatement.cs

@ -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
}
}

33
ICSharpCode.NRefactory.VB/Ast/Statements/DoLoopStatement.cs

@ -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);
}
}
}

55
ICSharpCode.NRefactory.VB/Ast/Statements/ExitStatement.cs

@ -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
}
}

40
ICSharpCode.NRefactory.VB/Ast/Statements/ExpressionStatement.cs

@ -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);
}
}
}

38
ICSharpCode.NRefactory.VB/Ast/Statements/ForEachStatement.cs

@ -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);
}
}
}

45
ICSharpCode.NRefactory.VB/Ast/Statements/ForStatement.cs

@ -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);
}
}
}

27
ICSharpCode.NRefactory.VB/Ast/Statements/GoToStatement.cs

@ -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);
}
}
}

39
ICSharpCode.NRefactory.VB/Ast/Statements/IfElseStatement.cs

@ -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();
}
}
}

35
ICSharpCode.NRefactory.VB/Ast/Statements/LabelDeclarationStatement.cs

@ -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);
}
}
}

37
ICSharpCode.NRefactory.VB/Ast/Statements/LocalDeclarationStatement.cs

@ -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();
}
}
}

43
ICSharpCode.NRefactory.VB/Ast/Statements/ReturnStatement.cs

@ -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);
}
}
}

147
ICSharpCode.NRefactory.VB/Ast/Statements/SelectStatement.cs

@ -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
}
}

26
ICSharpCode.NRefactory.VB/Ast/Statements/Statement.cs

@ -115,18 +115,18 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -115,18 +115,18 @@ namespace ICSharpCode.NRefactory.VB.Ast
}
// Make debugging easier by giving Statements a ToString() implementation
public override string ToString()
{
// if (IsNull)
// return "Null";
// StringWriter w = new StringWriter();
// AcceptVisitor(new OutputVisitor(w, new CSharpFormattingOptions()), null);
// string text = w.ToString().TrimEnd().Replace("\t", "").Replace(w.NewLine, " ");
// if (text.Length > 100)
// return text.Substring(0, 97) + "...";
// else
// return text;
throw new NotImplementedException();
}
// public override string ToString()
// {
//// if (IsNull)
//// return "Null";
//// StringWriter w = new StringWriter();
//// AcceptVisitor(new OutputVisitor(w, new CSharpFormattingOptions()), null);
//// string text = w.ToString().TrimEnd().Replace("\t", "").Replace(w.NewLine, " ");
//// if (text.Length > 100)
//// return text.Substring(0, 97) + "...";
//// else
//// return text;
// throw new NotImplementedException();
// }
}
}

36
ICSharpCode.NRefactory.VB/Ast/Statements/SyncLockStatement.cs

@ -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();
}
}
}

43
ICSharpCode.NRefactory.VB/Ast/Statements/ThrowStatement.cs

@ -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);
}
}
}

67
ICSharpCode.NRefactory.VB/Ast/Statements/TryStatement.cs

@ -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();
}
}
}

33
ICSharpCode.NRefactory.VB/Ast/Statements/UsingStatement.cs

@ -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);
}
}
}

31
ICSharpCode.NRefactory.VB/Ast/Statements/WhileStatement.cs

@ -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);
}
}
}

36
ICSharpCode.NRefactory.VB/Ast/Statements/WithStatement.cs

@ -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();
}
}
}

44
ICSharpCode.NRefactory.VB/Ast/Statements/YieldStatement.cs

@ -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);
}
}
}

49
ICSharpCode.NRefactory.VB/Ast/TypeMembers/Accessor.cs

@ -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);
}
}
}

45
ICSharpCode.NRefactory.VB/Ast/TypeMembers/ConstructorDeclaration.cs

@ -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);
}
}
}

59
ICSharpCode.NRefactory.VB/Ast/TypeMembers/EventDeclaration.cs

@ -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);
}
}
}

71
ICSharpCode.NRefactory.VB/Ast/TypeMembers/ExternalMethodDeclaration.cs

@ -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
}
}

81
ICSharpCode.NRefactory.VB/Ast/TypeMembers/FieldDeclaration.cs

@ -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);
}
}
}

72
ICSharpCode.NRefactory.VB/Ast/TypeMembers/MethodDeclaration.cs

@ -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);
}
}
}

83
ICSharpCode.NRefactory.VB/Ast/TypeMembers/OperatorDeclaration.cs

@ -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
}//
}

57
ICSharpCode.NRefactory.VB/Ast/TypeMembers/PropertyDeclaration.cs

@ -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);
}
}
}

63
ICSharpCode.NRefactory.VB/Ast/TypeMembers/VariableDeclarator.cs

@ -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);
}
}
}

84
ICSharpCode.NRefactory.VB/Ast/TypeName/AstType.cs

@ -1,7 +1,8 @@ @@ -1,7 +1,8 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This 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
{
@ -70,38 +71,55 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -70,38 +71,55 @@ namespace ICSharpCode.NRefactory.VB.Ast
return new ComposedType { BaseType = this }.MakeArrayType(rank);
}
// TODO : reimplement this
// /// <summary>
// /// Builds an expression that can be used to access a static member on this type.
// /// </summary>
// public MemberReferenceExpression Member(string memberName)
// {
// return new TypeReferenceExpression { Type = this }.Member(memberName);
// }
//
// /// <summary>
// /// Builds an invocation expression using this type as target.
// /// </summary>
// public InvocationExpression Invoke(string methodName, IEnumerable<Expression> arguments)
// {
// return new TypeReferenceExpression { Type = this }.Invoke(methodName, arguments);
// }
//
// /// <summary>
// /// Builds an invocation expression using this type as target.
// /// </summary>
// public InvocationExpression Invoke(string methodName, params Expression[] arguments)
// {
// return new TypeReferenceExpression { Type = this }.Invoke(methodName, arguments);
// }
//
// /// <summary>
// /// Builds an invocation expression using this type as target.
// /// </summary>
// public InvocationExpression Invoke(string methodName, IEnumerable<AstType> typeArguments, IEnumerable<Expression> arguments)
// {
// return new TypeReferenceExpression { Type = this }.Invoke(methodName, typeArguments, arguments);
// }
public static AstType FromName(string fullName)
{
if (string.IsNullOrEmpty(fullName))
throw new ArgumentNullException("fullName");
fullName = fullName.Trim();
if (!fullName.Contains("."))
return new SimpleType(fullName);
string[] parts = fullName.Split('.');
AstType type = new SimpleType(parts.First());
foreach (var part in parts.Skip(1)) {
type = new QualifiedType(type, part);
}
return type;
}
/// <summary>
/// Builds an expression that can be used to access a static member on this type.
/// </summary>
public MemberAccessExpression Member(string memberName)
{
return new TypeReferenceExpression { Type = this }.Member(memberName);
}
/// <summary>
/// Builds an invocation expression using this type as target.
/// </summary>
public InvocationExpression Invoke(string methodName, IEnumerable<Expression> arguments)
{
return new TypeReferenceExpression { Type = this }.Invoke(methodName, arguments);
}
/// <summary>
/// Builds an invocation expression using this type as target.
/// </summary>
public InvocationExpression Invoke(string methodName, params Expression[] arguments)
{
return new TypeReferenceExpression { Type = this }.Invoke(methodName, arguments);
}
/// <summary>
/// Builds an invocation expression using this type as target.
/// </summary>
public InvocationExpression Invoke(string methodName, IEnumerable<AstType> typeArguments, IEnumerable<Expression> arguments)
{
return new TypeReferenceExpression { Type = this }.Invoke(methodName, typeArguments, arguments);
}
public static AstType Create(Type type)
{

2
ICSharpCode.NRefactory.VB/Ast/TypeName/ComposedType.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Linq;

2
ICSharpCode.NRefactory.VB/Ast/TypeName/PrimitiveType.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Linq;

2
ICSharpCode.NRefactory.VB/Ast/TypeName/QualifiedType.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Linq;

40
ICSharpCode.NRefactory.VB/Ast/VBModifierToken.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
@ -46,10 +46,11 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -46,10 +46,11 @@ namespace ICSharpCode.NRefactory.VB.Ast
new KeyValuePair<Modifiers, int>(Modifiers.Overridable, "Overridable".Length),
new KeyValuePair<Modifiers, int>(Modifiers.NotInheritable, "NotInheritable".Length),
new KeyValuePair<Modifiers, int>(Modifiers.NotOverridable, "NotOverridable".Length),
new KeyValuePair<Modifiers, int>(Modifiers.Dim, "Dim".Length),
new KeyValuePair<Modifiers, int>(Modifiers.Const, "Const".Length),
new KeyValuePair<Modifiers, int>(Modifiers.Shared, "Shared".Length),
new KeyValuePair<Modifiers, int>(Modifiers.Static, "Static".Length),
new KeyValuePair<Modifiers, int>(Modifiers.Override, "Override".Length),
new KeyValuePair<Modifiers, int>(Modifiers.Overrides, "Overrides".Length),
new KeyValuePair<Modifiers, int>(Modifiers.ReadOnly, "ReadOnly".Length),
new KeyValuePair<Modifiers, int>(Modifiers.WriteOnly, "WriteOnly".Length),
new KeyValuePair<Modifiers, int>(Modifiers.Shadows, "Shadows".Length),
@ -57,8 +58,17 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -57,8 +58,17 @@ namespace ICSharpCode.NRefactory.VB.Ast
new KeyValuePair<Modifiers, int>(Modifiers.Overloads, "Overloads".Length),
new KeyValuePair<Modifiers, int>(Modifiers.WithEvents, "WithEvents".Length),
new KeyValuePair<Modifiers, int>(Modifiers.Default, "Default".Length),
new KeyValuePair<Modifiers, int>(Modifiers.Dim, "Dim".Length),
// parameter modifiers
new KeyValuePair<Modifiers, int>(Modifiers.Optional, "Optional".Length),
new KeyValuePair<Modifiers, int>(Modifiers.ByVal, "ByVal".Length),
new KeyValuePair<Modifiers, int>(Modifiers.ByRef, "ByRef".Length),
new KeyValuePair<Modifiers, int>(Modifiers.ParamArray, "ParamArray".Length),
// operator modifiers
new KeyValuePair<Modifiers, int>(Modifiers.Narrowing, "Narrowing".Length),
new KeyValuePair<Modifiers, int>(Modifiers.Widening, "Widening".Length),
// VB 11 modifiers
new KeyValuePair<Modifiers, int>(Modifiers.Async, "Async".Length),
new KeyValuePair<Modifiers, int>(Modifiers.Iterator, "Iterator".Length),
// even though it's used for patterns only, it needs to be in this table to be usable in the AST
new KeyValuePair<Modifiers, int>(Modifiers.Any, "Any".Length)
};
@ -99,8 +109,8 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -99,8 +109,8 @@ namespace ICSharpCode.NRefactory.VB.Ast
return "Shared";
case Modifiers.Static:
return "Static";
case Modifiers.Override:
return "Override";
case Modifiers.Overrides:
return "Overrides";
case Modifiers.ReadOnly:
return "ReadOnly";
case Modifiers.Shadows:
@ -117,8 +127,24 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -117,8 +127,24 @@ namespace ICSharpCode.NRefactory.VB.Ast
return "Dim";
case Modifiers.WriteOnly:
return "WriteOnly";
case Modifiers.Optional:
return "Optional";
case Modifiers.ByVal:
return "ByVal";
case Modifiers.ByRef:
return "ByRef";
case Modifiers.ParamArray:
return "ParamArray";
case Modifiers.Widening:
return "Widening";
case Modifiers.Narrowing:
return "Narrowing";
case Modifiers.Async:
return "Async";
case Modifiers.Iterator:
return "Iterator";
default:
throw new NotSupportedException("Invalid value for Modifiers");
throw new NotSupportedException("Invalid value for Modifiers: " + modifier);
}
}
}

2
ICSharpCode.NRefactory.VB/AstBuilder/ExpressionBuilder.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;

2
ICSharpCode.NRefactory.VB/AstBuilder/StatementBuilder.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;

91
ICSharpCode.NRefactory.VB/IAstVisitor.cs

@ -9,18 +9,21 @@ namespace ICSharpCode.NRefactory.VB { @@ -9,18 +9,21 @@ namespace ICSharpCode.NRefactory.VB {
public interface IAstVisitor<in T, out S>
{
S VisitBlockStatement(BlockStatement blockStatement, T data);
S VisitComment(Comment comment, T data);
S VisitCompilationUnit(CompilationUnit compilationUnit, T data);
S VisitPatternPlaceholder(AstNode placeholder, PatternMatching.Pattern pattern, T data);
S VisitTypeParameterDeclaration(TypeParameterDeclaration typeParameterDeclaration, T data);
S VisitParameterDeclaration(ParameterDeclaration parameterDeclaration, T data);
S VisitVBTokenNode(VBTokenNode vBTokenNode, T data);
S VisitEventMemberSpecifier(EventMemberSpecifier eventMemberSpecifier, T data);
S VisitInterfaceMemberSpecifier(InterfaceMemberSpecifier interfaceMemberSpecifier, T data);
// Global scope
S VisitAliasImportsClause(AliasImportsClause aliasImportsClause, T data);
S VisitAttribute(Attribute attribute, T data);
S VisitAttributeBlock(AttributeBlock attributeBlock, T data);
S VisitImportsStatement(ImportsStatement importsStatement, T data);
S VisitMembersImportsClause(MemberImportsClause membersImportsClause, T data);
S VisitMemberImportsClause(MemberImportsClause memberImportsClause, T data);
S VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration, T data);
S VisitOptionStatement(OptionStatement optionStatement, T data);
S VisitTypeDeclaration(TypeDeclaration typeDeclaration, T data);
@ -29,12 +32,70 @@ namespace ICSharpCode.NRefactory.VB { @@ -29,12 +32,70 @@ namespace ICSharpCode.NRefactory.VB {
S VisitEnumMemberDeclaration(EnumMemberDeclaration enumMemberDeclaration, T data);
S VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration, T data);
// TypeMember scope
S VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration, T data);
S VisitMethodDeclaration(MethodDeclaration methodDeclaration, T data);
S VisitExternalMethodDeclaration(ExternalMethodDeclaration externalMethodDeclaration, T data);
S VisitFieldDeclaration(FieldDeclaration fieldDeclaration, T data);
S VisitVariableDeclaratorWithTypeAndInitializer(VariableDeclaratorWithTypeAndInitializer variableDeclaratorWithTypeAndInitializer, T data);
S VisitVariableDeclaratorWithObjectCreation(VariableDeclaratorWithObjectCreation variableDeclaratorWithObjectCreation, T data);
S VisitVariableIdentifier(VariableIdentifier variableIdentifier, T data);
S VisitAccessor(Accessor accessor, T data);
S VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration, T data);
S VisitEventDeclaration(EventDeclaration eventDeclaration, T data);
S VisitOperatorDeclaration(OperatorDeclaration operatorDeclaration, T data);
// Expression scope
S VisitIdentifier(Identifier identifier, T data);
S VisitXmlIdentifier(XmlIdentifier xmlIdentifier, T data);
S VisitXmlLiteralString(XmlLiteralString xmlLiteralString, T data);
S VisitSimpleNameExpression(SimpleNameExpression identifierExpression, T data);
S VisitPrimitiveExpression(PrimitiveExpression primitiveExpression, T data);
S VisitInstanceExpression(InstanceExpression instanceExpression, T data);
S VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression, T data);
S VisitGetTypeExpression(GetTypeExpression getTypeExpression, T data);
S VisitTypeOfIsExpression(TypeOfIsExpression typeOfIsExpression, T data);
S VisitGetXmlNamespaceExpression(GetXmlNamespaceExpression getXmlNamespaceExpression, T data);
S VisitMemberAccessExpression(MemberAccessExpression memberAccessExpression, T data);
S VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression, T data);
S VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression, T data);
S VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression, T data);
S VisitAssignmentExpression(AssignmentExpression assignmentExpression, T data);
S VisitIdentifierExpression(IdentifierExpression identifierExpression, T data);
S VisitInvocationExpression(InvocationExpression invocationExpression, T data);
S VisitArrayInitializerExpression(ArrayInitializerExpression arrayInitializerExpression, T data);
S VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, T data);
S VisitObjectCreationExpression(ObjectCreationExpression objectCreationExpression, T data);
S VisitCastExpression(CastExpression castExpression, T data);
S VisitFieldInitializerExpression(FieldInitializerExpression fieldInitializerExpression, T data);
S VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, T data);
S VisitConditionalExpression(ConditionalExpression conditionalExpression, T data);
// Statement scope
S VisitLabelDeclarationStatement(LabelDeclarationStatement labelDeclarationStatement, T data);
S VisitLocalDeclarationStatement(LocalDeclarationStatement localDeclarationStatement, T data);
S VisitExpressionStatement(ExpressionStatement expressionStatement, T data);
S VisitWithStatement(WithStatement withStatement, T data);
S VisitSyncLockStatement(SyncLockStatement syncLockStatement, T data);
S VisitIfElseStatement(IfElseStatement ifElseStatement, T data);
S VisitTryStatement(TryStatement tryStatement, T data);
S VisitThrowStatement(ThrowStatement throwStatement, T data);
S VisitCatchBlock(CatchBlock catchBlock, T data);
S VisitReturnStatement(ReturnStatement returnStatement, T data);
S VisitWhileStatement(WhileStatement whileStatement, T data);
S VisitForStatement(ForStatement forStatement, T data);
S VisitForEachStatement(ForEachStatement forEachStatement, T data);
S VisitExitStatement(ExitStatement exitStatement, T data);
S VisitContinueStatement(ContinueStatement continueStatement, T data);
S VisitSelectStatement(SelectStatement selectStatement, T data);
S VisitYieldStatement(YieldStatement yieldStatement, T data);
S VisitVariableInitializer(VariableInitializer variableInitializer, T data);
S VisitRangeCaseClause(RangeCaseClause rangeCaseClause, T data);
S VisitComparisonCaseClause(ComparisonCaseClause comparisonCaseClause, T data);
S VisitSimpleCaseClause(SimpleCaseClause simpleCaseClause, T data);
S VisitCaseStatement(CaseStatement caseStatement, T data);
S VisitDoLoopStatement(DoLoopStatement doLoopStatement, T data);
S VisitUsingStatement(UsingStatement usingStatement, T data);
// TypeName
S VisitPrimitiveType(PrimitiveType primitiveType, T data);
@ -42,5 +103,33 @@ namespace ICSharpCode.NRefactory.VB { @@ -42,5 +103,33 @@ namespace ICSharpCode.NRefactory.VB {
S VisitComposedType(ComposedType composedType, T data);
S VisitArraySpecifier(ArraySpecifier arraySpecifier, T data);
S VisitSimpleType(SimpleType simpleType, T data);
S VisitGoToStatement(GoToStatement goToStatement, T data);
S VisitSingleLineSubLambdaExpression(SingleLineSubLambdaExpression singleLineSubLambdaExpression, T data);
S VisitMultiLineLambdaExpression(MultiLineLambdaExpression multiLineLambdaExpression, T data);
S VisitSingleLineFunctionLambdaExpression(SingleLineFunctionLambdaExpression singleLineFunctionLambdaExpression, T data);
S VisitQueryExpression(QueryExpression queryExpression, T data);
S VisitEmptyExpression(EmptyExpression emptyExpression, T data);
S VisitAnonymousObjectCreationExpression(AnonymousObjectCreationExpression anonymousObjectCreationExpression, T data);
S VisitCollectionRangeVariableDeclaration(CollectionRangeVariableDeclaration collectionRangeVariableDeclaration, T data);
S VisitFromQueryOperator(FromQueryOperator fromQueryOperator, T data);
S VisitAggregateQueryOperator(AggregateQueryOperator aggregateQueryOperator, T data);
S VisitSelectQueryOperator(SelectQueryOperator selectQueryOperator, T data);
S VisitDistinctQueryOperator(DistinctQueryOperator distinctQueryOperator, T data);
S VisitWhereQueryOperator(WhereQueryOperator whereQueryOperator, T data);
S VisitOrderExpression(OrderExpression orderExpression, T data);
S VisitOrderByQueryOperator(OrderByQueryOperator orderByQueryOperator, T data);
S VisitPartitionQueryOperator(PartitionQueryOperator partitionQueryOperator, T data);
S VisitLetQueryOperator(LetQueryOperator letQueryOperator, T data);
S VisitGroupByQueryOperator(GroupByQueryOperator groupByQueryOperator, T data);
S VisitJoinQueryOperator(JoinQueryOperator joinQueryOperator, T data);
S VisitJoinCondition(JoinCondition joinCondition, T data);
S VisitGroupJoinQueryOperator(GroupJoinQueryOperator groupJoinQueryOperator, T data);
}
}

68
ICSharpCode.NRefactory.VB/ICSharpCode.NRefactory.VB.csproj

@ -3,16 +3,20 @@ @@ -3,16 +3,20 @@
<PropertyGroup>
<ProjectGuid>{7B82B671-419F-45F4-B778-D9286F996EFA}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputType>Library</OutputType>
<RootNamespace>ICSharpCode.NRefactory.VB</RootNamespace>
<AssemblyName>ICSharpCode.NRefactory.VB</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x86' ">
<PlatformTarget>x86</PlatformTarget>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>bin\Debug\</OutputPath>
@ -46,16 +50,44 @@ @@ -46,16 +50,44 @@
<Compile Include="Ast\AstLocation.cs" />
<Compile Include="Ast\AstNode.cs" />
<Compile Include="Ast\AstNodeCollection.cs" />
<Compile Include="Ast\Comment.cs" />
<Compile Include="Ast\Enums.cs" />
<Compile Include="Ast\Expressions\AnonymousObjectCreationExpression.cs" />
<Compile Include="Ast\Expressions\ArrayCreateExpression.cs" />
<Compile Include="Ast\Expressions\ArrayInitializerExpression.cs" />
<Compile Include="Ast\Expressions\AssignmentExpression.cs" />
<Compile Include="Ast\Expressions\BinaryOperatorExpression.cs" />
<Compile Include="Ast\Expressions\CastExpression.cs" />
<Compile Include="Ast\Expressions\CollectionRangeVariableDeclaration.cs" />
<Compile Include="Ast\Expressions\ConditionalExpression.cs" />
<Compile Include="Ast\Expressions\EmptyExpression.cs" />
<Compile Include="Ast\Expressions\Expression.cs" />
<Compile Include="Ast\Expressions\FieldInitializerExpression.cs" />
<Compile Include="Ast\Expressions\GetTypeExpression.cs" />
<Compile Include="Ast\Expressions\GetXmlNamespaceExpression.cs" />
<Compile Include="Ast\Expressions\IdentifierExpression.cs" />
<Compile Include="Ast\Expressions\InstanceExpression.cs" />
<Compile Include="Ast\Expressions\InvocationExpression.cs" />
<Compile Include="Ast\Expressions\LambdaExpression.cs" />
<Compile Include="Ast\Expressions\MemberAccessExpression.cs" />
<Compile Include="Ast\Expressions\NamedArgumentExpression.cs" />
<Compile Include="Ast\Expressions\ObjectCreationExpression.cs" />
<Compile Include="Ast\Expressions\ParenthesizedExpression.cs" />
<Compile Include="Ast\Expressions\QueryExpression.cs" />
<Compile Include="Ast\Expressions\SimpleNameExpression.cs" />
<Compile Include="Ast\Expressions\PrimitiveExpression.cs" />
<Compile Include="Ast\Expressions\TypeOfIsExpression.cs" />
<Compile Include="Ast\Expressions\TypeReferenceExpression.cs" />
<Compile Include="Ast\Expressions\UnaryOperatorExpression.cs" />
<Compile Include="Ast\Expressions\VariableInitializer.cs" />
<Compile Include="Ast\Expressions\XmlIdentifier.cs" />
<Compile Include="Ast\Expressions\XmlLiteralString.cs" />
<Compile Include="Ast\General\Attribute.cs" />
<Compile Include="Ast\General\AttributeBlock.cs" />
<Compile Include="Ast\General\AttributedNode.cs" />
<Compile Include="Ast\General\CompilationUnit.cs" />
<Compile Include="Ast\General\EventMemberSpecifier.cs" />
<Compile Include="Ast\General\InterfaceMemberSpecifier.cs" />
<Compile Include="Ast\General\ParameterDeclaration.cs" />
<Compile Include="Ast\General\TypeParameterDeclaration.cs" />
<Compile Include="Ast\Generated.cs" />
@ -70,7 +102,35 @@ @@ -70,7 +102,35 @@
<Compile Include="Ast\Identifier.cs" />
<Compile Include="Ast\INullable.cs" />
<Compile Include="Ast\Statements\BlockStatement.cs" />
<Compile Include="Ast\Statements\ContinueStatement.cs" />
<Compile Include="Ast\Statements\DoLoopStatement.cs" />
<Compile Include="Ast\Statements\ExitStatement.cs" />
<Compile Include="Ast\Statements\ExpressionStatement.cs" />
<Compile Include="Ast\Statements\ForEachStatement.cs" />
<Compile Include="Ast\Statements\ForStatement.cs" />
<Compile Include="Ast\Statements\GoToStatement.cs" />
<Compile Include="Ast\Statements\IfElseStatement.cs" />
<Compile Include="Ast\Statements\LabelDeclarationStatement.cs" />
<Compile Include="Ast\Statements\LocalDeclarationStatement.cs" />
<Compile Include="Ast\Statements\ReturnStatement.cs" />
<Compile Include="Ast\Statements\SelectStatement.cs" />
<Compile Include="Ast\Statements\Statement.cs" />
<Compile Include="Ast\Statements\SyncLockStatement.cs" />
<Compile Include="Ast\Statements\ThrowStatement.cs" />
<Compile Include="Ast\Statements\TryStatement.cs" />
<Compile Include="Ast\Statements\UsingStatement.cs" />
<Compile Include="Ast\Statements\WhileStatement.cs" />
<Compile Include="Ast\Statements\WithStatement.cs" />
<Compile Include="Ast\Statements\YieldStatement.cs" />
<Compile Include="Ast\TypeMembers\Accessor.cs" />
<Compile Include="Ast\TypeMembers\ConstructorDeclaration.cs" />
<Compile Include="Ast\TypeMembers\EventDeclaration.cs" />
<Compile Include="Ast\TypeMembers\ExternalMethodDeclaration.cs" />
<Compile Include="Ast\TypeMembers\FieldDeclaration.cs" />
<Compile Include="Ast\TypeMembers\MethodDeclaration.cs" />
<Compile Include="Ast\TypeMembers\OperatorDeclaration.cs" />
<Compile Include="Ast\TypeMembers\PropertyDeclaration.cs" />
<Compile Include="Ast\TypeMembers\VariableDeclarator.cs" />
<Compile Include="Ast\TypeName\AstType.cs" />
<Compile Include="Ast\TypeName\ComposedType.cs" />
<Compile Include="Ast\TypeName\PrimitiveType.cs" />
@ -122,6 +182,7 @@ @@ -122,6 +182,7 @@
<Compile Include="VBParser.cs" />
<Compile Include="Visitors\AbstractAstTransformer.cs" />
<Compile Include="Visitors\AbstractAstVisitor.cs" />
<Compile Include="Visitors\CSharpToVBConverterVisitor.cs" />
<Compile Include="Visitors\NodeTrackingAstVisitor.cs" />
</ItemGroup>
<ItemGroup>
@ -130,6 +191,7 @@ @@ -130,6 +191,7 @@
<Folder Include="Ast\General" />
<Folder Include="Ast\GlobalScope" />
<Folder Include="Ast\Expressions" />
<Folder Include="Ast\TypeMembers" />
<Folder Include="Ast\Statements" />
<Folder Include="Ast\TypeName" />
<Folder Include="Lexer" />

2
ICSharpCode.NRefactory.VB/Lexer/Block.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;

2
ICSharpCode.NRefactory.VB/Lexer/ExpressionFinder.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;

2
ICSharpCode.NRefactory.VB/Lexer/ExpressionFinderState.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;

2
ICSharpCode.NRefactory.VB/Lexer/Extensions.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;

2
ICSharpCode.NRefactory.VB/Lexer/LATextReader.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;

2
ICSharpCode.NRefactory.VB/Lexer/LookupTable.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Globalization;

2
ICSharpCode.NRefactory.VB/Lexer/SavepointEventArgs.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;

2
ICSharpCode.NRefactory.VB/Lexer/Special/BlankLine.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;

2
ICSharpCode.NRefactory.VB/Lexer/Special/Comment.cs

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save