Browse Source

Added some token getters.

newNRvisualizers
Mike Krüger 15 years ago
parent
commit
66d45aca27
  1. 12
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/AnonymousMethodExpression.cs
  2. 12
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/ArgListExpression.cs
  3. 8
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/ArrayInitializerExpression.cs
  4. 4
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/AsExpression.cs
  5. 8
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/CastExpression.cs
  6. 12
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/CheckedExpression.cs
  7. 8
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/ConditionalExpression.cs
  8. 12
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/DefaultValueExpression.cs
  9. 4
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/DirectionExpression.cs
  10. 8
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/IndexerExpression.cs
  11. 8
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/InvocationExpression.cs
  12. 4
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/IsExpression.cs
  13. 4
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/LambdaExpression.cs
  14. 8
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/MemberReferenceExpression.cs
  15. 12
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/ObjectCreateExpression.cs
  16. 8
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/ParenthesizedExpression.cs
  17. 12
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/SizeOfExpression.cs
  18. 12
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/StackAllocExpression.cs
  19. 12
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/TypeOfExpression.cs
  20. 4
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/UnaryOperatorExpression.cs
  21. 12
      ICSharpCode.NRefactory/CSharp/Ast/Expressions/UncheckedExpression.cs
  22. 8
      ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/DelegateDeclaration.cs
  23. 8
      ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/NamespaceDeclaration.cs
  24. 8
      ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/TypeDeclaration.cs
  25. 8
      ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/UsingAliasDeclaration.cs
  26. 8
      ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/UsingDeclaration.cs
  27. 8
      ICSharpCode.NRefactory/CSharp/Ast/Statements/BlockStatement.cs
  28. 4
      ICSharpCode.NRefactory/CSharp/Ast/Statements/BreakStatement.cs
  29. 4
      ICSharpCode.NRefactory/CSharp/Ast/Statements/CheckedStatement.cs
  30. 4
      ICSharpCode.NRefactory/CSharp/Ast/Statements/ContinueStatement.cs
  31. 4
      ICSharpCode.NRefactory/CSharp/Ast/Statements/ExpressionStatement.cs
  32. 12
      ICSharpCode.NRefactory/CSharp/Ast/Statements/FixedStatement.cs
  33. 12
      ICSharpCode.NRefactory/CSharp/Ast/Statements/ForStatement.cs
  34. 16
      ICSharpCode.NRefactory/CSharp/Ast/Statements/ForeachStatement.cs
  35. 8
      ICSharpCode.NRefactory/CSharp/Ast/Statements/GotoStatement.cs
  36. 16
      ICSharpCode.NRefactory/CSharp/Ast/Statements/IfElseStatement.cs
  37. 12
      ICSharpCode.NRefactory/CSharp/Ast/Statements/LockStatement.cs
  38. 8
      ICSharpCode.NRefactory/CSharp/Ast/Statements/ReturnStatement.cs
  39. 20
      ICSharpCode.NRefactory/CSharp/Ast/Statements/SwitchStatement.cs
  40. 8
      ICSharpCode.NRefactory/CSharp/Ast/Statements/ThrowStatement.cs
  41. 4
      ICSharpCode.NRefactory/CSharp/Ast/Statements/UncheckedStatement.cs
  42. 4
      ICSharpCode.NRefactory/CSharp/Ast/Statements/UnsafeStatement.cs
  43. 12
      ICSharpCode.NRefactory/CSharp/Ast/Statements/UsingStatement.cs
  44. 4
      ICSharpCode.NRefactory/CSharp/Ast/Statements/VariableDeclarationStatement.cs
  45. 16
      ICSharpCode.NRefactory/CSharp/Ast/Statements/WhileStatement.cs
  46. 16
      ICSharpCode.NRefactory/CSharp/Ast/Statements/YieldStatement.cs
  47. 8
      ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/ConstructorDeclaration.cs
  48. 11
      ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/DestructorDeclaration.cs
  49. 8
      ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/MethodDeclaration.cs
  50. 8
      ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/OperatorDeclaration.cs
  51. 8
      ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/PropertyDeclaration.cs
  52. 4
      ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/VariableInitializer.cs
  53. 4
      ICSharpCode.NRefactory/CSharp/Parser/CSharpParser.cs

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

