コード例 #1
0
ファイル: RegExpDfa.cs プロジェクト: Daoting/dt
 RegExpDfa()
 {
     this._statesCache          = new Dictionary <RegExpDfaWave, RegExpDfaWave>();
     this._stringsToStatesCache = new RegExpStringKeyTable();
     this._initialState         = new RegExpState();
     this._finalState           = this._initialState;
 }
コード例 #2
0
ファイル: RegExpDfa.cs プロジェクト: Daoting/dt
 /// <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;
 }
コード例 #3
0
ファイル: RegExpDfa.cs プロジェクト: Daoting/dt
        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);
                }
            }
        }