Beispiel #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);
        }