Example #1
0
        internal PrologStackFrameList(PrologMachine machine)
        {
            if (machine == null)
            {
                throw new ArgumentNullException("machine");
            }

            Machine = machine;
        }
 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();
 }
Example #3
0
 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;
     }
 }
 public void Reset()
 {
     Machine = null;
 }
 public MachineChangedEventArgs(PrologMachine machine)
 {
     Machine = machine;
 }