8#include <ext/algorithm>
11#include <alib/variant>
18#include "../glushkov/GlushkovFollow.h"
19#include "../glushkov/GlushkovIndexate.h"
20#include "../glushkov/GlushkovFirst.h"
33 template <
class SymbolType >
49 template <
class SymbolType >
53template <
class SymbolType >
100 for (
const auto & symbol : firstSet )
105 common::Streams::err <<
"---------------------------------------------------------" << std::endl;
107 for (
const auto & symbol : indexedRTE.
getAlphabet ( ) )
112 for (
const auto & symbol : firstSet )
119 if ( kv.second.empty ( ) )
130 common::Streams::err <<
"---------------------------------------------------------" << std::endl;
144 if ( symb.getRank ( ) == 0 ) {
148 automaton.addTransition ( phi ( symb ), { }, std::move ( stateTo ) );
153 for (
const auto & e : followTuple )
154 stateFrom.push_back ( e );
157 common::Streams::err <<
"Transition 2: " << phi ( symb ) <<
" ( " << stateFrom <<
" ) -> " << stateTo << std::endl;
159 automaton.addTransition ( phi ( symb ), std::move ( stateFrom ), std::move ( stateTo ) );
170 if ( followTupleElem.count ( symb ) == 0 )
177 for (
const auto & e : symbFollowTuple )
178 stateFrom.push_back ( e );
181 common::Streams::err <<
"Transition 1" << ( stateFrom.empty() ?
"a" :
"b" ) <<
": " << phi ( symb ) <<
" ( " << stateFrom <<
" ) -> " << stateTo << std::endl;
184 automaton.addTransition ( phi ( symb ), std::move ( stateFrom ), std::move ( stateTo ) );
Nondeterministic finite tree automaton without epsilon transitions. Accepts regular tree languages.
Definition: NFTA.h:72
static bool verbose
Verbose flag. Some algorithms print additional runtime information about internal datastructures or t...
Definition: GlobalData.h:24
static ext::reference_wrapper< ext::ostream > err
Standard error stream. Mapped to descriptor 2.
Definition: GlobalData.h:72
Definition: ranked_symbol.hpp:20
Basic exception from which all other exceptions are derived.
Definition: CommonException.h:21
Class extending the map class from the standard library. Original reason is to allow printing of the ...
Definition: map.hpp:48
R & at(const T &key, R &defaultValue)
Definition: map.hpp:163
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
auto begin() &
Inherited behavior of begin for non-const instance.
Definition: set.hpp:99
auto end() &
Inherited behavior of end for non-const instance.
Definition: set.hpp:129
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
static ext::set< common::ranked_symbol< SymbolType > > first(const rte::FormalRTE< SymbolType > &rte)
Definition: GlushkovFirst.h:37
static ext::map< common::ranked_symbol< ext::pair< SymbolType, unsigned > >, TFollowTuple< SymbolType > > follow(const rte::FormalRTE< ext::pair< SymbolType, unsigned > > &rte)
Definition: GlushkovFollow.h:63
static FormalRTE< ext::pair< SymbolType, unsigned > > index(const rte::FormalRTE< SymbolType > &rte)
Definition: GlushkovIndexate.h:23
Definition: ToFTAGlushkov.h:31
static automaton::NFTA< SymbolType, ext::set< common::ranked_symbol< ext::pair< SymbolType, unsigned > > > > convert(const rte::FormalRTE< SymbolType > &rte)
Definition: ToFTAGlushkov.h:54
Definition: ToGrammar.h:31
Definition: converterCommon.hpp:8
bool excludes(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, Compare comp)
Tests two sorted ranges wheter all elements from the second are not present in the first.
Definition: algorithm.hpp:46
Definition: ToFTAGlushkov.h:22