Browse Source

Added some missing token properties.

newNRvisualizers
Mike Krüger 15 years ago
parent
commit
65d688a65d
  1. 8
      ICSharpCode.NRefactory/CSharp/Ast/ComposedType.cs
  2. 22
      ICSharpCode.NRefactory/CSharp/Ast/Statements/TryCatchStatement.cs
  3. 8
      ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/EventDeclaration.cs

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

@ -102,6 +102,10 @@ namespace ICSharpCode.NRefactory.CSharp @@ -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 @@ -117,6 +121,10 @@ namespace ICSharpCode.NRefactory.CSharp
}
}
public CSharpTokenNode RBracketToken {
get { return GetChildByRole (Roles.RBracket); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{
return visitor.VisitArraySpecifier(this, data);

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

@ -30,7 +30,7 @@ using System.Linq; @@ -30,7 +30,7 @@ using System.Linq;
namespace ICSharpCode.NRefactory.CSharp
{
/// <summary>
/// try { TryBlock } CatchClauses finally { FinallyBlock }
/// try TryBlock CatchClauses finally FinallyBlock
/// </summary>
public class TryCatchStatement : Statement
{
@ -40,6 +40,10 @@ namespace ICSharpCode.NRefactory.CSharp @@ -40,6 +40,10 @@ namespace ICSharpCode.NRefactory.CSharp
public static readonly Role<CSharpTokenNode> FinallyKeywordRole = new Role<CSharpTokenNode>("FinallyKeyword", CSharpTokenNode.Null);
public static readonly Role<BlockStatement> FinallyBlockRole = new Role<BlockStatement>("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 @@ -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 @@ -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 @@ -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); }

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

@ -46,6 +46,10 @@ namespace ICSharpCode.NRefactory.CSharp @@ -46,6 +46,10 @@ namespace ICSharpCode.NRefactory.CSharp
public static readonly Role<Accessor> AddAccessorRole = new Role<Accessor>("AddAccessor", Accessor.Null);
public static readonly Role<Accessor> RemoveAccessorRole = new Role<Accessor>("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 @@ -56,6 +60,10 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole (RemoveAccessorRole, value); }
}
public CSharpTokenNode RBraceToken {
get { return GetChildByRole (Roles.RBrace); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{
return visitor.VisitCustomEventDeclaration (this, data);

Loading…
Cancel
Save