Exemple #1
0
        /// <summary>
        /// Returns <c>true</c> if the literal depicts a constant.
        /// </summary>
        /// <param name="lit">literal</param>
        /// <param name="constValue">out parameter to receive the constant value, if the literal
        /// depicts a constant, otherwise <c>null</c></param>
        public static bool IsConst(this ILiteral lit, out object constValue)
        {
            IsConstLiteralVisitor vtor = new IsConstLiteralVisitor();

            lit.Accept(vtor);
            constValue = vtor.ConstValue;
            return(vtor.Result);
        }
Exemple #2
0
 /// <summary>
 /// Returns <c>true</c> if the literal depicts a constant.
 /// </summary>
 /// <param name="lit">literal</param>
 /// <param name="constValue">out parameter to receive the constant value, if the literal 
 /// depicts a constant, otherwise <c>null</c></param>
 public static bool IsConst(this ILiteral lit, out object constValue)
 {
     IsConstLiteralVisitor vtor = new IsConstLiteralVisitor();
     lit.Accept(vtor);
     constValue = vtor.ConstValue;
     return vtor.Result;
 }