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

fix type generality related errors

parent 209d1544
No related branches found
No related tags found
No related merge requests found
...@@ -119,7 +119,7 @@ regexp::UnboundedRegExp < SymbolType > ToRegExpAlgebraic::convert ( const automa ...@@ -119,7 +119,7 @@ regexp::UnboundedRegExp < SymbolType > ToRegExpAlgebraic::convert ( const automa
   
template < class SymbolType, class StateType > template < class SymbolType, class StateType >
regexp::UnboundedRegExp < SymbolType > ToRegExpAlgebraic::convert ( const automaton::NFA < SymbolType, StateType > & automaton ) { regexp::UnboundedRegExp < SymbolType > ToRegExpAlgebraic::convert ( const automaton::NFA < SymbolType, StateType > & automaton ) {
equations::RightRegularEquationSolver < SymbolType, SymbolType > solver; equations::RightRegularEquationSolver < SymbolType, StateType > solver;
   
// initialize equations // initialize equations
solver.setVariableSymbols ( automaton.getStates ( ) ); solver.setVariableSymbols ( automaton.getStates ( ) );
...@@ -136,7 +136,7 @@ regexp::UnboundedRegExp < SymbolType > ToRegExpAlgebraic::convert ( const automa ...@@ -136,7 +136,7 @@ regexp::UnboundedRegExp < SymbolType > ToRegExpAlgebraic::convert ( const automa
   
template < class SymbolType, class StateType > template < class SymbolType, class StateType >
regexp::UnboundedRegExp < SymbolType > ToRegExpAlgebraic::convert ( const automaton::DFA < SymbolType, StateType > & automaton ) { regexp::UnboundedRegExp < SymbolType > ToRegExpAlgebraic::convert ( const automaton::DFA < SymbolType, StateType > & automaton ) {
equations::RightRegularEquationSolver < SymbolType, SymbolType > solver; equations::RightRegularEquationSolver < SymbolType, StateType > solver;
   
// initialize equations // initialize equations
solver.setVariableSymbols ( automaton.getStates ( ) ); solver.setVariableSymbols ( automaton.getStates ( ) );
......
...@@ -132,7 +132,7 @@ void RegularEquationSolver < TerminalSymbolType, VariableSymbolType >::removeVar ...@@ -132,7 +132,7 @@ void RegularEquationSolver < TerminalSymbolType, VariableSymbolType >::removeVar
const regexp::UnboundedRegExpAlternation < TerminalSymbolType > & alt = kv.second; const regexp::UnboundedRegExpAlternation < TerminalSymbolType > & alt = kv.second;
   
if ( ( from == symb || to == symb ) && alt.getElements ( ).size ( ) != 0 ) { if ( ( from == symb || to == symb ) && alt.getElements ( ).size ( ) != 0 ) {
throw exception::CommonException ( "Symbol '" + ( std::string ) symb + "' is in use." ); throw exception::CommonException ( "Symbol '" + ext::to_string ( symb ) + "' is in use." );
} }
} }
   
...@@ -141,7 +141,7 @@ void RegularEquationSolver < TerminalSymbolType, VariableSymbolType >::removeVar ...@@ -141,7 +141,7 @@ void RegularEquationSolver < TerminalSymbolType, VariableSymbolType >::removeVar
const regexp::UnboundedRegExpAlternation < TerminalSymbolType > & alt = kv.second; const regexp::UnboundedRegExpAlternation < TerminalSymbolType > & alt = kv.second;
   
if ( from == symb && alt.getElements ( ).size ( ) != 0 ) { if ( from == symb && alt.getElements ( ).size ( ) != 0 ) {
throw exception::CommonException ( "Symbol '" + ( std::string ) from + "' is in use." ); throw exception::CommonException ( "Symbol '" + ext::to_string ( from ) + "' is in use." );
} }
} }
   
...@@ -173,11 +173,11 @@ void RegularEquationSolver < TerminalSymbolType, VariableSymbolType >::addVariab ...@@ -173,11 +173,11 @@ void RegularEquationSolver < TerminalSymbolType, VariableSymbolType >::addVariab
template < class TerminalSymbolType, class VariableSymbolType > template < class TerminalSymbolType, class VariableSymbolType >
void RegularEquationSolver < TerminalSymbolType, VariableSymbolType >::addEquation ( const VariableSymbolType & from, const VariableSymbolType & to, const regexp::UnboundedRegExpElement < TerminalSymbolType > & eq ) { void RegularEquationSolver < TerminalSymbolType, VariableSymbolType >::addEquation ( const VariableSymbolType & from, const VariableSymbolType & to, const regexp::UnboundedRegExpElement < TerminalSymbolType > & eq ) {
if ( nonterminalSymbols.count ( from ) == 0 ) { if ( nonterminalSymbols.count ( from ) == 0 ) {
throw exception::CommonException ( "Symbol from ('" + ( std::string ) from + "') is not in equation system." ); throw exception::CommonException ( "Symbol from ('" + ext::to_string ( from ) + "') is not in equation system." );
} }
   
if ( nonterminalSymbols.count ( to ) == 0 ) { if ( nonterminalSymbols.count ( to ) == 0 ) {
throw exception::CommonException ( "Symbol to ('" + ( std::string ) to + "') is not in equation system." ); throw exception::CommonException ( "Symbol to ('" + ext::to_string ( to ) + "') is not in equation system." );
} }
   
equationTransition.find ( std::make_pair ( from, to ) )->second.appendElement ( eq ); equationTransition.find ( std::make_pair ( from, to ) )->second.appendElement ( eq );
...@@ -186,7 +186,7 @@ void RegularEquationSolver < TerminalSymbolType, VariableSymbolType >::addEquati ...@@ -186,7 +186,7 @@ void RegularEquationSolver < TerminalSymbolType, VariableSymbolType >::addEquati
template < class TerminalSymbolType, class VariableSymbolType > template < class TerminalSymbolType, class VariableSymbolType >
void RegularEquationSolver < TerminalSymbolType, VariableSymbolType >::addEquation ( const VariableSymbolType & from, const regexp::UnboundedRegExpElement < TerminalSymbolType > & eq ) { void RegularEquationSolver < TerminalSymbolType, VariableSymbolType >::addEquation ( const VariableSymbolType & from, const regexp::UnboundedRegExpElement < TerminalSymbolType > & eq ) {
if ( nonterminalSymbols.count ( from ) == 0 ) { if ( nonterminalSymbols.count ( from ) == 0 ) {
throw exception::CommonException ( "Symbol from ('" + ( std::string ) from + "') is not in equation system." ); throw exception::CommonException ( "Symbol from ('" + ext::to_string ( from ) + "') is not in equation system." );
} }
   
equationFinal.find ( from )->second.appendElement ( eq ); equationFinal.find ( from )->second.appendElement ( eq );
...@@ -223,7 +223,7 @@ void RegularEquationSolver < TerminalSymbolType, VariableSymbolType >::sortSymbo ...@@ -223,7 +223,7 @@ void RegularEquationSolver < TerminalSymbolType, VariableSymbolType >::sortSymbo
template < class TerminalSymbolType, class VariableSymbolType > template < class TerminalSymbolType, class VariableSymbolType >
regexp::UnboundedRegExp < TerminalSymbolType > RegularEquationSolver < TerminalSymbolType, VariableSymbolType >::solve ( const VariableSymbolType & solveFor ) { regexp::UnboundedRegExp < TerminalSymbolType > RegularEquationSolver < TerminalSymbolType, VariableSymbolType >::solve ( const VariableSymbolType & solveFor ) {
if ( nonterminalSymbols.count ( solveFor ) == 0 ) { if ( nonterminalSymbols.count ( solveFor ) == 0 ) {
throw exception::CommonException ( "Symbol solveFor ('" + ( std::string ) solveFor + "') is not in equation system." ); throw exception::CommonException ( "Symbol solveFor ('" + ext::to_string ( solveFor ) + "') is not in equation system." );
} }
   
/* /*
......
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