GoalStackParent() public method

Returns the stack position of the parent goal of the goal at the specified position on the stack
public GoalStackParent ( ushort frame ) : ushort
frame ushort
return ushort
Beispiel #1
0
 private void DumpPrologStack(PrologContext context)
 {
     if (context.GoalStackDepth > 0)
     {
         for (ushort i = 0; i <= context.CurrentFrame; i++)
         {
             Structure g = context.GoalStackGoal(i);
             if (g != null)
             {
                 ushort frame = i;
                 while (frame != 0)
                 {
                     //Output.Write("{0}/", frame);
                     Output.Write("  ");
                     frame = context.GoalStackParent(frame);
                 }
                 //Output.Write(' ');
                 //Output.Write("{0}<{1}: ", i, PrologContext.GoalStackParent(i));
                 Output.WriteLine(Term.ToStringInPrologFormat(g));
             }
         }
     }
     else
     {
         Output.WriteLine("Goal stack is empty.");
     }
 }
Beispiel #2
0
 private void DumpPrologStack(PrologContext context)
 {
     if (context.GoalStackDepth > 0)
         for (ushort i = 0; i <= context.CurrentFrame; i++)
         {
             Structure g = context.GoalStackGoal(i);
             if (g != null)
             {
                 ushort frame = i;
                 while (frame != 0)
                 {
                     //Output.Write("{0}/", frame);
                     Output.Write("  ");
                     frame = context.GoalStackParent(frame);
                 }
                 //Output.Write(' ');
                 //Output.Write("{0}<{1}: ", i, PrologContext.GoalStackParent(i));
                 Output.WriteLine(Term.ToStringInPrologFormat(g));
             }
         }
     else
         Output.WriteLine("Goal stack is empty.");
 }