private void GetAllLiterals(IList <SingleValue> allLiterals)
 {
     if (this is Literal)
     {
         SingleValue sv = (SingleValue)this;
         if (allLiterals.IndexOf(sv) == -1)
         {
             allLiterals.Add((Literal)this);
         }
     }
     else if (this is FunctionCalc)
     {
         foreach (var item in ((FunctionCalc)this).Inputs)
         {
             item.GetAllLiterals(allLiterals);
         }
     }
 }
        // ------------------------

        private static string SingleValueAsText(SingleValue expr)
        {
            string sText = expr.Text;

            return(sText);
        }