14#include <ext/typeinfo>
15#include <ext/iostream>
16#include <ext/algorithm>
41 template <
class SymbolType >
44 template <
class SymbolType >
47 template <
class SymbolType >
50 template <
class SymbolType >
53 template <
class SymbolType >
56 template <
class SymbolType >
59 template <
class SymbolType >
62 template <
class SymbolType >
65 template <
class SymbolType >
68 template <
class SymbolType >
71 template <
class SymbolType >
74 template <
class SymbolType >
77 template <
class SymbolType >
84 static std::string
diff (
const T & a,
const T & b );
87template <
class SymbolType >
89 out <<
"GrammarsComparer" << std::endl;
92 out <<
"Nonterminal alphabet" << std::endl;
98 out <<
"Rules" << std::endl;
104 out <<
"Initial symbol" << std::endl;
107 out <<
"---" << std::endl;
112 out <<
"Terminal alphabet" << std::endl;
118template <
class SymbolType >
120 out <<
"GrammarsComparer" << std::endl;
123 out <<
"Nonterminal alphabet" << std::endl;
129 out <<
"Rules" << std::endl;
135 out <<
"Initial symbol" << std::endl;
138 out <<
"---" << std::endl;
143 out <<
"Terminal alphabet" << std::endl;
149template <
class SymbolType >
151 out <<
"GrammarsComparer" << std::endl;
154 out <<
"Nonterminal alphabet" << std::endl;
160 out <<
"Rules" << std::endl;
166 out <<
"Initial symbol" << std::endl;
169 out <<
"---" << std::endl;
174 out <<
"Terminal alphabet" << std::endl;
180template <
class SymbolType >
182 out <<
"GrammarsComparer" << std::endl;
185 out <<
"Nonterminal alphabet" << std::endl;
191 out <<
"Rules" << std::endl;
197 out <<
"Initial symbol" << std::endl;
200 out <<
"---" << std::endl;
205 out <<
"Terminal alphabet" << std::endl;
211template <
class SymbolType >
213 out <<
"GrammarsComparer" << std::endl;
216 out <<
"Nonterminal alphabet" << std::endl;
222 out <<
"Rules" << std::endl;
228 out <<
"Initial symbol" << std::endl;
231 out <<
"---" << std::endl;
236 out <<
"Terminal alphabet" << std::endl;
242template <
class SymbolType >
244 out <<
"GrammarsComparer" << std::endl;
247 out <<
"Nonterminal alphabet" << std::endl;
253 out <<
"Rules" << std::endl;
259 out <<
"Initial symbol" << std::endl;
262 out <<
"---" << std::endl;
267 out <<
"Terminal alphabet" << std::endl;
273template <
class SymbolType >
275 out <<
"GrammarsComparer" << std::endl;
278 out <<
"Nonterminal alphabet" << std::endl;
284 out <<
"Rules" << std::endl;
290 out <<
"Initial symbol" << std::endl;
293 out <<
"---" << std::endl;
298 out <<
"Terminal alphabet" << std::endl;
304template <
class SymbolType >
306 out <<
"GrammarsComparer" << std::endl;
309 out <<
"Nonterminal alphabet" << std::endl;
315 out <<
"Rules" << std::endl;
321 out <<
"Initial symbol" << std::endl;
324 out <<
"---" << std::endl;
329 out <<
"Terminal alphabet" << std::endl;
335template <
class SymbolType >
337 out <<
"GrammarsComparer" << std::endl;
340 out <<
"Nonterminal alphabet" << std::endl;
346 out <<
"Rules" << std::endl;
352 out <<
"Initial symbol" << std::endl;
355 out <<
"---" << std::endl;
360 out <<
"Terminal alphabet" << std::endl;
366template <
class SymbolType >
368 out <<
"GrammarsComparer" << std::endl;
371 out <<
"Nonterminal alphabet" << std::endl;
377 out <<
"Rules" << std::endl;
383 out <<
"Initial symbol" << std::endl;
386 out <<
"---" << std::endl;
391 out <<
"Terminal alphabet" << std::endl;
397template <
class SymbolType >
399 out <<
"GrammarsComparer" << std::endl;
402 out <<
"Nonterminal alphabet" << std::endl;
408 out <<
"Rules" << std::endl;
414 out <<
"Initial symbol" << std::endl;
417 out <<
"---" << std::endl;
422 out <<
"Terminal alphabet" << std::endl;
428template <
class SymbolType >
430 out <<
"GrammarsComparer" << std::endl;
433 out <<
"Nonterminal alphabet" << std::endl;
439 out <<
"Rules" << std::endl;
445 out <<
"Initial symbol" << std::endl;
448 out <<
"---" << std::endl;
453 out <<
"Terminal alphabet" << std::endl;
459template <
class SymbolType >
461 out <<
"GrammarsComparer" << std::endl;
464 out <<
"Nonterminal alphabet" << std::endl;
470 out <<
"Rules" << std::endl;
476 out <<
"Initial symbol" << std::endl;
479 out <<
"---" << std::endl;
484 out <<
"Terminal alphabet" << std::endl;
493 GrammarDiff::printDiff ( a, b, out );
static void setDiff(ext::ostream &out, const ext::set< T > &a, const ext::set< T > &b)
Definition: DiffAux.h:33
static void mapDiff(ext::ostream &out, const ext::map< T, R > &a, const ext::map< T, R > &b)
Definition: DiffAux.h:84
static bool compare(const grammar::LeftLG< SymbolType > &a, const grammar::LeftLG< SymbolType > &b)
Definition: GrammarCompare.h:67
Definition: GrammarDiff.h:39
static void diff(const T &a, const T &b, ext::ostream &out)
Definition: GrammarDiff.h:491
std::string str() const &
Definition: sstream.cpp:29
Context free grammar in Chomsky hierarchy or type 2 in Chomsky hierarchy. Generates context free lang...
Definition: CFG.h:67
const NonterminalSymbolType & getInitialSymbol() const &
Definition: CFG.h:148
const ext::set< TerminalSymbolType > & getTerminalAlphabet() const &
Definition: CFG.h:215
const ext::set< NonterminalSymbolType > & getNonterminalAlphabet() const &
Definition: CFG.h:177
const ext::map< NonterminalSymbolType, ext::set< ext::vector< ext::variant< TerminalSymbolType, NonterminalSymbolType > > > > & getRules() const &
Definition: CFG.h:332
Chomsky normal form of a context free grammar in Chomsky hierarchy or type 2 in Chomsky hierarchy....
Definition: CNF.h:66
const NonterminalSymbolType & getInitialSymbol() const &
Definition: CNF.h:165
const ext::map< NonterminalSymbolType, ext::set< ext::variant< TerminalSymbolType, ext::pair< NonterminalSymbolType, NonterminalSymbolType > > > > & getRules() const &
Definition: CNF.h:373
const ext::set< NonterminalSymbolType > & getNonterminalAlphabet() const &
Definition: CNF.h:194
const ext::set< TerminalSymbolType > & getTerminalAlphabet() const &
Definition: CNF.h:232
Context sensitive grammar in Chomsky hierarchy or type 1 in Chomsky hierarchy. Generates context sens...
Definition: CSG.h:64
const ext::set< SymbolType > & getNonterminalAlphabet() const &
Definition: CSG.h:178
const ext::set< SymbolType > & getTerminalAlphabet() const &
Definition: CSG.h:216
const SymbolType & getInitialSymbol() const &
Definition: CSG.h:149
const ext::map< ext::tuple< ext::vector< SymbolType >, SymbolType, ext::vector< SymbolType > >, ext::set< ext::vector< SymbolType > > > & getRules() const &
Definition: CSG.h:363
Context preserving unrestricted grammar. Type 0 in Chomsky hierarchy. Generates recursively enumerabl...
Definition: ContextPreservingUnrestrictedGrammar.h:64
const ext::map< ext::tuple< ext::vector< SymbolType >, SymbolType, ext::vector< SymbolType > >, ext::set< ext::vector< SymbolType > > > & getRules() const &
Definition: ContextPreservingUnrestrictedGrammar.h:334
const ext::set< SymbolType > & getNonterminalAlphabet() const &
Definition: ContextPreservingUnrestrictedGrammar.h:173
const ext::set< SymbolType > & getTerminalAlphabet() const &
Definition: ContextPreservingUnrestrictedGrammar.h:211
const SymbolType & getInitialSymbol() const &
Definition: ContextPreservingUnrestrictedGrammar.h:144
Context free grammar without epsilon rules in Chomsky hierarchy or type 2 in Chomsky hierarchy....
Definition: EpsilonFreeCFG.h:65
const ext::set< NonterminalSymbolType > & getNonterminalAlphabet() const &
Definition: EpsilonFreeCFG.h:173
const NonterminalSymbolType & getInitialSymbol() const &
Definition: EpsilonFreeCFG.h:144
const ext::map< NonterminalSymbolType, ext::set< ext::vector< ext::variant< TerminalSymbolType, NonterminalSymbolType > > > > & getRules() const &
Definition: EpsilonFreeCFG.h:340
const ext::set< TerminalSymbolType > & getTerminalAlphabet() const &
Definition: EpsilonFreeCFG.h:211
Greibach normal form of a context free grammar in Chomsky hierarchy or type 2 in Chomsky hierarchy....
Definition: GNF.h:65
const ext::set< TerminalSymbolType > & getTerminalAlphabet() const &
Definition: GNF.h:211
const ext::map< NonterminalSymbolType, ext::set< ext::pair< TerminalSymbolType, ext::vector< NonterminalSymbolType > > > > & getRules() const &
Definition: GNF.h:339
const NonterminalSymbolType & getInitialSymbol() const &
Definition: GNF.h:144
const ext::set< NonterminalSymbolType > & getNonterminalAlphabet() const &
Definition: GNF.h:173
Context free grammar in Chomsky hierarchy or type 2 in Chomsky hierarchy. Generates context free lang...
Definition: LG.h:67
const NonterminalSymbolType & getInitialSymbol() const &
Definition: LG.h:161
const ext::set< NonterminalSymbolType > & getNonterminalAlphabet() const &
Definition: LG.h:190
const ext::map< NonterminalSymbolType, ext::set< ext::variant< ext::vector< TerminalSymbolType >, ext::tuple< ext::vector< TerminalSymbolType >, NonterminalSymbolType, ext::vector< TerminalSymbolType > > > > > & getRules() const &
Definition: LG.h:370
const ext::set< TerminalSymbolType > & getTerminalAlphabet() const &
Definition: LG.h:228
Left linear grammar in Chomsky hierarchy or type 3 in Chomsky hierarchy. Generates regular languages.
Definition: LeftLG.h:66
const NonterminalSymbolType & getInitialSymbol() const &
Definition: LeftLG.h:160
const ext::set< NonterminalSymbolType > & getNonterminalAlphabet() const &
Definition: LeftLG.h:189
const ext::set< TerminalSymbolType > & getTerminalAlphabet() const &
Definition: LeftLG.h:227
const ext::map< NonterminalSymbolType, ext::set< ext::variant< ext::vector< TerminalSymbolType >, ext::pair< NonterminalSymbolType, ext::vector< TerminalSymbolType > > > > > & getRules() const &
Definition: LeftLG.h:359
Left regular grammar in Chomsky hierarchy or type 3 in Chomsky hierarchy. Generates regular languages...
Definition: LeftRG.h:70
const ext::set< TerminalSymbolType > & getTerminalAlphabet() const &
Definition: LeftRG.h:236
const ext::map< NonterminalSymbolType, ext::set< ext::variant< TerminalSymbolType, ext::pair< NonterminalSymbolType, TerminalSymbolType > > > > & getRules() const &
Definition: LeftRG.h:376
const NonterminalSymbolType & getInitialSymbol() const &
Definition: LeftRG.h:169
const ext::set< NonterminalSymbolType > & getNonterminalAlphabet() const &
Definition: LeftRG.h:198
Noncontracting grammar in Chomsky hierarchy or type 1 in Chomsky hierarchy. Generates context sensiti...
Definition: NonContractingGrammar.h:64
const ext::set< SymbolType > & getTerminalAlphabet() const &
Definition: NonContractingGrammar.h:210
const ext::set< SymbolType > & getNonterminalAlphabet() const &
Definition: NonContractingGrammar.h:172
const ext::map< ext::vector< SymbolType >, ext::set< ext::vector< SymbolType > > > & getRules() const &
Definition: NonContractingGrammar.h:360
const SymbolType & getInitialSymbol() const &
Definition: NonContractingGrammar.h:143
Right linear grammar in Chomsky hierarchy or type 3 in Chomsky hierarchy. Generates regular languages...
Definition: RightLG.h:65
const ext::map< NonterminalSymbolType, ext::set< ext::variant< ext::vector< TerminalSymbolType >, ext::pair< ext::vector< TerminalSymbolType >, NonterminalSymbolType > > > > & getRules() const &
Definition: RightLG.h:356
const NonterminalSymbolType & getInitialSymbol() const &
Definition: RightLG.h:159
const ext::set< NonterminalSymbolType > & getNonterminalAlphabet() const &
Definition: RightLG.h:188
const ext::set< TerminalSymbolType > & getTerminalAlphabet() const &
Definition: RightLG.h:226
Right regular grammar in Chomsky hierarchy or type 3 in Chomsky hierarchy. Generates regular language...
Definition: RightRG.h:70
const ext::map< NonterminalSymbolType, ext::set< ext::variant< TerminalSymbolType, ext::pair< TerminalSymbolType, NonterminalSymbolType > > > > & getRules() const &
Definition: RightRG.h:375
const ext::set< NonterminalSymbolType > & getNonterminalAlphabet() const &
Definition: RightRG.h:198
const ext::set< TerminalSymbolType > & getTerminalAlphabet() const &
Definition: RightRG.h:236
const NonterminalSymbolType & getInitialSymbol() const &
Definition: RightRG.h:169
Unrestricted grammar. Type 0 in Chomsky hierarchy. Generates recursively enumerable languages.
Definition: UnrestrictedGrammar.h:64
const ext::map< ext::vector< SymbolType >, ext::set< ext::vector< SymbolType > > > & getRules() const &
Definition: UnrestrictedGrammar.h:330
const SymbolType & getInitialSymbol() const &
Definition: UnrestrictedGrammar.h:144
const ext::set< SymbolType > & getTerminalAlphabet() const &
Definition: UnrestrictedGrammar.h:211
const ext::set< SymbolType > & getNonterminalAlphabet() const &
Definition: UnrestrictedGrammar.h:173
Definition: AutomatonCompare.h:29