Exemple #1
0
        private void ProcessPop(MyHead head,
                                PopTransition <TState> pdaTransition, TTransition sourceTransition)
        {
            var record = new PopHistoryRecord <TState, TTransition, TPosition, TContext>(
                pdaTransition.NextState, sourceTransition, myTransitionProvider.Target(sourceTransition), head.CurrentContext);

            myPopHistory.AddToPopHistory(head.StackTop, record);

            foreach (var newTop in head.StackTop.Pop())
            {
                ProcessPopForNewTop(pdaTransition.NextState, sourceTransition, head.CurrentContext, newTop);
            }
        }
Exemple #2
0
        protected void Pop(TState nextState)
        {
            var head = myState.CurrentHead;

            var currentTop = head.CurrentContext.StackTop;
            var record     = new PopHistoryRecord <TState, TTransition, TPosition, TContext>(
                nextState, myState.CurrentTransition, myState.NextPosition, head.CurrentContext);

            myState.PopHistory.AddToPopHistory(currentTop, record);

            foreach (var newTop in currentTop.Pop())
            {
                ProcessPopForNewTop(nextState, myState.CurrentTransition, myState.NextPosition, head.CurrentContext, newTop);
            }
        }