Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Concepts
Static Public Member Functions
grammar::convert::ToAutomatonBottomUp Class Reference

#include <ToAutomatonBottomUp.h>

Static Public Member Functions

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)
 

Member Function Documentation

◆ 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
Tthe type of converted grammar
TerminalSymbolTypethe type of terminals in the converted grammar
NonterminalSymbolTypethe type of nonterminals in the converted grammar
Parameters
grammarthe converted context free grammar
Returns
pushdown automaton accepting the language generated by grammar
Here is the call graph for this function:

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