Esempio n. 1
0
        /***************************************************************************************************
        *  Determine whether this expr has a constant value (EK_CONSTANT or EK_ZEROINIT), possibly with
        *  side effects (via EK_SEQUENCE or EK_SEQREV). Returns NULL if not, or the constant expr if so.
        *  The returned Expr will always be an EK_CONSTANT or EK_ZEROINIT.
        ***************************************************************************************************/
        public static Expr GetConst(this Expr expr)
        {
            Expr exprVal = expr.GetSeqVal();

            if (null == exprVal || !exprVal.isCONSTANT_OK() && exprVal.Kind != ExpressionKind.EK_ZEROINIT)
            {
                return(null);
            }
            return(exprVal);
        }