Example #1
0
        public static void ConstsParser(string wholeFormula, ref int begin, ref int end, ref int pos, ParserObject p, List <object> charInput)
        {
            string constExpression = wholeFormula.Substring(begin, end - begin).ToLower();

            if (ConstNumbers.Consts.ContainsKey(constExpression))
            {
                charInput.Add(ConstNumbers.Consts[constExpression]);
                charInput.Add(CommonTool.GetSymbol(wholeFormula[pos]));
            }
            else
            {
                throw new Exception("UNKNOW CONST! " + constExpression + " .");
            }

            //归零
            begin = end = pos + 1;
            p.SetClear();
        }