Browse Source

NRefactory: remove collection setters from AST; expose AstNodeCollection<T> instead.

newNRvisualizers
Daniel Grunwald 15 years ago
parent
commit
904b05fe5e
  1. 31
      ICSharpCode.NRefactory/CSharp/Ast/AstNode.cs
  2. 156
      ICSharpCode.NRefactory/CSharp/Ast/AstNodeCollection.cs
  3. 3
      ICSharpCode.NRefactory/CSharp/Ast/ComposedType.cs
  4. 5
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/AnonymousMethodExpression.cs
  5. 5
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/ArgListExpression.cs
  6. 6
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/ArrayCreateExpression.cs
  7. 5
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/ArrayInitializerExpression.cs
  8. 39
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/Expression.cs
  9. 5
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/IdentifierExpression.cs
  10. 5
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/IndexerExpression.cs
  11. 5
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/InvocationExpression.cs
  12. 5
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/LambdaExpression.cs
  13. 5
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/MemberReferenceExpression.cs
  14. 5
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/ObjectCreateExpression.cs
  15. 5
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/PointerReferenceExpression.cs
  16. 6
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/QueryExpression.cs
  17. 5
      ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/Attribute.cs
  18. 5
      ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/AttributeSection.cs
  19. 5
      ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/Constraint.cs
  20. 11
      ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/DelegateDeclaration.cs
  21. 10
      ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/NamespaceDeclaration.cs
  22. 14
      ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/TypeDeclaration.cs
  23. 5
      ICSharpCode.NRefactory/CSharp/Ast/MemberType.cs
  24. 5
      ICSharpCode.NRefactory/CSharp/Ast/SimpleType.cs
  25. 5
      ICSharpCode.NRefactory/CSharp/Ast/Statements/BlockStatement.cs
  26. 5
      ICSharpCode.NRefactory/CSharp/Ast/Statements/FixedStatement.cs
  27. 8
      ICSharpCode.NRefactory/CSharp/Ast/Statements/ForStatement.cs
  28. 11
      ICSharpCode.NRefactory/CSharp/Ast/Statements/SwitchStatement.cs
  29. 5
      ICSharpCode.NRefactory/CSharp/Ast/Statements/TryCatchStatement.cs
  30. 15
      ICSharpCode.NRefactory/CSharp/Ast/Statements/VariableDeclarationStatement.cs
  31. 3
      ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/AttributedNode.cs
  32. 8
      ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/ConstructorDeclaration.cs
  33. 5
      ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/EventDeclaration.cs
  34. 5
      ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/FieldDeclaration.cs
  35. 5
      ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/IndexerDeclaration.cs
  36. 11
      ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/MethodDeclaration.cs
  37. 5
      ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/OperatorDeclaration.cs
  38. 5
      ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/ParameterDeclaration.cs
  39. 4
      ICSharpCode.NRefactory/CSharp/Parser/CSharpParser.cs
  40. 3
      ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj

31
ICSharpCode.NRefactory/CSharp/Ast/AstNode.cs

