A push transition – add an instance of a given State to the top of the state stack.
Return the state that was popped
Apply the transition to the given stack
.
# File lib/pushdown/transition/pop.rb, line 22
def apply( stack )
raise Pushdown::TransitionError, "can't pop from an empty stack" if stack.empty?
raise Pushdown::TransitionError, "can't pop the only state on the stack" if stack.length == 1
self.log.debug "popping a state"
@popped_state = stack.pop
@popped_state.on_stop
stack.last.on_resume
return stack
end