public override ASTN VisitNot([NotNull] NotContext context)
        {
            NotNode node = new NotNode(context)
            {
                expr = VisitExpr(context.expr()) as ExprNode
            };

            return(node);
        }
Exemplo n.º 2
0
    bool Visit(NotContext notcontext)
    {
        var result = Visit(notcontext.cond);

        if (result is bool)
        {
            return(!(bool)result);
        }

        throw new InvalidOperationException($"Operator 'not' cannot be applied to operands of type {result.GetType()}");
    }