Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
CockeYoungerKasami.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <global/GlobalData.h>
9
11#include <string/LinearString.h>
13
14namespace grammar {
15
16namespace generate {
17
22public:
34 template < class TerminalSymbolType, class NonterminalSymbolType >
36
37};
38
39template < class TerminalSymbolType, class NonterminalSymbolType >
41 unsigned stringSize = string.getContent ( ).size ( );
42
43 if ( ( stringSize == 0 ) && grammar.getGeneratesEpsilon ( ) ) return true;
44
46
47 return data[stringSize - 1][0].count ( grammar.getInitialSymbol ( ) );
48}
49
50} /* namespace generate */
51
52} /* namespace grammar */
53
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Chomsky normal form of a context free grammar in Chomsky hierarchy or type 2 in Chomsky hierarchy....
Definition: CNF.h:66
static ext::vector< ext::vector< ext::set< NonterminalSymbolType > > > generate(const grammar::CNF< TerminalSymbolType, NonterminalSymbolType > &grammar, const string::LinearString< TerminalSymbolType > &string)
Definition: CockeYoungerKasamiVerbose.h:39
Definition: CockeYoungerKasami.h:21
static bool generate(const grammar::CNF< TerminalSymbolType, NonterminalSymbolType > &grammar, const string::LinearString< TerminalSymbolType > &string)
Definition: CockeYoungerKasami.h:40
Linear string.
Definition: LinearString.h:57
Definition: ToAutomaton.h:24