FormeleMethode/NdfaToDfaConverter.cs
/// <summary>
/// Finalises the conversion by removing the _ part from each state.
/// </summary>
/// <param name="dfa">The merged.</param>
/// <returns></returns>
Finalises the conversion by removing the _ part from each state.
Finalises the conversion by removing the _ part from each state .
private static Automata<string> RemoveStateSeperators(Automata<string> dfa)
		{
			Automata<string> finaleDFA = new Automata<string>(dfa.symbols);
			foreach (Transition<string> trans in dfa.transitions)
			{
				finaleDFA.AddTransition(new Transition<string>(trans.GetFromState().Replace("_", string.Empty),
															   trans.GetSymbol(),
															   trans.GetToState().Replace("_", string.Empty)));
			}
			foreach (string startState in dfa.startStates)
			{
				finaleDFA.DefineAsStartState(startState.Replace("_", string.Empty));
			}
			foreach (string endState in dfa.endStates)
			{
				finaleDFA.DefineAsFinalState(endState.Replace("_", string.Empty));
			}
			return finaleDFA;
		}
private static Automata < string > RemoveStateSeperators ( Automata < string > dfa ) { Automata < string > finaleDFA = new Automata < string > ( dfa . symbols ) ; foreach ( Transition < string > trans in dfa . transitions ) { finaleDFA . AddTransition ( new Transition < string > ( trans . GetFromState ( ) . Replace ( " " , string . Empty ) , trans . GetSymbol ( ) , trans . GetToState ( ) . Replace ( " " , string . Empty ) ) ) ; } foreach ( string startState in dfa . startStates ) { finaleDFA . DefineAsStartState ( startState . Replace ( " " , string . Empty ) ) ; } foreach ( string endState in dfa . endStates ) { finaleDFA . DefineAsFinalState ( endState . Replace ( " " , string . Empty ) ) ; } return finaleDFA ; }
Finalises the conversion by removing the _ part from each state.
Finalises the conversion by removing the _ part from each state .
None
dfa
Automata<string>
None