/NRefactory/ICSharpCode.NRefactory.VB/Ast/Expressions/CollectionRangeVariableDeclaration.cs

http://github.com/icsharpcode/ILSpy · C# · 42 lines · 30 code · 7 blank · 5 comment · 4 complexity · d432a002666a46e3ec71bdc3ce81f1e6 MD5 · raw file

  1. // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
  2. // This code is distributed under MIT X11 license (for details please see \doc\license.txt)
  3. using System;
  4. using System.Collections.Generic;
  5. namespace ICSharpCode.NRefactory.VB.Ast
  6. {
  7. /// <summary>
  8. /// Identifier As Type In Expression
  9. /// </summary>
  10. public class CollectionRangeVariableDeclaration : AstNode
  11. {
  12. public static readonly Role<CollectionRangeVariableDeclaration> CollectionRangeVariableDeclarationRole = new Role<CollectionRangeVariableDeclaration>("CollectionRangeVariableDeclaration");
  13. public VariableIdentifier Identifier {
  14. get { return GetChildByRole(VariableIdentifier.VariableIdentifierRole); }
  15. set { SetChildByRole(VariableIdentifier.VariableIdentifierRole, value); }
  16. }
  17. public AstType Type {
  18. get { return GetChildByRole(Roles.Type); }
  19. set { SetChildByRole(Roles.Type, value); }
  20. }
  21. public Expression Expression {
  22. get { return GetChildByRole (Roles.Expression); }
  23. set { SetChildByRole (Roles.Expression, value); }
  24. }
  25. public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
  26. {
  27. return visitor.VisitCollectionRangeVariableDeclaration(this, data);
  28. }
  29. protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
  30. {
  31. CollectionRangeVariableDeclaration o = other as CollectionRangeVariableDeclaration;
  32. return o != null && this.Identifier.DoMatch(o.Identifier, match) && this.Type.DoMatch(o.Type, match) && this.Expression.DoMatch(o.Expression, match);
  33. }
  34. }
  35. }