18#include <ext/algorithm>
51 template <
class T,
class TerminalSymbolType =
typename grammar::TerminalSymbolTypeOfGrammar < T >,
class NonterminalSymbolType =
typename grammar::NonterminalSymbolTypeOfGrammar < T > >
55template <
class T,
class TerminalSymbolType,
class NonterminalSymbolType >
65 set_intersection( Vt.
begin( ), Vt.
end( ),
grammar.getNonterminalAlphabet( ).begin( ),
grammar.getNonterminalAlphabet( ).end( ), std::inserter( newNonTerminals, newNonTerminals.
begin( ) ) );
66 for(
const auto & symbol : newNonTerminals )
67 ret.addNonterminalSymbol( symbol.template get < NonterminalSymbolType > ( ) );
69 set_intersection( Vt.
begin( ), Vt.
end( ),
grammar.getTerminalAlphabet( ).begin( ),
grammar.getTerminalAlphabet( ).end( ), std::inserter( newTerminals, newTerminals.
begin( ) ) );
70 for(
const auto & symbol : newTerminals )
71 ret.addTerminalSymbol( symbol.template get < TerminalSymbolType > ( ) );
76 return Vt.count( symb );
80 for(
const auto & rule : rawRules ) {
81 if( newNonTerminals.count( rule.first ) ) {
82 for(
const auto& rhs : rule.second ) {
83 if(
all_of( rhs.begin( ), rhs.end( ), testCallback ) )
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
Implementation of the variant class allowing to store any type of those listed in the template parame...
Definition: variant.hpp:98
static bool addRawRule(LG< TerminalSymbolType, NonterminalSymbolType > &grammar, NonterminalSymbolType leftHandSide, ext::vector< ext::variant< TerminalSymbolType, NonterminalSymbolType > > rightHandSide)
Definition: AddRawRule.h:92
static ext::map< NonterminalSymbolType, ext::set< ext::vector< ext::variant< TerminalSymbolType, NonterminalSymbolType > > > > getRawRules(const LG< TerminalSymbolType, NonterminalSymbolType > &grammar)
Definition: RawRules.h:92
static ext::set< ext::variant< TerminalSymbolType, NonterminalSymbolType > > getReachableSymbols(const T &grammar)
Definition: ReachableSymbols.h:42
Definition: UnreachableSymbolsRemover.h:38
static T remove(const T &grammar)
Definition: UnreachableSymbolsRemover.h:56
ext::set< ext::pair< StateType, StateType > > ret(const ext::set< ext::pair< StateType, StateType > > &S, const DeterministicPushdownStoreSymbolType &pdaSymbol, const InputSymbolType &input, const N &nondeterministic)
Definition: RHDPDACommon.h:57
all_of(T &&...) -> all_of< T... >
Definition: ToAutomaton.h:24