@ -1,4 +1,4 @@
// //
// AstNode.cs // AstNode.cs
// //
// Author: // Author:
@ -164,16 +164,9 @@ namespace ICSharpCode.NRefactory.CSharp
return role.NullObject; return role.NullObject;
} }
public IEnumerable<T> GetChildrenByRole<T>(Role<T> role) where T : AstNode public AstNodeCollection<T> GetChildrenByRole<T>(Role<T> role) where T : AstNode
{ {
AstNode next; return new AstNodeCollection<T>(this, role);
for (AstNode cur = firstChild; cur != null; cur = next) {
// Remember next before yielding cur.
// This allows removing/replacing nodes while iterating through the list.
next = cur.nextSibling;
if (cur.role == role)
yield return (T)cur;
}
} }
protected void SetChildByRole<T>(Role<T> role, T newChild) where T : AstNode protected void SetChildByRole<T>(Role<T> role, T newChild) where T : AstNode
@ -185,24 +178,6 @@ namespace ICSharpCode.NRefactory.CSharp
oldChild.ReplaceWith(newChild); oldChild.ReplaceWith(newChild);
} }
protected void SetChildrenByRole<T>(Role<T> role, IEnumerable<T> newChildren) where T : AstNode
{
// Evaluate 'newChildren' first, since it might change when we remove the old children
// Example: SetChildren(role, GetChildrenByRole(role));
if (newChildren != null)
newChildren = newChildren.ToList();
// remove old children
foreach (AstNode node in GetChildrenByRole(role))
node.Remove();
// add new children
if (newChildren != null) {
foreach (T node in newChildren) {
AddChild(node, role);
}
}
}
public void AddChild<T>(T child, Role<T> role) where T : AstNode public void AddChild<T>(T child, Role<T> role) where T : AstNode
{ {
if (role == null) if (role == null)

156
ICSharpCode.NRefactory/CSharp/Ast/AstNodeCollection.cs

@ -0,0 +1,156 @@
// 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.Linq;
namespace ICSharpCode.NRefactory.CSharp
{
/// <summary>
/// Represents the children of an AstNode that have a specific role.
/// </summary>
public struct AstNodeCollection<T> : ICollection<T> where T : AstNode
{
readonly AstNode node;
readonly Role<T> role;
public AstNodeCollection(AstNode node, Role<T> role)
{
if (node == null)
throw new ArgumentNullException("node");
if (role == null)
throw new ArgumentNullException("role");
this.node = node;
this.role = role;
}
public int Count {
get {
var e = GetEnumerator();
int count = 0;
while (e.MoveNext())
count++;
return count;
}
}
public void Add(T element)
{
node.AddChild(element, role);
}
public void AddRange(IEnumerable<T> nodes)
{
// Evaluate 'nodes' first, since it might change when we add the new children
// Example: collection.AddRange(collection);
if (nodes != null) {
foreach (T node in nodes.ToList())
Add(node);
}
}
public void AddRange(T[] nodes)
{
// Fast overload for arrays - we don't need to create a copy
if (nodes != null) {
foreach (T node in nodes)
Add(node);
}
}
public void ReplaceWith(IEnumerable<T> nodes)
{
// Evaluate 'nodes' first, since it might change when we call Clear()
// Example: collection.ReplaceWith(collection);
if (nodes != null)
nodes = nodes.ToList();
Clear();
foreach (T node in nodes)
Add(node);
}
public void MoveTo(ICollection<T> targetCollection)
{
foreach (T node in this) {
node.Remove();
targetCollection.Add(node);
}
}
public bool Contains(T element)
{
return element != null && element.Parent == node && element.Role == role;
}
public bool Remove(T element)
{
if (Contains(element)) {
element.Remove();
return true;
} else {
return false;
}
}
public void CopyTo(T[] array, int arrayIndex)
{
foreach (T item in this)
array[arrayIndex++] = item;
}
public void Clear()
{
foreach (T item in this)
item.Remove();
}
bool ICollection<T>.IsReadOnly {
get { return false; }
}
public IEnumerator<T> GetEnumerator()
{
AstNode next;
for (AstNode cur = node.FirstChild; cur != null; cur = next) {
// Remember next before yielding cur.
// This allows removing/replacing nodes while iterating through the list.
next = cur.NextSibling;
if (cur.Role == role)
yield return (T)cur;
}
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
#region Equals and GetHashCode implementation
public override bool Equals(object obj)
{
if (obj is AstNodeCollection<T>) {
return ((AstNodeCollection<T>)obj) == this;
} else {
return false;
}
}
public override int GetHashCode()
{
return node.GetHashCode() ^ role.GetHashCode();
}
public static bool operator ==(AstNodeCollection<T> left, AstNodeCollection<T> right)
{
return left.role == right.role && left.node == right.node;
}
public static bool operator !=(AstNodeCollection<T> left, AstNodeCollection<T> right)
{
return !(left.role == right.role && left.node == right.node);
}
#endregion
}
}

3
ICSharpCode.NRefactory/CSharp/Ast/ComposedType.cs

@ -67,9 +67,8 @@ namespace ICSharpCode.NRefactory.CSharp
} }
} }
public IEnumerable<ArraySpecifier> ArraySpecifiers { public AstNodeCollection<ArraySpecifier> ArraySpecifiers {
get { return GetChildrenByRole (ArraySpecifierRole); } get { return GetChildrenByRole (ArraySpecifierRole); }
set { SetChildrenByRole (ArraySpecifierRole, value); }
} }
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)

5
ICSharpCode.NRefactory/CSharp/Ast/Expressions/AnonymousMethodExpression.cs

@ -1,4 +1,4 @@
// //
// AnonymousMethodExpression.cs // AnonymousMethodExpression.cs
// //
// Author: // Author:
@ -47,9 +47,8 @@ namespace ICSharpCode.NRefactory.CSharp
get { return GetChildByRole (Roles.LPar); } get { return GetChildByRole (Roles.LPar); }
} }
public IEnumerable<ParameterDeclaration> Parameters { public AstNodeCollection<ParameterDeclaration> Parameters {
get { return GetChildrenByRole (Roles.Parameter); } get { return GetChildrenByRole (Roles.Parameter); }
set { SetChildrenByRole (Roles.Parameter, value); }
} }
public CSharpTokenNode RParToken { public CSharpTokenNode RParToken {

5
ICSharpCode.NRefactory/CSharp/Ast/Expressions/ArgListExpression.cs

@ -1,4 +1,4 @@
// //
// ArgListExpression.cs // ArgListExpression.cs
// //
// Author: // Author:
@ -45,9 +45,8 @@ namespace ICSharpCode.NRefactory.CSharp
get { return GetChildByRole (Roles.LPar); } get { return GetChildByRole (Roles.LPar); }
} }
public IEnumerable<Expression> Arguments { public AstNodeCollection<Expression> Arguments {
get { return GetChildrenByRole(Roles.Argument); } get { return GetChildrenByRole(Roles.Argument); }
set { SetChildrenByRole(Roles.Argument, value); }
} }
public CSharpTokenNode RParToken { public CSharpTokenNode RParToken {

6
ICSharpCode.NRefactory/CSharp/Ast/Expressions/ArrayCreateExpression.cs

@ -16,18 +16,16 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole (Roles.Type, value); } set { SetChildByRole (Roles.Type, value); }
} }
public IEnumerable<Expression> Arguments { public AstNodeCollection<Expression> Arguments {
get { return GetChildrenByRole (Roles.Argument); } get { return GetChildrenByRole (Roles.Argument); }
set { SetChildrenByRole (Roles.Argument, value); }
} }
/// <summary> /// <summary>
/// Gets additional array ranks (those without size info). /// Gets additional array ranks (those without size info).
/// Empty for "new int[5,1]"; will contain a single element for "new int[5][]". /// Empty for "new int[5,1]"; will contain a single element for "new int[5][]".
/// </summary> /// </summary>
public IEnumerable<ArraySpecifier> AdditionalArraySpecifiers { public AstNodeCollection<ArraySpecifier> AdditionalArraySpecifiers {
get { return GetChildrenByRole(AdditionalArraySpecifierRole); } get { return GetChildrenByRole(AdditionalArraySpecifierRole); }
set { SetChildrenByRole (AdditionalArraySpecifierRole, value); }
} }
public ArrayInitializerExpression Initializer { public ArrayInitializerExpression Initializer {

5
ICSharpCode.NRefactory/CSharp/Ast/Expressions/ArrayInitializerExpression.cs

@ -1,4 +1,4 @@
// //
// ArrayInitializerExpression.cs // ArrayInitializerExpression.cs
// //
// Author: // Author:
@ -55,9 +55,8 @@ namespace ICSharpCode.NRefactory.CSharp
get { return GetChildByRole (Roles.LBrace); } get { return GetChildByRole (Roles.LBrace); }
} }
public IEnumerable<Expression> Elements { public AstNodeCollection<Expression> Elements {
get { return GetChildrenByRole(Roles.Expression); } get { return GetChildrenByRole(Roles.Expression); }
set { SetChildrenByRole(Roles.Expression, value); }
} }
public CSharpTokenNode RBraceToken { public CSharpTokenNode RBraceToken {

39
ICSharpCode.NRefactory/CSharp/Ast/Expressions/Expression.cs

@ -66,7 +66,10 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public IndexerExpression Indexer(IEnumerable<Expression> arguments) public IndexerExpression Indexer(IEnumerable<Expression> arguments)
{ {
return new IndexerExpression { Target = this, Arguments = arguments }; IndexerExpression expr = new IndexerExpression();
expr.Target = this;
expr.Arguments.AddRange(arguments);
return expr;
} }
/// <summary> /// <summary>
@ -74,7 +77,10 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public IndexerExpression Indexer(params Expression[] arguments) public IndexerExpression Indexer(params Expression[] arguments)
{ {
return new IndexerExpression { Target = this, Arguments = arguments }; IndexerExpression expr = new IndexerExpression();
expr.Target = this;
expr.Arguments.AddRange(arguments);
return expr;
} }
/// <summary> /// <summary>
@ -98,14 +104,14 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public InvocationExpression Invoke(string methodName, IEnumerable<AstType> typeArguments, IEnumerable<Expression> arguments) public InvocationExpression Invoke(string methodName, IEnumerable<AstType> typeArguments, IEnumerable<Expression> arguments)
{ {
return new InvocationExpression { InvocationExpression ie = new InvocationExpression();
Target = new MemberReferenceExpression { MemberReferenceExpression mre = new MemberReferenceExpression();
Target = this, mre.Target = this;
MemberName = methodName, mre.MemberName = methodName;
TypeArguments = typeArguments mre.TypeArguments.AddRange(typeArguments);
}, ie.Target = mre;
Arguments = arguments ie.Arguments.AddRange(arguments);
}; return ie;
} }
/// <summary> /// <summary>
@ -113,10 +119,10 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public InvocationExpression Invoke(IEnumerable<Expression> arguments) public InvocationExpression Invoke(IEnumerable<Expression> arguments)
{ {
return new InvocationExpression { InvocationExpression ie = new InvocationExpression();
Target = this, ie.Target = this;
Arguments = arguments ie.Arguments.AddRange(arguments);
}; return ie;
} }
/// <summary> /// <summary>
@ -124,7 +130,10 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public InvocationExpression Invoke(params Expression[] arguments) public InvocationExpression Invoke(params Expression[] arguments)
{ {
return Invoke(arguments.AsEnumerable()); InvocationExpression ie = new InvocationExpression();
ie.Target = this;
ie.Arguments.AddRange(arguments);
return ie;
} }
public CastExpression CastTo(AstType type) public CastExpression CastTo(AstType type)

5
ICSharpCode.NRefactory/CSharp/Ast/Expressions/IdentifierExpression.cs

@ -1,4 +1,4 @@
// //
// IdentifierExpression.cs // IdentifierExpression.cs
// //
// Author: // Author:
@ -56,9 +56,8 @@ namespace ICSharpCode.NRefactory.CSharp
} }
} }
public IEnumerable<AstType> TypeArguments { public AstNodeCollection<AstType> TypeArguments {
get { return GetChildrenByRole (Roles.TypeArgument); } get { return GetChildrenByRole (Roles.TypeArgument); }
set { SetChildrenByRole (Roles.TypeArgument, value); }
} }
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)

5
ICSharpCode.NRefactory/CSharp/Ast/Expressions/IndexerExpression.cs

