11#include <string/LinearString.h>
33 template <
class TerminalSymbolType,
class NonterminalSymbolType >
38template <
class TerminalSymbolType,
class NonterminalSymbolType >
40 unsigned stringSize =
string.getContent ( ).size ( );
42 if ( ( stringSize == 0 ) &&
grammar.getGeneratesEpsilon ( ) )
return { };
45 data.resize ( stringSize );
47 for (
unsigned i = 0;
i < stringSize;
i++ )
48 data[
i].resize ( stringSize -
i );
50 for (
unsigned i = 0;
i < stringSize;
i++ )
52 const NonterminalSymbolType & lhs = rule.first;
55 if ( rhs.template is < TerminalSymbolType > ( ) && ( rhs.template get < TerminalSymbolType > ( ) ==
string.getContent ( )[
i] ) )
60 for (
unsigned i = 1;
i < stringSize;
i++ )
61 for (
unsigned j = 0; j < stringSize -
i; j++ ) {
64 for (
unsigned k = 0; k <
i; k++ ) {
68 for (
const NonterminalSymbolType & verticalElement : vertical ) {
69 for (
const NonterminalSymbolType & diagonalElement : diagonal )
72 const NonterminalSymbolType & lhs = rule.first;
78 if ( ( rhsp.first == verticalElement ) && ( rhsp.second == diagonalElement ) )
79 targetCell.insert ( lhs );
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 > log
Standard loging stream. Mapped to descriptor 4.
Definition: GlobalData.h:78
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
reverse_iterator insert(const_reverse_iterator pos, const T &value)
Inserts the value on position given by iterator pos.
Definition: vector.hpp:229
Chomsky normal form of a context free grammar in Chomsky hierarchy or type 2 in Chomsky hierarchy....
Definition: CNF.h:66
Definition: CockeYoungerKasamiVerbose.h:20
static ext::vector< ext::vector< ext::set< NonterminalSymbolType > > > generate(const grammar::CNF< TerminalSymbolType, NonterminalSymbolType > &grammar, const string::LinearString< TerminalSymbolType > &string)
Definition: CockeYoungerKasamiVerbose.h:39
Linear string.
Definition: LinearString.h:57
int i
Definition: AllEpsilonClosure.h:118
Definition: ToAutomaton.h:24