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

some tiny fixes

parent 7d0414f7
No related branches found
No related tags found
No related merge requests found
Pipeline #39844 passed with warnings
...@@ -97,17 +97,17 @@ private: ...@@ -97,17 +97,17 @@ private:
* @return the regular expression node representing the transitions between states @p from and @p to * @return the regular expression node representing the transitions between states @p from and @p to
*/ */
template < class SymbolType, class EpsilonType, class StateType > template < class SymbolType, class EpsilonType, class StateType >
static const regexp::UnboundedRegExpStructure < SymbolType > transitionsToRegExp ( const automaton::MultiInitialStateEpsilonNFA < SymbolType, EpsilonType, StateType > & automaton, const StateType & from, const StateType & to ); static regexp::UnboundedRegExpStructure < SymbolType > transitionsToRegExp ( const automaton::MultiInitialStateEpsilonNFA < SymbolType, EpsilonType, StateType > & automaton, const StateType & from, const StateType & to );
   
/** /**
* @return Wrapper for map.at ( ) that returns default value of UnboundedRegExpEmpty if key does not exist * @return Wrapper for map.at ( ) that returns default value of UnboundedRegExpEmpty if key does not exist
*/ */
template < class SymbolType, class StateType > template < class SymbolType, class StateType >
static const regexp::UnboundedRegExpStructure < SymbolType > RGetDefault ( const std::map < std::pair < StateType, StateType >, regexp::UnboundedRegExpStructure < SymbolType > > & R, const std::pair < StateType, StateType > & key ); static regexp::UnboundedRegExpStructure < SymbolType > RGetDefault ( const std::map < std::pair < StateType, StateType >, regexp::UnboundedRegExpStructure < SymbolType > > & R, const std::pair < StateType, StateType > & key );
}; };
   