@ -1,4 +1,4 @@
// //
// IndexerExpression.cs // IndexerExpression.cs
// //
// Author: // Author:
@ -42,9 +42,8 @@ namespace ICSharpCode.NRefactory.CSharp
get { return GetChildByRole (Roles.LBracket); } get { return GetChildByRole (Roles.LBracket); }
} }
public IEnumerable<Expression> Arguments { public AstNodeCollection<Expression> Arguments {
get { return GetChildrenByRole<Expression>(Roles.Argument); } get { return GetChildrenByRole<Expression>(Roles.Argument); }
set { SetChildrenByRole(Roles.Argument, value); }
} }
public CSharpTokenNode RBracketToken { public CSharpTokenNode RBracketToken {

5
ICSharpCode.NRefactory/CSharp/Ast/Expressions/InvocationExpression.cs

@ -1,4 +1,4 @@
// //
// InvocationExpression.cs // InvocationExpression.cs
// //
// Author: // Author:
@ -42,9 +42,8 @@ namespace ICSharpCode.NRefactory.CSharp
get { return GetChildByRole (Roles.LPar); } get { return GetChildByRole (Roles.LPar); }
} }
public IEnumerable<Expression> Arguments { public AstNodeCollection<Expression> Arguments {
get { return GetChildrenByRole<Expression>(Roles.Argument); } get { return GetChildrenByRole<Expression>(Roles.Argument); }
set { SetChildrenByRole(Roles.Argument, value); }
} }
public CSharpTokenNode RParToken { public CSharpTokenNode RParToken {

5
ICSharpCode.NRefactory/CSharp/Ast/Expressions/LambdaExpression.cs

@ -1,4 +1,4 @@
// //
// LambdaExpression.cs // LambdaExpression.cs
// //
// Author: // Author:
@ -36,9 +36,8 @@ namespace ICSharpCode.NRefactory.CSharp
public readonly static Role<CSharpTokenNode> ArrowRole = new Role<CSharpTokenNode>("Arrow", CSharpTokenNode.Null); public readonly static Role<CSharpTokenNode> ArrowRole = new Role<CSharpTokenNode>("Arrow", CSharpTokenNode.Null);
public static readonly Role<AstNode> BodyRole = new Role<AstNode>("Body", AstNode.Null); public static readonly Role<AstNode> BodyRole = new Role<AstNode>("Body", AstNode.Null);
public IEnumerable<ParameterDeclaration> Parameters { public AstNodeCollection<ParameterDeclaration> Parameters {
get { return GetChildrenByRole (Roles.Parameter); } get { return GetChildrenByRole (Roles.Parameter); }
set { SetChildrenByRole (Roles.Parameter, value); }
} }
public CSharpTokenNode ArrowToken { public CSharpTokenNode ArrowToken {

5
ICSharpCode.NRefactory/CSharp/Ast/Expressions/MemberReferenceExpression.cs

@ -1,4 +1,4 @@
// //
// MemberReferenceExpression.cs // MemberReferenceExpression.cs
// //
// Author: // Author:
@ -51,9 +51,8 @@ namespace ICSharpCode.NRefactory.CSharp
get { return GetChildByRole (Roles.LChevron); } get { return GetChildByRole (Roles.LChevron); }
} }
public IEnumerable<AstType> TypeArguments { public AstNodeCollection<AstType> TypeArguments {
get { return GetChildrenByRole (Roles.TypeArgument); } get { return GetChildrenByRole (Roles.TypeArgument); }
set { SetChildrenByRole (Roles.TypeArgument, value); }
} }
public CSharpTokenNode RChevronToken { public CSharpTokenNode RChevronToken {

5
ICSharpCode.NRefactory/CSharp/Ast/Expressions/ObjectCreateExpression.cs

@ -1,4 +1,4 @@
// //
// ObjectCreateExpression.cs // ObjectCreateExpression.cs
// //
// Author: // Author:
@ -48,9 +48,8 @@ namespace ICSharpCode.NRefactory.CSharp
get { return GetChildByRole (Roles.LPar); } get { return GetChildByRole (Roles.LPar); }
} }
public IEnumerable<Expression> Arguments { public AstNodeCollection<Expression> Arguments {
get { return GetChildrenByRole (Roles.Argument); } get { return GetChildrenByRole (Roles.Argument); }
set { SetChildrenByRole (Roles.Argument, value); }
} }
public CSharpTokenNode RParToken { public CSharpTokenNode RParToken {

5
ICSharpCode.NRefactory/CSharp/Ast/Expressions/PointerReferenceExpression.cs

@ -1,4 +1,4 @@
// //
// PointerReferenceExpression.cs // PointerReferenceExpression.cs
// //
// Author: // Author:
@ -49,9 +49,8 @@ namespace ICSharpCode.NRefactory.CSharp
} }
} }
public IEnumerable<AstType> TypeArguments { public AstNodeCollection<AstType> TypeArguments {
get { return GetChildrenByRole (Roles.TypeArgument); } get { return GetChildrenByRole (Roles.TypeArgument); }
set { SetChildrenByRole (Roles.TypeArgument, value); }
} }
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)

6
ICSharpCode.NRefactory/CSharp/Ast/Expressions/QueryExpression.cs

@ -28,9 +28,8 @@ namespace ICSharpCode.NRefactory.CSharp
} }
#endregion #endregion
public IEnumerable<QueryClause> Clauses { public AstNodeCollection<QueryClause> Clauses {
get { return GetChildrenByRole(ClauseRole); } get { return GetChildrenByRole(ClauseRole); }
set { SetChildrenByRole(ClauseRole, value); }
} }
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
@ -260,9 +259,8 @@ namespace ICSharpCode.NRefactory.CSharp
get { return GetChildByRole (Roles.Keyword); } get { return GetChildByRole (Roles.Keyword); }
} }
public IEnumerable<QueryOrdering> Orderings { public AstNodeCollection<QueryOrdering> Orderings {
get { return GetChildrenByRole (OrderingRole); } get { return GetChildrenByRole (OrderingRole); }
set { SetChildrenByRole (OrderingRole, value); }
} }
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)

5
ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/Attribute.cs

@ -1,4 +1,4 @@
// //
// Attribute.cs // Attribute.cs
// //
// Author: // Author:
@ -44,9 +44,8 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole (Roles.Type, value); } set { SetChildByRole (Roles.Type, value); }
} }
public IEnumerable<Expression> Arguments { public AstNodeCollection<Expression> Arguments {
get { return base.GetChildrenByRole (Roles.Argument); } get { return base.GetChildrenByRole (Roles.Argument); }
set { SetChildrenByRole (Roles.Argument, value); }
} }
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)

5
ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/AttributeSection.cs

@ -1,4 +1,4 @@
// //
// AttributeSection.cs // AttributeSection.cs
// //
// Author: // Author:
@ -49,9 +49,8 @@ namespace ICSharpCode.NRefactory.CSharp
set; set;
} }
public IEnumerable<Attribute> Attributes { public AstNodeCollection<Attribute> Attributes {
get { return base.GetChildrenByRole (AttributeRole); } get { return base.GetChildrenByRole (AttributeRole); }
set { SetChildrenByRole (AttributeRole, value); }
} }
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)

