Пример #1
0
        public TreeNode Evaluate()
        {
            exceptions.Clear();

            try {
                if (ExpressionTree == null)
                {
                    var parser = new Parser();
                    ExpressionTree = parser.Parse(input);
                    ExpressionTree.CopyFunctionsFrom(function_table_expression);
                }

                return(Evaluate(ExpressionTree));
            } catch (Exception e) {
                var next = e;

                do
                {
                    if (next != null)
                    {
                        exceptions.Add(next);
                        next = next.InnerException;
                    }
                } while(next != null && next.InnerException != null);

                if (next != null)
                {
                    exceptions.Add(next);
                }
            }

            return(null);
        }