Skip to content
Snippets Groups Projects
Commit d85e6848 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

improvements in DFA string parser

parent 95807fcc
No related branches found
No related tags found
No related merge requests found
...@@ -93,7 +93,7 @@ void stringApi < automaton::DFA < SymbolType, StateType > >::parseTransition(std ...@@ -93,7 +93,7 @@ void stringApi < automaton::DFA < SymbolType, StateType > >::parseTransition(std
states.insert(from); states.insert(from);
if ( initial ) { if ( initial ) {
if(initialState != NULL) if(initialState != NULL)
throw exception::CommonException("Multiple initial states are not avaiable for NFA type"); throw exception::CommonException("Multiple initial states are not avaiable for DFA type");
initialState = new StateType(from); initialState = new StateType(from);
} }
if ( final ) if ( final )
...@@ -111,11 +111,9 @@ void stringApi < automaton::DFA < SymbolType, StateType > >::parseTransition(std ...@@ -111,11 +111,9 @@ void stringApi < automaton::DFA < SymbolType, StateType > >::parseTransition(std
StateType to = alib::stringApi<StateType>::parse(input); StateType to = alib::stringApi<StateType>::parse(input);
states.insert(to); states.insert(to);
transitionFunction.insert(ext::make_tuple(from, *iter, to)); transitionFunction.insert(ext::make_tuple(from, *iter, to));
token = automaton::AutomatonFromStringLexer::next(input);
} else {
token = automaton::AutomatonFromStringLexer::next(input);
} }
token = automaton::AutomatonFromStringLexer::next(input);
++iter; ++iter;
} }
automaton::AutomatonFromStringLexer::putback(input, token); automaton::AutomatonFromStringLexer::putback(input, token);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment