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

http://github.com/icsharpcode/ILSpy · C# · 39 lines · 28 code · 6 blank · 5 comment · 3 complexity · 4173ea2fa0c548cc3fd61488cd5b5748 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. /// Represents a named argument passed to a method or attribute.
  9. /// </summary>
  10. public class NamedArgumentExpression : Expression
  11. {
  12. public Identifier Identifier {
  13. get { return GetChildByRole(Roles.Identifier); }
  14. set { SetChildByRole(Roles.Identifier, value); }
  15. }
  16. public VBTokenNode AssignToken {
  17. get { return GetChildByRole (Roles.Assign); }
  18. }
  19. public Expression Expression {
  20. get { return GetChildByRole (Roles.Expression); }
  21. set { SetChildByRole (Roles.Expression, value); }
  22. }
  23. public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
  24. {
  25. return visitor.VisitNamedArgumentExpression(this, data);
  26. }
  27. protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
  28. {
  29. NamedArgumentExpression o = other as NamedArgumentExpression;
  30. return o != null && this.Identifier.DoMatch(o.Identifier, match) && this.Expression.DoMatch(o.Expression, match);
  31. }
  32. }
  33. }