PopTask() public method

public PopTask ( ) : Continuation
return Continuation
示例#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);
     }
 }
示例#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);
     }
 }
示例#3
0
 private static void dumpTasks(Continuation c, TextWriter sw)
 {
     sw.WriteLine("Tasks:");
     while (c.Task != null)
     {
         sw.WriteLine("{0}", c.Task);
         c = c.PopTask();
     }
 }
示例#4
0
        // The following are useful for debugging.
        public static IEnvironment GetEnvironment(this Continuation c)
        {
            EvaluateTask t = null;

            while (c.Task != null && (t = c.Task as EvaluateTask) == null)
            {
                c = c.PopTask();
            }
            return(t == null ? null : t.Env);
        }
示例#5
0
 private static Datum Evaluate(Continuation c)
 {
     while (c.Task != null)
     {
         try
         {
             c = c.Task.Perform(c.PopTask());
             c.Statistics.Steps++;
         }
         catch (Exception ex)
         {
             c = c.ErrorHandler(c, ex);
         }
     }
     return(c.Result);
 }
示例#6
0
 private static Datum Evaluate(Continuation c)
 {
     while (c.Task != null)
     {
         try
         {
             c = c.Task.Perform(c.PopTask());
             c.Statistics.Steps++;
         }
         catch (Exception ex)
         {
             c = c.ErrorHandler(c, ex);
         }
     }
     return c.Result;
 }
示例#7
0
 private static void dumpTasks(Continuation c, TextWriter sw)
 {
     sw.WriteLine("Tasks:");
     while (c.Task != null)
     {
         sw.WriteLine("{0}", c.Task);
         c = c.PopTask();
     }
 }