/NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/ExpressionStatement.cs

http://github.com/icsharpcode/ILSpy · C# · 40 lines · 28 code · 6 blank · 6 comment · 2 complexity · bd36ce8223f9c008ebb6bcf3b7c79086 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.IO;
  5. namespace ICSharpCode.NRefactory.VB.Ast
  6. {
  7. /// <summary>
  8. /// Expression
  9. /// </summary>
  10. // TODO this does not directly reflect the VB grammar!
  11. public class ExpressionStatement : Statement
  12. {
  13. public Expression Expression {
  14. get { return GetChildByRole (Roles.Expression); }
  15. set { SetChildByRole (Roles.Expression, value); }
  16. }
  17. public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
  18. {
  19. return visitor.VisitExpressionStatement(this, data);
  20. }
  21. public ExpressionStatement()
  22. {
  23. }
  24. public ExpressionStatement(Expression expression)
  25. {
  26. this.Expression = expression;
  27. }
  28. protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
  29. {
  30. ExpressionStatement o = other as ExpressionStatement;
  31. return o != null && this.Expression.DoMatch(o.Expression, match);
  32. }
  33. }
  34. }