AST.BitwiseNot.GetExpr C# (CSharp) Метод

GetExpr() публичный Метод

public GetExpr ( ABT env ) : ABT.Expr
env ABT
Результат ABT.Expr
        public override ABT.Expr GetExpr(ABT.Env env) {
            ABT.Expr expr = this.Expr.GetExpr(env);

            if (!expr.Type.IsIntegral) {
                throw new InvalidOperationException("Expected integral Type.");
            }

            expr = ABT.TypeCast.IntegralPromotion(expr).Item1;

            if (expr.IsConstExpr) {
                switch (expr.Type.Kind) {
                    case ABT.ExprTypeKind.LONG:
                        return new ABT.ConstLong(~((ABT.ConstLong)expr).Value, env);
                    case ABT.ExprTypeKind.ULONG:
                        return new ABT.ConstULong(~((ABT.ConstULong)expr).Value, env);
                    default:
                        throw new InvalidOperationException();
                }
            }

            return new ABT.BitwiseNot(expr);
        }
    }