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

#include <ToGNF.h>

Static Public Member Functions

template<class TerminalSymbolType , class NonterminalSymbolType >
static grammar::GNF< TerminalSymbolType, ext::variant< TerminalSymbolType, NonterminalSymbolType > > convert (const grammar::CFG< TerminalSymbolType, NonterminalSymbolType > &grammar)
 
template<class TerminalSymbolType , class NonterminalSymbolType >
static grammar::GNF< TerminalSymbolType, ext::variant< TerminalSymbolType, NonterminalSymbolType > > convert (const grammar::EpsilonFreeCFG< TerminalSymbolType, NonterminalSymbolType > &grammar)
 
template<class TerminalSymbolType , class NonterminalSymbolType >
static grammar::GNF< TerminalSymbolType, ext::variant< TerminalSymbolType, NonterminalSymbolType > > convert (const grammar::CNF< TerminalSymbolType, NonterminalSymbolType > &grammar)
 
template<class TerminalSymbolType , class NonterminalSymbolType >
static grammar::GNF< TerminalSymbolType, NonterminalSymbolType > convert (const grammar::GNF< TerminalSymbolType, NonterminalSymbolType > &grammar)
 
template<class TerminalSymbolType , class NonterminalSymbolType >
static grammar::GNF< TerminalSymbolType, ext::variant< TerminalSymbolType, NonterminalSymbolType > > convert (const grammar::LG< TerminalSymbolType, NonterminalSymbolType > &grammar)
 
template<class TerminalSymbolType , class NonterminalSymbolType >
static grammar::GNF< TerminalSymbolType, ext::variant< TerminalSymbolType, NonterminalSymbolType > > convert (const grammar::LeftLG< TerminalSymbolType, NonterminalSymbolType > &grammar)
 
template<class TerminalSymbolType , class NonterminalSymbolType >
static grammar::RightRG< TerminalSymbolType, NonterminalSymbolType > convert (const grammar::LeftRG< TerminalSymbolType, NonterminalSymbolType > &grammar)
 
template<class TerminalSymbolType , class NonterminalSymbolType >
static grammar::GNF< TerminalSymbolType, ext::variant< TerminalSymbolType, NonterminalSymbolType > > convert (const grammar::RightLG< TerminalSymbolType, NonterminalSymbolType > &grammar)
 
template<class TerminalSymbolType , class NonterminalSymbolType >
static grammar::RightRG< TerminalSymbolType, NonterminalSymbolType > convert (const grammar::RightRG< TerminalSymbolType, NonterminalSymbolType > &grammar)
 

Detailed Description

Implements transformation of a grammar into greibach normal form.

Member Function Documentation

◆ convert() [1/9]

template<class TerminalSymbolType , class NonterminalSymbolType >
grammar::GNF< TerminalSymbolType, ext::variant< TerminalSymbolType, NonterminalSymbolType > > grammar::simplify::ToGNF::convert ( const grammar::CFG< TerminalSymbolType, NonterminalSymbolType > &  grammar)
static

Implements transformation of a grammar into greibach normal form.

Template Parameters
TerminalSymbolTypethe type of terminals in the transformed grammar
NonterminalSymbolTypethe type of nonterminals in the transformed grammar
Parameters
grammarthe transformed grammar
Returns
an grammar in greibach normal form equivalent to the grammar
Here is the call graph for this function:
Here is the caller graph for this function:

◆ convert() [2/9]

template<class TerminalSymbolType , class NonterminalSymbolType >
grammar::GNF< TerminalSymbolType, ext::variant< TerminalSymbolType, NonterminalSymbolType > > grammar::simplify::ToGNF::convert ( const grammar::CNF< TerminalSymbolType, NonterminalSymbolType > &  grammar)
static

Implements transformation of a grammar into greibach normal form.

Template Parameters
TerminalSymbolTypethe type of terminals in the transformed grammar
NonterminalSymbolTypethe type of nonterminals in the transformed grammar
Parameters
grammarthe transformed grammar
Returns
an grammar in greibach normal form equivalent to the grammar
Here is the call graph for this function:

◆ convert() [3/9]

template<class TerminalSymbolType , class NonterminalSymbolType >
grammar::GNF< TerminalSymbolType, ext::variant< TerminalSymbolType, NonterminalSymbolType > > grammar::simplify::ToGNF::convert ( const grammar::EpsilonFreeCFG< TerminalSymbolType, NonterminalSymbolType > &  grammar)
static

