Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
|
#include <GrammarAlternation.h>
Static Public Member Functions | |
template<class TerminalSymbolType , class NonterminalSymbolType > | |
static grammar::CFG< TerminalSymbolType, ext::pair< NonterminalSymbolType, unsigned > > | alternation (const grammar::CFG< TerminalSymbolType, NonterminalSymbolType > &first, const grammar::CFG< TerminalSymbolType, NonterminalSymbolType > &second) |
Alternation of two grammars. For two regular grammars G1 and G2, we create a regular grammar such that L(G) = L(G1) \cup L(G2). For CFG and CFG/RG we create a context free grammar such that L(G) = L(G1) \cup L(G2). Source:
|
static |
Alternates two grammars.
TerminalSymbolType | Type for terminal symbols. |
NonterminalSymbolType | Type for nonterminal symbols. |
first | First grammar (G1) |
second | Second grammar (G2) |