18template<
class SymbolType,
class StateType >
28template<
class SymbolType,
class StateType >
51 unsigned rank = ext::from_string < unsigned > ( token.value );
71 parseTransition(input, states, symbols, finalStates, transitionFunction);
81 res.setStates(states);
82 res.setFinalStates(finalStates);
85 res.addTransition(std::get<1>(transition), std::get<0>(transition), std::get<2>(transition));
90template<
class SymbolType,
class StateType >
97 while ( iter != symbols.end ( ) ) {
103 states.insert ( state );
105 innerTransitionFunction.insert(
ext::make_tuple(std::move ( from ), *iter));
118 states.insert ( to );
120 bool initial =
false;
127 finalStates.insert ( to );
136 transitionFunction.insert (
ext::make_tuple ( std::move ( std::get < 0 > ( innerTransition ) ), std::move ( std::get < 1 > ( innerTransition ) ), to ) );
140template<
class SymbolType,
class StateType >
145template<
class SymbolType,
class StateType >
148 for(
const auto& symbol :
automaton.getInputAlphabet()) {
156 for(
const auto& state :
automaton.getStates()) {
157 composeTransitionsToState(output,
automaton, state);
169template <
class SymbolType,
class StateType >
172 auto toStateTransitionsIter = symbolTransitionsToState.
begin ( );
177 if ( toStateTransitionsIter == symbolTransitionsToState.
end ( ) || toStateTransitionsIter->first.first != inputSymbol ) {
179 }
else while ( toStateTransitionsIter != symbolTransitionsToState.
end ( ) && toStateTransitionsIter->first.first == inputSymbol ) {
186 ++ toStateTransitionsIter;
static Token next(ext::istream &input)
Definition: AutomatonFromStringLexer.cpp:12
Nondeterministic finite tree automaton without epsilon transitions. Accepts regular tree languages.
Definition: NFTA.h:72
Definition: ranked_symbol.hpp:20
Basic exception from which all other exceptions are derived.
Definition: CommonException.h:21
static Token peek(ext::istream &input)
Definition: lexer.hpp:53
static void putback(ext::istream &input, const Token &token)
Definition: lexer.hpp:61
Class extending the multimap class from the standard library. Original reason is to allow printing of...
Definition: multimap.hpp:48
auto begin() &
Inherited behavior of begin for non-const instance.
Definition: multimap.hpp:167
auto end() &
Inherited behavior of end for non-const instance.
Definition: multimap.hpp:197
Class extending the tuple class from the standard library. Original reason is to allow printing of th...
Definition: tuple.hpp:42
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
auto begin() &
Inherited behavior of begin for non-const instance.
Definition: vector.hpp:125
auto end() &
Inherited behavior of end for non-const instance.
Definition: vector.hpp:155
typename T::StateType StateType
Definition: ToGrammarLeftRG.h:64
typename T::SymbolType SymbolType
Definition: ReachableStates.h:176
return res
Definition: MinimizeByPartitioning.h:145
Definition: ToGrammar.h:31
Definition: normalize.hpp:10
reference_mover< T > make_mover(T ¶m)
Move adaptor construction function specialized to lvalue reference parameter.
Definition: iterator.hpp:468
std::string to_string(const T &value)
To string method designated for objects that can be casted to string.
Definition: string.hpp:131
constexpr auto make_tuple(Elements &&... args)
Helper of extended tuple construction. The tuple is constructed from values pack, types are deduced.
Definition: tuple.hpp:203
static void initialFinalState(ext::istream &input, bool &rightArrow, bool &leftArrow)
Definition: AutomatonFromStringParserCommon.cpp:10
static void composeList(ext::ostream &output, const ext::vector< Type > &list)
Definition: AutomatonToStringComposerCommon.h:21
Definition: stringApi.hpp:26