Ejemplo n.º 1
0
 RegExpDfa()
 {
     this._statesCache          = new Dictionary <RegExpDfaWave, RegExpDfaWave>();
     this._stringsToStatesCache = new RegExpStringKeyTable();
     this._initialState         = new RegExpState();
     this._finalState           = this._initialState;
 }
Ejemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="initialTransition"></param>
 public RegExpDfa(Transition initialTransition)
 {
     this._statesCache          = new Dictionary <RegExpDfaWave, RegExpDfaWave>();
     this._stringsToStatesCache = new RegExpStringKeyTable();
     this._initialState         = new RegExpState();
     this._initialState.AddTransition(initialTransition);
     this._finalState = initialTransition.Target;
 }
Ejemplo n.º 3
0
        RegExpDfa(RegExpDfa source)
        {
            this._statesCache          = new Dictionary <RegExpDfaWave, RegExpDfaWave>();
            this._stringsToStatesCache = new RegExpStringKeyTable();
            Dictionary <RegExpState, RegExpState> dictionary = new Dictionary <RegExpState, RegExpState>();

            foreach (RegExpState state in source.GetAllStates())
            {
                dictionary.Add(state, new RegExpState());
            }
            this._initialState = dictionary[source._initialState];
            this._finalState   = dictionary[source._finalState];
            foreach (RegExpState state2 in dictionary.Keys)
            {
                foreach (Transition transition in state2.Transitions)
                {
                    Transition transition2 = transition.Copy(dictionary[transition.Target]);
                    dictionary[state2].AddTransition(transition2);
                }
            }
        }