コード例 #1
0
        internal PrologStackFrameList(PrologMachine machine)
        {
            if (machine == null)
            {
                throw new ArgumentNullException("machine");
            }

            Machine = machine;
        }
コード例 #2
0
 void OnMachineChanged(object sender, MachineChangedEventArgs e)
 {
     if (_currentMachine != null)
     {
         _currentMachine.ExecutionComplete -= OnExecutionComplete;
         _currentMachine.ExecutionSuspended -= OnExecutionSuspended;
     }
     _currentMachine = e.Machine;
     if (_currentMachine != null)
     {
         _currentMachine.ExecutionComplete += OnExecutionComplete;
         _currentMachine.ExecutionSuspended += OnExecutionSuspended;
     }
     AdjustVariables();
 }
コード例 #3
0
ファイル: PrologRun.cs プロジェクト: Slesa/Poseidon
 PrologMachine Execute(PrologMachine machine, Query query)
 {
     try
     {
         machine.ExecutionComplete += CodeExecuted;
         machine.RunToBacktrack();
         machine.Restart();
         var result = machine.RunToSuccess();
         Console.WriteLine(Enum.GetName(typeof(ExecutionResults), result));
         return machine;
     }
     catch (Exception ex)
     {
         Console.WriteLine("Error, got exception: {0}", ex.Message);
         return null;
     }
 }
コード例 #4
0
 public void Reset()
 {
     Machine = null;
 }
コード例 #5
0
 public MachineChangedEventArgs(PrologMachine machine)
 {
     Machine = machine;
 }