5
ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/Constraint.cs

@ -1,4 +1,4 @@
// //
// Constraint.cs // Constraint.cs
// //
// Author: // Author:
@ -53,9 +53,8 @@ namespace ICSharpCode.NRefactory.CSharp
// TODO: what about new(), struct and class constraints? // TODO: what about new(), struct and class constraints?
public IEnumerable<AstType> BaseTypes { public AstNodeCollection<AstType> BaseTypes {
get { return GetChildrenByRole (BaseTypeRole); } get { return GetChildrenByRole (BaseTypeRole); }
set { SetChildrenByRole (BaseTypeRole, value); }
} }
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)

11
ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/DelegateDeclaration.cs

@ -1,4 +1,4 @@
// //
// DelegateDeclaration.cs // DelegateDeclaration.cs
// //
// Author: // Author:
@ -54,27 +54,24 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole (Roles.Type, value); } set { SetChildByRole (Roles.Type, value); }
} }
public IEnumerable<TypeParameterDeclaration> TypeParameters { public AstNodeCollection<TypeParameterDeclaration> TypeParameters {
get { return GetChildrenByRole (Roles.TypeParameter); } get { return GetChildrenByRole (Roles.TypeParameter); }
set { SetChildrenByRole (Roles.TypeParameter, value); }
} }
public CSharpTokenNode LParToken { public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); } get { return GetChildByRole (Roles.LPar); }
} }
public IEnumerable<ParameterDeclaration> Parameters { public AstNodeCollection<ParameterDeclaration> Parameters {
get { return GetChildrenByRole (Roles.Parameter); } get { return GetChildrenByRole (Roles.Parameter); }
set { SetChildrenByRole (Roles.Parameter, value); }
} }
public CSharpTokenNode RParToken { public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); } get { return GetChildByRole (Roles.RPar); }
} }
public IEnumerable<Constraint> Constraints { public AstNodeCollection<Constraint> Constraints {
get { return GetChildrenByRole (Roles.Constraint); } get { return GetChildrenByRole (Roles.Constraint); }
set { SetChildrenByRole (Roles.Constraint, value); }
} }
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)

10
ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/NamespaceDeclaration.cs

@ -1,4 +1,4 @@
// //
// NamespaceDeclaration.cs // NamespaceDeclaration.cs
// //
// Author: // Author:
@ -54,13 +54,12 @@ namespace ICSharpCode.NRefactory.CSharp
return builder.ToString (); return builder.ToString ();
} }
set { set {
SetChildrenByRole (Roles.Identifier, value.Split('.').Select(ident => new Identifier(ident, AstLocation.Empty))); GetChildrenByRole(Roles.Identifier).ReplaceWith(value.Split('.').Select(ident => new Identifier(ident, AstLocation.Empty)));
} }
} }
public IEnumerable<Identifier> Identifiers { public AstNodeCollection<Identifier> Identifiers {
get { return GetChildrenByRole (Roles.Identifier); } get { return GetChildrenByRole (Roles.Identifier); }
set { SetChildrenByRole (Roles.Identifier, value); }
} }
/// <summary> /// <summary>
@ -79,9 +78,8 @@ namespace ICSharpCode.NRefactory.CSharp
get { return GetChildByRole (Roles.LBrace); } get { return GetChildByRole (Roles.LBrace); }
} }
public IEnumerable<AstNode> Members { public AstNodeCollection<AstNode> Members {
get { return GetChildrenByRole(MemberRole); } get { return GetChildrenByRole(MemberRole); }
set { SetChildrenByRole(MemberRole, value); }
} }
public CSharpTokenNode RBraceToken { public CSharpTokenNode RBraceToken {

14
ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/TypeDeclaration.cs

@ -1,4 +1,4 @@
// //
// TypeDeclaration.cs // TypeDeclaration.cs
// //
// Author: // Author:
@ -59,28 +59,24 @@ namespace ICSharpCode.NRefactory.CSharp
} }
} }
public IEnumerable<TypeParameterDeclaration> TypeParameters { public AstNodeCollection<TypeParameterDeclaration> TypeParameters {
get { return GetChildrenByRole (Roles.TypeParameter); } get { return GetChildrenByRole (Roles.TypeParameter); }
set { SetChildrenByRole (Roles.TypeParameter, value); }
} }
public IEnumerable<AstType> BaseTypes { public AstNodeCollection<AstType> BaseTypes {
get { return GetChildrenByRole (BaseTypeRole); } get { return GetChildrenByRole (BaseTypeRole); }
set { SetChildrenByRole (BaseTypeRole, value); }
} }
public IEnumerable<Constraint> Constraints { public AstNodeCollection<Constraint> Constraints {
get { return GetChildrenByRole (Roles.Constraint); } get { return GetChildrenByRole (Roles.Constraint); }
set { SetChildrenByRole (Roles.Constraint, value); }
} }
public CSharpTokenNode LBraceToken { public CSharpTokenNode LBraceToken {
get { return GetChildByRole (Roles.LBrace); } get { return GetChildByRole (Roles.LBrace); }
} }
public IEnumerable<AttributedNode> Members { public AstNodeCollection<AttributedNode> Members {
get { return GetChildrenByRole (MemberRole); } get { return GetChildrenByRole (MemberRole); }
set { SetChildrenByRole (MemberRole, value); }
} }
public CSharpTokenNode RBraceToken { public CSharpTokenNode RBraceToken {

5
ICSharpCode.NRefactory/CSharp/Ast/MemberType.cs

@ -1,4 +1,4 @@
// //
// FullTypeName.cs // FullTypeName.cs
// //
// Author: // Author:
@ -51,9 +51,8 @@ namespace ICSharpCode.NRefactory.CSharp
} }
} }
public IEnumerable<AstType> TypeArguments { public AstNodeCollection<AstType> TypeArguments {
get { return GetChildrenByRole (Roles.TypeArgument); } get { return GetChildrenByRole (Roles.TypeArgument); }
set { SetChildrenByRole (Roles.TypeArgument, value); }
} }
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)

