12#include <ext/algorithm>
16#include "../glushkov/GlushkovFollow.h"
17#include "../glushkov/GlushkovIndexate.h"
18#include "../glushkov/GlushkovFirst.h"
19#include "../glushkov/GlushkovLast.h"
42 template <
class SymbolType >
48 template <
class SymbolType >
52template <
class SymbolType >
69 for (
const auto & nonterminal : indexedRegExp.
getAlphabet ( ) )
70 grammar.addNonterminalSymbol ( nonterminal );
91 for (
const auto & rule :
grammar.getRules ( ) )
92 for (
const auto & rhs : rule.second ) {
99 if ( rawRhs.second == symbol.getSymbol ( ) )
100 grammar.addRule ( rule.first, rawRhs.first );
104 grammar.setGeneratesEpsilon (
true );
109template <
class SymbolType >
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
Right regular grammar in Chomsky hierarchy or type 3 in Chomsky hierarchy. Generates regular language...
Definition: RightRG.h:70
static ext::set< UnboundedRegExpSymbol< SymbolType > > first(const regexp::UnboundedRegExp< SymbolType > &re)
Definition: GlushkovFirst.h:69
static ext::set< UnboundedRegExpSymbol< SymbolType > > follow(const regexp::UnboundedRegExp< SymbolType > &re, const UnboundedRegExpSymbol< SymbolType > &symbol)
Definition: GlushkovFollow.h:77
static regexp::UnboundedRegExp< ext::pair< SymbolType, unsigned > > index(const regexp::UnboundedRegExp< SymbolType > &re)
static ext::set< UnboundedRegExpSymbol< SymbolType > > last(const regexp::UnboundedRegExp< SymbolType > &re)
Definition: GlushkovLast.h:69
Represents the symbol in the regular expression. The can't have any children.
Definition: UnboundedRegExpSymbol.h:42
Unbounded regular expression represents regular expression. It describes regular languages....
Definition: UnboundedRegExp.h:80
const ext::set< SymbolType > & getAlphabet() const &
Definition: UnboundedRegExp.h:122
Definition: ToGrammarRightRGGlushkov.h:31
static grammar::RightRG< SymbolType, ext::pair< SymbolType, unsigned > > convert(const regexp::FormalRegExp< SymbolType > ®exp)
Definition: ToGrammarRightRGGlushkov.h:110
static bool languageContainsEpsilon(const regexp::FormalRegExpElement< SymbolType > ®exp)
Definition: RegExpEpsilon.h:91
return grammar
Definition: ToGrammarLeftRG.h:99
typename T::SymbolType SymbolType
Definition: ReachableStates.h:176
Definition: converterCommon.hpp:8
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79
Definition: ToAutomaton.h:24
Definition: ToAutomaton.h:15