Ejemplo n.º 1
0
        public WamEnvironment(WamEnvironment predecessor, WamInstructionPointer returnInstructionPointer, WamChoicePoint cutChoicePoint)
        {
            m_id          = s_nextId++;
            m_predecessor = predecessor;
            m_returnInstructionPointer = returnInstructionPointer;
            m_cutChoicePoint           = cutChoicePoint;

            m_permanentRegisters = new WamReferenceTargetList();
        }
Ejemplo n.º 2
0
        public WamEnvironment(WamEnvironment predecessor, WamInstructionPointer returnInstructionPointer, WamChoicePoint cutChoicePoint)
        {
            Id          = _nextId++;
            Predecessor = predecessor;
            ReturnInstructionPointer = returnInstructionPointer;
            CutChoicePoint           = cutChoicePoint;

            PermanentRegisters = new WamReferenceTargetList();
        }
Ejemplo n.º 3
0
        public WamEnvironment(WamEnvironment predecessor, WamInstructionPointer returnInstructionPointer, WamChoicePoint cutChoicePoint)
        {
            Id = _nextId++;
            Predecessor = predecessor;
            ReturnInstructionPointer = returnInstructionPointer;
            CutChoicePoint = cutChoicePoint;

            PermanentRegisters = new WamReferenceTargetList();
        }
Ejemplo n.º 4
0
        public WamEnvironment(WamEnvironment predecessor, WamInstructionPointer returnInstructionPointer, WamChoicePoint cutChoicePoint)
        {
            m_id = s_nextId++;
            m_predecessor = predecessor;
            m_returnInstructionPointer = returnInstructionPointer;
            m_cutChoicePoint = cutChoicePoint;

            m_permanentRegisters = new WamReferenceTargetList();
        }
Ejemplo n.º 5
0
        public WamChoicePoint(WamChoicePoint predecessor, WamEnvironment environment, int stackIndex, WamInstructionPointer returnInstructionPointer, IEnumerable<WamReferenceTarget> argumentRegisters, WamChoicePoint cutChoicePoint)
        {
            m_generation = s_nextGeneration++;

            m_predecessor = predecessor;
            m_environment = environment;
            m_stackIndex = stackIndex;
            m_returnInstructionPointer = returnInstructionPointer;
            m_argumentRegisters = new WamReferenceTargetList(argumentRegisters);
            m_cutChoicePoint = cutChoicePoint;

            m_backtrackInstructionPointer = WamInstructionPointer.Undefined;
            m_predicateEnumerator = null;

            m_trail = new List<WamVariable>();
        }
Ejemplo n.º 6
0
        public WamChoicePoint(WamChoicePoint predecessor, WamEnvironment environment, int stackIndex, WamInstructionPointer returnInstructionPointer, IEnumerable<WamReferenceTarget> argumentRegisters, WamChoicePoint cutChoicePoint)
        {
            Generation = NextGeneration++;

            Predecessor = predecessor;
            Environment = environment;
            StackIndex = stackIndex;
            ReturnInstructionPointer = returnInstructionPointer;
            ArgumentRegisters = new WamReferenceTargetList(argumentRegisters);
            CutChoicePoint = cutChoicePoint;

            BacktrackInstructionPointer = WamInstructionPointer.Undefined;
            PredicateEnumerator = null;

            Trail = new List<WamVariable>();
        }
Ejemplo n.º 7
0
 private bool IsBreakpoint(WamInstructionPointer wamInstructionPointer)
 {
     //HACK: Implement
     return false;
 }
Ejemplo n.º 8
0
        public void PushContext(WamInstructionStream instructionStream)
        {
            if (instructionStream == null)
            {
                throw new ArgumentNullException("instructionStream");
            }

            WamContext context = new WamContext();
            m_contextStack.Push(context);
            m_currentContext = context;

            State = WamMachineStates.Run;
            InstructionPointer = new WamInstructionPointer(instructionStream);
            ReturnInstructionPointer = WamInstructionPointer.Undefined;
            StackIndex = 0;

            Environment = null;
            ChoicePoint = null;
            ArgumentRegisters.Clear();
            TemporaryRegisters.Clear();

            CurrentStructure = null;
            CurrentStructureIndex = -1;
        }
Ejemplo n.º 9
0
        public void SetInstructionStream(WamInstructionStream instructionStream)
        {
            if (instructionStream == null)
            {
                throw new ArgumentNullException("instructionStream");
            }

            ReturnInstructionPointer = InstructionPointer.GetNext();
            CutChoicePoint = ChoicePoint;
            TemporaryRegisters.Clear();

            StackIndex += 1;
            InstructionPointer = new WamInstructionPointer(instructionStream);
        }