Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Static Public Member Functions
grammar::transform::GrammarConcatenation Class Reference

#include <GrammarConcatenation.h>

Static Public Member Functions

template<class TerminalSymbolType , class NonterminalSymbolType >
static grammar::CFG< TerminalSymbolType, ext::pair< NonterminalSymbolType, unsigned > > concatenation (const grammar::CFG< TerminalSymbolType, NonterminalSymbolType > &first, const grammar::CFG< TerminalSymbolType, NonterminalSymbolType > &second)
 

Detailed Description

Concatenation of two grammars. For two regular grammars G1 and G2, we create a regular grammar such that L(G) = L(G1).L(G2). For CFG and CFG/RG we create a context free grammar such that L(G) = L(G1).(G2). Source:

Member Function Documentation

◆ concatenation()

template<class TerminalSymbolType , class NonterminalSymbolType >
grammar::CFG< TerminalSymbolType, ext::pair< NonterminalSymbolType, unsigned > > grammar::transform::GrammarConcatenation::concatenation ( const grammar::CFG< TerminalSymbolType, NonterminalSymbolType > &  first,
const grammar::CFG< TerminalSymbolType, NonterminalSymbolType > &  second 
)
static

Concatenates two grammars.

Template Parameters
TerminalSymbolTypeType for terminal symbols.
NonterminalSymbolTypeType for nonterminal symbols.
Parameters
firstFirst grammar (G1)
secondSecond grammar (G2)
Returns
CFG grammar for concatenation of two CFG or RightRG for concatenation of two RightRG.
Here is the call graph for this function:

The documentation for this class was generated from the following file: