public void PushStackFrame(PrtState state) { var deferredSet = new HashSet <PrtValue>(); if (TopOfStack != null) { deferredSet.UnionWith(TopOfStack.deferredSet); } deferredSet.UnionWith(state.deferredSet); deferredSet.ExceptWith(state.dos.Keys); deferredSet.ExceptWith(state.transitions.Keys); var actionSet = new HashSet <PrtValue>(); if (TopOfStack != null) { actionSet.UnionWith(TopOfStack.actionSet); } actionSet.ExceptWith(state.deferredSet); actionSet.UnionWith(state.dos.Keys); actionSet.ExceptWith(state.transitions.Keys); //push the new state on stack stateStack.Push(new PrtStateStackFrame(state, deferredSet, actionSet)); }
public PrtStateStackFrame(PrtState st, HashSet <PrtValue> defSet, HashSet <PrtValue> actSet) { this.state = st; this.deferredSet = new HashSet <PrtValue>(); foreach (var item in defSet) { this.deferredSet.Add(item); } this.actionSet = new HashSet <PrtValue>(); foreach (var item in actSet) { this.actionSet.Add(item); } }
public void PrtPushState(PrtState s) { stateStack.PushStackFrame(s); }
public PrtTransition(PrtFun fun, PrtState toState, bool isPush) { this.transitionFun = fun; this.gotoState = toState; this.isPushTran = isPush; }
public void PrtChangeState(PrtState s) { Debug.Assert(stateStack.TopOfStack != null); stateStack.PopStackFrame(); stateStack.PushStackFrame(s); }