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
コード例 #1
0
ファイル: Repl.cs プロジェクト: rzubek/UnityProlog
 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.");
     }
 }
コード例 #2
0
ファイル: Repl.cs プロジェクト: recardona/UnityProlog
 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.");
 }