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)
5
using System.Collections.Generic;
7
namespace ICSharpCode.NRefactory.VB.Ast
10
/// Operator Expression
12
public class UnaryOperatorExpression : Expression
14
public readonly static Role<VBTokenNode> OperatorRole = BinaryOperatorExpression.OperatorRole;
16
public UnaryOperatorExpression()
20
public UnaryOperatorExpression(UnaryOperatorType op, Expression expression)
23
this.Expression = expression;
26
public UnaryOperatorType Operator {
31
public VBTokenNode OperatorToken {
32
get { return GetChildByRole (OperatorRole); }
35
public Expression Expression {
36
get { return GetChildByRole (Roles.Expression); }
37
set { SetChildByRole (Roles.Expression, value); }
40
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
42
return visitor.VisitUnaryOperatorExpression(this, data);
45
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
47
UnaryOperatorExpression o = other as UnaryOperatorExpression;
48
return o != null && this.Operator == o.Operator && this.Expression.DoMatch(o.Expression, match);
51
public static string GetOperatorSymbol(UnaryOperatorType op)
54
case UnaryOperatorType.Not:
56
case UnaryOperatorType.Minus:
58
case UnaryOperatorType.Plus:
61
throw new NotSupportedException("Invalid value for UnaryOperatorType");
66
public enum UnaryOperatorType
68
/// <summary>Logical/Bitwise not (Not a)</summary>
70
/// <summary>Unary minus (-a)</summary>
72
/// <summary>Unary plus (+a)</summary>
74
/// <summary>AddressOf</summary>
76
/// <summary>Await</summary>