5
ICSharpCode.NRefactory/CSharp/Ast/SimpleType.cs

@ -1,4 +1,4 @@
// //
// FullTypeName.cs // FullTypeName.cs
// //
// Author: // Author:
@ -56,9 +56,8 @@ namespace ICSharpCode.NRefactory.CSharp
} }
} }
public IEnumerable<AstType> TypeArguments { public AstNodeCollection<AstType> TypeArguments {
get { return GetChildrenByRole (Roles.TypeArgument); } get { return GetChildrenByRole (Roles.TypeArgument); }
set { SetChildrenByRole (Roles.TypeArgument, value); }
} }
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)

5
ICSharpCode.NRefactory/CSharp/Ast/Statements/BlockStatement.cs

@ -1,4 +1,4 @@
// //
// BlockStatement.cs // BlockStatement.cs
// //
// Author: // Author:
@ -56,9 +56,8 @@ namespace ICSharpCode.NRefactory.CSharp
get { return GetChildByRole (Roles.LBrace); } get { return GetChildByRole (Roles.LBrace); }
} }
public IEnumerable<Statement> Statements { public AstNodeCollection<Statement> Statements {
get { return GetChildrenByRole (StatementRole); } get { return GetChildrenByRole (StatementRole); }
set { SetChildrenByRole (StatementRole, value); }
} }
public CSharpTokenNode RBraceToken { public CSharpTokenNode RBraceToken {

5
ICSharpCode.NRefactory/CSharp/Ast/Statements/FixedStatement.cs

@ -1,4 +1,4 @@
// //
// FixedStatement.cs // FixedStatement.cs
// //
// Author: // Author:
@ -46,9 +46,8 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole (Roles.Type, value); } set { SetChildByRole (Roles.Type, value); }
} }
public IEnumerable<VariableInitializer> Variables { public AstNodeCollection<VariableInitializer> Variables {
get { return GetChildrenByRole (Roles.Variable); } get { return GetChildrenByRole (Roles.Variable); }
set { SetChildrenByRole (Roles.Variable, value); }
} }
public CSharpTokenNode RParToken { public CSharpTokenNode RParToken {

8
ICSharpCode.NRefactory/CSharp/Ast/Statements/ForStatement.cs

@ -1,4 +1,4 @@
// //
// ForStatement.cs // ForStatement.cs
// //
// Author: // Author:
@ -49,9 +49,8 @@ namespace ICSharpCode.NRefactory.CSharp
/// Note: this contains multiple statements for "for (a = 2, b = 1; a > b; a--)", but contains /// Note: this contains multiple statements for "for (a = 2, b = 1; a > b; a--)", but contains
/// only a single statement for "for (int a = 2, b = 1; a > b; a--)" (a single VariableDeclarationStatement with two variables) /// only a single statement for "for (int a = 2, b = 1; a > b; a--)" (a single VariableDeclarationStatement with two variables)
/// </summary> /// </summary>
public IEnumerable<Statement> Initializers { public AstNodeCollection<Statement> Initializers {
get { return GetChildrenByRole (InitializerRole); } get { return GetChildrenByRole (InitializerRole); }
set { SetChildrenByRole (InitializerRole, value); }
} }
public Expression Condition { public Expression Condition {
@ -59,9 +58,8 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole (Roles.Condition, value); } set { SetChildByRole (Roles.Condition, value); }
} }
public IEnumerable<Statement> Iterators { public AstNodeCollection<Statement> Iterators {
get { return GetChildrenByRole (IteratorRole); } get { return GetChildrenByRole (IteratorRole); }
set { SetChildrenByRole (IteratorRole, value); }
} }
public CSharpTokenNode RParToken { public CSharpTokenNode RParToken {

11
ICSharpCode.NRefactory/CSharp/Ast/Statements/SwitchStatement.cs

@ -1,4 +1,4 @@
// //
// SwitchStatement.cs // SwitchStatement.cs
// //
// Author: // Author:
@ -57,9 +57,8 @@ namespace ICSharpCode.NRefactory.CSharp
get { return GetChildByRole (Roles.LBrace); } get { return GetChildByRole (Roles.LBrace); }
} }
public IEnumerable<SwitchSection> SwitchSections { public AstNodeCollection<SwitchSection> SwitchSections {
get { return GetChildrenByRole (SwitchSectionRole); } get { return GetChildrenByRole (SwitchSectionRole); }
set { SetChildrenByRole (SwitchSectionRole, value); }
} }
public CSharpTokenNode RBraceToken { public CSharpTokenNode RBraceToken {
@ -82,14 +81,12 @@ namespace ICSharpCode.NRefactory.CSharp
} }
} }
public IEnumerable<CaseLabel> CaseLabels { public AstNodeCollection<CaseLabel> CaseLabels {
get { return GetChildrenByRole (CaseLabelRole); } get { return GetChildrenByRole (CaseLabelRole); }
set { SetChildrenByRole (CaseLabelRole, value); }
} }
public IEnumerable<Statement> Statements { public AstNodeCollection<Statement> Statements {
get { return GetChildrenByRole (Roles.EmbeddedStatement); } get { return GetChildrenByRole (Roles.EmbeddedStatement); }
set { SetChildrenByRole (Roles.EmbeddedStatement, value); }
} }
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)

