mirror of https://github.com/icsharpcode/ILSpy.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.4 KiB
43 lines
1.4 KiB
using System; |
|
using System.Collections.Generic; |
|
|
|
namespace ICSharpCode.NRefactory.CSharp |
|
{ |
|
/// <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 IEnumerable<Expression> Arguments { |
|
get { return GetChildrenByRole (Roles.Argument); } |
|
set { SetChildrenByRole (Roles.Argument, value); } |
|
} |
|
|
|
/// <summary> |
|
/// Gets additional array ranks (those without size info). |
|
/// Empty for "new int[5,1]"; will contain a single element for "new int[5][]". |
|
/// </summary> |
|
public IEnumerable<ArraySpecifier> AdditionalArraySpecifiers { |
|
get { return GetChildrenByRole(AdditionalArraySpecifierRole); } |
|
set { SetChildrenByRole (AdditionalArraySpecifierRole, value); } |
|
} |
|
|
|
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); |
|
} |
|
} |
|
}
|
|
|