#include <ToAutomaton.h>
|
template<class TerminalSymbolType , class NonterminalSymbolType > |
static automaton::NFA< TerminalSymbolType, NonterminalSymbolType > | convert (const grammar::LeftRG< TerminalSymbolType, NonterminalSymbolType > &grammar) |
|
template<class TerminalSymbolType , class NonterminalSymbolType > |
static automaton::NFA< TerminalSymbolType, NonterminalSymbolType > | convert (const grammar::RightRG< TerminalSymbolType, NonterminalSymbolType > &grammar) |
|
template<class T , class TerminalSymbolType = typename grammar::TerminalSymbolTypeOfGrammar < T >, class NonterminalSymbolType = typename grammar::NonterminalSymbolTypeOfGrammar < T >> |
static automaton::NPDA< TerminalSymbolType, ext::variant< TerminalSymbolType, NonterminalSymbolType >, unsigned > | convert (const T &grammar) |
|
Converts regular grammar to nondeterministic finite automaton. Sources: Melichar 2.98 (RightRG -> NFA) and 2.102 (LeftRG -> NFA).
◆ convert() [1/3]
template<class TerminalSymbolType , class NonterminalSymbolType >
automaton::NFA< TerminalSymbolType, NonterminalSymbolType > grammar::convert::ToAutomaton::convert |
( |
const grammar::LeftRG< TerminalSymbolType, NonterminalSymbolType > & |
grammar | ) |
|
|
static |
Performs the conversion.
- Template Parameters
-
TerminalSymbolType | the type of terminal symbol of the grammar |
NonterminalSymbolType | the type of nonterminal symbol of the grammar |
- Parameters
-
grammar | the left regular grammar to convert. |
- Returns
- finite automaton accepting the language generated by
grammar
.
◆ convert() [2/3]
template<class TerminalSymbolType , class NonterminalSymbolType >
automaton::NFA< TerminalSymbolType, NonterminalSymbolType > grammar::convert::ToAutomaton::convert |
( |
const grammar::RightRG< TerminalSymbolType, NonterminalSymbolType > & |
grammar | ) |
|
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Template Parameters
-
TerminalSymbolType | the type of terminal symbol of the grammar |
NonterminalSymbolType | the type of nonterminal symbol of the grammar |
- Parameters
-
grammar | the right regular grammar to convert. |
- Returns
- finite automaton accepting the language generated by
grammar
.
◆ convert() [3/3]
template<class T , class TerminalSymbolType , class NonterminalSymbolType >
automaton::NPDA< TerminalSymbolType, ext::variant< TerminalSymbolType, NonterminalSymbolType >, unsigned > grammar::convert::ToAutomaton::convert |
( |
const T & |
grammar | ) |
|
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Template Parameters
-
T | the type of converted grammar |
TerminalSymbolType | the type of terminal symbol of the grammar |
NonterminalSymbolType | the type of nonterminal symbol of the grammar |
- Parameters
-
grammar | some context free grammar. |
- Returns
- pushdown automaton accepting the language generated by
grammar
.
The documentation for this class was generated from the following file: