Ejemplo n.º 1
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.º 2
0
        internal void InvalidateInstructionStream()
        {
            m_wamInstructionStream = null;

            if (m_prologInstructionStream != null)
            {
                m_prologInstructionStream = null;
                RaisePropertyChanged(new PropertyChangedEventArgs("PrologInstructionStream"));
            }
        }
Ejemplo n.º 3
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);
        }