diff --git a/ICSharpCode.NRefactory/CSharp/Ast/ComposedType.cs b/ICSharpCode.NRefactory/CSharp/Ast/ComposedType.cs index 17b183eade..63aca527ce 100644 --- a/ICSharpCode.NRefactory/CSharp/Ast/ComposedType.cs +++ b/ICSharpCode.NRefactory/CSharp/Ast/ComposedType.cs @@ -102,6 +102,10 @@ namespace ICSharpCode.NRefactory.CSharp } } + public CSharpTokenNode LBracketToken { + get { return GetChildByRole (Roles.LBracket); } + } + public int Dimensions { get { return 1 + GetChildrenByRole(Roles.Comma).Count(); } set { @@ -117,6 +121,10 @@ namespace ICSharpCode.NRefactory.CSharp } } + public CSharpTokenNode RBracketToken { + get { return GetChildByRole (Roles.RBracket); } + } + public override S AcceptVisitor (AstVisitor visitor, T data) { return visitor.VisitArraySpecifier(this, data); diff --git a/ICSharpCode.NRefactory/CSharp/Ast/Statements/TryCatchStatement.cs b/ICSharpCode.NRefactory/CSharp/Ast/Statements/TryCatchStatement.cs index b9e540c3f0..01d62e185e 100644 --- a/ICSharpCode.NRefactory/CSharp/Ast/Statements/TryCatchStatement.cs +++ b/ICSharpCode.NRefactory/CSharp/Ast/Statements/TryCatchStatement.cs @@ -30,7 +30,7 @@ using System.Linq; namespace ICSharpCode.NRefactory.CSharp { /// - /// try { TryBlock } CatchClauses finally { FinallyBlock } + /// try TryBlock CatchClauses finally FinallyBlock /// public class TryCatchStatement : Statement { @@ -40,6 +40,10 @@ namespace ICSharpCode.NRefactory.CSharp public static readonly Role FinallyKeywordRole = new Role("FinallyKeyword", CSharpTokenNode.Null); public static readonly Role FinallyBlockRole = new Role("FinallyBlock", BlockStatement.Null); + public CSharpTokenNode TryToken { + get { return GetChildByRole (TryKeywordRole); } + } + public BlockStatement TryBlock { get { return GetChildByRole (TryBlockRole); } set { SetChildByRole (TryBlockRole, value); } @@ -50,6 +54,10 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildrenByRole (CatchClauseRole, value); } } + public CSharpTokenNode FinallyToken { + get { return GetChildByRole (FinallyKeywordRole); } + } + public BlockStatement FinallyBlock { get { return GetChildByRole (FinallyBlockRole); } set { SetChildByRole (FinallyBlockRole, value); } @@ -72,6 +80,14 @@ namespace ICSharpCode.NRefactory.CSharp } } + public CSharpTokenNode CatchToken { + get { return GetChildByRole (Roles.Keyword); } + } + + public CSharpTokenNode LParToken { + get { return GetChildByRole (Roles.LPar); } + } + public AstType Type { get { return GetChildByRole (Roles.Type); } set { SetChildByRole (Roles.Type, value); } @@ -87,6 +103,10 @@ namespace ICSharpCode.NRefactory.CSharp } } + public CSharpTokenNode RParToken { + get { return GetChildByRole (Roles.RPar); } + } + public BlockStatement Body { get { return GetChildByRole (Roles.Body); } set { SetChildByRole (Roles.Body, value); } diff --git a/ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/EventDeclaration.cs b/ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/EventDeclaration.cs index 7c469e1c75..4b46724181 100644 --- a/ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/EventDeclaration.cs +++ b/ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/EventDeclaration.cs @@ -46,6 +46,10 @@ namespace ICSharpCode.NRefactory.CSharp public static readonly Role AddAccessorRole = new Role("AddAccessor", Accessor.Null); public static readonly Role RemoveAccessorRole = new Role("RemoveAccessor", Accessor.Null); + public CSharpTokenNode LBraceToken { + get { return GetChildByRole (Roles.LBrace); } + } + public Accessor AddAccessor { get { return GetChildByRole (AddAccessorRole); } set { SetChildByRole (AddAccessorRole, value); } @@ -56,6 +60,10 @@ namespace ICSharpCode.NRefactory.CSharp set { SetChildByRole (RemoveAccessorRole, value); } } + public CSharpTokenNode RBraceToken { + get { return GetChildByRole (Roles.RBrace); } + } + public override S AcceptVisitor (AstVisitor visitor, T data) { return visitor.VisitCustomEventDeclaration (this, data);