Пример #1
0
        private static void ProcessFunction(FormulaToken token, Stack operandsStack)
        {
            byte num1 = (token is FunctionFormulaToken) ? (token as FunctionFormulaToken).ArgumentsCount : (token as FunctionVarFormulaToken).ArgumentsCount;

            if (!(token is FunctionFormulaToken))
            {
                ushort num4 = (token as FunctionVarFormulaToken).Function.Code;
            }
            else
            {
                ushort num5 = (token as FunctionFormulaToken).Function.Code;
            }
            StringBuilder builder1 = new StringBuilder();

            builder1.Append(token.ToString());
            builder1.Append("(");
            string[] textArray1 = new string[num1];
            for (byte num2 = 0; num2 < num1; num2 = (byte)(num2 + 1))
            {
                textArray1[num2] = operandsStack.Pop() as string;
            }
            for (byte num3 = num1; num3 > 0; num3 = (byte)(num3 - 1))
            {
                string text1 = textArray1[num3 - 1];
                builder1.Append(text1);
                if (num3 != 1)
                {
                    builder1.Append(";");
                }
            }
            builder1.Append(")");
            operandsStack.Push(builder1.ToString());
        }
Пример #2
0
        private static void ProcessBinaryOperator(FormulaToken token, Stack operandsStack)
        {
            string text1 = operandsStack.Pop() as string;
            string text2 = operandsStack.Pop() as string;

            operandsStack.Push(text2 + token.ToString() + text1);
        }
Пример #3
0
        private static void ProcessUnaryOperator(FormulaToken token, Stack operandsStack)
        {
            string text1 = operandsStack.Pop() as string;

            if (token.Code == 20)
            {
                operandsStack.Push(text1 + token.ToString());
            }
            else if (token.Code == 0x15)
            {
                operandsStack.Push("(" + text1 + ")");
            }
            else
            {
                operandsStack.Push(token.ToString() + text1);
            }
        }
Пример #4
0
 private static void ProcessOperand(FormulaToken token, Stack operandsStack)
 {
     operandsStack.Push(token.ToString());
 }