Example #1
0
 /// <summary>
 /// Tries to evaluate the input expression contained in the given evaluator.
 /// </summary>
 /// <param name="evaluator">The row evaluator with the given expression.</param>
 /// <returns>True if the evaluation was successfull.</returns>
 private bool EvaluateExpression(RowEvaluator evaluator)
 {
     try
     {
         evaluator.InterpretExpression();
         return(true);
     }
     catch (Exception ex)
     {
         lstResultList.Items.Add(String.Format("  error: {0}", ex.Message));
         return(false);
     }
 }
Example #2
0
        internal void Evaluate(out List <ExpressionItem> list)
        {
            Scanner      scanner = new Scanner(scriptFileContents, Environment.NewLine);
            RowEvaluator rowEvaluator;

            list = new List <ExpressionItem>();

            while (scanner.HasNext())
            {
                rowEvaluator = new RowEvaluator(scanner.Next());
                rowEvaluator.ParseExpression();
                rowEvaluator.InterpretExpression();
                list.Add(rowEvaluator.InterpretedExpression);
            }
        }