RegExpDfa() { this._statesCache = new Dictionary <RegExpDfaWave, RegExpDfaWave>(); this._stringsToStatesCache = new RegExpStringKeyTable(); this._initialState = new RegExpState(); this._finalState = this._initialState; }
/// <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; }
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); } } }