Ejemplo n.º 1
0
        private BoundExpression BindUnaryExpression(UnaryExpressionSyntax _syntax)
        {
            var _boundOperand  = BindExpression(_syntax.Operand);
            var _boundOperator = BoundUnaryOperator.Bind(_syntax.OperatorToken.Kind, _boundOperand.Type);

            if (_boundOperator == null)
            {
                Diagnostics.ReportUndefinedUnaryOperator(_syntax.OperatorToken.Span, _syntax.OperatorToken.Text, _boundOperand.Type);
                return(_boundOperand);
            }
            return(new BoundUnaryExpression(_boundOperator, _boundOperand));
        }
Ejemplo n.º 2
0
 public BoundUnaryExpression(BoundUnaryOperator _op, BoundExpression _operand)
 {
     Op      = _op;
     Operand = _operand;
 }