5
ICSharpCode.NRefactory/CSharp/Ast/Statements/TryCatchStatement.cs

@ -1,4 +1,4 @@
// //
// TryCatchStatement.cs // TryCatchStatement.cs
// //
// Author: // Author:
@ -49,9 +49,8 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole (TryBlockRole, value); } set { SetChildByRole (TryBlockRole, value); }
} }
public IEnumerable<CatchClause> CatchClauses { public AstNodeCollection<CatchClause> CatchClauses {
get { return GetChildrenByRole (CatchClauseRole); } get { return GetChildrenByRole (CatchClauseRole); }
set { SetChildrenByRole (CatchClauseRole, value); }
} }
public CSharpTokenNode FinallyToken { public CSharpTokenNode FinallyToken {

15
ICSharpCode.NRefactory/CSharp/Ast/Statements/VariableDeclarationStatement.cs

@ -1,4 +1,4 @@
// //
// VariableDeclarationStatement.cs // VariableDeclarationStatement.cs
// //
// Author: // Author:
@ -33,6 +33,16 @@ namespace ICSharpCode.NRefactory.CSharp
{ {
public static readonly Role<CSharpModifierToken> ModifierRole = AttributedNode.ModifierRole; public static readonly Role<CSharpModifierToken> ModifierRole = AttributedNode.ModifierRole;
public VariableDeclarationStatement()
{
}
public VariableDeclarationStatement(AstType type, string name, Expression initializer = null)
{
this.Type = type;
this.Variables.Add(new VariableInitializer(name, initializer));
}
public Modifiers Modifiers { public Modifiers Modifiers {
get { return AttributedNode.GetModifiers(this); } get { return AttributedNode.GetModifiers(this); }
set { AttributedNode.SetModifiers(this, value); } set { AttributedNode.SetModifiers(this, value); }
@ -43,9 +53,8 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole (Roles.Type, value); } set { SetChildByRole (Roles.Type, value); }
} }
public IEnumerable<VariableInitializer> Variables { public AstNodeCollection<VariableInitializer> Variables {
get { return GetChildrenByRole (Roles.Variable); } get { return GetChildrenByRole (Roles.Variable); }
set { SetChildrenByRole (Roles.Variable, value); }
} }
public CSharpTokenNode SemicolonToken { public CSharpTokenNode SemicolonToken {

3
ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/AttributedNode.cs

@ -11,9 +11,8 @@ namespace ICSharpCode.NRefactory.CSharp
public static readonly Role<AttributeSection> AttributeRole = new Role<AttributeSection>("Attribute"); public static readonly Role<AttributeSection> AttributeRole = new Role<AttributeSection>("Attribute");
public static readonly Role<CSharpModifierToken> ModifierRole = new Role<CSharpModifierToken>("Modifier"); public static readonly Role<CSharpModifierToken> ModifierRole = new Role<CSharpModifierToken>("Modifier");
public IEnumerable<AttributeSection> Attributes { public AstNodeCollection<AttributeSection> Attributes {
get { return base.GetChildrenByRole (AttributeRole); } get { return base.GetChildrenByRole (AttributeRole); }
set { SetChildrenByRole (AttributeRole, value); }
} }
public Modifiers Modifiers { public Modifiers Modifiers {

8
ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/ConstructorDeclaration.cs

@ -1,4 +1,4 @@
// //
// ConstructorDeclaration.cs // ConstructorDeclaration.cs
// //
// Author: // Author:
@ -37,9 +37,8 @@ namespace ICSharpCode.NRefactory.CSharp
get { return GetChildByRole (Roles.LPar); } get { return GetChildByRole (Roles.LPar); }
} }
public IEnumerable<ParameterDeclaration> Parameters { public AstNodeCollection<ParameterDeclaration> Parameters {
get { return GetChildrenByRole (Roles.Parameter); } get { return GetChildrenByRole (Roles.Parameter); }
set { SetChildrenByRole (Roles.Parameter, value); }
} }
public CSharpTokenNode RParToken { public CSharpTokenNode RParToken {
@ -105,9 +104,8 @@ namespace ICSharpCode.NRefactory.CSharp
set; set;
} }
public IEnumerable<Expression> Arguments { public AstNodeCollection<Expression> Arguments {
get { return GetChildrenByRole (Roles.Argument); } get { return GetChildrenByRole (Roles.Argument); }
set { SetChildrenByRole (Roles.Argument, value); }
} }
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)

5
ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/EventDeclaration.cs

@ -1,4 +1,4 @@
// //
// EventDeclaration.cs // EventDeclaration.cs
// //
// Author: // Author:
@ -30,9 +30,8 @@ namespace ICSharpCode.NRefactory.CSharp
{ {
public class EventDeclaration : MemberDeclaration public class EventDeclaration : MemberDeclaration
{ {
public IEnumerable<VariableInitializer> Variables { public AstNodeCollection<VariableInitializer> Variables {
get { return GetChildrenByRole (Roles.Variable); } get { return GetChildrenByRole (Roles.Variable); }
set { SetChildrenByRole (Roles.Variable, value); }
} }
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)

5
ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/FieldDeclaration.cs

@ -1,4 +1,4 @@
// //
// FieldDeclaration.cs // FieldDeclaration.cs
// //
// Author: // Author:
@ -31,9 +31,8 @@ namespace ICSharpCode.NRefactory.CSharp
{ {
public class FieldDeclaration : MemberDeclaration public class FieldDeclaration : MemberDeclaration
{ {
public IEnumerable<VariableInitializer> Variables { public AstNodeCollection<VariableInitializer> Variables {
get { return GetChildrenByRole (Roles.Variable); } get { return GetChildrenByRole (Roles.Variable); }
set { SetChildrenByRole (Roles.Variable, value); }
} }
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)

5
ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/IndexerDeclaration.cs

@ -1,4 +1,4 @@
// //
// IndexerDeclaration.cs // IndexerDeclaration.cs
// //
// Author: // Author:
@ -35,9 +35,8 @@ namespace ICSharpCode.NRefactory.CSharp
get { return GetChildByRole (Roles.LBracket); } get { return GetChildByRole (Roles.LBracket); }
} }
public IEnumerable<ParameterDeclaration> Parameters { public AstNodeCollection<ParameterDeclaration> Parameters {
get { return GetChildrenByRole (Roles.Parameter); } get { return GetChildrenByRole (Roles.Parameter); }
set { SetChildrenByRole (Roles.Parameter, value); }
} }
public CSharpTokenNode RBracketToken { public CSharpTokenNode RBracketToken {

11
ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/MethodDeclaration.cs

@ -1,4 +1,4 @@
// //
// MethodDeclaration.cs // MethodDeclaration.cs
// //
// Author: // Author:
@ -31,27 +31,24 @@ namespace ICSharpCode.NRefactory.CSharp
{ {
public class MethodDeclaration : MemberDeclaration public class MethodDeclaration : MemberDeclaration
{ {
public IEnumerable<TypeParameterDeclaration> TypeParameters { public AstNodeCollection<TypeParameterDeclaration> TypeParameters {
get { return GetChildrenByRole (Roles.TypeParameter); } get { return GetChildrenByRole (Roles.TypeParameter); }
set { SetChildrenByRole (Roles.TypeParameter, value); }
} }
public CSharpTokenNode LParToken { public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); } get { return GetChildByRole (Roles.LPar); }
} }
public IEnumerable<ParameterDeclaration> Parameters { public AstNodeCollection<ParameterDeclaration> Parameters {
get { return GetChildrenByRole (Roles.Parameter); } get { return GetChildrenByRole (Roles.Parameter); }
set { SetChildrenByRole (Roles.Parameter, value); }
} }
public CSharpTokenNode RParToken { public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); } get { return GetChildByRole (Roles.RPar); }
} }
public IEnumerable<Constraint> Constraints { public AstNodeCollection<Constraint> Constraints {
get { return GetChildrenByRole (Roles.Constraint); } get { return GetChildrenByRole (Roles.Constraint); }
set { SetChildrenByRole (Roles.Constraint, value); }
} }
public BlockStatement Body { public BlockStatement Body {

5
ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/OperatorDeclaration.cs

@ -1,4 +1,4 @@
// //
// OperatorDeclaration.cs // OperatorDeclaration.cs
// //
// Author: // Author:
@ -80,9 +80,8 @@ namespace ICSharpCode.NRefactory.CSharp
get { return GetChildByRole (Roles.LPar); } get { return GetChildByRole (Roles.LPar); }
} }
public IEnumerable<ParameterDeclaration> Parameters { public AstNodeCollection<ParameterDeclaration> Parameters {
get { return GetChildrenByRole (Roles.Parameter); } get { return GetChildrenByRole (Roles.Parameter); }
set { SetChildrenByRole (Roles.Parameter, value); }
} }
public CSharpTokenNode RParToken { public CSharpTokenNode RParToken {

5
ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/ParameterDeclaration.cs

@ -1,4 +1,4 @@
// //
// ParameterDeclarationExpression.cs // ParameterDeclarationExpression.cs
// //
// Author: // Author:
@ -49,9 +49,8 @@ namespace ICSharpCode.NRefactory.CSharp
} }
} }
public IEnumerable<AttributeSection> Attributes { public AstNodeCollection<AttributeSection> Attributes {
get { return GetChildrenByRole (AttributeRole); } get { return GetChildrenByRole (AttributeRole); }
set { SetChildrenByRole (AttributeRole, value); }
} }
public ParameterModifier ParameterModifier { public ParameterModifier ParameterModifier {

4
ICSharpCode.NRefactory/CSharp/Parser/CSharpParser.cs

@ -122,9 +122,7 @@ namespace ICSharpCode.NRefactory.CSharp
if (location != null) if (location != null)
spec.AddChild (new CSharpTokenNode (Convert (location[0]), 1), FieldDeclaration.Roles.RBracket); spec.AddChild (new CSharpTokenNode (Convert (location[0]), 1), FieldDeclaration.Roles.RBracket);
result.ArraySpecifiers = new ArraySpecifier[] { result.ArraySpecifiers.Add(spec);
spec
};
} }
return result; return result;
} }

3
ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup> <PropertyGroup>
<ProjectGuid>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</ProjectGuid> <ProjectGuid>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</ProjectGuid>
@ -56,6 +56,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="CSharp\Ast\AstComparer.cs" /> <Compile Include="CSharp\Ast\AstComparer.cs" />
<Compile Include="CSharp\Ast\AstNodeCollection.cs" />
<Compile Include="CSharp\Ast\Expressions\TypeReferenceExpression.cs" /> <Compile Include="CSharp\Ast\Expressions\TypeReferenceExpression.cs" />
<Compile Include="CSharp\Ast\IAstVisitor.cs" /> <Compile Include="CSharp\Ast\IAstVisitor.cs" />
<Compile Include="CSharp\Ast\CompilationUnit.cs" /> <Compile Include="CSharp\Ast\CompilationUnit.cs" />

Loading…
Cancel
Save