示例#1
0
        internal static void CloneTransitions(
            FSM srcFsm, int srcState, FSM destFsm, int destState)
        {
            //Clone the transitions from srcState to destState
            Transitions srcTrans = null;

            srcFsm.Trans.TryGetValue(srcState, out srcTrans);
            if (srcTrans == null)
            {
                return;
            }

            Transitions destTrans = null;

            destFsm.Trans.TryGetValue(destState, out destTrans);

            if (destTrans == null)
            {
                destTrans = new Transitions();
                destFsm.Trans.Add(destState, destTrans);
            }

            destTrans.CloneTransitions(srcTrans, srcState, destState);
        }
        internal int FsmMakeTransition(int prevState, XName inputSymbol, out XName matchingName, out WildCard matchingWildCard)
        {
            Transitions currTrans = this.ValidationStates.Trans[prevState];

            return(currTrans.GetNextState(inputSymbol, out matchingName, out matchingWildCard));
        }
示例#3
0
 internal void Add(WildCard wildCard, int nextState)
 {
     Transitions.Add <WildCard>(ref this.wildCardTransitions, wildCard, nextState);
 }
示例#4
0
 internal void Add(XName name, int nextState)
 {
     Transitions.Add <XName>(ref this.nameTransitions, name, nextState);
 }