Implements transformation of a grammar into greibach normal form.

Template Parameters
TerminalSymbolTypethe type of terminals in the transformed grammar
NonterminalSymbolTypethe type of nonterminals in the transformed grammar
Parameters
grammarthe transformed grammar
Returns
an grammar in greibach normal form equivalent to the grammar
Here is the call graph for this function:

◆ convert() [4/9]

template<class TerminalSymbolType , class NonterminalSymbolType >
grammar::GNF< TerminalSymbolType, NonterminalSymbolType > grammar::simplify::ToGNF::convert ( const grammar::GNF< TerminalSymbolType, NonterminalSymbolType > &  grammar)
static

Implements transformation of a grammar into greibach normal form.

Template Parameters
TerminalSymbolTypethe type of terminals in the transformed grammar
NonterminalSymbolTypethe type of nonterminals in the transformed grammar
Parameters
grammarthe transformed grammar
Returns
an grammar in greibach normal form equivalent to the grammar

◆ convert() [5/9]

template<class TerminalSymbolType , class NonterminalSymbolType >
grammar::GNF< TerminalSymbolType, ext::variant< TerminalSymbolType, NonterminalSymbolType > > grammar::simplify::ToGNF::convert ( const grammar::LeftLG< TerminalSymbolType, NonterminalSymbolType > &  grammar)
static

Implements transformation of a grammar into greibach normal form.

Template Parameters
TerminalSymbolTypethe type of terminals in the transformed grammar
NonterminalSymbolTypethe type of nonterminals in the transformed grammar
Parameters
grammarthe transformed grammar
Returns
an grammar in greibach normal form equivalent to the grammar
Here is the call graph for this function:

◆ convert() [6/9]

template<class TerminalSymbolType , class NonterminalSymbolType >
grammar::RightRG< TerminalSymbolType, NonterminalSymbolType > grammar::simplify::ToGNF::convert ( const grammar::LeftRG< TerminalSymbolType, NonterminalSymbolType > &  grammar)
static

Implements transformation of a grammar into greibach normal form.

Template Parameters
TerminalSymbolTypethe type of terminals in the transformed grammar
NonterminalSymbolTypethe type of nonterminals in the transformed grammar
Parameters
grammarthe transformed grammar
Returns
an grammar in greibach normal form equivalent to the grammar
Here is the call graph for this function:

◆ convert() [7/9]

template<class TerminalSymbolType , class NonterminalSymbolType >
grammar::GNF< TerminalSymbolType, ext::variant< TerminalSymbolType, NonterminalSymbolType > > grammar::simplify::ToGNF::convert ( const grammar::LG< TerminalSymbolType, NonterminalSymbolType > &  grammar)
static

Implements transformation of a grammar into greibach normal form.

Template Parameters
TerminalSymbolTypethe type of terminals in the transformed grammar
NonterminalSymbolTypethe type of nonterminals in the transformed grammar
Parameters
grammarthe transformed grammar
Returns
an grammar in greibach normal form equivalent to the grammar
Here is the call graph for this function:

◆ convert() [8/9]

template<class TerminalSymbolType , class NonterminalSymbolType >
grammar::GNF< TerminalSymbolType, ext::variant< TerminalSymbolType, NonterminalSymbolType > > grammar::simplify::ToGNF::convert ( const grammar::RightLG< TerminalSymbolType, NonterminalSymbolType > &  grammar)
static

Implements transformation of a grammar into greibach normal form.

Template Parameters
TerminalSymbolTypethe type of terminals in the transformed grammar
NonterminalSymbolTypethe type of nonterminals in the transformed grammar
Parameters
grammarthe transformed grammar
Returns
an grammar in greibach normal form equivalent to the grammar
Here is the call graph for this function:

◆ convert() [9/9]

template<class TerminalSymbolType , class NonterminalSymbolType >
grammar::RightRG< TerminalSymbolType, NonterminalSymbolType > grammar::simplify::ToGNF::convert ( const grammar::RightRG< TerminalSymbolType, NonterminalSymbolType > &  grammar)
static

Implements transformation of a grammar into greibach normal form.

Template Parameters
TerminalSymbolTypethe type of terminals in the transformed grammar
NonterminalSymbolTypethe type of nonterminals in the transformed grammar
Parameters
grammarthe transformed grammar
Returns
an grammar in greibach normal form equivalent to the grammar

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