示例#1
0
        private void AppendEquation(string key, string arg)
        {
            var eq = new Equation(arg, this);
            var reversePolishNotation = new ReversePolishNotation(this);
            var result = reversePolishNotation.CalculateEquation(eq);

            this.Cells.Add(key, result);
        }
示例#2
0
 private void ExpressionCalculation(string line)
 {
     try
     {
         var eq = new Equation(line, _spreadSheet);
         var reversePolishNotation = new ReversePolishNotation(_spreadSheet);
         var result = reversePolishNotation.CalculateEquation(eq);
         Console.WriteLine($"\tResult of {line}={result}");
     }
     catch (ValidationException ex)
     {
         Console.WriteLine(ex.Message);
     }
 }