#include <ToAutomatonBottomUp.h>
|
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) |
|
◆ convert()
template<class T , class TerminalSymbolType , class NonterminalSymbolType >
automaton::NPDA< TerminalSymbolType, ext::variant< TerminalSymbolType, NonterminalSymbolType >, unsigned > grammar::convert::ToAutomatonBottomUp::convert |
( |
const T & |
grammar | ) |
|
|
static |
Converts a context free grammar to a pushdown automaton by method of bottom up analysis. Note: The algorithm implementation maintains the invariant of pushdown automata representation regarding the top of the stack. The top of the stack is on the left and therefore the popped symbols are reversed in each transition.
- Template Parameters
-
T | the type of converted grammar |
TerminalSymbolType | the type of terminals in the converted grammar |
NonterminalSymbolType | the type of nonterminals in the converted grammar |
- Parameters
-
grammar | the converted context free grammar |
- Returns
- pushdown automaton accepting the language generated by
grammar
The documentation for this class was generated from the following file: