Exemple #1
0
 public Datum Evaluate(Continuation c)
 {
     try
     {
         while (c.Task != null)
         {
             if (debug)
             {
                 Console.WriteLine("{0}", c.GetStackTrace());
                 Console.Write("Press enter for next step.");
                 Console.ReadLine();
             }
             c = c.Task.Perform(c.PopTask());
         }
         c = c.PopTask();
         var result = c.Result;
         c = c.PopResult();
         if (c.Result != null)
         {
             throw new Exception(string.Format("Additional '{0}' on result stack", c.Result));
         }
         return(result);
     }
     catch (EvaluationException)
     {
         throw;
     }
     catch (Exception ex)
     {
         throw c.error(ex, "EvaluationError", ex.Message);
     }
 }
Exemple #2
0
 public Datum Evaluate(Continuation c)
 {
     try
     {
         while (c.Task != null)
         {
             if (debug)
             {
                 Console.WriteLine("{0}", c.GetStackTrace());
                 Console.Write("Press enter for next step.");
                 Console.ReadLine();
             }
             c = c.Task.Perform(c.PopTask());
         }
         c = c.PopTask();
         var result = c.Result;
         c = c.PopResult();
         if (c.Result != null)
             throw new Exception(string.Format("Additional '{0}' on result stack", c.Result));
         return result;
     }
     catch (EvaluationException)
     {
         throw;
     }
     catch (Exception ex)
     {
         throw c.error(ex, "EvaluationError", ex.Message);
     }
 }