buffalo
Loading...
Searching...
No Matches
bf::SLRParser< G > Class Template Reference

#include <buffalo.h>

Inheritance diagram for bf::SLRParser< G >:
bf::Parser< G >

Public Member Functions

Grammar< G > constGetGrammar () const
 
std::expected< typename G::ValueType, ErrorParse (std::string_view input, std::vector< Token< G > > *tokens=nullptr) override
 
 SLRParser ()=delete
 
- Public Member Functions inherited from bf::Parser< G >
virtual ~Parser ()=default
 

Static Public Member Functions

static std::expected< SLRParser, ErrorBuild (NonTerminal< G > &start)
 

Protected Member Functions

 SLRParser (NonTerminal< G > &start)
 

Detailed Description

template<IGrammar G>
class bf::SLRParser< G >

SLR PARSER

Template Parameters
G

Definition at line 830 of file buffalo.h.

Constructor & Destructor Documentation

◆ SLRParser() [1/2]

template<IGrammar G>
bf::SLRParser< G >::SLRParser ( NonTerminal< G > &  start)
inlineprotected

Simply constructs the SLRParser's grammar and empty tables. SLRParser<G>::BuildParsingTables MUST be called before attempting to parse.

Parameters
tokenizer
start

Definition at line 1049 of file buffalo.h.

◆ SLRParser() [2/2]

template<IGrammar G>
bf::SLRParser< G >::SLRParser ( )
delete

Construction of a parser can generate grammar errors. Use SLRParser<G>::Build to create.

Member Function Documentation

◆ Build()

template<IGrammar G>
static std::expected< SLRParser, Error > bf::SLRParser< G >::Build ( NonTerminal< G > &  start)
inlinestatic

Definition at line 1147 of file buffalo.h.

◆ GetGrammar()

template<IGrammar G>
Grammar< G > const & bf::SLRParser< G >::GetGrammar ( ) const
inline

Definition at line 1052 of file buffalo.h.

◆ Parse()

template<IGrammar G>
std::expected< typename G::ValueType, Error > bf::SLRParser< G >::Parse ( std::string_view  input,
std::vector< Token< G > > *  tokens = nullptr 
)
inlineoverridevirtual

Implements bf::Parser< G >.

Definition at line 1057 of file buffalo.h.


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