예제 #1
0
    public static bool IsFixExpression(
        this NeuUnaryExpression unaryExpression)
    {
        switch (unaryExpression)
        {
        case NeuPrefixExpression _:

            return(true);

        ///

        case NeuPostfixExpression _:

            return(true);

        ///

        default:

            return(false);
        }
    }
예제 #2
0
    public static NeuOperation Execute(
        this NeuInterpreter interpreter,
        NeuUnaryExpression unaryExpr)
    {
        if (unaryExpr.IsFixExpression())
        {
            throw new Exception();
        }

        ///

        switch (unaryExpr)
        {
        case NeuSizeOfExpression sizeOfExpr:

            return(interpreter.Execute(sizeOfExpr));

        ///

        default:

            throw new Exception();
        }
    }