8#include <ext/algorithm>
27 template <
class SymbolType >
34 if ( source.first == substitutionSymbol.
getSymbol ( ) )
35 substTargets.push_back ( transition.second );
52 template <
class SymbolType >
54 unsigned nextState = 0;
55 const unsigned * tailArg =
nullptr;
59 automaton.addInputSymbols (
rte.getSubstitutionAlphabet ( ) );
61 rte.getRTE ( ).getStructure ( ).template accept < void, ToFTAThompson::Formal < SymbolType > > (
automaton, nextState, tailArg );
69 template <
class SymbolType >
81template <
class SymbolType >
83 unsigned state = nextState ++;
86 node.getLeftElement ( ).template accept < void, ToFTAThompson::Formal < SymbolType > > (
automaton, nextState, tailArg );
87 automaton.addTransition ( * tailArg, state );
89 node.getRightElement ( ).template accept < void, ToFTAThompson::Formal < SymbolType > > (
automaton, nextState, tailArg );
90 automaton.addTransition ( * tailArg, state );
92 tailArg = & *
automaton.getStates ( ).find ( state );
95template <
class SymbolType >
97 node.getLeftElement ( ).template accept < void, ToFTAThompson::Formal < SymbolType > > (
automaton, nextState, tailArg );
98 const unsigned *
result = tailArg;
102 for (
unsigned substTarget : substTargets ) {
103 automaton.removeTransition (
node.getSubstitutionSymbol ( ).getSymbol ( ), { }, substTarget);
106 node.getRightElement ( ).template accept < void, ToFTAThompson::Formal < SymbolType > > (
automaton, nextState, tailArg );
108 for (
unsigned substTarget : substTargets ) {
109 automaton.addTransition ( * tailArg, substTarget );
115template <
class SymbolType >
117 unsigned state = nextState ++;
119 node.getElement ( ).template accept < void, ToFTAThompson::Formal < SymbolType > > (
automaton, nextState, tailArg );
124 for (
unsigned substTarget : substTargets ) {
125 std::cout <<
"eps transition from " << * tailArg <<
" to " << substTarget << std::endl;
126 automaton.addTransition ( * tailArg, substTarget );
129 automaton.addTransition ( * tailArg, state );
130 automaton.addTransition (
node.getSubstitutionSymbol ( ).getSymbol ( ), { }, state );
132 tailArg = & *
automaton.getStates ( ).find ( state );
135template <
class SymbolType >
137 unsigned state = nextState ++;
141 c.template accept < void, ToFTAThompson::Formal < SymbolType > > (
automaton, nextState, tailArg );
142 from.push_back ( * tailArg );
145 tailArg = & *
automaton.getStates ( ).find ( state );
148template <
class SymbolType >
150 unsigned state = nextState ++;
153 tailArg = & *
automaton.getStates ( ).find ( state );
156template <
class SymbolType >
158 unsigned state = nextState ++;
160 tailArg = & *
automaton.getStates ( ).find ( state );
Epsilon nondeterministic finite tree automaton. Accepts regular tree languages.
Definition: EpsilonNFTA.h:73
Definition: ranked_symbol.hpp:20
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
Implementation of the variant class allowing to store any type of those listed in the template parame...
Definition: variant.hpp:98
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Definition: ToFTAThompson.h:26
static automaton::EpsilonNFTA< SymbolType, unsigned > convert(const rte::FormalRTE< SymbolType > &rte)
Definition: ToFTAThompson.h:53
for(const StateType &state :fsm.getStates()) renamingData.insert(std Rename::RenamedAutomaton< T > result(renamingData.at(fsm.getInitialState()))
Definition: Rename.h:253
Definition: ToGrammar.h:31
Definition: converterCommon.hpp:8
Definition: ToFTAGlushkov.h:22