@ -39,12 +39,12 @@ namespace ICSharpCode.NRefactory.CSharp
get; set; get; set;
} }
public CSharpTokenNode DelegateKeyword { public CSharpTokenNode DelegateToken {
get { return GetChildrenByRole (Roles.Keyword); } get { return GetChildByRole (Roles.Keyword); }
} }
public CSharpTokenNode LPar { public CSharpTokenNode LParToken {
get { return GetChildrenByRole (Roles.LPar); } get { return GetChildByRole (Roles.LPar); }
} }
public IEnumerable<ParameterDeclaration> Parameters { public IEnumerable<ParameterDeclaration> Parameters {
@ -52,8 +52,8 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildrenByRole (Roles.Parameter, value); } set { SetChildrenByRole (Roles.Parameter, value); }
} }
public CSharpTokenNode RPar { public CSharpTokenNode RParToken {
get { return GetChildrenByRole (Roles.RPar); } get { return GetChildByRole (Roles.RPar); }
} }
public BlockStatement Body { public BlockStatement Body {

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

@ -37,11 +37,23 @@ namespace ICSharpCode.NRefactory.CSharp
get; set; get; set;
} }
public CSharpTokenNode ArgListToken {
get { return GetChildByRole (Roles.Keyword); }
}
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public IEnumerable<Expression> Arguments { public IEnumerable<Expression> Arguments {
get { return GetChildrenByRole(Roles.Argument); } get { return GetChildrenByRole(Roles.Argument); }
set { SetChildrenByRole(Roles.Argument, value); } set { SetChildrenByRole(Roles.Argument, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitArgListExpression (this, data); return visitor.VisitArgListExpression (this, data);

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

@ -51,11 +51,19 @@ namespace ICSharpCode.NRefactory.CSharp
} }
#endregion #endregion
public CSharpTokenNode LBraceToken {
get { return GetChildByRole (Roles.LBrace); }
}
public IEnumerable<Expression> Elements { public IEnumerable<Expression> Elements {
get { return GetChildrenByRole(Roles.Expression); } get { return GetChildrenByRole(Roles.Expression); }
set { SetChildrenByRole(Roles.Expression, value); } set { SetChildrenByRole(Roles.Expression, value); }
} }
public CSharpTokenNode RBraceToken {
get { return GetChildByRole (Roles.RBrace); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitArrayInitializerExpression (this, data); return visitor.VisitArrayInitializerExpression (this, data);

4
ICSharpCode.NRefactory/CSharp/Ast/Expressions/AsExpression.cs

@ -36,8 +36,8 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole(Roles.Expression, value); } set { SetChildByRole(Roles.Expression, value); }
} }
public CSharpTokenNode AsKeyword { public CSharpTokenNode AsToken {
get { return GetChildrenByRole (Roles.Keyword); } get { return GetChildByRole (Roles.Keyword); }
} }
public AstType Type { public AstType Type {

8
ICSharpCode.NRefactory/CSharp/Ast/Expressions/CastExpression.cs

@ -31,11 +31,19 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public class CastExpression : Expression public class CastExpression : Expression
{ {
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public AstType CastTo { public AstType CastTo {
get { return GetChildByRole (Roles.Type); } get { return GetChildByRole (Roles.Type); }
set { SetChildByRole (Roles.Type, value); } set { SetChildByRole (Roles.Type, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public Expression Expression { public Expression Expression {
get { return GetChildByRole (Roles.Expression); } get { return GetChildByRole (Roles.Expression); }
set { SetChildByRole (Roles.Expression, value); } set { SetChildByRole (Roles.Expression, value); }

12
ICSharpCode.NRefactory/CSharp/Ast/Expressions/CheckedExpression.cs

@ -31,11 +31,23 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public class CheckedExpression : Expression public class CheckedExpression : Expression
{ {
public CSharpTokenNode CheckedToken {
get { return GetChildByRole (Roles.Keyword); }
}
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public Expression Expression { public Expression Expression {
get { return GetChildByRole (Roles.Expression); } get { return GetChildByRole (Roles.Expression); }
set { SetChildByRole(Roles.Expression, value); } set { SetChildByRole(Roles.Expression, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitCheckedExpression (this, data); return visitor.VisitCheckedExpression (this, data);

8
ICSharpCode.NRefactory/CSharp/Ast/Expressions/ConditionalExpression.cs

@ -42,11 +42,19 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole(ConditionRole, value); } set { SetChildByRole(ConditionRole, value); }
} }
public CSharpTokenNode QuestionMarkToken {
get { return GetChildByRole (QuestionMarkRole); }
}
public Expression TrueExpression { public Expression TrueExpression {
get { return GetChildByRole(TrueRole); } get { return GetChildByRole(TrueRole); }
set { SetChildByRole(TrueRole, value); } set { SetChildByRole(TrueRole, value); }
} }
public CSharpTokenNode ColonToken {
get { return GetChildByRole (ColonRole); }
}
public Expression FalseExpression { public Expression FalseExpression {
get { return GetChildByRole(FalseRole); } get { return GetChildByRole(FalseRole); }
set { SetChildByRole(FalseRole, value); } set { SetChildByRole(FalseRole, value); }

12
ICSharpCode.NRefactory/CSharp/Ast/Expressions/DefaultValueExpression.cs

@ -31,11 +31,23 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public class DefaultValueExpression : Expression public class DefaultValueExpression : Expression
{ {
public CSharpTokenNode DefaultToken {
get { return GetChildByRole (Roles.Keyword); }
}
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public AstType Type { public AstType Type {
get { return GetChildByRole (Roles.Type); } get { return GetChildByRole (Roles.Type); }
set { SetChildByRole(Roles.Type, value); } set { SetChildByRole(Roles.Type, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitDefaultValueExpression (this, data); return visitor.VisitDefaultValueExpression (this, data);

4
ICSharpCode.NRefactory/CSharp/Ast/Expressions/DirectionExpression.cs

@ -43,6 +43,10 @@ namespace ICSharpCode.NRefactory.CSharp
set; set;
} }
public CSharpTokenNode FieldDirectionToken {
get { return GetChildByRole (Roles.Keyword); }
}
public Expression Expression { public Expression Expression {
get { return GetChildByRole (Roles.Expression); } get { return GetChildByRole (Roles.Expression); }
set { SetChildByRole (Roles.Expression, value); } set { SetChildByRole (Roles.Expression, value); }

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

@ -38,11 +38,19 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole(Roles.TargetExpression, value); } set { SetChildByRole(Roles.TargetExpression, value); }
} }
public CSharpTokenNode LBracketToken {
get { return GetChildByRole (Roles.LBracket); }
}
public IEnumerable<Expression> Arguments { public IEnumerable<Expression> Arguments {
get { return GetChildrenByRole<Expression>(Roles.Argument); } get { return GetChildrenByRole<Expression>(Roles.Argument); }
set { SetChildrenByRole(Roles.Argument, value); } set { SetChildrenByRole(Roles.Argument, value); }
} }
public CSharpTokenNode RBracketToken {
get { return GetChildByRole (Roles.RBracket); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitIndexerExpression (this, data); return visitor.VisitIndexerExpression (this, data);

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

@ -38,11 +38,19 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole(Roles.TargetExpression, value); } set { SetChildByRole(Roles.TargetExpression, value); }
} }
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public IEnumerable<Expression> Arguments { public IEnumerable<Expression> Arguments {
get { return GetChildrenByRole<Expression>(Roles.Argument); } get { return GetChildrenByRole<Expression>(Roles.Argument); }
set { SetChildrenByRole(Roles.Argument, value); } set { SetChildrenByRole(Roles.Argument, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitInvocationExpression (this, data); return visitor.VisitInvocationExpression (this, data);

4
ICSharpCode.NRefactory/CSharp/Ast/Expressions/IsExpression.cs

@ -36,6 +36,10 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole(Roles.Expression, value); } set { SetChildByRole(Roles.Expression, value); }
} }
public CSharpTokenNode IsToken {
get { return GetChildByRole (Roles.Keyword); }
}
public AstType Type { public AstType Type {
get { return GetChildByRole(Roles.Type); } get { return GetChildByRole(Roles.Type); }
set { SetChildByRole(Roles.Type, value); } set { SetChildByRole(Roles.Type, value); }

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

@ -41,6 +41,10 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildrenByRole (Roles.Parameter, value); } set { SetChildrenByRole (Roles.Parameter, value); }
} }
public CSharpTokenNode ArrowToken {
get { return GetChildByRole (ArrowRole); }
}
public AstNode Body { public AstNode Body {
get { return GetChildByRole (BodyRole); } get { return GetChildByRole (BodyRole); }
set { SetChildByRole (BodyRole, value); } set { SetChildByRole (BodyRole, value); }

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

@ -47,11 +47,19 @@ namespace ICSharpCode.NRefactory.CSharp
} }
} }
public CSharpTokenNode LChevronToken {
get { return GetChildByRole (Roles.LChevron); }
}
public IEnumerable<AstType> TypeArguments { public IEnumerable<AstType> TypeArguments {
get { return GetChildrenByRole (Roles.TypeArgument); } get { return GetChildrenByRole (Roles.TypeArgument); }
set { SetChildrenByRole (Roles.TypeArgument, value); } set { SetChildrenByRole (Roles.TypeArgument, value); }
} }
public CSharpTokenNode RChevronToken {
get { return GetChildByRole (Roles.RChevron); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitMemberReferenceExpression (this, data); return visitor.VisitMemberReferenceExpression (this, data);

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

@ -35,16 +35,28 @@ namespace ICSharpCode.NRefactory.CSharp
{ {
public readonly static Role<ArrayInitializerExpression> InitializerRole = ArrayCreateExpression.InitializerRole; public readonly static Role<ArrayInitializerExpression> InitializerRole = ArrayCreateExpression.InitializerRole;
public CSharpTokenNode NewToken {
get { return GetChildByRole (Roles.Keyword); }
}
public AstType Type { public AstType Type {
get { return GetChildByRole (Roles.Type); } get { return GetChildByRole (Roles.Type); }
set { SetChildByRole (Roles.Type, value); } set { SetChildByRole (Roles.Type, value); }
} }
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public IEnumerable<Expression> Arguments { public IEnumerable<Expression> Arguments {
get { return GetChildrenByRole (Roles.Argument); } get { return GetChildrenByRole (Roles.Argument); }
set { SetChildrenByRole (Roles.Argument, value); } set { SetChildrenByRole (Roles.Argument, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public ArrayInitializerExpression Initializer { public ArrayInitializerExpression Initializer {
get { return GetChildByRole (InitializerRole); } get { return GetChildByRole (InitializerRole); }
set { SetChildByRole (InitializerRole, value); } set { SetChildByRole (InitializerRole, value); }

8
ICSharpCode.NRefactory/CSharp/Ast/Expressions/ParenthesizedExpression.cs

@ -28,11 +28,19 @@ namespace ICSharpCode.NRefactory.CSharp
{ {
public class ParenthesizedExpression : Expression public class ParenthesizedExpression : Expression
{ {
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public Expression Expression { public Expression Expression {
get { return GetChildByRole (Roles.Expression); } get { return GetChildByRole (Roles.Expression); }
set { SetChildByRole (Roles.Expression, value); } set { SetChildByRole (Roles.Expression, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitParenthesizedExpression (this, data); return visitor.VisitParenthesizedExpression (this, data);

12
ICSharpCode.NRefactory/CSharp/Ast/Expressions/SizeOfExpression.cs

@ -31,11 +31,23 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public class SizeOfExpression : Expression public class SizeOfExpression : Expression
{ {
public CSharpTokenNode SizeOfToken {
get { return GetChildByRole (Roles.Keyword); }
}
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public AstType Type { public AstType Type {
get { return GetChildByRole (Roles.Type); } get { return GetChildByRole (Roles.Type); }
set { SetChildByRole(Roles.Type, value); } set { SetChildByRole(Roles.Type, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitSizeOfExpression (this, data); return visitor.VisitSizeOfExpression (this, data);

12
ICSharpCode.NRefactory/CSharp/Ast/Expressions/StackAllocExpression.cs

@ -31,16 +31,28 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public class StackAllocExpression : Expression public class StackAllocExpression : Expression
{ {
public CSharpTokenNode StackAllocToken {
get { return GetChildByRole (Roles.Keyword); }
}
public AstType Type { public AstType Type {
get { return GetChildByRole (Roles.Type); } get { return GetChildByRole (Roles.Type); }
set { SetChildByRole(Roles.Type, value); } set { SetChildByRole(Roles.Type, value); }
} }
public CSharpTokenNode LBracketToken {
get { return GetChildByRole (Roles.LBracket); }
}
public Expression CountExpression { public Expression CountExpression {
get { return GetChildByRole (Roles.Expression); } get { return GetChildByRole (Roles.Expression); }
set { SetChildByRole (Roles.Expression, value); } set { SetChildByRole (Roles.Expression, value); }
} }
public CSharpTokenNode RBracketToken {
get { return GetChildByRole (Roles.RBracket); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitStackAllocExpression (this, data); return visitor.VisitStackAllocExpression (this, data);

12
ICSharpCode.NRefactory/CSharp/Ast/Expressions/TypeOfExpression.cs

@ -29,11 +29,23 @@ namespace ICSharpCode.NRefactory.CSharp
{ {
public class TypeOfExpression : Expression public class TypeOfExpression : Expression
{ {
public CSharpTokenNode TypeOfToken {
get { return GetChildByRole (Roles.Keyword); }
}
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public AstType Type { public AstType Type {
get { return GetChildByRole (Roles.Type); } get { return GetChildByRole (Roles.Type); }
set { SetChildByRole(Roles.Type, value); } set { SetChildByRole(Roles.Type, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitTypeOfExpression (this, data); return visitor.VisitTypeOfExpression (this, data);

4
ICSharpCode.NRefactory/CSharp/Ast/Expressions/UnaryOperatorExpression.cs

@ -38,6 +38,10 @@ namespace ICSharpCode.NRefactory.CSharp
set; set;
} }
public CSharpTokenNode OperatorToken {
get { return GetChildByRole (OperatorRole); }
}
public Expression Expression { public Expression Expression {
get { return GetChildByRole (Roles.Expression); } get { return GetChildByRole (Roles.Expression); }
set { SetChildByRole (Roles.Expression, value); } set { SetChildByRole (Roles.Expression, value); }

12
ICSharpCode.NRefactory/CSharp/Ast/Expressions/UncheckedExpression.cs

@ -31,11 +31,23 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public class UncheckedExpression : Expression public class UncheckedExpression : Expression
{ {
public CSharpTokenNode UncheckedToken {
get { return GetChildByRole (Roles.Keyword); }
}
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public Expression Expression { public Expression Expression {
get { return GetChildByRole (Roles.Expression); } get { return GetChildByRole (Roles.Expression); }
set { SetChildByRole(Roles.Expression, value); } set { SetChildByRole(Roles.Expression, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitUncheckedExpression (this, data); return visitor.VisitUncheckedExpression (this, data);

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

@ -59,11 +59,19 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildrenByRole (Roles.TypeParameter, value); } set { SetChildrenByRole (Roles.TypeParameter, value); }
} }
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public IEnumerable<ParameterDeclaration> Parameters { public IEnumerable<ParameterDeclaration> Parameters {
get { return GetChildrenByRole (Roles.Parameter); } get { return GetChildrenByRole (Roles.Parameter); }
set { SetChildrenByRole (Roles.Parameter, value); } set { SetChildrenByRole (Roles.Parameter, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public IEnumerable<Constraint> Constraints { public IEnumerable<Constraint> Constraints {
get { return GetChildrenByRole (Roles.Constraint); } get { return GetChildrenByRole (Roles.Constraint); }
set { SetChildrenByRole (Roles.Constraint, value); } set { SetChildrenByRole (Roles.Constraint, value); }

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

@ -75,11 +75,19 @@ namespace ICSharpCode.NRefactory.CSharp
} }
} }
public CSharpTokenNode LBraceToken {
get { return GetChildByRole (Roles.LBrace); }
}
public IEnumerable<AstNode> Members { public IEnumerable<AstNode> Members {
get { return GetChildrenByRole(MemberRole); } get { return GetChildrenByRole(MemberRole); }
set { SetChildrenByRole(MemberRole, value); } set { SetChildrenByRole(MemberRole, value); }
} }
public CSharpTokenNode RBraceToken {
get { return GetChildByRole (Roles.RBrace); }
}
public static string BuildQualifiedName (string name1, string name2) public static string BuildQualifiedName (string name1, string name2)
{ {
if (string.IsNullOrEmpty (name1)) if (string.IsNullOrEmpty (name1))

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

@ -74,11 +74,19 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildrenByRole (Roles.Constraint, value); } set { SetChildrenByRole (Roles.Constraint, value); }
} }
public CSharpTokenNode LBraceToken {
get { return GetChildByRole (Roles.LBrace); }
}
public IEnumerable<AttributedNode> Members { public IEnumerable<AttributedNode> Members {
get { return GetChildrenByRole (MemberRole); } get { return GetChildrenByRole (MemberRole); }
set { SetChildrenByRole (MemberRole, value); } set { SetChildrenByRole (MemberRole, value); }
} }
public CSharpTokenNode RBraceToken {
get { return GetChildByRole (Roles.RBrace); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitTypeDeclaration (this, data); return visitor.VisitTypeDeclaration (this, data);

8
ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/UsingAliasDeclaration.cs

@ -40,6 +40,10 @@ namespace ICSharpCode.NRefactory.CSharp
} }
} }
public CSharpTokenNode UsingToken {
get { return GetChildByRole (Roles.Keyword); }
}
public string Alias { public string Alias {
get { get {
return GetChildByRole (AliasRole).Name; return GetChildByRole (AliasRole).Name;
@ -54,6 +58,10 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole (ImportRole, value); } set { SetChildByRole (ImportRole, value); }
} }
public CSharpTokenNode SemicolonToken {
get { return GetChildByRole (Roles.Semicolon); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitUsingAliasDeclaration (this, data); return visitor.VisitUsingAliasDeclaration (this, data);

8
ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/UsingDeclaration.cs

@ -43,6 +43,10 @@ namespace ICSharpCode.NRefactory.CSharp
} }
} }
public CSharpTokenNode UsingToken {
get { return GetChildByRole (Roles.Keyword); }
}
public AstType Import { public AstType Import {
get { return GetChildByRole (ImportRole); } get { return GetChildByRole (ImportRole); }
set { SetChildByRole (ImportRole, value); } set { SetChildByRole (ImportRole, value); }
@ -52,6 +56,10 @@ namespace ICSharpCode.NRefactory.CSharp
get { return this.Import.ToString(); } get { return this.Import.ToString(); }
} }
public CSharpTokenNode SemicolonToken {
get { return GetChildByRole (Roles.Semicolon); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitUsingDeclaration (this, data); return visitor.VisitUsingDeclaration (this, data);

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

@ -52,11 +52,19 @@ namespace ICSharpCode.NRefactory.CSharp
} }
#endregion #endregion
public CSharpTokenNode LBraceToken {
get { return GetChildByRole (Roles.LBrace); }
}
public IEnumerable<Statement> Statements { public IEnumerable<Statement> Statements {
get { return GetChildrenByRole (StatementRole); } get { return GetChildrenByRole (StatementRole); }
set { SetChildrenByRole (StatementRole, value); } set { SetChildrenByRole (StatementRole, value); }
} }
public CSharpTokenNode RBraceToken {
get { return GetChildByRole (Roles.RBrace); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitBlockStatement (this, data); return visitor.VisitBlockStatement (this, data);

4
ICSharpCode.NRefactory/CSharp/Ast/Statements/BreakStatement.cs

@ -31,6 +31,10 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public class BreakStatement : Statement public class BreakStatement : Statement
{ {
public CSharpTokenNode SemicolonToken {
get { return GetChildByRole (Roles.Semicolon); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitBreakStatement (this, data); return visitor.VisitBreakStatement (this, data);

4
ICSharpCode.NRefactory/CSharp/Ast/Statements/CheckedStatement.cs

@ -31,6 +31,10 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public class CheckedStatement : Statement public class CheckedStatement : Statement
{ {
public CSharpTokenNode CheckedToken {
get { return GetChildByRole (Roles.Keyword); }
}
public BlockStatement Body { public BlockStatement Body {
get { return GetChildByRole (Roles.Body); } get { return GetChildByRole (Roles.Body); }
set { SetChildByRole (Roles.Body, value); } set { SetChildByRole (Roles.Body, value); }

4
ICSharpCode.NRefactory/CSharp/Ast/Statements/ContinueStatement.cs

@ -31,6 +31,10 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public class ContinueStatement : Statement public class ContinueStatement : Statement
{ {
public CSharpTokenNode SemicolonToken {
get { return GetChildByRole (Roles.Semicolon); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitContinueStatement (this, data); return visitor.VisitContinueStatement (this, data);

4
ICSharpCode.NRefactory/CSharp/Ast/Statements/ExpressionStatement.cs

@ -36,6 +36,10 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole (Roles.Expression, value); } set { SetChildByRole (Roles.Expression, value); }
} }
public CSharpTokenNode SemicolonToken {
get { return GetChildByRole (Roles.Semicolon); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitExpressionStatement (this, data); return visitor.VisitExpressionStatement (this, data);

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

@ -33,6 +33,14 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public class FixedStatement : Statement public class FixedStatement : Statement
{ {
public CSharpTokenNode FixedToken {
get { return GetChildByRole (Roles.Keyword); }
}
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public AstType Type { public AstType Type {
get { return GetChildByRole (Roles.Type); } get { return GetChildByRole (Roles.Type); }
set { SetChildByRole (Roles.Type, value); } set { SetChildByRole (Roles.Type, value); }
@ -43,6 +51,10 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildrenByRole (Roles.Variable, value); } set { SetChildrenByRole (Roles.Variable, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public Statement EmbeddedStatement { public Statement EmbeddedStatement {
get { return GetChildByRole (Roles.EmbeddedStatement); } get { return GetChildByRole (Roles.EmbeddedStatement); }
set { SetChildByRole (Roles.EmbeddedStatement, value); } set { SetChildByRole (Roles.EmbeddedStatement, value); }

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

@ -36,6 +36,14 @@ namespace ICSharpCode.NRefactory.CSharp
public readonly static Role<Statement> InitializerRole = new Role<Statement>("Initializer", Statement.Null); public readonly static Role<Statement> InitializerRole = new Role<Statement>("Initializer", Statement.Null);
public readonly static Role<Statement> IteratorRole = new Role<Statement>("Iterator", Statement.Null); public readonly static Role<Statement> IteratorRole = new Role<Statement>("Iterator", Statement.Null);
public CSharpTokenNode ForToken {
get { return GetChildByRole (Roles.Keyword); }
}
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
/// <summary> /// <summary>
/// Gets the list of initializer statements. /// Gets the list of initializer statements.
/// 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
@ -56,6 +64,10 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildrenByRole (IteratorRole, value); } set { SetChildrenByRole (IteratorRole, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public Statement EmbeddedStatement { public Statement EmbeddedStatement {
get { return GetChildByRole (Roles.EmbeddedStatement); } get { return GetChildByRole (Roles.EmbeddedStatement); }
set { SetChildByRole (Roles.EmbeddedStatement, value); } set { SetChildByRole (Roles.EmbeddedStatement, value); }

16
ICSharpCode.NRefactory/CSharp/Ast/Statements/ForeachStatement.cs

@ -31,6 +31,14 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public class ForeachStatement : Statement public class ForeachStatement : Statement
{ {
public CSharpTokenNode ForeachToken {
get { return GetChildByRole (Roles.Keyword); }
}
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public AstType VariableType { public AstType VariableType {
get { return GetChildByRole (Roles.Type); } get { return GetChildByRole (Roles.Type); }
set { SetChildByRole (Roles.Type, value); } set { SetChildByRole (Roles.Type, value); }
@ -45,11 +53,19 @@ namespace ICSharpCode.NRefactory.CSharp
} }
} }
public CSharpTokenNode InToken {
get { return GetChildByRole (Roles.InKeyword); }
}
public Expression InExpression { public Expression InExpression {
get { return GetChildByRole (Roles.Expression); } get { return GetChildByRole (Roles.Expression); }
set { SetChildByRole (Roles.Expression, value); } set { SetChildByRole (Roles.Expression, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public Statement EmbeddedStatement { public Statement EmbeddedStatement {
get { return GetChildByRole (Roles.EmbeddedStatement); } get { return GetChildByRole (Roles.EmbeddedStatement); }
set { SetChildByRole (Roles.EmbeddedStatement, value); } set { SetChildByRole (Roles.EmbeddedStatement, value); }

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

@ -41,6 +41,10 @@ namespace ICSharpCode.NRefactory.CSharp
set; set;
} }
public CSharpTokenNode GotoToken {
get { return GetChildByRole (Roles.Keyword); }
}
public string Label { public string Label {
get { get {
return GetChildByRole (Roles.Identifier).Name; return GetChildByRole (Roles.Identifier).Name;
@ -61,6 +65,10 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole (Roles.Expression, value); } set { SetChildByRole (Roles.Expression, value); }
} }
public CSharpTokenNode SemicolonToken {
get { return GetChildByRole (Roles.Semicolon); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitGotoStatement (this, data); return visitor.VisitGotoStatement (this, data);

16
ICSharpCode.NRefactory/CSharp/Ast/Statements/IfElseStatement.cs

@ -38,16 +38,32 @@ namespace ICSharpCode.NRefactory.CSharp
public readonly static Role<CSharpTokenNode> ElseKeywordRole = new Role<CSharpTokenNode>("ElseKeyword", CSharpTokenNode.Null); public readonly static Role<CSharpTokenNode> ElseKeywordRole = new Role<CSharpTokenNode>("ElseKeyword", CSharpTokenNode.Null);
public readonly static Role<Statement> FalseRole = new Role<Statement>("False", Statement.Null); public readonly static Role<Statement> FalseRole = new Role<Statement>("False", Statement.Null);
public CSharpTokenNode IfToken {
get { return GetChildByRole (IfKeywordRole); }
}
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public Expression Condition { public Expression Condition {
get { return GetChildByRole (ConditionRole); } get { return GetChildByRole (ConditionRole); }
set { SetChildByRole (ConditionRole, value); } set { SetChildByRole (ConditionRole, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public Statement TrueStatement { public Statement TrueStatement {
get { return GetChildByRole (TrueRole); } get { return GetChildByRole (TrueRole); }
set { SetChildByRole (TrueRole, value); } set { SetChildByRole (TrueRole, value); }
} }
public CSharpTokenNode ElseToken {
get { return GetChildByRole (ElseKeywordRole); }
}
public Statement FalseStatement { public Statement FalseStatement {
get { return GetChildByRole (FalseRole); } get { return GetChildByRole (FalseRole); }
set { SetChildByRole (FalseRole, value); } set { SetChildByRole (FalseRole, value); }

12
ICSharpCode.NRefactory/CSharp/Ast/Statements/LockStatement.cs

@ -31,11 +31,23 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public class LockStatement : Statement public class LockStatement : Statement
{ {
public CSharpTokenNode LockToken {
get { return GetChildByRole (Roles.Keyword); }
}
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public Expression Expression { public Expression Expression {
get { return GetChildByRole (Roles.Expression); } get { return GetChildByRole (Roles.Expression); }
set { SetChildByRole (Roles.Expression, value); } set { SetChildByRole (Roles.Expression, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public Statement EmbeddedStatement { public Statement EmbeddedStatement {
get { return GetChildByRole (Roles.EmbeddedStatement); } get { return GetChildByRole (Roles.EmbeddedStatement); }
set { SetChildByRole (Roles.EmbeddedStatement, value); } set { SetChildByRole (Roles.EmbeddedStatement, value); }

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

@ -31,11 +31,19 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public class ReturnStatement : Statement public class ReturnStatement : Statement
{ {
public CSharpTokenNode ReturnToken {
get { return GetChildByRole (Roles.Keyword); }
}
public Expression Expression { public Expression Expression {
get { return GetChildByRole (Roles.Expression); } get { return GetChildByRole (Roles.Expression); }
set { SetChildByRole (Roles.Expression, value); } set { SetChildByRole (Roles.Expression, value); }
} }
public CSharpTokenNode SemicolonToken {
get { return GetChildByRole (Roles.Semicolon); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitReturnStatement (this, data); return visitor.VisitReturnStatement (this, data);

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

@ -36,16 +36,36 @@ namespace ICSharpCode.NRefactory.CSharp
{ {
public static readonly Role<SwitchSection> SwitchSectionRole = new Role<SwitchSection>("SwitchSection"); public static readonly Role<SwitchSection> SwitchSectionRole = new Role<SwitchSection>("SwitchSection");
public CSharpTokenNode SwitchToken {
get { return GetChildByRole (Roles.Keyword); }
}
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public Expression Expression { public Expression Expression {
get { return GetChildByRole (Roles.Expression); } get { return GetChildByRole (Roles.Expression); }
set { SetChildByRole (Roles.Expression, value); } set { SetChildByRole (Roles.Expression, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public CSharpTokenNode LBraceToken {
get { return GetChildByRole (Roles.LBrace); }
}
public IEnumerable<SwitchSection> SwitchSections { public IEnumerable<SwitchSection> SwitchSections {
get { return GetChildrenByRole (SwitchSectionRole); } get { return GetChildrenByRole (SwitchSectionRole); }
set { SetChildrenByRole (SwitchSectionRole, value); } set { SetChildrenByRole (SwitchSectionRole, value); }
} }
public CSharpTokenNode RBraceToken {
get { return GetChildByRole (Roles.RBrace); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitSwitchStatement (this, data); return visitor.VisitSwitchStatement (this, data);

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

@ -31,11 +31,19 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public class ThrowStatement : Statement public class ThrowStatement : Statement
{ {
public CSharpTokenNode ThrowToken {
get { return GetChildByRole (Roles.Keyword); }
}
public Expression Expression { public Expression Expression {
get { return GetChildByRole (Roles.Expression); } get { return GetChildByRole (Roles.Expression); }
set { SetChildByRole (Roles.Expression, value); } set { SetChildByRole (Roles.Expression, value); }
} }
public CSharpTokenNode SemicolonToken {
get { return GetChildByRole (Roles.Semicolon); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitThrowStatement (this, data); return visitor.VisitThrowStatement (this, data);

4
ICSharpCode.NRefactory/CSharp/Ast/Statements/UncheckedStatement.cs

@ -31,6 +31,10 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public class UncheckedStatement : Statement public class UncheckedStatement : Statement
{ {
public CSharpTokenNode UncheckedToken {
get { return GetChildByRole (Roles.Keyword); }
}
public BlockStatement Body { public BlockStatement Body {
get { return GetChildByRole (Roles.Body); } get { return GetChildByRole (Roles.Body); }
set { SetChildByRole (Roles.Body, value); } set { SetChildByRole (Roles.Body, value); }

4
ICSharpCode.NRefactory/CSharp/Ast/Statements/UnsafeStatement.cs

@ -31,6 +31,10 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public class UnsafeStatement : Statement public class UnsafeStatement : Statement
{ {
public CSharpTokenNode UnsafeToken {
get { return GetChildByRole (Roles.Keyword); }
}
public BlockStatement Body { public BlockStatement Body {
get { return GetChildByRole (Roles.Body); } get { return GetChildByRole (Roles.Body); }
set { SetChildByRole (Roles.Body, value); } set { SetChildByRole (Roles.Body, value); }

12
ICSharpCode.NRefactory/CSharp/Ast/Statements/UsingStatement.cs

@ -33,6 +33,14 @@ namespace ICSharpCode.NRefactory.CSharp
{ {
public static readonly Role<AstNode> ResourceAcquisitionRole = new Role<AstNode>("ResourceAcquisition", AstNode.Null); public static readonly Role<AstNode> ResourceAcquisitionRole = new Role<AstNode>("ResourceAcquisition", AstNode.Null);
public CSharpTokenNode UsingToken {
get { return GetChildByRole (Roles.Keyword); }
}
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
/// <summary> /// <summary>
/// Either a VariableDeclarationStatement, or an Expression. /// Either a VariableDeclarationStatement, or an Expression.
/// </summary> /// </summary>
@ -41,6 +49,10 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole (ResourceAcquisitionRole, value); } set { SetChildByRole (ResourceAcquisitionRole, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public Statement EmbeddedStatement { public Statement EmbeddedStatement {
get { return GetChildByRole (Roles.EmbeddedStatement); } get { return GetChildByRole (Roles.EmbeddedStatement); }
set { SetChildByRole (Roles.EmbeddedStatement, value); } set { SetChildByRole (Roles.EmbeddedStatement, value); }

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

@ -48,6 +48,10 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildrenByRole (Roles.Variable, value); } set { SetChildrenByRole (Roles.Variable, value); }
} }
public CSharpTokenNode SemicolonToken {
get { return GetChildByRole (Roles.Semicolon); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitVariableDeclarationStatement (this, data); return visitor.VisitVariableDeclarationStatement (this, data);

16
ICSharpCode.NRefactory/CSharp/Ast/Statements/WhileStatement.cs

@ -40,11 +40,27 @@ namespace ICSharpCode.NRefactory.CSharp
set; set;
} }
public CSharpTokenNode DoToken {
get { return GetChildByRole (DoKeywordRole); }
}
public CSharpTokenNode WhileToken {
get { return GetChildByRole (WhileKeywordRole); }
}
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public Expression Condition { public Expression Condition {
get { return GetChildByRole (Roles.Condition); } get { return GetChildByRole (Roles.Condition); }
set { SetChildByRole (Roles.Condition, value); } set { SetChildByRole (Roles.Condition, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public Statement EmbeddedStatement { public Statement EmbeddedStatement {
get { return GetChildByRole (Roles.EmbeddedStatement); } get { return GetChildByRole (Roles.EmbeddedStatement); }
set { SetChildByRole (Roles.EmbeddedStatement, value); } set { SetChildByRole (Roles.EmbeddedStatement, value); }

16
ICSharpCode.NRefactory/CSharp/Ast/Statements/YieldStatement.cs

@ -32,11 +32,27 @@ namespace ICSharpCode.NRefactory.CSharp
public static readonly Role<CSharpTokenNode> ReturnKeywordRole = new Role<CSharpTokenNode>("ReturnKeyword", CSharpTokenNode.Null); public static readonly Role<CSharpTokenNode> ReturnKeywordRole = new Role<CSharpTokenNode>("ReturnKeyword", CSharpTokenNode.Null);
public static readonly Role<CSharpTokenNode> BreakKeywordRole = new Role<CSharpTokenNode>("BreakKeyword", CSharpTokenNode.Null); public static readonly Role<CSharpTokenNode> BreakKeywordRole = new Role<CSharpTokenNode>("BreakKeyword", CSharpTokenNode.Null);
public CSharpTokenNode YieldToken {
get { return GetChildByRole (YieldKeywordRole); }
}
public CSharpTokenNode ReturnToken {
get { return GetChildByRole (ReturnKeywordRole); }
}
public CSharpTokenNode BreakToken {
get { return GetChildByRole (BreakKeywordRole); }
}
public Expression Expression { public Expression Expression {
get { return GetChildByRole (Roles.Expression); } get { return GetChildByRole (Roles.Expression); }
set { SetChildByRole (Roles.Expression, value); } set { SetChildByRole (Roles.Expression, value); }
} }
public CSharpTokenNode SemicolonToken {
get { return GetChildByRole (Roles.Semicolon); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitYieldStatement (this, data); return visitor.VisitYieldStatement (this, data);

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

@ -33,11 +33,19 @@ namespace ICSharpCode.NRefactory.CSharp
{ {
public static readonly Role<ConstructorInitializer> InitializerRole = new Role<ConstructorInitializer>("Initializer", ConstructorInitializer.Null); public static readonly Role<ConstructorInitializer> InitializerRole = new Role<ConstructorInitializer>("Initializer", ConstructorInitializer.Null);
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public IEnumerable<ParameterDeclaration> Parameters { public IEnumerable<ParameterDeclaration> Parameters {
get { return GetChildrenByRole (Roles.Parameter); } get { return GetChildrenByRole (Roles.Parameter); }
set { SetChildrenByRole (Roles.Parameter, value); } set { SetChildrenByRole (Roles.Parameter, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public ConstructorInitializer Initializer { public ConstructorInitializer Initializer {
get { return GetChildByRole (InitializerRole); } get { return GetChildByRole (InitializerRole); }
set { SetChildByRole( InitializerRole, value); } set { SetChildByRole( InitializerRole, value); }

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

@ -30,6 +30,17 @@ namespace ICSharpCode.NRefactory.CSharp
{ {
public static readonly Role<CSharpTokenNode> TildeRole = new Role<CSharpTokenNode>("Tilde", CSharpTokenNode.Null); public static readonly Role<CSharpTokenNode> TildeRole = new Role<CSharpTokenNode>("Tilde", CSharpTokenNode.Null);
public CSharpTokenNode TildeToken {
get { return GetChildByRole (TildeRole); }
}
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public BlockStatement Body { public BlockStatement Body {
get { return GetChildByRole (Roles.Body); } get { return GetChildByRole (Roles.Body); }
set { SetChildByRole (Roles.Body, value); } set { SetChildByRole (Roles.Body, value); }

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

@ -36,11 +36,19 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildrenByRole (Roles.TypeParameter, value); } set { SetChildrenByRole (Roles.TypeParameter, value); }
} }
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public IEnumerable<ParameterDeclaration> Parameters { public IEnumerable<ParameterDeclaration> Parameters {
get { return GetChildrenByRole (Roles.Parameter); } get { return GetChildrenByRole (Roles.Parameter); }
set { SetChildrenByRole (Roles.Parameter, value); } set { SetChildrenByRole (Roles.Parameter, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public IEnumerable<Constraint> Constraints { public IEnumerable<Constraint> Constraints {
get { return GetChildrenByRole (Roles.Constraint); } get { return GetChildrenByRole (Roles.Constraint); }
set { SetChildrenByRole (Roles.Constraint, value); } set { SetChildrenByRole (Roles.Constraint, value); }

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

@ -76,11 +76,19 @@ namespace ICSharpCode.NRefactory.CSharp
set; set;
} }
public CSharpTokenNode LParToken {
get { return GetChildByRole (Roles.LPar); }
}
public IEnumerable<ParameterDeclaration> Parameters { public IEnumerable<ParameterDeclaration> Parameters {
get { return GetChildrenByRole (Roles.Parameter); } get { return GetChildrenByRole (Roles.Parameter); }
set { SetChildrenByRole (Roles.Parameter, value); } set { SetChildrenByRole (Roles.Parameter, value); }
} }
public CSharpTokenNode RParToken {
get { return GetChildByRole (Roles.RPar); }
}
public BlockStatement Body { public BlockStatement Body {
get { return GetChildByRole (Roles.Body); } get { return GetChildByRole (Roles.Body); }
set { SetChildByRole (Roles.Body, value); } set { SetChildByRole (Roles.Body, value); }

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

@ -31,6 +31,10 @@ namespace ICSharpCode.NRefactory.CSharp
public static readonly Role<Accessor> GetterRole = new Role<Accessor>("Getter", Accessor.Null); 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 static readonly Role<Accessor> SetterRole = new Role<Accessor>("Setter", Accessor.Null);
public CSharpTokenNode LBraceToken {
get { return GetChildByRole (Roles.LBrace); }
}
public Accessor Getter { public Accessor Getter {
get { return GetChildByRole(GetterRole); } get { return GetChildByRole(GetterRole); }
set { SetChildByRole(GetterRole, value); } set { SetChildByRole(GetterRole, value); }
@ -41,6 +45,10 @@ namespace ICSharpCode.NRefactory.CSharp
set { SetChildByRole(SetterRole, value); } set { SetChildByRole(SetterRole, value); }
} }
public CSharpTokenNode RBraceToken {
get { return GetChildByRole (Roles.RBrace); }
}
public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data) public override S AcceptVisitor<T, S> (AstVisitor<T, S> visitor, T data)
{ {
return visitor.VisitPropertyDeclaration (this, data); return visitor.VisitPropertyDeclaration (this, data);

4
ICSharpCode.NRefactory/CSharp/Ast/TypeMembers/VariableInitializer.cs

@ -43,6 +43,10 @@ namespace ICSharpCode.NRefactory.CSharp
} }
} }
public CSharpTokenNode AssignToken {
get { return GetChildByRole (Roles.Assign); }
}
public Expression Initializer { public Expression Initializer {
get { return GetChildByRole (Roles.Expression); } get { return GetChildByRole (Roles.Expression); }
set { SetChildByRole (Roles.Expression, value); } set { SetChildByRole (Roles.Expression, value); }

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

@ -2184,7 +2184,7 @@ namespace ICSharpCode.NRefactory.CSharp
{ {
var result = new ArrayInitializerExpression (); var result = new ArrayInitializerExpression ();
var location = LocationsBag.GetLocations (arrayInitializer); var location = LocationsBag.GetLocations (arrayInitializer);
result.AddChild (new CSharpTokenNode (Convert (arrayInitializer.Location), "{".Length), ArrayInitializerExpression.Roles.LBracket); result.AddChild (new CSharpTokenNode (Convert (arrayInitializer.Location), "{".Length), ArrayInitializerExpression.Roles.LBrace);
var commaLocations = LocationsBag.GetLocations (arrayInitializer.Elements); var commaLocations = LocationsBag.GetLocations (arrayInitializer.Elements);
for (int i = 0; i < arrayInitializer.Count; i++) { for (int i = 0; i < arrayInitializer.Count; i++) {
result.AddChild ((Expression)arrayInitializer[i].Accept (this), ArrayInitializerExpression.Roles.Expression); result.AddChild ((Expression)arrayInitializer[i].Accept (this), ArrayInitializerExpression.Roles.Expression);
@ -2195,7 +2195,7 @@ namespace ICSharpCode.NRefactory.CSharp
if (location != null) { if (location != null) {
if (location.Count == 2) // optional comma if (location.Count == 2) // optional comma
result.AddChild (new CSharpTokenNode (Convert (location[1]), ",".Length), ArrayInitializerExpression.Roles.Comma); result.AddChild (new CSharpTokenNode (Convert (location[1]), ",".Length), ArrayInitializerExpression.Roles.Comma);
result.AddChild (new CSharpTokenNode (Convert (location[location.Count - 1]), "}".Length), ArrayInitializerExpression.Roles.RBracket); result.AddChild (new CSharpTokenNode (Convert (location[location.Count - 1]), "}".Length), ArrayInitializerExpression.Roles.RBrace);
} }
return result; return result;
} }

Loading…
Cancel
Save