template < class SymbolType, class StateType > template < class SymbolType, class StateType >
const regexp::UnboundedRegExpStructure < SymbolType > ToRegExpKleene::RGetDefault ( const std::map < std::pair < StateType, StateType >, regexp::UnboundedRegExpStructure < SymbolType > > & R, const std::pair < StateType, StateType > & key ) { regexp::UnboundedRegExpStructure < SymbolType > ToRegExpKleene::RGetDefault ( const std::map < std::pair < StateType, StateType >, regexp::UnboundedRegExpStructure < SymbolType > > & R, const std::pair < StateType, StateType > & key ) {
auto it = R.find ( key ); auto it = R.find ( key );
return it != R.end ( ) ? it -> second : regexp::UnboundedRegExpStructure < SymbolType > ( regexp::UnboundedRegExpEmpty < SymbolType > ( ) ); return it != R.end ( ) ? it -> second : regexp::UnboundedRegExpStructure < SymbolType > ( regexp::UnboundedRegExpEmpty < SymbolType > ( ) );
} }
...@@ -176,7 +176,7 @@ regexp::UnboundedRegExp < SymbolType > ToRegExpKleene::convert ( const automaton ...@@ -176,7 +176,7 @@ regexp::UnboundedRegExp < SymbolType > ToRegExpKleene::convert ( const automaton
   
   
template < class SymbolType, class EpsilonType, class StateType > template < class SymbolType, class EpsilonType, class StateType >
const regexp::UnboundedRegExpStructure < SymbolType > ToRegExpKleene::transitionsToRegExp ( const automaton::MultiInitialStateEpsilonNFA < SymbolType, EpsilonType, StateType > & automaton, const StateType & from, const StateType & to ) { regexp::UnboundedRegExpStructure < SymbolType > ToRegExpKleene::transitionsToRegExp ( const automaton::MultiInitialStateEpsilonNFA < SymbolType, EpsilonType, StateType > & automaton, const StateType & from, const StateType & to ) {
regexp::UnboundedRegExpStructure < SymbolType > ret ( regexp::UnboundedRegExpEmpty < SymbolType > { } ); regexp::UnboundedRegExpStructure < SymbolType > ret ( regexp::UnboundedRegExpEmpty < SymbolType > { } );
   
if ( from == to ) if ( from == to )
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "common/DefaultStateType.h" #include "common/DefaultStateType.h"
#include "common/DefaultSymbolType.h" #include "common/DefaultSymbolType.h"
#include "common/DefaultEpsilonType.h" #include "common/DefaultEpsilonType.h"
#include <alib/variant>
#include <alib/set> #include <alib/set>
#include <alib/map> #include <alib/map>
#include "automaton/PDA/VisiblyPushdownDPDA.h" #include "automaton/PDA/VisiblyPushdownDPDA.h"
......
...@@ -40,9 +40,6 @@ public: ...@@ -40,9 +40,6 @@ public:
/** /**
* Iteration of a finite automaton using epsilon transitions. * Iteration of a finite automaton using epsilon transitions.
* @tparam T Type of the finite automaton. * @tparam T Type of the finite automaton.
* @tparam SymbolType Type for input symbols.
* @tparam EpsilonType Type for epsilon symbol. Defaults to DefaultEpsilonType.
* @tparam StateType Type for states.
* @param automaton automaton to iterate * @param automaton automaton to iterate
* @return epsilon nondeterministic FA representing the intersection of @p automaton * @return epsilon nondeterministic FA representing the intersection of @p automaton
*/ */
......
...@@ -999,7 +999,7 @@ void DotConverter::transitions(const automaton::CompactNFA < SymbolType, StateTy ...@@ -999,7 +999,7 @@ void DotConverter::transitions(const automaton::CompactNFA < SymbolType, StateTy
   
//put transitions from automaton to "transitions" //put transitions from automaton to "transitions"
for (const auto& transition : fsm.getTransitions()) { for (const auto& transition : fsm.getTransitions()) {
std::string symbol = replace ( factory::StringDataFactory::toString ( string::stringFrom ( transition.first.second ) ), "\"", "\\\"" ); std::string symbol = replace ( factory::StringDataFactory::toString ( string::stringFrom ( transition.first.second ) ), "\"", "\\\"" );
   
std::pair<int, int> key(states.find(transition.first.first)->second, states.find(transition.second)->second); std::pair<int, int> key(states.find(transition.first.first)->second, states.find(transition.second)->second);
ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key);
...@@ -1034,7 +1034,7 @@ void DotConverter::transitions(const automaton::ExtendedNFTA < SymbolType, RankT ...@@ -1034,7 +1034,7 @@ void DotConverter::transitions(const automaton::ExtendedNFTA < SymbolType, RankT
// print subgraph with the rte // print subgraph with the rte
out << '\n'; out << '\n';
out << "subgraph cluster_rte_" << auxNodeCnt << "{" << '\n'; out << "subgraph cluster_rte_" << auxNodeCnt << "{" << '\n';
out << "label=\"rte_" << auxNodeCnt << "\"\n"; out << "label=\"rte_" << auxNodeCnt << "\"\n";
out << "color = blue;\n"; out << "color = blue;\n";
out << convert::DotConverterRTE::convertInternal ( rte::FormalRTE < ext::variant < SymbolType, StateType >, RankType > ( transition.first.first ), "x" + ext::to_string ( auxNodeCnt ) + "x" ); out << convert::DotConverterRTE::convertInternal ( rte::FormalRTE < ext::variant < SymbolType, StateType >, RankType > ( transition.first.first ), "x" + ext::to_string ( auxNodeCnt ) + "x" );
out << "}\n" << std::endl; out << "}\n" << std::endl;
...@@ -1210,7 +1210,7 @@ void DotConverter::transitions(const automaton::DPDA < InputSymbolType, EpsilonT ...@@ -1210,7 +1210,7 @@ void DotConverter::transitions(const automaton::DPDA < InputSymbolType, EpsilonT
for (std::pair<const std::pair<int, int>, std::string>& transition : transitions) { for (std::pair<const std::pair<int, int>, std::string>& transition : transitions) {
out << transition.first.first << " -> " << transition.first.second; out << transition.first.first << " -> " << transition.first.second;
replaceInplace(transition.second, "\n", "\\n"); replaceInplace(transition.second, "\n", "\\n");
out << "[label=\"" << transition.second << "\"]\n"; out << "[label=\"" << transition.second << "\"]\n";
} }
} }
   
......
This diff is collapsed.
...@@ -97,7 +97,7 @@ bool xmlApi < object::Object >::first ( const ext::deque < sax::Token >::const_i ...@@ -97,7 +97,7 @@ bool xmlApi < object::Object >::first ( const ext::deque < sax::Token >::const_i
std::string xmlApi < object::Object >::xmlTagName ( ) { std::string xmlApi < object::Object >::xmlTagName ( ) {
std::string target = ext::to_string < object::Object > ( ); std::string target = ext::to_string < object::Object > ( );
   
throw ::exception::CommonException ( "Type " + target + " does not have xmlTagName." ); throw exception::CommonException ( "Type " + target + " does not have xmlTagName." );
} }
   
void xmlApi < object::Object >::composeRef ( xmlApiOutputContext & output, typename ext::map < object::Object, int >::iterator & elem ) { void xmlApi < object::Object >::composeRef ( xmlApiOutputContext & output, typename ext::map < object::Object, int >::iterator & elem ) {
......
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