예제 #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);
        }
예제 #2
0
 private string NotateLiteral(ILiteral literal, LiteralReference.EMode mode)
 {
     LiteralStringifier ls = new LiteralStringifier(this, mode);
     literal.Accept(ls);
     return ls.Result;
 }